task_name
stringlengths
4
18
source_code
stringlengths
134
18.1k
x86_64
stringlengths
1.13k
35.8k
aarch64_linux
stringlengths
1.42k
36.4k
riscv64
stringlengths
1.57k
39.1k
aarch64_apple
stringlengths
1.18k
31.7k
ackermann
/* Ackermann.c: calculate the Ackermann function (as far as that is possible), * and discuss its properties. Compile: cc -o ackermann ackermann.c ( Use the flag -D_SHORT_STRINGS if your compiler cannot handle multiline strings.) For usage information, give the command ackermann -h or see USAGE define...
.text .intel_syntax noprefix .file "ackermann.c" .globl ack # -- Begin function ack .p2align 4, 0x90 .type ack,@function ack: # @ack .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_cfa_register ...
.text .file "ackermann.c" .globl ack // -- Begin function ack .p2align 2 .type ack,@function ack: // @ack .cfi_startproc // %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 stp x29, x30, [sp, #16] // 16-byte Folded Spill add x29, sp, #16 ...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "ackermann.c" .globl ack # -- Begin function ack .p2align 1 .type ack,@function ack: # @ack .cfi_startproc # %bb.0: addi sp, sp, -32 .cfi_def_cfa_o...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _ack ; -- Begin function ack .p2align 2 _ack: ; @ack .cfi_startproc ; %bb.0: sub sp, sp, #48 stp x29, x30, [sp, #32] ; 16-byte Folded Spill add x29, sp, #3...
audio-codec
/** * @file * @author [sunzhenliang](https://github.com/HiSunzhenliang) * @brief A-law algorithm for encoding and decoding (16bit pcm <=> a-law). * This is the implementation of [G.711](https://en.wikipedia.org/wiki/G.711) * in C. **/ /** * Linear input code | Compressed code | Linear output code * -----------...
.text .intel_syntax noprefix .file "audio-codec.c" .globl encode # -- Begin function encode .p2align 4, 0x90 .type encode,@function encode: # @encode .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_cf...
.text .file "audio-codec.c" .globl encode // -- Begin function encode .p2align 2 .type encode,@function encode: // @encode .cfi_startproc // %bb.0: sub sp, sp, #80 .cfi_def_cfa_offset 80 str x0, [sp, #72] str x1, [sp, #64] str x2, [sp, #56] strb wzr, ...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "audio-codec.c" .globl encode # -- Begin function encode .p2align 1 .type encode,@function encode: # @encode .cfi_startproc # %bb.0: addi sp, sp, -112 .c...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _encode ; -- Begin function encode .p2align 2 _encode: ; @encode .cfi_startproc ; %bb.0: sub sp, sp, #80 .cfi_def_cfa_offset 80 str x0, [sp, #72] str x1, [sp, #64] str x2,...
avl-tree
/* A balanced binary search tree(AVLTree) implementation * Written by Coleman * Released under GNU GPL Version 2 or later(http://www.gnu.org/) */ #include "libmin.h" #include "element.h" #include "avlcore.h" #define MAXELEMENTSIZE 500000 void printTree(TreeNode *start, long level) { long i = 0; if(start ==...
.text .intel_syntax noprefix .file "avl-tree.c" .globl printTree # -- Begin function printTree .p2align 4, 0x90 .type printTree,@function printTree: # @printTree .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_...
.text .file "avl-tree.c" .globl printTree // -- Begin function printTree .p2align 2 .type printTree,@function printTree: // @printTree .cfi_startproc // %bb.0: sub sp, sp, #48 .cfi_def_cfa_offset 48 stp x29, x30, [sp, #32] // 16-byte Folded Spill ...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "avl-tree.c" .globl printTree # -- Begin function printTree .p2align 1 .type printTree,@function printTree: # @printTree .cfi_startproc # %bb.0: addi sp, sp, -4...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _printTree ; -- Begin function printTree .p2align 2 _printTree: ; @printTree .cfi_startproc ; %bb.0: sub sp, sp, #64 stp x29, x30, [sp, #48] ; 16-byte Folded Spill add...
bit-kernels
#include "libmin.h" #define NUM_ELEMENTS 100 // Total numbers to test #define TABLE_SIZE 256 // For table lookup; precompute for 8-bit numbers // Global lookup table for table method unsigned int popcount_table[TABLE_SIZE]; // ------------------------------ // Bit-counting Kernel 1: Naive method // -----------...
.text .intel_syntax noprefix .file "bit-kernels.c" .globl count_bits_naive # -- Begin function count_bits_naive .p2align 4, 0x90 .type count_bits_naive,@function count_bits_naive: # @count_bits_naive .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, ...
.text .file "bit-kernels.c" .globl count_bits_naive // -- Begin function count_bits_naive .p2align 2 .type count_bits_naive,@function count_bits_naive: // @count_bits_naive .cfi_startproc // %bb.0: sub sp, sp, #16 .cfi_def_cfa_offset 16 str w0, [sp, #12] str wzr, [sp, #8] ...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "bit-kernels.c" .globl count_bits_naive # -- Begin function count_bits_naive .p2align 1 .type count_bits_naive,@function count_bits_naive: # @count_bits_naive .cfi_startproc #...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _count_bits_naive ; -- Begin function count_bits_naive .p2align 2 _count_bits_naive: ; @count_bits_naive .cfi_startproc ; %bb.0: sub sp, sp, #16 .cfi_def_cfa_offset 16 str w0, [sp, #12] str wz...
bloom-filter
#include "libmin.h" #include "tinybloom.h" #define NUM_ITEMS 2048 #define NUM_BUCKETS NUM_ITEMS * 4 int bad_search(const unsigned int* array, unsigned int target, size_t size) { int i; for(i = 0; i < size; i++) if(array[i] == target) return 1; return 0; } int main(void) { unsigned false_positives = 0, true_po...
.text .intel_syntax noprefix .file "bloom-filter.c" .globl bad_search # -- Begin function bad_search .p2align 4, 0x90 .type bad_search,@function bad_search: # @bad_search .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp...
.text .file "bloom-filter.c" .globl bad_search // -- Begin function bad_search .p2align 2 .type bad_search,@function bad_search: // @bad_search .cfi_startproc // %bb.0: sub sp, sp, #48 .cfi_def_cfa_offset 48 str x0, [sp, #32] str w1, [sp, #28] str x2, [sp, #16...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "bloom-filter.c" .globl bad_search # -- Begin function bad_search .p2align 1 .type bad_search,@function bad_search: # @bad_search .cfi_startproc # %bb.0: addi sp,...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _bad_search ; -- Begin function bad_search .p2align 2 _bad_search: ; @bad_search .cfi_startproc ; %bb.0: sub sp, sp, #48 .cfi_def_cfa_offset 48 str x0, [sp, #32] str w1, [sp, #28] ...
boyer-moore-search
/* C Program for Bad Character Heuristic of Boyer Moore String Matching Algorithm */ // SOURCE: https://www.geeksforgeeks.org/boyer-moore-algorithm-for-pattern-searching/ #include "libmin.h" // valid SIZE's: 380, 760 (default), 1140, 1520 #define SIZE 760 // Inputs char inp_pat[] = "NzZVOzZXNoGXMl8yxesyY"; char inp_...
.text .intel_syntax noprefix .file "boyer-moore-search.c" .globl badCharHeuristic # -- Begin function badCharHeuristic .p2align 4, 0x90 .type badCharHeuristic,@function badCharHeuristic: # @badCharHeuristic .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offse...
.text .file "boyer-moore-search.c" .globl badCharHeuristic // -- Begin function badCharHeuristic .p2align 2 .type badCharHeuristic,@function badCharHeuristic: // @badCharHeuristic .cfi_startproc // %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 str x0, [sp, #24] str w1, [sp...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "boyer-moore-search.c" .globl badCharHeuristic # -- Begin function badCharHeuristic .p2align 1 .type badCharHeuristic,@function badCharHeuristic: # @badCharHeuristic .cfi_star...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _badCharHeuristic ; -- Begin function badCharHeuristic .p2align 2 _badCharHeuristic: ; @badCharHeuristic .cfi_startproc ; %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 str x0, [sp, #24] str w1...
bubble-sort
#include "libmin.h" // supported sizes: 256 (default), 512, 1024, 2048 #define DATASET_SIZE 256 int data[DATASET_SIZE]; // total swaps executed so far unsigned long swaps = 0; void print_data(int *data, unsigned size) { libmin_printf("DATA DUMP:\n"); for (unsigned i=0; i < size; i++) libmin_printf(" data[%...
.text .intel_syntax noprefix .file "bubble-sort.c" .globl print_data # -- Begin function print_data .p2align 4, 0x90 .type print_data,@function print_data: # @print_data .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp ...
.text .file "bubble-sort.c" .globl print_data // -- Begin function print_data .p2align 2 .type print_data,@function print_data: // @print_data .cfi_startproc // %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 stp x29, x30, [sp, #16] // 16-byte Folded S...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "bubble-sort.c" .globl print_data # -- Begin function print_data .p2align 1 .type print_data,@function print_data: # @print_data .cfi_startproc # %bb.0: addi sp, ...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _print_data ; -- Begin function print_data .p2align 2 _print_data: ; @print_data .cfi_startproc ; %bb.0: sub sp, sp, #48 stp x29, x30, [sp, #32] ; 16-byte Folded Spill a...
ccmac
// bench_horner_fp64.c // Simple FP64 Horner benchmark: y = (((cD*x + cD-1)*x + ... )*x + c0) // No CLI, no timing. Adjust work via macros. // Knobs (override with -DNAME=value): #ifndef N_ITER #define N_ITER 100 #endif #ifndef N_ELEMS #define N_ELEMS (1u << 6) // 1,048,576 #endif #ifndef DEGREE #define DEG...
.text .intel_syntax noprefix .file "ccmac.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 # -- Begin function main .LCPI0_0: .quad 0x4109000000000000 # double 204800 .LCPI0_1: .quad 0x3c9cd2b297d889bc # double 9.9999999999999997E-17 .LCPI0_2: .quad 0x...
.text .file "ccmac.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 // -- Begin function main .LCPI0_0: .xword 0x3c9cd2b297d889bc // double 9.9999999999999997E-17 .LCPI0_1: .xword 0x4109000000000000 // double 204800 .text .globl main .p2align 2 .type...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "ccmac.c" .section .sdata,"aw",@progbits .p2align 3 # -- Begin function main .LCPI0_0: .quad 0x3c9cd2b297d889bc # double 9.9999999999999997E-17 .LCPI0_1: .quad 0xbff0000...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .section __TEXT,__literal8,8byte_literals .p2align 3, 0x0 ; -- Begin function main lCPI0_0: .quad 0x3c9cd2b297d889bc ; double 9.9999999999999997E-17 lCPI0_1: .quad 0x4109000000000000 ; d...
checkers
#include "libmin.h" #include "consttypes.h" #include "functions.h" #include "test0-txt.h" MFILE __infile = { "test0.txt", __test0_sz, __test0, 0 }; MFILE *infile = &__infile; int main(int argc, char *argv[]) { libmin_mopen(infile, "r"); board_t* board = (board_t*)libmin_malloc(sizeof(board_t)); // main ...
.text .intel_syntax noprefix .file "checkers.c" .globl main # -- Begin function main .p2align 4, 0x90 .type main,@function main: # @main .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_cfa_registe...
.text .file "checkers.c" .globl main // -- Begin function main .p2align 2 .type main,@function main: // @main .cfi_startproc // %bb.0: sub sp, sp, #224 .cfi_def_cfa_offset 224 stp x29, x30, [sp, #208] // 16-byte Folded Spill add x29, sp, ...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "checkers.c" .globl main # -- Begin function main .p2align 1 .type main,@function main: # @main .cfi_startproc # %bb.0: addi sp, sp, -224 .cfi_def_cf...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _main ; -- Begin function main .p2align 2 _main: ; @main .cfi_startproc ; %bb.0: sub sp, sp, #272 stp x28, x27, [sp, #240] ; 16-byte Folded Spill stp x29, x30...
cipher
#include "libmin.h" void encipher(uint32_t *const in, uint32_t *const out, const uint32_t *const key) { uint32_t y=in[0], z=in[1], sum=0, delta=0x9E3779B9; uint32_t a=key[0], b=key[1], c=key[2], d=key[3], n=32; while (n-->0) { sum += delta; y += ((z << 4)+a) ^ (z+sum) ^ ((z >> 5)+b); z...
.text .intel_syntax noprefix .file "cipher.c" .globl encipher # -- Begin function encipher .p2align 4, 0x90 .type encipher,@function encipher: # @encipher .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_c...
.text .file "cipher.c" .globl encipher // -- Begin function encipher .p2align 2 .type encipher,@function encipher: // @encipher .cfi_startproc // %bb.0: sub sp, sp, #64 .cfi_def_cfa_offset 64 str x0, [sp, #56] str x1, [sp, #48] str x2, [sp, #40] ldr x8, [...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "cipher.c" .globl encipher # -- Begin function encipher .p2align 1 .type encipher,@function encipher: # @encipher .cfi_startproc # %bb.0: addi sp, sp, -80 .c...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _encipher ; -- Begin function encipher .p2align 2 _encipher: ; @encipher .cfi_startproc ; %bb.0: sub sp, sp, #64 .cfi_def_cfa_offset 64 str x0, [sp, #56] str x1, [sp, #48] str...
congrad
/* * bringup_bench_cg.c * * Minimal Conjugate Gradient solver benchmark for Bringup-Bench * Solves Ax = b where A is a 2D Laplacian (5-point stencil). * * - Deterministic init * - Tunable grid size (N*N system) * - Sparse CSR matrix * - Iterative solver with fixed max iterations * - Reports checksum of soluti...
.text .intel_syntax noprefix .file "congrad.c" .globl main # -- Begin function main .p2align 4, 0x90 .type main,@function main: # @main .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_cfa_register...
.text .file "congrad.c" .globl main // -- Begin function main .p2align 2 .type main,@function main: // @main .cfi_startproc // %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 stp x29, x30, [sp, #16] // 16-byte Folded Spill add x29, sp, #16...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "congrad.c" .globl main # -- Begin function main .p2align 1 .type main,@function main: # @main .cfi_startproc # %bb.0: addi sp, sp, -32 .cfi_def_cfa_...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _main ; -- Begin function main .p2align 2 _main: ; @main .cfi_startproc ; %bb.0: sub sp, sp, #64 stp x29, x30, [sp, #48] ; 16-byte Folded Spill add x29, sp, ...
convex-hull
#include "libmin.h" #define NUM_POINTS 50 // Total number of points generated. // Adjust this value to stress the algorithm further. typedef struct { int x; int y; } Point; // Global pivot for sorting: the point with the lowest y (and x on tie). Point p0; // Returns the orientati...
.text .intel_syntax noprefix .file "convex-hull.c" .globl orientation # -- Begin function orientation .p2align 4, 0x90 .type orientation,@function orientation: # @orientation .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, r...
.text .file "convex-hull.c" .globl orientation // -- Begin function orientation .p2align 2 .type orientation,@function orientation: // @orientation .cfi_startproc // %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 stur x0, [sp, #20] stur x1, [sp, #12] stur x2, [sp...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "convex-hull.c" .globl orientation # -- Begin function orientation .p2align 1 .type orientation,@function orientation: # @orientation .cfi_startproc # %bb.0: addi s...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _orientation ; -- Begin function orientation .p2align 2 _orientation: ; @orientation .cfi_startproc ; %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 stur x0, [sp, #20] stur x1, [sp, #...
distinctness
/* ELEMENT DISTINCTNESS ALGORITHM There are multiple ways of detecting whether the elements are distinct or not. One of the ways is to sort the elements in the array and check if the elements next to each other are equal or not. On the other hand an n^2 loop can be used to select an element from the array and chec...
.text .intel_syntax noprefix .file "distinctness.c" .globl isDistinct # -- Begin function isDistinct .p2align 4, 0x90 .type isDistinct,@function isDistinct: # @isDistinct .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp...
.text .file "distinctness.c" .globl isDistinct // -- Begin function isDistinct .p2align 2 .type isDistinct,@function isDistinct: // @isDistinct .cfi_startproc // %bb.0: str x29, [sp, #-16]! // 8-byte Folded Spill .cfi_def_cfa_offset 16 .cfi_offset...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "distinctness.c" .globl isDistinct # -- Begin function isDistinct .p2align 1 .type isDistinct,@function isDistinct: # @isDistinct .cfi_startproc # %bb.0: addi sp,...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _isDistinct ; -- Begin function isDistinct .p2align 2 _isDistinct: ; @isDistinct .cfi_startproc ; %bb.0: stp x28, x27, [sp, #-32]! ; 16-byte Folded Spill stp x29, x30, [sp,...
donut
#include "libmin.h" #undef sin #define sin libmin_sin #undef cos #define cos libmin_cos #undef memset #define memset libmin_memset #undef putchar #define putchar libmin_putc #undef printf #define printf libmin_printf #define xx unsigned x=0; x < 2; x++ #define K int k #define niam int main #define tixe libmin_success()...
.text .intel_syntax noprefix .file "donut.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 # -- Begin function main .LCPI0_0: .quad 0x40191eb851eb851f # double 6.2800000000000002 .LCPI0_1: .quad 0x3f947ae147ae147b # double 0.02 .LCPI0_2: .quad 0x3fa47a...
.text .file "donut.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 // -- Begin function main .LCPI0_0: .xword 0x3f947ae147ae147b // double 0.02 .LCPI0_1: .xword 0x3fb1eb851eb851ec // double 0.070000000000000007 .LCPI0_2: .xword 0x40191eb851eb851f ...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "donut.c" .section .sdata,"aw",@progbits .p2align 3 # -- Begin function main .LCPI0_0: .quad 0x40191eb851eb851f # double 6.2800000000000002 .LCPI0_1: .quad 0x3fa47ae147a...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .section __TEXT,__literal8,8byte_literals .p2align 3, 0x0 ; -- Begin function main lCPI0_0: .quad 0x3f947ae147ae147b ; double 0.02 lCPI0_1: .quad 0x3fb1eb851eb851ec ; double 0.0700000000...
flood-fill
#include "libmin.h" // sizes support 10 (default), 15, 20, 25 #define SIZE 10 // `M × N` matrix #define M SIZE #define N SIZE // matrix showing portion of the screen having different colors char mat[M][N] = { #if SIZE == 10 { 'Y', 'Y', 'Y', 'G', 'G', 'G', 'G', 'G', 'G', 'G' }, { 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', '...
.text .intel_syntax noprefix .file "flood-fill.c" .globl floodfill # -- Begin function floodfill .p2align 4, 0x90 .type floodfill,@function floodfill: # @floodfill .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cf...
.text .file "flood-fill.c" .globl floodfill // -- Begin function floodfill .p2align 2 .type floodfill,@function floodfill: // @floodfill .cfi_startproc // %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 stp x29, x30, [sp, #16] // 16-byte Folded Spill...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "flood-fill.c" .globl floodfill # -- Begin function floodfill .p2align 1 .type floodfill,@function floodfill: # @floodfill .cfi_startproc # %bb.0: addi sp, sp, ...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _floodfill ; -- Begin function floodfill .p2align 2 _floodfill: ; @floodfill .cfi_startproc ; %bb.0: sub sp, sp, #32 stp x29, x30, [sp, #16] ; 16-byte Folded Spill add...
frac-calc
/*************************************************************************** * fc.c Version 20180915.214818 * * * * Fraction Calculator * * Copyrig...
.text .intel_syntax noprefix .file "frac-calc.c" .globl main # -- Begin function main .p2align 4, 0x90 .type main,@function main: # @main .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_cfa_regist...
.text .file "frac-calc.c" .globl main // -- Begin function main .p2align 2 .type main,@function main: // @main .cfi_startproc // %bb.0: sub sp, sp, #320 .cfi_def_cfa_offset 320 stp x29, x30, [sp, #288] // 16-byte Folded Spill str x28, [sp...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "frac-calc.c" .globl main # -- Begin function main .p2align 1 .type main,@function main: # @main .cfi_startproc # %bb.0: addi sp, sp, -304 .cfi_def_c...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _main ; -- Begin function main .p2align 2 _main: ; @main .cfi_startproc ; %bb.0: sub sp, sp, #336 stp x28, x27, [sp, #304] ; 16-byte Folded Spill stp x29, x30...
fuzzy-match
/* * Copyright (C) 2022 Philip Jones * * Licensed under the MIT License. * https://opensource.org/licenses/MIT */ #include "libmin.h" int32_t fuzzy_match(const char *restrict pattern, const char *restrict str); static int32_t compute_score( int32_t jump, int first_char, const char *restrict match); static...
.text .intel_syntax noprefix .file "fuzzy-match.c" .globl fuzzy_match # -- Begin function fuzzy_match .p2align 4, 0x90 .type fuzzy_match,@function fuzzy_match: # @fuzzy_match .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, r...
.text .file "fuzzy-match.c" .globl fuzzy_match // -- Begin function fuzzy_match .p2align 2 .type fuzzy_match,@function fuzzy_match: // @fuzzy_match .cfi_startproc // %bb.0: sub sp, sp, #80 .cfi_def_cfa_offset 80 stp x29, x30, [sp, #64] // 16-byte Folde...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "fuzzy-match.c" .globl fuzzy_match # -- Begin function fuzzy_match .p2align 1 .type fuzzy_match,@function fuzzy_match: # @fuzzy_match .cfi_startproc # %bb.0: addi s...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _fuzzy_match ; -- Begin function fuzzy_match .p2align 2 _fuzzy_match: ; @fuzzy_match .cfi_startproc ; %bb.0: sub sp, sp, #80 stp x29, x30, [sp, #64] ; 16-byte Folded Spill ...
fy-shuffle
#include "libmin.h" /* BUILD : g++ FisherYatesShuffle.cpp -std=c++11*/ static int rand_int(int n) { int limit = RAND_MAX - RAND_MAX % n; int rnd; do { rnd = libmin_rand(); } while (rnd >= limit); return rnd % n; } void fy_shuffle(int *array, int n) { int i, j, tmp; for (i = n - 1; i > 0; i--) ...
.text .intel_syntax noprefix .file "fy-shuffle.c" .globl fy_shuffle # -- Begin function fy_shuffle .p2align 4, 0x90 .type fy_shuffle,@function fy_shuffle: # @fy_shuffle .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp ...
.text .file "fy-shuffle.c" .globl fy_shuffle // -- Begin function fy_shuffle .p2align 2 .type fy_shuffle,@function fy_shuffle: // @fy_shuffle .cfi_startproc // %bb.0: sub sp, sp, #48 .cfi_def_cfa_offset 48 stp x29, x30, [sp, #32] // 16-byte Folded Sp...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "fy-shuffle.c" .globl fy_shuffle # -- Begin function fy_shuffle .p2align 1 .type fy_shuffle,@function fy_shuffle: # @fy_shuffle .cfi_startproc # %bb.0: addi sp, s...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _fy_shuffle ; -- Begin function fy_shuffle .p2align 2 _fy_shuffle: ; @fy_shuffle .cfi_startproc ; %bb.0: sub sp, sp, #48 stp x29, x30, [sp, #32] ; 16-byte Folded Spill a...
gcd-list
/** * @file * @brief This program aims at calculating the GCD of n numbers by division * method * * @see gcd_iterative_euclidean.cpp, gcd_recursive_euclidean.cpp */ #include "libmin.h" /** Compute GCD using division algorithm * * @param[in] a array of integers to compute GCD for * @param[in] n number of integ...
.text .intel_syntax noprefix .file "gcd-list.c" .globl gcd # -- Begin function gcd .p2align 4, 0x90 .type gcd,@function gcd: # @gcd .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_cfa_register r...
.text .file "gcd-list.c" .globl gcd // -- Begin function gcd .p2align 2 .type gcd,@function gcd: // @gcd .cfi_startproc // %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 str x0, [sp, #24] str w1, [sp, #20] mov w8, #1 // =0...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "gcd-list.c" .globl gcd # -- Begin function gcd .p2align 1 .type gcd,@function gcd: # @gcd .cfi_startproc # %bb.0: addi sp, sp, -48 .cfi_def_cfa_of...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _gcd ; -- Begin function gcd .p2align 2 _gcd: ; @gcd .cfi_startproc ; %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 str x0, [sp, #24] str w1, [sp, #20] mov w8, #1 ...
grad-descent
#include "libmin.h" /** Gradient Descent for linear regression. * The formula for linear regression is : Y= wX + b * Cost Function: 1/n⅀(Yi - (wXi + b))^2 [i starts from 0 → n] *Functions Description: * 1) derivateWRTWeight(double weight, double bias): * Is the partial derivative of the cost function with respect to ...
.text .intel_syntax noprefix .file "grad-descent.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 # -- Begin function derivateWRTWeight .LCPI0_0: .quad 0x4049000000000000 # double 50 .LCPI0_1: .quad 0xc000000000000000 # double -2 .text .globl derivate...
.text .file "grad-descent.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 // -- Begin function derivateWRTWeight .LCPI0_0: .xword 0x4049000000000000 // double 50 .text .globl derivateWRTWeight .p2align 2 .type derivateWRTWeight,@function derivateWRTWeight: ...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "grad-descent.c" .section .sdata,"aw",@progbits .p2align 3 # -- Begin function derivateWRTWeight .LCPI0_0: .quad 0xc000000000000000 # double -2 .LCPI0_1: .quad 0x4049000...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .section __TEXT,__literal8,8byte_literals .p2align 3, 0x0 ; -- Begin function derivateWRTWeight lCPI0_0: .quad 0x4049000000000000 ; double 50 .section __TEXT,__text,regular,pure_instructions .globl ...
graph-tests
///////////////////////////////////////////////// // graph.c // a bunch of linked list and graph stuff // kindly contributed by group 7 Fall 2019 // - Jielun Tan, 12/2019 ///////////////////////////////////////////////// #include "libmin.h" struct queue { int items[40]; int front; int rear; }; struct n...
.text .intel_syntax noprefix .file "graph-tests.c" .globl createNode # -- Begin function createNode .p2align 4, 0x90 .type createNode,@function createNode: # @createNode .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp ...
.text .file "graph-tests.c" .globl createNode // -- Begin function createNode .p2align 2 .type createNode,@function createNode: // @createNode .cfi_startproc // %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 stp x29, x30, [sp, #16] // 16-byte Folded S...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "graph-tests.c" .globl createNode # -- Begin function createNode .p2align 1 .type createNode,@function createNode: # @createNode .cfi_startproc # %bb.0: addi sp, ...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _createNode ; -- Begin function createNode .p2align 2 _createNode: ; @createNode .cfi_startproc ; %bb.0: sub sp, sp, #32 stp x29, x30, [sp, #16] ; 16-byte Folded Spill a...
hanoi
#include "libmin.h" #define other(i,j) (6-(i+j)) static int num[4]; static long count; static int mov(int n, int f, int t) { int o; if (n == 1) { num[f]--; num[t]++; count++; return 0; } o = other(f, t); mov(n-1, f, o); mov(1, f, t); mov(n-1, o, t); return 0; } int mai...
.text .intel_syntax noprefix .file "hanoi.c" .globl main # -- Begin function main .p2align 4, 0x90 .type main,@function main: # @main .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_cfa_register r...
.text .file "hanoi.c" .globl main // -- Begin function main .p2align 2 .type main,@function main: // @main .cfi_startproc // %bb.0: sub sp, sp, #48 .cfi_def_cfa_offset 48 stp x29, x30, [sp, #32] // 16-byte Folded Spill add x29, sp, #32 ...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "hanoi.c" .globl main # -- Begin function main .p2align 1 .type main,@function main: # @main .cfi_startproc # %bb.0: addi sp, sp, -48 .cfi_def_cfa_of...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _main ; -- Begin function main .p2align 2 _main: ; @main .cfi_startproc ; %bb.0: sub sp, sp, #64 stp x29, x30, [sp, #48] ; 16-byte Folded Spill add x29, sp, ...
heapsort
#include "libmin.h" static int64_t bplong; static int64_t base[2048]; /*************************/ /* Heap Sort Program */ /*************************/ int HSORT(int64_t m, int64_t p) { int64_t i,j,k,l; int64_t size; int64_t msize, iran, ia, ic, im, ih, ir; int64_t count, ca; msize = m * bplong; si...
.text .intel_syntax noprefix .file "heapsort.c" .globl HSORT # -- Begin function HSORT .p2align 4, 0x90 .type HSORT,@function HSORT: # @HSORT .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_cfa_regi...
.text .file "heapsort.c" .globl HSORT // -- Begin function HSORT .p2align 2 .type HSORT,@function HSORT: // @HSORT .cfi_startproc // %bb.0: sub sp, sp, #144 .cfi_def_cfa_offset 144 stp x29, x30, [sp, #128] // 16-byte Folded Spill add x29, s...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "heapsort.c" .globl HSORT # -- Begin function HSORT .p2align 1 .type HSORT,@function HSORT: # @HSORT .cfi_startproc # %bb.0: addi sp, sp, -144 .cfi_def...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _HSORT ; -- Begin function HSORT .p2align 2 _HSORT: ; @HSORT .cfi_startproc ; %bb.0: sub sp, sp, #160 stp x29, x30, [sp, #144] ; 16-byte Folded Spill add x29, s...
heat-calc
#include "libmin.h" #define N 100 // Number of grid points along the rod. #define STEPS 500 // Number of time steps for the simulation. #define ALPHA 1.0 // Thermal diffusivity constant. #define DX 1.0 // Spatial step (distance between grid points). #define DT 0.1 // Time step (should be s...
.text .intel_syntax noprefix .file "heat-calc.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 # -- Begin function main .LCPI0_0: .quad 0x3ff0000000000000 # double 1 .LCPI0_1: .quad 0x3fb999999999999a # double 0.10000000000000001 .LCPI0_2: .quad 0x4059...
.text .file "heat-calc.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 // -- Begin function main .LCPI0_0: .xword 0x4059000000000000 // double 100 .LCPI0_1: .xword 0x3fb999999999999a // double 0.10000000000000001 .text .globl main .p2align 2 .type m...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "heat-calc.c" .section .sdata,"aw",@progbits .p2align 3 # -- Begin function main .LCPI0_0: .quad 0xc000000000000000 # double -2 .LCPI0_1: .quad 0x3fb999999999999a ...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .section __TEXT,__literal8,8byte_literals .p2align 3, 0x0 ; -- Begin function main lCPI0_0: .quad 0x4059000000000000 ; double 100 lCPI0_1: .quad 0x3fb999999999999a ; double 0.10000000000...
huff-encode
#include "libmin.h" #define MAX_TREE_HT 256 // Huffman tree node typedef struct HuffmanNode { char data; // Stored character (for leaf nodes) int freq; // Frequency of the character struct HuffmanNode *left; // Left child struct HuffmanNode *right;// Right child } Huffma...
.text .intel_syntax noprefix .file "huff-encode.c" .globl createNode # -- Begin function createNode .p2align 4, 0x90 .type createNode,@function createNode: # @createNode .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp ...
.text .file "huff-encode.c" .globl createNode // -- Begin function createNode .p2align 2 .type createNode,@function createNode: // @createNode .cfi_startproc // %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 stp x29, x30, [sp, #16] // 16-byte Folded S...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "huff-encode.c" .globl createNode # -- Begin function createNode .p2align 1 .type createNode,@function createNode: # @createNode .cfi_startproc # %bb.0: addi sp, ...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _createNode ; -- Begin function createNode .p2align 2 _createNode: ; @createNode .cfi_startproc ; %bb.0: sub sp, sp, #32 stp x29, x30, [sp, #16] ; 16-byte Folded Spill a...
idct-alg
#include "libmin.h" #define N 8 #define PI 3.14159265358979323846 double C(int u) { return (u == 0) ? libmin_sqrt(1.0 / N) : libmin_sqrt(2.0 / N); } void idct_2d(double input[N][N], double output[N][N]) { for (int x = 0; x < N; x++) { for (int y = 0; y < N; y++) { double sum = 0.0; ...
.text .intel_syntax noprefix .file "idct-alg.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 # -- Begin function C .LCPI0_0: .quad 0x3fd0000000000000 # double 0.25 .LCPI0_1: .quad 0x3fc0000000000000 # double 0.125 .text .globl C .p2align 4, 0x90 .t...
.text .file "idct-alg.c" .globl C // -- Begin function C .p2align 2 .type C,@function C: // @C .cfi_startproc // %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 stp x29, x30, [sp, #16] // 16-byte Folded Spill add x29, sp, #16 .cfi_d...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "idct-alg.c" .section .sdata,"aw",@progbits .p2align 3 # -- Begin function C .LCPI0_0: .quad 0x3fd0000000000000 # double 0.25 .LCPI0_1: .quad 0x3fc0000000000000 ...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _C ; -- Begin function C .p2align 2 _C: ; @C .cfi_startproc ; %bb.0: sub sp, sp, #32 stp x29, x30, [sp, #16] ; 16-byte Folded Spill add x29, sp, #16 ....
indirect-test
#include "libmin.h" int aglobal = 56; int foo(int x) { return x*x; } void bar(int (*pfoo)(int x)) { // call a function through a pointer aglobal = (*pfoo)(aglobal); // and implement a switch statement switch (aglobal & 0x7) { case 0: aglobal++; break; case 1: aglobal--; break; ca...
.text .intel_syntax noprefix .file "indirect-test.c" .globl foo # -- Begin function foo .p2align 4, 0x90 .type foo,@function foo: # @foo .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_cfa_regis...
.text .file "indirect-test.c" .globl foo // -- Begin function foo .p2align 2 .type foo,@function foo: // @foo .cfi_startproc // %bb.0: sub sp, sp, #16 .cfi_def_cfa_offset 16 str w0, [sp, #12] ldr w8, [sp, #12] ldr w9, [sp, #12] mul w0, w8, w9 a...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "indirect-test.c" .globl foo # -- Begin function foo .p2align 1 .type foo,@function foo: # @foo .cfi_startproc # %bb.0: addi sp, sp, -32 .cfi_def_c...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _foo ; -- Begin function foo .p2align 2 _foo: ; @foo .cfi_startproc ; %bb.0: sub sp, sp, #16 .cfi_def_cfa_offset 16 str w0, [sp, #12] ldr w8, [sp, #12] ldr w9, [sp, ...
k-means
/** * @file k_means_clustering.c * @brief K Means Clustering Algorithm implemented * @details * This file has K Means algorithm implemmented * It prints test output in eps format * * Note: * Though the code for clustering works for all the * 2D data points and can be extended for any size vector * by making t...
.text .intel_syntax noprefix .file "k-means.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 # -- Begin function calculateNearst .LCPI0_0: .quad 0x7fefffffffffffff # double 1.7976931348623157E+308 .text .globl calculateNearst .p2align 4, 0x90 .type calculateNears...
.text .file "k-means.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 // -- Begin function calculateNearst .LCPI0_0: .xword 0x7fefffffffffffff // double 1.7976931348623157E+308 .text .globl calculateNearst .p2align 2 .type calculateNearst,@function calculateNearst...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "k-means.c" .globl calculateNearst # -- Begin function calculateNearst .p2align 1 .type calculateNearst,@function calculateNearst: # @calculateNearst .cfi_startproc # %bb.0:...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .section __TEXT,__literal8,8byte_literals .p2align 3, 0x0 ; -- Begin function calculateNearst lCPI0_0: .quad 0x7fefffffffffffff ; double 1.7976931348623157E+308 .section __TEXT,__text,regular,pure_in...
kadane
#include "libmin.h" // Function to find the maximum sum of a contiguous subarray // in a given integer array int kadane(int arr[], int n, int *ends_at) { // stores the maximum sum subarray found so far int max_so_far = 0; *ends_at = -1; // stores the maximum sum of subarray ending at the current position ...
.text .intel_syntax noprefix .file "kadane.c" .globl kadane # -- Begin function kadane .p2align 4, 0x90 .type kadane,@function kadane: # @kadane .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_cfa_reg...
.text .file "kadane.c" .globl kadane // -- Begin function kadane .p2align 2 .type kadane,@function kadane: // @kadane .cfi_startproc // %bb.0: sub sp, sp, #48 .cfi_def_cfa_offset 48 str x0, [sp, #40] str w1, [sp, #36] str x2, [sp, #24] str wzr, [sp, #...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "kadane.c" .globl kadane # -- Begin function kadane .p2align 1 .type kadane,@function kadane: # @kadane .cfi_startproc # %bb.0: addi sp, sp, -80 .cfi_def...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _kadane ; -- Begin function kadane .p2align 2 _kadane: ; @kadane .cfi_startproc ; %bb.0: sub sp, sp, #48 .cfi_def_cfa_offset 48 str x0, [sp, #40] str w1, [sp, #36] str x2,...
knapsack
// // A Dynamic Programming based solution for 0-1 Knapsack problem // // The All ▲lgorithms library for python // // https://allalgorithms.com/dynamic-programming/ // https://github.com/allalgorithms/cpp // // Contributed by: Unknown // Github: Unknown // #include "libmin.h" #ifdef PROBLEM_TINY #define N 3 #define W ...
.text .intel_syntax noprefix .file "knapsack.c" .globl max # -- Begin function max .p2align 4, 0x90 .type max,@function max: # @max .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_cfa_register r...
.text .file "knapsack.c" .globl max // -- Begin function max .p2align 2 .type max,@function max: // @max .cfi_startproc // %bb.0: sub sp, sp, #16 .cfi_def_cfa_offset 16 str w0, [sp, #8] str w1, [sp, #4] ldr w8, [sp, #8] ldr w9, [sp, #4] subs w8...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "knapsack.c" .globl max # -- Begin function max .p2align 1 .type max,@function max: # @max .cfi_startproc # %bb.0: addi sp, sp, -32 .cfi_def_cfa_of...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _max ; -- Begin function max .p2align 2 _max: ; @max .cfi_startproc ; %bb.0: sub sp, sp, #16 .cfi_def_cfa_offset 16 str w0, [sp, #8] str w1, [sp, #4] ldr w8, [sp, #8...
knights-tour
//////////////////////////////////////////////////// // backtrack.c // C program for Knight Tour problem // There's a tunable hyperparameter called N // which sets the size of the chess board // kindly contributed by group 6 Fall 2019 // - Jielun Tan, 12/2019 /////////////////////////////////////////////////// // #in...
.text .intel_syntax noprefix .file "knights-tour.c" .globl isSafe # -- Begin function isSafe .p2align 4, 0x90 .type isSafe,@function isSafe: # @isSafe .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_c...
.text .file "knights-tour.c" .globl isSafe // -- Begin function isSafe .p2align 2 .type isSafe,@function isSafe: // @isSafe .cfi_startproc // %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 str w0, [sp, #28] str w1, [sp, #24] str x2, [sp, #16] ldr w8, [...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "knights-tour.c" .globl isSafe # -- Begin function isSafe .p2align 1 .type isSafe,@function isSafe: # @isSafe .cfi_startproc # %bb.0: addi sp, sp, -48 .c...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _isSafe ; -- Begin function isSafe .p2align 2 _isSafe: ; @isSafe .cfi_startproc ; %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 str w0, [sp, #28] str w1, [sp, #24] str x2,...
life
#include "libmin.h" void init(void); void draw(void); void process(void); void processMutate(int x, int y); int getNumNeigbors(int x, int y); void clrscr(void); void flip(void); char getLeft(int x, int y); char getRight(int x, int y); char getUp(int x, int y); char getDown(int x, int y); char getUpLeft(int x, int y); ...
.text .intel_syntax noprefix .file "life.c" .globl main # -- Begin function main .p2align 4, 0x90 .type main,@function main: # @main .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_cfa_register rb...
.text .file "life.c" .globl main // -- Begin function main .p2align 2 .type main,@function main: // @main .cfi_startproc // %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 stp x29, x30, [sp, #16] // 16-byte Folded Spill add x29, sp, #16 ....
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "life.c" .globl main # -- Begin function main .p2align 1 .type main,@function main: # @main .cfi_startproc # %bb.0: addi sp, sp, -32 .cfi_def_cfa_off...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _main ; -- Begin function main .p2align 2 _main: ; @main .cfi_startproc ; %bb.0: sub sp, sp, #32 stp x29, x30, [sp, #16] ; 16-byte Folded Spill add x29, sp, ...
lu-decomp
#include "libmin.h" #define N 5 // Matrix size // #define N 3 // Matrix size void print_matrix(const char* name, double mat[N][N]) { libmin_printf("%s =\n", name); for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { libmin_printf("%8.4f ", mat[i][j]); } libmin_pri...
.text .intel_syntax noprefix .file "lu-decomp.c" .globl print_matrix # -- Begin function print_matrix .p2align 4, 0x90 .type print_matrix,@function print_matrix: # @print_matrix .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, ...
.text .file "lu-decomp.c" .globl print_matrix // -- Begin function print_matrix .p2align 2 .type print_matrix,@function print_matrix: // @print_matrix .cfi_startproc // %bb.0: sub sp, sp, #48 .cfi_def_cfa_offset 48 stp x29, x30, [sp, #32] // 16-byte Fold...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "lu-decomp.c" .globl print_matrix # -- Begin function print_matrix .p2align 1 .type print_matrix,@function print_matrix: # @print_matrix .cfi_startproc # %bb.0: addi ...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _print_matrix ; -- Begin function print_matrix .p2align 2 _print_matrix: ; @print_matrix .cfi_startproc ; %bb.0: sub sp, sp, #48 stp x29, x30, [sp, #32] ; 16-byte Folded Spil...
mandelbrot
/** mandel.c by Eric R. Weeks written 9-28-96 ** weeks@dept.physics.upenn.edu ** http://dept.physics.upenn.edu/~weeks/ ** ** This program is public domain, but this header must be left intact ** and unchanged. ** ** to compile: cc -o mand mandel.c ** **/ #include "libmin.h" void color(int red...
.text .intel_syntax noprefix .file "mandelbrot.c" .globl color # -- Begin function color .p2align 4, 0x90 .type color,@function color: # @color .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_cfa_re...
.text .file "mandelbrot.c" .globl color // -- Begin function color .p2align 2 .type color,@function color: // @color .cfi_startproc // %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 stp x29, x30, [sp, #16] // 16-byte Folded Spill add x29, s...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "mandelbrot.c" .globl color # -- Begin function color .p2align 1 .type color,@function color: # @color .cfi_startproc # %bb.0: addi sp, sp, -32 .cfi_de...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _color ; -- Begin function color .p2align 2 _color: ; @color .cfi_startproc ; %bb.0: sub sp, sp, #64 stp x29, x30, [sp, #48] ; 16-byte Folded Spill add x29, sp...
matmult
#include "libmin.h" #define N 64 // Matrix dimension (adjust for more cache stress) static int A[N][N]; static int B[N][N]; static int C[N][N]; // Result from main multiplication (order: i, j, k) static int refC[N][N]; // Reference result using an alternative loop order (order: i, k, j) int main() { // I...
.text .intel_syntax noprefix .file "matmult.c" .globl main # -- Begin function main .p2align 4, 0x90 .type main,@function main: # @main .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_cfa_register...
.text .file "matmult.c" .globl main // -- Begin function main .p2align 2 .type main,@function main: // @main .cfi_startproc // %bb.0: sub sp, sp, #96 .cfi_def_cfa_offset 96 stp x29, x30, [sp, #80] // 16-byte Folded Spill add x29, sp, #80...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "matmult.c" .globl main # -- Begin function main .p2align 1 .type main,@function main: # @main .cfi_startproc # %bb.0: addi sp, sp, -128 .cfi_def_cfa...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _main ; -- Begin function main .p2align 2 _main: ; @main .cfi_startproc ; %bb.0: sub sp, sp, #128 stp x29, x30, [sp, #112] ; 16-byte Folded Spill add x29, sp,...
max-subseq
// The longest common subsequence in C #include "libmin.h" char S1[20] = "ACADBFEDSFSDFDSEFE", S2[20] = "CBDAEFEFESAFEASDD"; int i, j, m, n, LCS_table[40][40]; char b[40][40]; void lcsAlgo() { // Filling 0's in the matrix for (i = 0; i <= m; i++) LCS_table[i][0] = 0; for (i = 0; i <= n; i++) LCS_table...
.text .intel_syntax noprefix .file "max-subseq.c" .globl lcsAlgo # -- Begin function lcsAlgo .p2align 4, 0x90 .type lcsAlgo,@function lcsAlgo: # @lcsAlgo .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_...
.text .file "max-subseq.c" .globl lcsAlgo // -- Begin function lcsAlgo .p2align 2 .type lcsAlgo,@function lcsAlgo: // @lcsAlgo .cfi_startproc // %bb.0: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill .cfi_def_cfa_offset 16 mov x29, sp .cfi_def...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "max-subseq.c" .globl lcsAlgo # -- Begin function lcsAlgo .p2align 1 .type lcsAlgo,@function lcsAlgo: # @lcsAlgo .cfi_startproc # %bb.0: addi sp, sp, -64 ....
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _lcsAlgo ; -- Begin function lcsAlgo .p2align 2 _lcsAlgo: ; @lcsAlgo .cfi_startproc ; %bb.0: stp x29, x30, [sp, #-16]! ; 16-byte Folded Spill mov x29, sp sub sp, sp,...
mersenne
/* A C-program for MT19937: Integer version (1999/10/28) */ /* genrand() generates one pseudorandom unsigned integer (32bit) */ /* which is uniformly distributed among 0 to 2^32-1 for each */ /* call. sgenrand(seed) sets initial values to the working area */ /* of 624 words. Before genrand(), sgenrand(s...
.text .intel_syntax noprefix .file "mersenne.c" .globl sgenrand # -- Begin function sgenrand .p2align 4, 0x90 .type sgenrand,@function sgenrand: # @sgenrand .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def...
.text .file "mersenne.c" .globl sgenrand // -- Begin function sgenrand .p2align 2 .type sgenrand,@function sgenrand: // @sgenrand .cfi_startproc // %bb.0: sub sp, sp, #16 .cfi_def_cfa_offset 16 str w0, [sp, #12] str wzr, [sp, #8] b .LBB0_1 .LBB0_1: ...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "mersenne.c" .globl sgenrand # -- Begin function sgenrand .p2align 1 .type sgenrand,@function sgenrand: # @sgenrand .cfi_startproc # %bb.0: addi sp, sp, -32 ...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _sgenrand ; -- Begin function sgenrand .p2align 2 _sgenrand: ; @sgenrand .cfi_startproc ; %bb.0: sub sp, sp, #16 .cfi_def_cfa_offset 16 str w0, [sp, #12] str wzr, [sp, #8] b L...
monte-carlo
#include "libmin.h" #define NUM_SAMPLES 25000 // samples int main(void) { int count_inside_circle = 0; double x, y; // Seed the random number generator libmin_srand(42); for (int i = 0; i < NUM_SAMPLES; ++i) { // Generate random (x, y) point in [0, 1] × [0, 1] x = (double)libmin_rand() / RAND_M...
.text .intel_syntax noprefix .file "monte-carlo.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 # -- Begin function main .LCPI0_0: .quad 0x40d86a0000000000 # double 25000 .LCPI0_1: .quad 0x4010000000000000 # double 4 .LCPI0_2: .quad 0x3ff0000000000000...
.text .file "monte-carlo.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 // -- Begin function main .LCPI0_0: .xword 0x41dfffffffc00000 // double 2147483647 .LCPI0_1: .xword 0x40d86a0000000000 // double 25000 .text .globl main .p2align 2 .type main,@...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "monte-carlo.c" .section .sdata,"aw",@progbits .p2align 3 # -- Begin function main .LCPI0_0: .quad 0x4010000000000000 # double 4 .LCPI0_1: .quad 0x40d86a0000000000 ...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .section __TEXT,__literal8,8byte_literals .p2align 3, 0x0 ; -- Begin function main lCPI0_0: .quad 0x41dfffffffc00000 ; double 2147483647 lCPI0_1: .quad 0x40d86a0000000000 ; double 25000 ...
murmur-hash
#include "libmin.h" /** * `murmurhash.h' - murmurhash * * copyright (c) 2014-2022 joseph werle <joseph.werle@gmail.com> */ /** * Returns a murmur hash of `key' based on `seed' * using the MurmurHash3 algorithm */ uint32_t murmurhash(const char *, uint32_t, uint32_t); /** * `murmurhash.h' - murmurhash * * ...
.text .intel_syntax noprefix .file "murmur-hash.c" .globl murmurhash # -- Begin function murmurhash .p2align 4, 0x90 .type murmurhash,@function murmurhash: # @murmurhash .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp ...
.text .file "murmur-hash.c" .globl murmurhash // -- Begin function murmurhash .p2align 2 .type murmurhash,@function murmurhash: // @murmurhash .cfi_startproc // %bb.0: sub sp, sp, #96 .cfi_def_cfa_offset 96 str x0, [sp, #88] str w1, [sp, #84] str w2, [sp, #80]...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "murmur-hash.c" .globl murmurhash # -- Begin function murmurhash .p2align 1 .type murmurhash,@function murmurhash: # @murmurhash .cfi_startproc # %bb.0: addi sp, ...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _murmurhash ; -- Begin function murmurhash .p2align 2 _murmurhash: ; @murmurhash .cfi_startproc ; %bb.0: sub sp, sp, #96 .cfi_def_cfa_offset 96 str x0, [sp, #88] str w1, [sp, #84] ...
n-queens
#include "libmin.h" #define BOARD_SIZE 10 // You can change this to any board size (e.g., 4, 8, 12) int solution_count = 0; // Check if placing a queen at (row, col) is safe int is_safe(int queens[], int row, int col) { for (int i = 0; i < row; i++) { int q_col = queens[i]; if (q_col == col || libmin_ab...
.text .intel_syntax noprefix .file "n-queens.c" .globl is_safe # -- Begin function is_safe .p2align 4, 0x90 .type is_safe,@function is_safe: # @is_safe .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_cf...
.text .file "n-queens.c" .globl is_safe // -- Begin function is_safe .p2align 2 .type is_safe,@function is_safe: // @is_safe .cfi_startproc // %bb.0: sub sp, sp, #64 .cfi_def_cfa_offset 64 stp x29, x30, [sp, #48] // 16-byte Folded Spill add x2...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "n-queens.c" .globl is_safe # -- Begin function is_safe .p2align 1 .type is_safe,@function is_safe: # @is_safe .cfi_startproc # %bb.0: addi sp, sp, -64 .cf...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _is_safe ; -- Begin function is_safe .p2align 2 _is_safe: ; @is_safe .cfi_startproc ; %bb.0: sub sp, sp, #64 stp x29, x30, [sp, #48] ; 16-byte Folded Spill add x29...
natlog
#include "libmin.h" /* calculate e=2.718..., using an interative approximation */ int main(void) { /* STEPS is usually a very large number eg 10000000 */ int steps = 100000; double x, y; y = 1.0 + 1.0/steps; x = 1.0; for(; steps > 0; steps--) x *= y; libmin_printf("natlog: e=%f\n", x); libmin_...
.text .intel_syntax noprefix .file "natlog.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 # -- Begin function main .LCPI0_0: .quad 0x3ff0000000000000 # double 1 .text .globl main .p2align 4, 0x90 .type main,@function main: # @m...
.text .file "natlog.c" .globl main // -- Begin function main .p2align 2 .type main,@function main: // @main .cfi_startproc // %bb.0: sub sp, sp, #48 .cfi_def_cfa_offset 48 stp x29, x30, [sp, #32] // 16-byte Folded Spill add x29, sp, #32 ...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "natlog.c" .section .sdata,"aw",@progbits .p2align 3 # -- Begin function main .LCPI0_0: .quad 0x3ff0000000000000 # double 1 .text .globl main .p2align 1 .type main,@f...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _main ; -- Begin function main .p2align 2 _main: ; @main .cfi_startproc ; %bb.0: sub sp, sp, #48 stp x29, x30, [sp, #32] ; 16-byte Folded Spill add x29, sp, ...
nbody-sim
#include "libmin.h" #define N_BODIES 3 // Number of particles #define NUM_STEPS 1000 // Number of simulation steps #define DT 0.01 // Time step (seconds) #define G 6.67430e-11 // Gravitational constant (m^3 kg^-1 s^-2) #ifndef EPS #define EPS 1e-9 // Softening factor to avoid singularities #endi...
.text .intel_syntax noprefix .file "nbody-sim.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 # -- Begin function main .LCPI0_0: .quad 0x3f847ae147ae147b # double 0.01 .LCPI0_1: .quad 0x3dd2589effed8acc # double 6.6742999999999994E-11 .LCPI0_2: .quad ...
.text .file "nbody-sim.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 // -- Begin function main .LCPI0_0: .xword 0x3dd2589effed8acc // double 6.6742999999999994E-11 .LCPI0_1: .xword 0x3cb0000000000000 // double 2.2204460492503131E-16 .LCPI0_2: .xword ...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "nbody-sim.c" .section .sdata,"aw",@progbits .p2align 3 # -- Begin function main .LCPI0_0: .quad 0x3f847ae147ae147b # double 0.01 .LCPI0_1: .quad 0x3cb0000000000000 ...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .section __TEXT,__literal8,8byte_literals .p2align 3, 0x0 ; -- Begin function main lCPI0_0: .quad 0x3dd2589effed8acc ; double 6.6742999999999994E-11 lCPI0_1: .quad 0x3cb0000000000000 ; d...
nr-solver
#include "libmin.h" typedef double (*fn_type)(double x); double sqrt_value; #define FN_SQRT #ifdef FN_SQRT double f(double x) { return x*x - sqrt_value; } double df(double x) { return x*2.0; } #endif #ifdef FN_COMPLEX double f(double x) { return x*x*x - x - 1.0; } double df(double x) { return x*3.0 - 1.0...
.text .intel_syntax noprefix .file "nr-solver.c" .globl f # -- Begin function f .p2align 4, 0x90 .type f,@function f: # @f .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_cfa_register rbp m...
.text .file "nr-solver.c" .globl f // -- Begin function f .p2align 2 .type f,@function f: // @f .cfi_startproc // %bb.0: sub sp, sp, #16 .cfi_def_cfa_offset 16 str d0, [sp, #8] ldr d0, [sp, #8] ldr d1, [sp, #8] adrp x8, sqrt_value ldr d2, [...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "nr-solver.c" .globl f # -- Begin function f .p2align 1 .type f,@function f: # @f .cfi_startproc # %bb.0: addi sp, sp, -32 .cfi_def_cfa_offset ...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _f ; -- Begin function f .p2align 2 _f: ; @f .cfi_startproc ; %bb.0: sub sp, sp, #16 .cfi_def_cfa_offset 16 str d0, [sp, #8] ldr d0, [sp, #8] ldr d1, [sp, #8] a...
packet-filter
#include "libmin.h" // Define protocol value for TCP #define TCP_PROTOCOL 6 // Define constants for the 192.168.0.0/16 IP range. #define FIXED_IP_FIRST 192 #define FIXED_IP_SECOND 168 #define PACKET_COUNT 100 // Total number of packets to simulate // Packet structure definition typedef struct { unsigned int sr...
.text .intel_syntax noprefix .file "packet-filter.c" .globl generate_packet # -- Begin function generate_packet .p2align 4, 0x90 .type generate_packet,@function generate_packet: # @generate_packet .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -...
.text .file "packet-filter.c" .globl generate_packet // -- Begin function generate_packet .p2align 2 .type generate_packet,@function generate_packet: // @generate_packet .cfi_startproc // %bb.0: sub sp, sp, #48 .cfi_def_cfa_offset 48 stp x29, x30, [sp, #32] //...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "packet-filter.c" .globl generate_packet # -- Begin function generate_packet .p2align 1 .type generate_packet,@function generate_packet: # @generate_packet .cfi_startproc # ...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _generate_packet ; -- Begin function generate_packet .p2align 2 _generate_packet: ; @generate_packet .cfi_startproc ; %bb.0: sub sp, sp, #48 stp x29, x30, [sp, #32] ; 16-byte Folde...
parrondo
/* parrando.c: simulation of J. Parrando's probability paradox */ /* Parrondo's game is based upon two simple games of chance. The gambler's fortune starts at 0. The simple game: Toss a biased coin and win +1 with probability S_WIN_PROB (defined below). Otherwise win -1; The complex game: If the playe...
.text .intel_syntax noprefix .file "parrondo.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 # -- Begin function cointoss .LCPI0_0: .quad 0x41dfffffffc00000 # double 2147483647 .text .globl cointoss .p2align 4, 0x90 .type cointoss,@function cointoss: ...
.text .file "parrondo.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 // -- Begin function cointoss .LCPI0_0: .xword 0x41dfffffffc00000 // double 2147483647 .text .globl cointoss .p2align 2 .type cointoss,@function cointoss: // @coin...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "parrondo.c" .section .sdata,"aw",@progbits .p2align 3 # -- Begin function cointoss .LCPI0_0: .quad 0x41dfffffffc00000 # double 2147483647 .text .globl cointoss .p2ali...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .section __TEXT,__literal8,8byte_literals .p2align 3, 0x0 ; -- Begin function cointoss lCPI0_0: .quad 0x41dfffffffc00000 ; double 2147483647 .section __TEXT,__text,regular,pure_instructions .globl _...
pascal
/* pascal.c: print rows of Pascal's triangle to stdout. The algorithm is simply to generate successive rows iteratively using the defining property of pascal's triangle: C(n,k) = C(n-1,k-1) + C(n-1,k). The program is written for simplicity rather than efficiency. The only tri...
.text .intel_syntax noprefix .file "pascal.c" .globl num_digits # -- Begin function num_digits .p2align 4, 0x90 .type num_digits,@function num_digits: # @num_digits .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi...
.text .file "pascal.c" .globl num_digits // -- Begin function num_digits .p2align 2 .type num_digits,@function num_digits: // @num_digits .cfi_startproc // %bb.0: sub sp, sp, #16 .cfi_def_cfa_offset 16 str w0, [sp, #12] mov w8, #1 // =0...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "pascal.c" .globl num_digits # -- Begin function num_digits .p2align 1 .type num_digits,@function num_digits: # @num_digits .cfi_startproc # %bb.0: addi sp, sp, -...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _num_digits ; -- Begin function num_digits .p2align 2 _num_digits: ; @num_digits .cfi_startproc ; %bb.0: sub sp, sp, #16 .cfi_def_cfa_offset 16 str w0, [sp, #12] mov w8, #1 ...
pi-calc
#include "libmin.h" // Developer- Dik T. Winter // Intro- Calculates the first 15000 digits of PI. // Details- http://stackoverflow.com/questions/20287513/can-anyone-make-heads-or-tales-of-this-spigot-algorithm-code-pitiny-c // Source- http://www.iwriteiam.nl/SigProgC.html#pi int a[52514],b,c=52514,d,e,f=1e4,g,h;int...
.text .intel_syntax noprefix .file "pi-calc.c" .globl main # -- Begin function main .p2align 4, 0x90 .type main,@function main: # @main .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_cfa_register...
.text .file "pi-calc.c" .globl main // -- Begin function main .p2align 2 .type main,@function main: // @main .cfi_startproc // %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 stp x29, x30, [sp, #16] // 16-byte Folded Spill add x29, sp, #16...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "pi-calc.c" .globl main # -- Begin function main .p2align 1 .type main,@function main: # @main .cfi_startproc # %bb.0: addi sp, sp, -48 .cfi_def_cfa_...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _main ; -- Begin function main .p2align 2 _main: ; @main .cfi_startproc ; %bb.0: sub sp, sp, #48 stp x29, x30, [sp, #32] ; 16-byte Folded Spill add x29, sp, ...
primal-test
/* miller_rabin_int.c -- long long implementation of the Miller-Rabin test * * Copyright 2014 by Colin Benner <colin-software@yzhs.de> * * This file is part of frobenius-test. * * frobenius-test is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as publ...
.text .intel_syntax noprefix .file "primal-test.c" .globl get_random_int # -- Begin function get_random_int .p2align 4, 0x90 .type get_random_int,@function get_random_int: # @get_random_int .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 m...
.text .file "primal-test.c" .globl get_random_int // -- Begin function get_random_int .p2align 2 .type get_random_int,@function get_random_int: // @get_random_int .cfi_startproc // %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 stp x29, x30, [sp, #16] // 16-b...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "primal-test.c" .globl get_random_int # -- Begin function get_random_int .p2align 1 .type get_random_int,@function get_random_int: # @get_random_int .cfi_startproc # %bb.0...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _get_random_int ; -- Begin function get_random_int .p2align 2 _get_random_int: ; @get_random_int .cfi_startproc ; %bb.0: sub sp, sp, #32 stp x29, x30, [sp, #16] ; 16-byte Folded ...
priority-queue
// ripped from geeksforgeeks // C code to implement Priority Queue // using Linked List #include "libmin.h" // Node typedef struct node { int data; // Lower values indicate higher priority int priority; struct node* next; } Node; // Function to Create A New Node Node* newNode(int d, int p) { ...
.text .intel_syntax noprefix .file "priority-queue.c" .globl newNode # -- Begin function newNode .p2align 4, 0x90 .type newNode,@function newNode: # @newNode .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_...
.text .file "priority-queue.c" .globl newNode // -- Begin function newNode .p2align 2 .type newNode,@function newNode: // @newNode .cfi_startproc // %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 stp x29, x30, [sp, #16] // 16-byte Folded Spill ...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "priority-queue.c" .globl newNode # -- Begin function newNode .p2align 1 .type newNode,@function newNode: # @newNode .cfi_startproc # %bb.0: addi sp, sp, -3...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _newNode ; -- Begin function newNode .p2align 2 _newNode: ; @newNode .cfi_startproc ; %bb.0: sub sp, sp, #32 stp x29, x30, [sp, #16] ; 16-byte Folded Spill add x29...
qsort-demo
#include "libmin.h" /* qsort int comparison function */ int int_cmp(const void *a, const void *b) { const int *ia = (const int *)a; // casting pointer types const int *ib = (const int *)b; return *ia - *ib; /* integer comparison: returns negative if a < b and positive if a > b */ } /* integer arr...
.text .intel_syntax noprefix .file "qsort-demo.c" .globl int_cmp # -- Begin function int_cmp .p2align 4, 0x90 .type int_cmp,@function int_cmp: # @int_cmp .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_...
.text .file "qsort-demo.c" .globl int_cmp // -- Begin function int_cmp .p2align 2 .type int_cmp,@function int_cmp: // @int_cmp .cfi_startproc // %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 str x0, [sp, #24] str x1, [sp, #16] ldr x8, [sp, #24] str x8, ...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "qsort-demo.c" .globl int_cmp # -- Begin function int_cmp .p2align 1 .type int_cmp,@function int_cmp: # @int_cmp .cfi_startproc # %bb.0: addi sp, sp, -48 ....
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _int_cmp ; -- Begin function int_cmp .p2align 2 _int_cmp: ; @int_cmp .cfi_startproc ; %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 str x0, [sp, #24] str x1, [sp, #16] ldr x...
qsort-test
#include "libmin.h" /* Comparison function for integers. */ int int_compare(const void *a, const void *b) { const int *ia = (const int *) a; const int *ib = (const int *) b; return (*ia) - (*ib); } /* Utility function to check if an array of integers is sorted (non-decreasing order). */ int is_sorted(cons...
.text .intel_syntax noprefix .file "qsort-test.c" .globl int_compare # -- Begin function int_compare .p2align 4, 0x90 .type int_compare,@function int_compare: # @int_compare .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rs...
.text .file "qsort-test.c" .globl int_compare // -- Begin function int_compare .p2align 2 .type int_compare,@function int_compare: // @int_compare .cfi_startproc // %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 str x0, [sp, #24] str x1, [sp, #16] ldr x8, [sp, #2...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "qsort-test.c" .globl int_compare # -- Begin function int_compare .p2align 1 .type int_compare,@function int_compare: # @int_compare .cfi_startproc # %bb.0: addi sp...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _int_compare ; -- Begin function int_compare .p2align 2 _int_compare: ; @int_compare .cfi_startproc ; %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 str x0, [sp, #24] str x1, [sp, #16...
quaternions
/** * @file * @brief Functions related to 3D quaternions and Euler angles. * @author Krishna Vedala */ #include "libmin.h" /** * @addtogroup quaternions Library for 3D Vectors & Quaternions * @{ * @file * @brief Generic header that provides data types for 3D vectors and quaternions * @author Krishna Vedala ...
.text .intel_syntax noprefix .file "quaternions.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 # -- Begin function quat_from_euler .LCPI0_0: .quad 0x3fe0000000000000 # double 0.5 .text .globl quat_from_euler .p2align 4, 0x90 .type quat_from_euler,@function quat...
.text .file "quaternions.c" .globl quat_from_euler // -- Begin function quat_from_euler .p2align 2 .type quat_from_euler,@function quat_from_euler: // @quat_from_euler .cfi_startproc // %bb.0: sub sp, sp, #160 .cfi_def_cfa_offset 160 stp x29, x30, [sp, #144] //...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "quaternions.c" .section .sdata,"aw",@progbits .p2align 3 # -- Begin function quat_from_euler .LCPI0_0: .quad 0x3fe0000000000000 # double 0.5 .text .globl quat_from_eul...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _quat_from_euler ; -- Begin function quat_from_euler .p2align 2 _quat_from_euler: ; @quat_from_euler .cfi_startproc ; %bb.0: sub sp, sp, #160 stp x29, x30, [sp, #144] ; 16-byte Fold...
quine
#include "libmin.h" #define B(x)int main(){libmin_puts("#include \"libmin.h\"\n#define B(x)"x"\n#define X(s)S(s)\n#define S(s)#s\nB(X(B(x)))\n");libmin_success(); return 0;} #define X(s)S(s) #define S(s)#s B(X(B(x)))
.text .intel_syntax noprefix .file "quine.c" .globl main # -- Begin function main .p2align 4, 0x90 .type main,@function main: # @main .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_cfa_register r...
.text .file "quine.c" .globl main // -- Begin function main .p2align 2 .type main,@function main: // @main .cfi_startproc // %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 stp x29, x30, [sp, #16] // 16-byte Folded Spill add x29, sp, #16 ...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "quine.c" .globl main # -- Begin function main .p2align 1 .type main,@function main: # @main .cfi_startproc # %bb.0: addi sp, sp, -32 .cfi_def_cfa_of...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _main ; -- Begin function main .p2align 2 _main: ; @main .cfi_startproc ; %bb.0: sub sp, sp, #32 stp x29, x30, [sp, #16] ; 16-byte Folded Spill add x29, sp, ...
rabinkarp-search
/* Rabin-Karp rolling hash string search algorithm */ #include "libmin.h" #define TRUE 1 #define FALSE 0 // valid SIZE's: 380, 760 (default), 1140, 1520 #define SIZE 1520 // Inputs char inp_pat[] = "NzZVOzZXNoGXMl8yxesyY"; char inp_txt[] = "zJfMus2WzLnMr82T4bmuzKTNjcylzYfNiGjMssyBZc2PzZPMvMyXzJnMvMyjzZQgzYfMnMyx...
.text .intel_syntax noprefix .file "rabinkarp-search.c" .globl search # -- Begin function search .p2align 4, 0x90 .type search,@function search: # @search .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_d...
.text .file "rabinkarp-search.c" .globl search // -- Begin function search .p2align 2 .type search,@function search: // @search .cfi_startproc // %bb.0: sub sp, sp, #80 .cfi_def_cfa_offset 80 str x0, [sp, #72] str w1, [sp, #68] str x2, [sp, #56] str w...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "rabinkarp-search.c" .globl search # -- Begin function search .p2align 1 .type search,@function search: # @search .cfi_startproc # %bb.0: addi sp, sp, -96...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _search ; -- Begin function search .p2align 2 _search: ; @search .cfi_startproc ; %bb.0: sub sp, sp, #80 .cfi_def_cfa_offset 80 str x0, [sp, #72] str w1, [sp, #68] str x2,...
rand-test
/* * rand_test.c * * A randomness testing application that runs a battery of tests on two random * generators: * 1. A deliberately weak random generator (bad_rand). * 2. The system's standard library rand() function, wrapped in good_rand. * * The tests include: * - Monobit test: Count the number of 1 bit...
.text .intel_syntax noprefix .file "rand-test.c" .globl bad_rand # -- Begin function bad_rand .p2align 4, 0x90 .type bad_rand,@function bad_rand: # @bad_rand .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_de...
.text .file "rand-test.c" .globl bad_rand // -- Begin function bad_rand .p2align 2 .type bad_rand,@function bad_rand: // @bad_rand .cfi_startproc // %bb.0: adrp x8, bad_rand.state ldr w9, [x8, :lo12:bad_rand.state] mov w10, #54436 // =0xd...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "rand-test.c" .globl bad_rand # -- Begin function bad_rand .p2align 1 .type bad_rand,@function bad_rand: # @bad_rand .cfi_startproc # %bb.0: addi sp, sp, -16 ...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _bad_rand ; -- Begin function bad_rand .p2align 2 _bad_rand: ; @bad_rand .cfi_startproc ; %bb.0: adrp x8, _bad_rand.state@PAGE ldr w9, [x8, _bad_rand.state@PAGEOFF] mov w10, #54...
ransac
/* * ransac_line_fit.c * * A simple RANSAC application that fits a line (y = m*x + b) * to a set of 2D points. The data is generated with a known ground-truth * line plus some noise (inliers) along with a number of outlier points. * * To compile: * gcc ransac_line_fit.c -lm -o ransac_line_fit * * Then run...
.text .intel_syntax noprefix .file "ransac.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 # -- Begin function line_distance .LCPI0_0: .quad 0x3ff0000000000000 # double 1 .text .globl line_distance .p2align 4, 0x90 .type line_distance,@function line_distance: ...
.text .file "ransac.c" .globl line_distance // -- Begin function line_distance .p2align 2 .type line_distance,@function line_distance: // @line_distance .cfi_startproc // %bb.0: sub sp, sp, #64 .cfi_def_cfa_offset 64 stp x29, x30, [sp, #48] // 16-byte Fold...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "ransac.c" .section .sdata,"aw",@progbits .p2align 3 # -- Begin function line_distance .LCPI0_0: .quad 0x3ff0000000000000 # double 1 .text .globl line_distance .p2alig...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _line_distance ; -- Begin function line_distance .p2align 2 _line_distance: ; @line_distance .cfi_startproc ; %bb.0: sub sp, sp, #64 stp x29, x30, [sp, #48] ; 16-byte Folded Sp...
rle-compress
/** * @file * @author [serturx](https://github.com/serturx/) * @brief Encode a null terminated string using [Run-length encoding](https://en.wikipedia.org/wiki/Run-length_encoding) * @details * Run-length encoding is a lossless compression algorithm. * It works by counting the consecutive occurences symbols * an...
.text .intel_syntax noprefix .file "rle-compress.c" .globl run_length_encode # -- Begin function run_length_encode .p2align 4, 0x90 .type run_length_encode,@function run_length_encode: # @run_length_encode .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset r...
.text .file "rle-compress.c" .globl run_length_encode // -- Begin function run_length_encode .p2align 2 .type run_length_encode,@function run_length_encode: // @run_length_encode .cfi_startproc // %bb.0: sub sp, sp, #96 .cfi_def_cfa_offset 96 stp x29, x30, [sp, #80] ...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "rle-compress.c" .globl run_length_encode # -- Begin function run_length_encode .p2align 1 .type run_length_encode,@function run_length_encode: # @run_length_encode .cfi_startpr...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _run_length_encode ; -- Begin function run_length_encode .p2align 2 _run_length_encode: ; @run_length_encode .cfi_startproc ; %bb.0: sub sp, sp, #128 stp x29, x30, [sp, #112] ; 16-byte ...
rsa-cipher
#include "libmin.h" // Define 128-bit integer type (GCC/Clang-specific) typedef __int128 int128; // Fast modular exponentiation: computes (base^exp) mod mod int128 mod_pow(int128 base, int128 exp, int128 mod) { int128 result = 1; base = base % mod; while (exp > 0) { if (exp & 1) result...
.text .intel_syntax noprefix .file "rsa-cipher.c" .globl mod_pow # -- Begin function mod_pow .p2align 4, 0x90 .type mod_pow,@function mod_pow: # @mod_pow .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_...
.text .file "rsa-cipher.c" .globl mod_pow // -- Begin function mod_pow .p2align 2 .type mod_pow,@function mod_pow: // @mod_pow .cfi_startproc // %bb.0: sub sp, sp, #80 .cfi_def_cfa_offset 80 stp x29, x30, [sp, #64] // 16-byte Folded Spill add ...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "rsa-cipher.c" .globl mod_pow # -- Begin function mod_pow .p2align 1 .type mod_pow,@function mod_pow: # @mod_pow .cfi_startproc # %bb.0: addi sp, sp, -96 ....
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _mod_pow ; -- Begin function mod_pow .p2align 2 _mod_pow: ; @mod_pow .cfi_startproc ; %bb.0: sub sp, sp, #80 stp x29, x30, [sp, #64] ; 16-byte Folded Spill add x29...
sat-solver
#include "libmin.h" #define NUM_VARS 8 // Number of variables: x1, x2, ..., x8 #define NUM_CLAUSES 10 // Total number of clauses in the CNF formula #define MAX_LITERALS 4 // Maximum literals per clause (including terminating 0) #define UNASSIGNED -1 // Marker for unassigned variables // Defin...
.text .intel_syntax noprefix .file "sat-solver.c" .globl conflict # -- Begin function conflict .p2align 4, 0x90 .type conflict,@function conflict: # @conflict .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_d...
.text .file "sat-solver.c" .globl conflict // -- Begin function conflict .p2align 2 .type conflict,@function conflict: // @conflict .cfi_startproc // %bb.0: sub sp, sp, #48 .cfi_def_cfa_offset 48 str wzr, [sp, #40] b .LBB0_1 .LBB0_1: ...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "sat-solver.c" .globl conflict # -- Begin function conflict .p2align 1 .type conflict,@function conflict: # @conflict .cfi_startproc # %bb.0: addi sp, sp, -64...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _conflict ; -- Begin function conflict .p2align 2 _conflict: ; @conflict .cfi_startproc ; %bb.0: sub sp, sp, #48 .cfi_def_cfa_offset 48 str wzr, [sp, #40] b LBB0_1 LBB0_1: ...
shortest-path
// C Program for Floyd Warshall Algorithm #include "libmin.h" // Number of vertices in the graph #define V 8 /* Define Infinite as a large enough value. This value will be used for vertices not connected to each other */ #define INF 99999 #define N 99999 // A function to print the solution matrix void printSolu...
.text .intel_syntax noprefix .file "shortest-path.c" .globl floydWarshall # -- Begin function floydWarshall .p2align 4, 0x90 .type floydWarshall,@function floydWarshall: # @floydWarshall .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mo...
.text .file "shortest-path.c" .globl floydWarshall // -- Begin function floydWarshall .p2align 2 .type floydWarshall,@function floydWarshall: // @floydWarshall .cfi_startproc // %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 str x0, [sp, #24] str wzr, [sp, #20] b .LB...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "shortest-path.c" .globl floydWarshall # -- Begin function floydWarshall .p2align 1 .type floydWarshall,@function floydWarshall: # @floydWarshall .cfi_startproc # %bb.0:...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _floydWarshall ; -- Begin function floydWarshall .p2align 2 _floydWarshall: ; @floydWarshall .cfi_startproc ; %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 str x0, [sp, #24] str wzr, [sp...
sieve
#include "libmin.h" /***********************************************/ #define LIMIT 8 /* You may need to change this to '3' for PC's */ /* and Clones or you can experiment with higher*/ /* values, but '13' is currently the max. */ /***********************************************/ ...
.text .intel_syntax noprefix .file "sieve.c" .globl main # -- Begin function main .p2align 4, 0x90 .type main,@function main: # @main .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_cfa_register r...
.text .file "sieve.c" .globl main // -- Begin function main .p2align 2 .type main,@function main: // @main .cfi_startproc // %bb.0: sub sp, sp, #48 .cfi_def_cfa_offset 48 stp x29, x30, [sp, #32] // 16-byte Folded Spill add x29, sp, #32 ...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "sieve.c" .globl main # -- Begin function main .p2align 1 .type main,@function main: # @main .cfi_startproc # %bb.0: addi sp, sp, -48 .cfi_def_cfa_of...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _main ; -- Begin function main .p2align 2 _main: ; @main .cfi_startproc ; %bb.0: sub sp, sp, #48 stp x29, x30, [sp, #32] ; 16-byte Folded Spill add x29, sp, ...
simple-grep
#include "libmin.h" #include "speech.h" #define BUFFER_LENGTH 511 struct _MFILE speech = { "speech.txt", __speech_sz, __speech, 0 }; int main(void) { int ac = 3; char *av[] = { "simple-grep", "speech.txt", "the" }; char lineBuffer[BUFFER_LENGTH+1]; MFILE *fp = &speech; int count = 0; if (ac < 3) { l...
.text .intel_syntax noprefix .file "simple-grep.c" .globl main # -- Begin function main .p2align 4, 0x90 .type main,@function main: # @main .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_cfa_regi...
.text .file "simple-grep.c" .globl main // -- Begin function main .p2align 2 .type main,@function main: // @main .cfi_startproc // %bb.0: stp x29, x30, [sp, #-32]! // 16-byte Folded Spill .cfi_def_cfa_offset 32 str x28, [sp, #16] ...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "simple-grep.c" .globl main # -- Begin function main .p2align 1 .type main,@function main: # @main .cfi_startproc # %bb.0: addi sp, sp, -576 .cfi_def...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _main ; -- Begin function main .p2align 2 _main: ; @main .cfi_startproc ; %bb.0: stp x28, x27, [sp, #-32]! ; 16-byte Folded Spill stp x29, x30, [sp, #16] ...
skeleton
#include "libmin.h" int main(void) { libmin_printf("This is a test!, %d, %f...\n", 23, 44.4); libmin_success(); return 0; }
.text .intel_syntax noprefix .file "skeleton.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 # -- Begin function main .LCPI0_0: .quad 0x4046333333333333 # double 44.399999999999999 .text .globl main .p2align 4, 0x90 .type main,@function main: ...
.text .file "skeleton.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 // -- Begin function main .LCPI0_0: .xword 0x4046333333333333 // double 44.399999999999999 .text .globl main .p2align 2 .type main,@function main: // @main .c...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "skeleton.c" .section .sdata,"aw",@progbits .p2align 3 # -- Begin function main .LCPI0_0: .quad 4631445561792475955 # 0x4046333333333333 .text .globl main .p2align 1 ....
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .section __TEXT,__literal8,8byte_literals .p2align 3, 0x0 ; -- Begin function main lCPI0_0: .quad 0x4046333333333333 ; double 44.399999999999999 .section __TEXT,__text,regular,pure_instructions .glo...
spelt2num
#include "libmin.h" // Developer- Seonghoon Kang // Intro- Reads a spelt number and writes a corresponding decimal number. // Details- http://www.ioccc.org/2012/kang/hint.html char *p = "fifty-two trillion six-hundred and seventy five million and sixty-one thousand and five-hundred sixty-two\n"; long long n,u,m,b;in...
.text .intel_syntax noprefix .file "spelt2num.c" .globl main # -- Begin function main .p2align 4, 0x90 .type main,@function main: # @main .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_cfa_regist...
.text .file "spelt2num.c" .globl main // -- Begin function main .p2align 2 .type main,@function main: // @main .cfi_startproc // %bb.0: sub sp, sp, #80 .cfi_def_cfa_offset 80 stp x29, x30, [sp, #64] // 16-byte Folded Spill add x29, sp, #...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "spelt2num.c" .section .sdata,"aw",@progbits .p2align 3 # -- Begin function main .LCPI0_0: .quad 3353953467947191203 # 0x2e8ba2e8ba2e8ba3 .text .globl main .p2align 1 ...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _main ; -- Begin function main .p2align 2 _main: ; @main .cfi_startproc ; %bb.0: sub sp, sp, #96 stp x29, x30, [sp, #80] ; 16-byte Folded Spill add x29, sp, ...
spirograph
/** * @file * @author [Krishna Vedala](https://github.com/kvedala) * @brief Implementation of * [Spirograph](https://en.wikipedia.org/wiki/Spirograph) * * @details * Implementation of the program is based on the geometry shown in the figure * below: * * <a * href="https://commons.wikimedia.org/wiki/File:Reso...
.text .intel_syntax noprefix .file "spirograph.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 # -- Begin function spirograph .LCPI0_0: .quad 0x3ff0000000000000 # double 1 .LCPI0_1: .quad 0x400921fb54442d18 # double 3.1415926535897931 .section .rodata...
.text .file "spirograph.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 // -- Begin function spirograph .LCPI0_0: .xword 0x400921fb54442d18 // double 3.1415926535897931 .text .globl spirograph .p2align 2 .type spirograph,@function spirograph: ...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "spirograph.c" .section .sdata,"aw",@progbits .p2align 3 # -- Begin function spirograph .LCPI0_0: .quad 0x400921fb54442d18 # double 3.1415926535897931 .LCPI0_1: .quad 0x...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .section __TEXT,__literal8,8byte_literals .p2align 3, 0x0 ; -- Begin function spirograph lCPI0_0: .quad 0x400921fb54442d18 ; double 3.1415926535897931 .section __TEXT,__text,regular,pure_instructions...
strange
#include "libmin.h" int ma\ in() { int arr[10], i; for(i=0; i<10; i++){ i[arr] = i; } while(i --> 0){ libmin_printf("%d ", *arr+i); } https://www.google.com i = 010; libmin_printf("\n| %d |", i); i = 5i; libmin_printf("\n %d", i); libmin_success(); ...
.text .intel_syntax noprefix .file "strange.c" .globl main # -- Begin function main .p2align 4, 0x90 .type main,@function main: # @main .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_cfa_register...
.text .file "strange.c" .globl main // -- Begin function main .p2align 2 .type main,@function main: // @main .cfi_startproc // %bb.0: sub sp, sp, #64 .cfi_def_cfa_offset 64 stp x29, x30, [sp, #48] // 16-byte Folded Spill add x29, sp, #48...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "strange.c" .globl main # -- Begin function main .p2align 1 .type main,@function main: # @main .cfi_startproc # %bb.0: addi sp, sp, -64 .cfi_def_cfa_...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _main ; -- Begin function main .p2align 2 _main: ; @main .cfi_startproc ; %bb.0: sub sp, sp, #80 stp x29, x30, [sp, #64] ; 16-byte Folded Spill add x29, sp, ...
sudoku-solver
#include "libmin.h" #define N 9 // Sudoku grid size (9x9) // Hard, but solvable, Sudoku puzzle. // Zeros indicate empty cells. static int board[N][N] = { {8, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 3, 6, 0, 0, 0, 0, 0}, {0, 7, 0, 0, 9, 0, 2, 0, 0}, {0, 5, 0, 0, 0, 7, 0, 0, 0}, {0, 0, 0, 0, 4, 5, 7, 0, 0}...
.text .intel_syntax noprefix .file "sudoku-solver.c" .globl isSafe # -- Begin function isSafe .p2align 4, 0x90 .type isSafe,@function isSafe: # @isSafe .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_...
.text .file "sudoku-solver.c" .globl isSafe // -- Begin function isSafe .p2align 2 .type isSafe,@function isSafe: // @isSafe .cfi_startproc // %bb.0: sub sp, sp, #48 .cfi_def_cfa_offset 48 str w0, [sp, #40] str w1, [sp, #36] str w2, [sp, #32] str wzr,...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "sudoku-solver.c" .globl isSafe # -- Begin function isSafe .p2align 1 .type isSafe,@function isSafe: # @isSafe .cfi_startproc # %bb.0: addi sp, sp, -64 ....
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _isSafe ; -- Begin function isSafe .p2align 2 _isSafe: ; @isSafe .cfi_startproc ; %bb.0: sub sp, sp, #48 .cfi_def_cfa_offset 48 str w0, [sp, #40] str w1, [sp, #36] str w2,...
tiny-NN
/* ============================================================================ Name : TinyNN.c Author : Darius Malysiak Version : 0.01 Copyright : It's mine Description : A tiny 2-layer NN (one input neuron and one output neuron) implementation with backpropagation training ===================...
.text .intel_syntax noprefix .file "tiny-NN.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 # -- Begin function g_deriv .LCPI0_0: .quad 0x3ff0000000000000 # double 1 .LCPI0_1: .quad 0xbff0000000000000 # double -1 .text .globl g_deriv .p2align 4, 0x9...
.text .file "tiny-NN.c" .globl g_deriv // -- Begin function g_deriv .p2align 2 .type g_deriv,@function g_deriv: // @g_deriv .cfi_startproc // %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 stp x29, x30, [sp, #16] // 16-byte Folded Spill add x29...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "tiny-NN.c" .section .sdata,"aw",@progbits .p2align 3 # -- Begin function g_deriv .LCPI0_0: .quad 0x3ff0000000000000 # double 1 .text .globl g_deriv .p2align 1 .type ...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _g_deriv ; -- Begin function g_deriv .p2align 2 _g_deriv: ; @g_deriv .cfi_startproc ; %bb.0: sub sp, sp, #32 stp x29, x30, [sp, #16] ; 16-byte Folded Spill add x29...
topo-sort
// C Program to implement Topological Sorting #include "libmin.h" // Structure to represent a stack struct Stack { int data; struct Stack* next; }; struct Graph { int V; // No. of vertices // Pointer to an array containing adjacency lists struct List* adj; }; // Structure to repres...
.text .intel_syntax noprefix .file "topo-sort.c" .globl createStackNode # -- Begin function createStackNode .p2align 4, 0x90 .type createStackNode,@function createStackNode: # @createStackNode .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 ...
.text .file "topo-sort.c" .globl createStackNode // -- Begin function createStackNode .p2align 2 .type createStackNode,@function createStackNode: // @createStackNode .cfi_startproc // %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 stp x29, x30, [sp, #16] // 16-...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "topo-sort.c" .globl createStackNode # -- Begin function createStackNode .p2align 1 .type createStackNode,@function createStackNode: # @createStackNode .cfi_startproc # %bb....
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _createStackNode ; -- Begin function createStackNode .p2align 2 _createStackNode: ; @createStackNode .cfi_startproc ; %bb.0: sub sp, sp, #32 stp x29, x30, [sp, #16] ; 16-byte Folde...
totient
/* totient.c: Calculates the Euler totient function, phi. * * By Terry R. McConnell * * Theory * * Euler's totient function, phi(n), is defined as the number of natural * numbers <= n which are relatively prime to n. (We count 1 as relatively * prime to everything.) It is an ex...
.text .intel_syntax noprefix .file "totient.c" .globl main # -- Begin function main .p2align 4, 0x90 .type main,@function main: # @main .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_cfa_register...
.text .file "totient.c" .globl main // -- Begin function main .p2align 2 .type main,@function main: // @main .cfi_startproc // %bb.0: sub sp, sp, #48 .cfi_def_cfa_offset 48 stp x29, x30, [sp, #32] // 16-byte Folded Spill add x29, sp, #32...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "totient.c" .globl main # -- Begin function main .p2align 1 .type main,@function main: # @main .cfi_startproc # %bb.0: addi sp, sp, -64 .cfi_def_cfa_...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _main ; -- Begin function main .p2align 2 _main: ; @main .cfi_startproc ; %bb.0: sub sp, sp, #80 stp x29, x30, [sp, #64] ; 16-byte Folded Spill add x29, sp, ...
transcend
// bench_transcendentals.c // Bringup-Bench style transcendentals benchmark (no CLI, no timing). // 64-bit only; functions: {exp, sin, cos, mix(exp/sin/cos)}. // Work per experiment: N_ITER * N_ELEMS. // Compile-time knobs (override with -DNAME=value): #ifndef N_ITER #define N_ITER 10 // outer iteratio...
.text .intel_syntax noprefix .file "transcend.c" .globl main # -- Begin function main .p2align 4, 0x90 .type main,@function main: # @main .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_def_cfa_regist...
.text .file "transcend.c" .globl main // -- Begin function main .p2align 2 .type main,@function main: // @main .cfi_startproc // %bb.0: sub sp, sp, #32 .cfi_def_cfa_offset 32 stp x29, x30, [sp, #16] // 16-byte Folded Spill add x29, sp, #...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "transcend.c" .globl main # -- Begin function main .p2align 1 .type main,@function main: # @main .cfi_startproc # %bb.0: addi sp, sp, -32 .cfi_def_cf...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _main ; -- Begin function main .p2align 2 _main: ; @main .cfi_startproc ; %bb.0: sub sp, sp, #32 stp x29, x30, [sp, #16] ; 16-byte Folded Spill add x29, sp, ...
uniquify
#include "libmin.h" /* Comparison function for strings. * qsort passes pointers to elements (here pointers to char pointers), * so we cast accordingly. */ int string_compare(const void *a, const void *b) { const char * const *str1 = (const char * const *) a; const char * const *str2 = (const char * const *)...
.text .intel_syntax noprefix .file "uniquify.c" .globl string_compare # -- Begin function string_compare .p2align 4, 0x90 .type string_compare,@function string_compare: # @string_compare .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov ...
.text .file "uniquify.c" .globl string_compare // -- Begin function string_compare .p2align 2 .type string_compare,@function string_compare: // @string_compare .cfi_startproc // %bb.0: sub sp, sp, #48 .cfi_def_cfa_offset 48 stp x29, x30, [sp, #32] // 16-byte...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "uniquify.c" .globl string_compare # -- Begin function string_compare .p2align 1 .type string_compare,@function string_compare: # @string_compare .cfi_startproc # %bb.0: ...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _string_compare ; -- Begin function string_compare .p2align 2 _string_compare: ; @string_compare .cfi_startproc ; %bb.0: sub sp, sp, #48 stp x29, x30, [sp, #32] ; 16-byte Folded ...
vectors-3d
/** * @file * @brief Functions related to 3D vector operations. * @author Krishna Vedala */ #include "libmin.h" /** * @addtogroup quaternions Library for 3D Vectors & Quaternions * @{ * @file * @brief Generic header that provides data types for 3D vectors and quaternions * @author Krishna Vedala */ /** Min...
.text .intel_syntax noprefix .file "vectors-3d.c" .globl vector_sub # -- Begin function vector_sub .p2align 4, 0x90 .type vector_sub,@function vector_sub: # @vector_sub .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp ...
.text .file "vectors-3d.c" .globl vector_sub // -- Begin function vector_sub .p2align 2 .type vector_sub,@function vector_sub: // @vector_sub .cfi_startproc // %bb.0: sub sp, sp, #48 .cfi_def_cfa_offset 48 str x0, [sp, #16] str x1, [sp, #8] ldr x8, [sp, #16] ...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "vectors-3d.c" .globl vector_sub # -- Begin function vector_sub .p2align 1 .type vector_sub,@function vector_sub: # @vector_sub .cfi_startproc # %bb.0: addi sp, s...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _vector_sub ; -- Begin function vector_sub .p2align 2 _vector_sub: ; @vector_sub .cfi_startproc ; %bb.0: sub sp, sp, #48 .cfi_def_cfa_offset 48 str x0, [sp, #16] str x1, [sp, #8] ...
verlet
/* * verlet.c * * Minimal Verlet integration benchmark (2D harmonic oscillators). * - Deterministic init (fixed LCG seed) * - Tunable problem size via macros * - No malloc; static storage * - Optional timing via RISC-V rdcycle or portable fallbacks * - Produces a simple checksum to verify determinism * * You ...
.text .intel_syntax noprefix .file "verlet.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 # -- Begin function main .LCPI0_0: .quad 0x3f50624dd2f1a9fc # double 0.001 .LCPI0_1: .quad 0x4014000000000000 # double 5 .text .globl main .p2align 4, 0x90 ....
.text .file "verlet.c" .section .rodata.cst8,"aM",@progbits,8 .p2align 3, 0x0 // -- Begin function main .LCPI0_0: .xword 0x3f50624dd2f1a9fc // double 0.001 .text .globl main .p2align 2 .type main,@function main: // @main .cfi_startproc //...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "verlet.c" .section .sdata,"aw",@progbits .p2align 3 # -- Begin function main .LCPI0_0: .quad 4562254508917369340 # 0x3f50624dd2f1a9fc .text .globl main .p2align 1 .ty...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .section __TEXT,__literal8,8byte_literals .p2align 3, 0x0 ; -- Begin function main lCPI0_0: .quad 0x3f50624dd2f1a9fc ; double 0.001 .section __TEXT,__text,regular,pure_instructions .globl _main .p2...
weekday
#include "libmin.h" int dayOfWeek(int y, int m, int d) { int t[]={0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4}; y -= (m<3) ? 1 : 0; return (y + y/4 - y/100 + y/400 + t[m-1] + d) % 7; } int main(int argc, char** argv) { const char *days[7]={"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; ...
.text .intel_syntax noprefix .file "weekday.c" .globl dayOfWeek # -- Begin function dayOfWeek .p2align 4, 0x90 .type dayOfWeek,@function dayOfWeek: # @dayOfWeek .cfi_startproc # %bb.0: push rbp .cfi_def_cfa_offset 16 .cfi_offset rbp, -16 mov rbp, rsp .cfi_d...
.text .file "weekday.c" .globl dayOfWeek // -- Begin function dayOfWeek .p2align 2 .type dayOfWeek,@function dayOfWeek: // @dayOfWeek .cfi_startproc // %bb.0: sub sp, sp, #96 .cfi_def_cfa_offset 96 stp x29, x30, [sp, #80] // 16-byte Folded Spill a...
.text .attribute 4, 16 .attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0" .file "weekday.c" .globl dayOfWeek # -- Begin function dayOfWeek .p2align 1 .type dayOfWeek,@function dayOfWeek: # @dayOfWeek .cfi_startproc # %bb.0: addi sp, sp, -80...
.section __TEXT,__text,regular,pure_instructions .build_version macos, 15, 0 .globl _dayOfWeek ; -- Begin function dayOfWeek .p2align 2 _dayOfWeek: ; @dayOfWeek .cfi_startproc ; %bb.0: sub sp, sp, #96 stp x29, x30, [sp, #80] ; 16-byte Folded Spill add...