LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_faidx.c
// Function: test_faidx_iseq
int test_faidx_iseq(const char *fn, const char *fnfai, const char *fngzi,
                    enum fai_format_options format, const char *expected,
                    const char *index) {
    const char *found_name = NULL;
    int idx = atoi(index);
    faidx_t *fai = NULL;

    fai = load_index(fn, fnfai, fngzi, 0, format);
    if (!fai)
        return -1;

    found_name = faidx_iseq(fai, idx);

    if (expected) {
        if (!found_name || strcmp(found_name, expected) != 0) {
            fprintf(stderr, "Unexpected result %s from faidx_iseq(fai, %d), "
                    "expected %s\n", found_name ? found_name : "(null)",
                    idx, expected);
            fai_destroy(fai);
            return -1;
        }
    } else {
        printf("%s\n", found_name ? found_name : "(null)");
    }

    fai_destroy(fai);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
movq %r9, %rdi
callq 0x4800
movl %eax, %ebp
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
movl %ebx, %r8d
callq 0x6073
testq %rax, %rax
je 0x691c
movq %rax, %rbx
movq %rax, %rdi
movl %ebp, %esi
callq 0x8a37
movq %rax, %r15
testq %r14, %r14
je 0x6924
testq %r15, %r15
je 0x6954
movq %r15, %rdi
movq %r14, %rsi
callq 0x46d0
xorl %r12d, %r12d
testl %eax, %eax
je 0x693a
jmp 0x695b
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jmp 0x6942
testq %r15, %r15
leaq 0x8b9cf(%rip), %rdi     # 0x922fd
cmovneq %r15, %rdi
callq 0x47e0
xorl %r12d, %r12d
movq %rbx, %rdi
callq 0x6ef4
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8b9a2(%rip), %r15     # 0x922fd
movq 0xac676(%rip), %rax     # 0xb2fd8
movq (%rax), %rdi
leaq 0x8b955(%rip), %rsi     # 0x922c1
movq %r15, %rdx
movl %ebp, %ecx
movq %r14, %r8
xorl %eax, %eax
callq 0x4710
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jmp 0x693a
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_faidx.c
// Function: test_faidx_seq_len
int test_faidx_seq_len(const char *fn, const char *fnfai, const char *fngzi,
                       enum fai_format_options format, const char *expected,
                       const char *seq) {
    int found_len;
    faidx_t *fai = NULL;

    fai = load_index(fn, fnfai, fngzi, 0, format);
    if (!fai)
        return -1;

    found_len = faidx_seq_len(fai, seq);
    fai_destroy(fai);

    if (expected) {
        int exp_len = atoi(expected);
        if (found_len != exp_len) {
            fprintf(stderr, "Unexpected result %d from faidx_seq_len(fai, %s) "
                    "expected %s\n", found_len, seq, expected);
            return -1;
        }
    } else {
        printf("%d\n", found_len);
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r9, %r14
movq %r8, %rbx
movl %ecx, %r8d
xorl %ecx, %ecx
callq 0x6073
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x6a0d
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x8b5c
movl %eax, %ebp
movq %r12, %rdi
callq 0x6ef4
testq %rbx, %rbx
je 0x69fa
movq %rbx, %rdi
callq 0x4800
xorl %r15d, %r15d
cmpl %eax, %ebp
je 0x6a0d
movq 0xac5ff(%rip), %rax     # 0xb2fd8
movq (%rax), %rdi
leaq 0x8b921(%rip), %rsi     # 0x92304
movl %ebp, %edx
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x4710
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x6a0d
leaq 0x911cd(%rip), %rdi     # 0x97bce
xorl %r15d, %r15d
movl %ebp, %esi
xorl %eax, %eax
callq 0x4060
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_faidx.c
// Function: test_faidx_seq_len64
int test_faidx_seq_len64(const char *fn, const char *fnfai, const char *fngzi,
                         enum fai_format_options format, const char *expected,
                         const char *seq) {
    hts_pos_t found_len;
    faidx_t *fai = NULL;

    fai = load_index(fn, fnfai, fngzi, 0, format);
    if (!fai)
        return -1;

    found_len = faidx_seq_len(fai, seq);
    fai_destroy(fai);

    if (expected) {
        long long exp_len = strtoll(expected, NULL, 10);
        if (found_len != exp_len) {
            fprintf(stderr, "Unexpected result %"PRIhts_pos
                    " from fai_seq_len64(fai, %s) expected %s\n",
                    found_len, seq, expected);
            return -1;
        }
    } else {
        printf("%"PRIhts_pos"\n", found_len);
    }

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r9, %r14
movq %r8, %rbx
movl %ecx, %r8d
xorl %ecx, %ecx
callq 0x6073
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x6aaf
movq %rax, %r13
movq %rax, %rdi
movq %r14, %rsi
callq 0x8b5c
movslq %eax, %r15
movq %r13, %rdi
callq 0x6ef4
testq %rbx, %rbx
je 0x6a9b
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x40b0
cmpq %r15, %rax
je 0x6aaf
movq 0xac55f(%rip), %rax     # 0xb2fd8
movq (%rax), %rdi
leaq 0x8b8bf(%rip), %rsi     # 0x92342
movq %r15, %rdx
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x4710
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jmp 0x6aaf
leaq 0x8b74b(%rip), %rdi     # 0x921ed
xorl %r12d, %r12d
movq %r15, %rsi
xorl %eax, %eax
callq 0x4060
movl %r12d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/minoki[P]icfpc2006/run_directthreaded_tailcall.c
// Function: OP_CondMove
void OP_CondMove(PARAMS)
{
    uint32_t op = arr0->data[pc];
    uint32_t a = (op >> 6) & 7;
    uint32_t b = (op >> 3) & 7;
    uint32_t c = op & 7;
    if (reg[c] != 0) {
        reg[a] = reg[b];
    }
    ++pc;
    MUSTTAIL return program[pc](ARGS);
}

// Assembly:
movl 0x4(%rsi,%rdi,4), %eax
movl %eax, %edx
andl $0x7, %edx
leaq 0x2cf4(%rip), %rcx      # 0x40e0
cmpl $0x0, (%rcx,%rdx,4)
je 0x1405
movl %eax, %edx
shrl %edx
andl $0x1c, %edx
movl (%rdx,%rcx), %edx
shrl $0x4, %eax
andl $0x1c, %eax
movl %edx, (%rax,%rcx)
movq 0x2d0c(%rip), %rax      # 0x4118
movq 0x8(%rax,%rdi,8), %rax
incq %rdi
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O1/minoki[P]icfpc2006/run_directthreaded_tailcall.c
// Function: OP_ArrayIndex
void OP_ArrayIndex(PARAMS)
{
    uint32_t op = arr0->data[pc];
    uint32_t a = (op >> 6) & 7;
    uint32_t b = (op >> 3) & 7;
    uint32_t c = op & 7;
    uint32_t i = reg[b];
    assert(i < arrsize);
    struct array *ai = arr[i];
    assert(ai != NULL);
    assert(reg[c] < ai->length);
    reg[a] = ai->data[reg[c]];
    ++pc;
    MUSTTAIL return program[pc](ARGS);
}

// Assembly:
pushq %rax
movl 0x4(%rsi,%rdi,4), %eax
movl %eax, %edx
shrl %edx
andl $0x1c, %edx
leaq 0x2cb7(%rip), %rcx      # 0x40e0
movl (%rdx,%rcx), %edx
cmpq %rdx, 0x2c8d(%rip)      # 0x40c0
jbe 0x1475
movq 0x2ce4(%rip), %r8       # 0x4120
movq (%r8,%rdx,8), %rdx
testq %rdx, %rdx
je 0x1494
movl %eax, %r8d
andl $0x7, %r8d
movl (%rcx,%r8,4), %r8d
cmpl (%rdx), %r8d
jae 0x14b3
movl 0x4(%rdx,%r8,4), %edx
shrl $0x4, %eax
andl $0x1c, %eax
movl %edx, (%rax,%rcx)
movq 0x2cae(%rip), %rax      # 0x4118
movq 0x8(%rax,%rdi,8), %rax
incq %rdi
popq %rcx
jmpq *%rax
leaq 0xb88(%rip), %rdi       # 0x2004
leaq 0xb8d(%rip), %rsi       # 0x2010
leaq 0xba4(%rip), %rcx       # 0x202e
movl $0x3b, %edx
callq 0x1080
leaq 0xbbe(%rip), %rdi       # 0x2059
leaq 0xb6e(%rip), %rsi       # 0x2010
leaq 0xb85(%rip), %rcx       # 0x202e
movl $0x3d, %edx
callq 0x1080
leaq 0xbaa(%rip), %rdi       # 0x2064
leaq 0xb4f(%rip), %rsi       # 0x2010
leaq 0xb66(%rip), %rcx       # 0x202e
movl $0x3e, %edx
callq 0x1080
// File: /workspace/github_c_makefile_star2_O1/minoki[P]icfpc2006/run_directthreaded_tailcall.c
// Function: OP_ArrayAmendment
void OP_ArrayAmendment(PARAMS)
{
    uint32_t op = arr0->data[pc];
    uint32_t a = (op >> 6) & 7;
    uint32_t b = (op >> 3) & 7;
    uint32_t c = op & 7;
    uint32_t i = reg[a];
    assert(i < arrsize);
    struct array *ai = arr[i];
    assert(ai != NULL);
    assert(reg[b] < ai->length);
    ai->data[reg[b]] = reg[c];
    if (i == 0) {
        program[reg[b]] = operations[reg[c] >> 28];
    }
    ++pc;
    MUSTTAIL return program[pc](ARGS);
}

// Assembly:
pushq %rax
movl 0x4(%rsi,%rdi,4), %eax
movl %eax, %edx
shrl $0x4, %edx
andl $0x1c, %edx
leaq 0x2bfa(%rip), %rcx      # 0x40e0
movl (%rdx,%rcx), %edx
cmpq %rdx, 0x2bd0(%rip)      # 0x40c0
jbe 0x155d
movq 0x2c27(%rip), %r8       # 0x4120
movq (%r8,%rdx,8), %r9
testq %r9, %r9
je 0x157c
movl %eax, %r8d
shrl $0x3, %r8d
andl $0x7, %r8d
movl (%rcx,%r8,4), %r10d
cmpl (%r9), %r10d
jae 0x159b
andl $0x7, %eax
movl (%rcx,%rax,4), %r11d
movl %r11d, 0x4(%r9,%r10,4)
testq %rdx, %rdx
jne 0x154b
movl (%rcx,%rax,4), %eax
shrl $0x1c, %eax
leaq 0x2828(%rip), %rdx      # 0x3d60
movq (%rdx,%rax,8), %rax
movq 0x2bd5(%rip), %rdx      # 0x4118
movl (%rcx,%r8,4), %ecx
movq %rax, (%rdx,%rcx,8)
movq 0x2bc6(%rip), %rax      # 0x4118
movq 0x8(%rax,%rdi,8), %rax
incq %rdi
popq %rcx
jmpq *%rax
leaq 0xaa0(%rip), %rdi       # 0x2004
leaq 0xaa5(%rip), %rsi       # 0x2010
leaq 0xb06(%rip), %rcx       # 0x2078
movl $0x4a, %edx
callq 0x1080
leaq 0xad6(%rip), %rdi       # 0x2059
leaq 0xa86(%rip), %rsi       # 0x2010
leaq 0xae7(%rip), %rcx       # 0x2078
movl $0x4c, %edx
callq 0x1080
leaq 0xb05(%rip), %rdi       # 0x20a7
leaq 0xa67(%rip), %rsi       # 0x2010
leaq 0xac8(%rip), %rcx       # 0x2078
movl $0x4d, %edx
callq 0x1080
// File: /workspace/github_c_makefile_star2_O1/minoki[P]icfpc2006/run_directthreaded_tailcall.c
// Function: OP_Add
void OP_Add(PARAMS)
{
    uint32_t op = arr0->data[pc];
    uint32_t a = (op >> 6) & 7;
    uint32_t b = (op >> 3) & 7;
    uint32_t c = op & 7;
    reg[a] = reg[b] + reg[c];
    ++pc;
    MUSTTAIL return program[pc](ARGS);
}

// Assembly:
movl 0x4(%rsi,%rdi,4), %eax
movl %eax, %ecx
andl $0x7, %ecx
movl %eax, %edx
shrl %edx
andl $0x1c, %edx
leaq 0x2b0f(%rip), %r8       # 0x40e0
movl (%r8,%rcx,4), %ecx
addl (%rdx,%r8), %ecx
shrl $0x4, %eax
andl $0x1c, %eax
movl %ecx, (%rax,%r8)
movq 0x2b2e(%rip), %rax      # 0x4118
movq 0x8(%rax,%rdi,8), %rax
incq %rdi
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O1/minoki[P]icfpc2006/run_directthreaded_tailcall.c
// Function: OP_Div
void OP_Div(PARAMS)
{
    uint32_t op = arr0->data[pc];
    uint32_t a = (op >> 6) & 7;
    uint32_t b = (op >> 3) & 7;
    uint32_t c = op & 7;
    assert(reg[c] != 0);
    reg[a] = reg[b] / reg[c];
    ++pc;
    MUSTTAIL return program[pc](ARGS);
}

// Assembly:
movl 0x4(%rsi,%rdi,4), %ecx
movl %ecx, %eax
andl $0x7, %eax
leaq 0x2aa1(%rip), %r8       # 0x40e0
movl (%r8,%rax,4), %r9d
testl %r9d, %r9d
je 0x1673
movl %ecx, %eax
shrl %eax
andl $0x1c, %eax
movl (%rax,%r8), %eax
xorl %edx, %edx
divl %r9d
shrl $0x4, %ecx
andl $0x1c, %ecx
movl %eax, (%rcx,%r8)
movq 0x2aaf(%rip), %rax      # 0x4118
movq 0x8(%rax,%rdi,8), %rax
incq %rdi
jmpq *%rax
pushq %rax
leaq 0xa40(%rip), %rdi       # 0x20bb
leaq 0x98e(%rip), %rsi       # 0x2010
leaq 0xa3e(%rip), %rcx       # 0x20c7
movl $0x6f, %edx
callq 0x1080
// File: /workspace/github_c_makefile_star2_O1/minoki[P]icfpc2006/run_directthreaded_tailcall.c
// Function: OP_Alloc
void OP_Alloc(PARAMS)
{
    uint32_t op = arr0->data[pc];
    uint32_t b = (op >> 3) & 7;
    uint32_t c = op & 7;
    uint32_t capacity = reg[c];
    uint32_t i = 0;
    if (freelist_end == freelist) {
        i = arrsize;
        ++arrsize;
        arr = realloc(arr, sizeof(struct array *) * arrsize);
        assert(arr != NULL);
    } else {
        i = *(--freelist_end);
        *freelist_end = 0;
    }
    struct array *newarr = calloc(1 + capacity, sizeof(uint32_t));
    assert(newarr != NULL);
    newarr->length = capacity;
    arr[i] = newarr;
    reg[b] = i;
    ++pc;
    MUSTTAIL return program[pc](ARGS);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4(%rsi,%rdi,4), %r15d
movl %r15d, %eax
andl $0x7, %eax
leaq 0x29b7(%rip), %r12      # 0x40e0
movl (%r12,%rax,4), %ebp
movq 0x29d4(%rip), %rax      # 0x4108
cmpq 0x29c5(%rip), %rax      # 0x4100
je 0x1755
leaq -0x4(%rax), %rcx
movq %rcx, 0x29c0(%rip)      # 0x4108
movl -0x4(%rax), %r13d
movl $0x0, -0x4(%rax)
jmp 0x1787
movq 0x2964(%rip), %r13      # 0x40c0
leaq 0x1(%r13), %rax
movq %rax, 0x2959(%rip)      # 0x40c0
movq 0x29b2(%rip), %rdi      # 0x4120
leaq 0x8(,%r13,8), %rsi
callq 0x1120
movq %rax, 0x299e(%rip)      # 0x4120
testq %rax, %rax
je 0x17f8
leal 0x1(%rbp), %edi
movl $0x4, %esi
callq 0x10a0
testq %rax, %rax
je 0x17d9
movl %ebp, (%rax)
movq 0x297e(%rip), %rcx      # 0x4120
movl %r13d, %edx
movq %rax, (%rcx,%rdx,8)
shrl %r15d
andl $0x1c, %r15d
movl %r13d, (%r15,%r12)
movq 0x295d(%rip), %rax      # 0x4118
movq 0x8(%rax,%r14,8), %rax
incq %r14
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
leaq 0x937(%rip), %rdi       # 0x2117
leaq 0x829(%rip), %rsi       # 0x2010
leaq 0x903(%rip), %rcx       # 0x20f1
movl $0x97, %edx
callq 0x1080
leaq 0x91b(%rip), %rdi       # 0x211a
leaq 0x80a(%rip), %rsi       # 0x2010
leaq 0x8e4(%rip), %rcx       # 0x20f1
movl $0x91, %edx
callq 0x1080
// File: /workspace/github_c_makefile_star2_O1/minoki[P]icfpc2006/run_directthreaded_tailcall.c
// Function: OP_Abandon
void OP_Abandon(PARAMS)
{
    uint32_t op = arr0->data[pc];
    uint32_t c = op & 7;
    uint32_t i = reg[c];
    assert(i < arrsize);
    assert(i != 0);
    assert(arr[i] != NULL);
    free(arr[i]);
    arr[i] = NULL;
    if (freelist_end - freelist == freelist_capacity) {
        uint32_t freelist_new_capacity = freelist_capacity == 0 ? 32 : freelist_capacity * 2;
        freelist = realloc(freelist, freelist_new_capacity * sizeof(uint32_t));
        memset(freelist + freelist_capacity, 0, (freelist_new_capacity - freelist_capacity) * sizeof(uint32_t));
        freelist_end = freelist + freelist_capacity;
        freelist_capacity = freelist_new_capacity;
    }
    *freelist_end++ = i;
    ++pc;
    MUSTTAIL return program[pc](ARGS);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl 0x4(%rsi,%rdi,4), %eax
andl $0x7, %eax
leaq 0x28b2(%rip), %rcx      # 0x40e0
movl (%rcx,%rax,4), %r12d
cmpq %r12, 0x2887(%rip)      # 0x40c0
jbe 0x1919
testl %r12d, %r12d
je 0x1938
movq %rdi, %r14
movq 0x28ce(%rip), %rax      # 0x4120
movq (%rax,%r12,8), %rdi
testq %rdi, %rdi
je 0x1957
movq %rsi, %rbx
callq 0x1030
movq 0x28b2(%rip), %rax      # 0x4120
movq $0x0, (%rax,%r12,8)
movq 0x288b(%rip), %rcx      # 0x4108
movq 0x287c(%rip), %rdi      # 0x4100
subq %rdi, %rcx
sarq $0x2, %rcx
movl 0x287f(%rip), %eax      # 0x4110
cmpq %rax, %rcx
jne 0x18e4
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x20, %r13d
cmovnel %ecx, %r13d
leaq (,%r13,4), %rsi
callq 0x1120
movq %rax, 0x2847(%rip)      # 0x4100
movl 0x2851(%rip), %ecx      # 0x4110
leaq (%rax,%rcx,4), %r15
movl %r13d, %edx
subl %ecx, %edx
shlq $0x2, %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x1090
movq %r15, 0x282b(%rip)      # 0x4108
movl %r13d, 0x282c(%rip)     # 0x4110
movq 0x281d(%rip), %rax      # 0x4108
leaq 0x4(%rax), %rcx
movq %rcx, 0x2812(%rip)      # 0x4108
movl %r12d, (%rax)
movq 0x2818(%rip), %rax      # 0x4118
movq 0x8(%rax,%r14,8), %rax
incq %r14
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmpq *%rax
leaq 0x6e4(%rip), %rdi       # 0x2004
leaq 0x6e9(%rip), %rsi       # 0x2010
leaq 0x7f8(%rip), %rcx       # 0x2126
movl $0xa3, %edx
callq 0x1080
leaq 0x80f(%rip), %rdi       # 0x214e
leaq 0x6ca(%rip), %rsi       # 0x2010
leaq 0x7d9(%rip), %rcx       # 0x2126
movl $0xa4, %edx
callq 0x1080
leaq 0x7f7(%rip), %rdi       # 0x2155
leaq 0x6ab(%rip), %rsi       # 0x2010
leaq 0x7ba(%rip), %rcx       # 0x2126
movl $0xa5, %edx
callq 0x1080
// File: /workspace/github_c_makefile_star2_O1/minoki[P]icfpc2006/run_directthreaded_tailcall.c
// Function: OP_Output
void OP_Output(PARAMS)
{
    uint32_t op = arr0->data[pc];
    uint32_t c = op & 7;
    assert(reg[c] <= 255);
    putchar(reg[c]);
    ++pc;
    MUSTTAIL return program[pc](ARGS);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl 0x4(%rsi,%rdi,4), %eax
andl $0x7, %eax
leaq 0x2755(%rip), %rcx      # 0x40e0
movl (%rcx,%rax,4), %edi
cmpl $0x100, %edi            # imm = 0x100
jae 0x19bc
movq %rsi, %rbx
callq 0x1040
movq 0x2773(%rip), %rax      # 0x4118
movq 0x8(%rax,%r14,8), %rax
incq %r14
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
leaq 0x7a1(%rip), %rdi       # 0x2164
leaq 0x646(%rip), %rsi       # 0x2010
leaq 0x7a1(%rip), %rcx       # 0x2172
movl $0xb7, %edx
callq 0x1080
// File: /workspace/github_c_makefile_star2_O1/minoki[P]icfpc2006/run_directthreaded_tailcall.c
// Function: OP_Input
void OP_Input(PARAMS)
{
    uint32_t op = arr0->data[pc];
    uint32_t c = op & 7;
    fflush(stdout);
    int ch = getchar();
    if (ch == EOF) {
        reg[c] = (uint32_t)(-1);
    } else {
        assert(0 <= ch && ch <= 255);
        reg[c] = (uint32_t)ch;
    }
    ++pc;
    MUSTTAIL return program[pc](ARGS);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4(%rsi,%rdi,4), %r15d
movq 0x25de(%rip), %rax      # 0x3fd0
movq (%rax), %rdi
callq 0x1100
callq 0x10b0
cmpl $-0x1, %eax
je 0x1a2a
cmpl $0x100, %eax            # imm = 0x100
jb 0x1a2f
leaq 0x787(%rip), %rdi       # 0x2199
leaq 0x5f7(%rip), %rsi       # 0x2010
leaq 0x78e(%rip), %rcx       # 0x21ae
movl $0xc5, %edx
callq 0x1080
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
andl $0x7, %r15d
leaq 0x26a6(%rip), %rcx      # 0x40e0
movl %eax, (%rcx,%r15,4)
movq 0x26d3(%rip), %rax      # 0x4118
movq 0x8(%rax,%r14,8), %rax
incq %r14
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O1/minoki[P]icfpc2006/run_directthreaded_tailcall.c
// Function: OP_LoadProgram
void OP_LoadProgram(PARAMS)
{
    uint32_t op = arr0->data[pc];
    uint32_t b = (op >> 3) & 7;
    uint32_t c = op & 7;
    uint32_t i = reg[b];
    if (UNLIKELY(i != 0)) {
        assert(i < arrsize);
        assert(arr[i] != NULL);
        uint32_t length = arr[i]->length;
        struct array *newprogram = malloc((length + 1) * sizeof(uint32_t));
        assert(newprogram != NULL);
        memcpy(newprogram, arr[i], (length + 1) * sizeof(uint32_t));
        free(arr[0]);
        arr[0] = newprogram;
        arr0 = newprogram;
        recalc();
    }
    pc = reg[c];
    assert(pc < arr[0]->length);
    MUSTTAIL return program[pc](ARGS);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl 0x4(%rsi,%rdi,4), %eax
movl %eax, %r14d
andl $0x7, %r14d
shrl %eax
andl $0x1c, %eax
leaq 0x2666(%rip), %r15      # 0x40e0
movl (%rax,%r15), %edi
testl %edi, %edi
jne 0x1aaa
movl (%r15,%r14,4), %edi
movq 0x2693(%rip), %rax      # 0x4120
movq (%rax), %rax
cmpl (%rax), %edi
jae 0x1abc
movq 0x267d(%rip), %rax      # 0x4118
movq (%rax,%rdi,8), %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmpq *%rax
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x1170
movq (%rbx), %rsi
jmp 0x1a82
leaq 0x750(%rip), %rdi       # 0x2213
leaq 0x546(%rip), %rsi       # 0x2010
leaq 0x703(%rip), %rcx       # 0x21d4
movl $0xde, %edx
callq 0x1080
// File: /workspace/github_c_makefile_star2_O1/minoki[P]icfpc2006/run_directthreaded_tailcall.c
// Function: recalc
void recalc(void)
{
    struct array *a0 = arr[0];
    uint32_t length = a0->length;
    if (program) {
        free(program);
    }
    program = malloc(sizeof(OP) * length);
    assert(program != NULL);
    for (uint32_t i = 0; i < length; ++i) {
        uint32_t op = a0->data[i];
        program[i] = operations[op >> 28];
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x263a(%rip), %rax      # 0x4120
movq (%rax), %rbx
movl (%rbx), %r14d
movq 0x2625(%rip), %rdi      # 0x4118
testq %rdi, %rdi
je 0x1afd
callq 0x1030
leaq (,%r14,8), %rdi
callq 0x10f0
movq %rax, 0x2607(%rip)      # 0x4118
testq %rax, %rax
je 0x1b4a
testq %r14, %r14
je 0x1b42
xorl %eax, %eax
leaq 0x223c(%rip), %rcx      # 0x3d60
movl 0x4(%rbx,%rax,4), %edx
shrl $0x1c, %edx
movq (%rcx,%rdx,8), %rdx
movq 0x25e2(%rip), %rsi      # 0x4118
movq %rdx, (%rsi,%rax,8)
incq %rax
cmpq %rax, %r14
jne 0x1b24
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x757(%rip), %rdi       # 0x22a8
leaq 0x4b8(%rip), %rsi       # 0x2010
leaq 0x6e3(%rip), %rcx       # 0x2242
movl $0x10b, %edx            # imm = 0x10B
callq 0x1080
// File: /workspace/github_c_makefile_star2_O1/minoki[P]icfpc2006/run_directthreaded_tailcall.c
// Function: OP_Orthography
void OP_Orthography(PARAMS)
{
    uint32_t op = arr0->data[pc];
    uint32_t a = (op >> 25) & 7;
    uint32_t value = op & ((UINT32_C(1) << 25) - 1);
    reg[a] = value;
    ++pc;
    MUSTTAIL return program[pc](ARGS);
}

// Assembly:
movl 0x4(%rsi,%rdi,4), %eax
movl %eax, %ecx
andl $0x1ffffff, %ecx        # imm = 0x1FFFFFF
shrl $0x17, %eax
andl $0x1c, %eax
leaq 0x255e(%rip), %rdx      # 0x40e0
movl %ecx, (%rax,%rdx)
movq 0x258c(%rip), %rax      # 0x4118
movq 0x8(%rax,%rdi,8), %rax
incq %rdi
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O1/aligusnet[P]morpheus/tests/activation_test.c
// Function: test_sigmoid
void test_sigmoid() {
  double x[] = {10e10, 0, -10e10};
  double y[3];
  double expected[] = {1, 0.5, 0};
  int n = sizeof(x)/sizeof(x[0]);
  morpheus_sigmoid(n, x, y);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, y, n);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x58, %rsp
movaps 0x5c86(%rip), %xmm0     # 0x70b0
leaq 0x40(%rsp), %rsi
movaps %xmm0, (%rsi)
movabsq $-0x3dc8b78918000000, %rax # imm = 0xC2374876E8000000
movq %rax, 0x10(%rsi)
movaps 0x5bc9(%rip), %xmm0     # 0x7010
movq %rsp, %rbx
movaps %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
leaq 0x20(%rsp), %r14
movl $0x3, %edi
movq %r14, %rdx
callq 0x3d1c
movl $0xb, %r8d
movq %rbx, %rdi
movq %r14, %rsi
movl $0x3, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
addq $0x58, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/aligusnet[P]morpheus/tests/activation_test.c
// Function: test_sigmoid_gradient
void test_sigmoid_gradient() {
  double x[] = {10e10, 0, -10e10};
  double y[3];
  double expected[] = {0, 0.25, 0};
  int n = sizeof(x)/sizeof(x[0]);
  morpheus_sigmoid_gradient(n, x, y);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, y, n);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x58, %rsp
movaps 0x5c15(%rip), %xmm0     # 0x70b0
leaq 0x40(%rsp), %rsi
movaps %xmm0, (%rsi)
movabsq $-0x3dc8b78918000000, %rax # imm = 0xC2374876E8000000
movq %rax, 0x10(%rsi)
movaps 0x5b78(%rip), %xmm0     # 0x7030
movq %rsp, %rbx
movaps %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
leaq 0x20(%rsp), %r14
movl $0x3, %edi
movq %r14, %rdx
callq 0x3d71
movl $0x14, %r8d
movq %rbx, %rdi
movq %r14, %rsi
movl $0x3, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
addq $0x58, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/aligusnet[P]morpheus/tests/activation_test.c
// Function: test_relu
void test_relu() {
  double x[] = {10e10, 0, -10e10};
  double y[3];
  double expected[] = {10e10, 0, 0};
  int n = sizeof(x)/sizeof(x[0]);
  morpheus_relu(n, x, y);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, y, n);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x58, %rsp
movaps 0x5ba4(%rip), %xmm0     # 0x70b0
leaq 0x40(%rsp), %rsi
movaps %xmm0, (%rsi)
movabsq $-0x3dc8b78918000000, %rax # imm = 0xC2374876E8000000
movq %rax, 0x10(%rsi)
movaps 0x5b27(%rip), %xmm0     # 0x7050
movq %rsp, %rbx
movaps %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
leaq 0x20(%rsp), %r14
movl $0x3, %edi
movq %r14, %rdx
callq 0x3dd6
movl $0x1d, %r8d
movq %rbx, %rdi
movq %r14, %rsi
movl $0x3, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
addq $0x58, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/aligusnet[P]morpheus/tests/activation_test.c
// Function: test_relu_gradient
void test_relu_gradient() {
  double x[] = {10e10, 0, -10e10};
  double y[3];
  double expected[] = {1, 0, 0};
  int n = sizeof(x)/sizeof(x[0]);
  morpheus_relu_gradient(n, x, y);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, y, n);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x58, %rsp
movaps 0x5b33(%rip), %xmm0     # 0x70b0
leaq 0x40(%rsp), %rsi
movaps %xmm0, (%rsi)
movabsq $-0x3dc8b78918000000, %rax # imm = 0xC2374876E8000000
movq %rax, 0x10(%rsi)
movaps 0x5ad6(%rip), %xmm0     # 0x7070
movq %rsp, %rbx
movaps %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
leaq 0x20(%rsp), %r14
movl $0x3, %edi
movq %r14, %rdx
callq 0x3df9
movl $0x26, %r8d
movq %rbx, %rdi
movq %r14, %rsi
movl $0x3, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
addq $0x58, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/aligusnet[P]morpheus/tests/activation_test.c
// Function: test_tanh
void test_tanh() {
  double x[] = {10e10, 0, -10e10};
  double y[3];
  double expected[] = {1, 0, -1};
  int n = sizeof(x)/sizeof(x[0]);
  morpheus_tanh(n, x, y);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, y, n);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x58, %rsp
movaps 0x5ac2(%rip), %xmm0     # 0x70b0
leaq 0x40(%rsp), %rsi
movaps %xmm0, (%rsi)
movabsq $-0x3dc8b78918000000, %rax # imm = 0xC2374876E8000000
movq %rax, 0x10(%rsi)
movaps 0x5a85(%rip), %xmm0     # 0x7090
movq %rsp, %rbx
movaps %xmm0, (%rbx)
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, 0x10(%rbx)
leaq 0x20(%rsp), %r14
movl $0x3, %edi
movq %r14, %rdx
callq 0x3e25
movl $0x2f, %r8d
movq %rbx, %rdi
movq %r14, %rsi
movl $0x3, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
addq $0x58, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/aligusnet[P]morpheus/tests/activation_test.c
// Function: test_tanh_gradient
void test_tanh_gradient() {
  double x[] = {10e10, 0, -10e10};
  double y[3];
  double expected[] = {0, 1, 0};
  int n = sizeof(x)/sizeof(x[0]);
  morpheus_tanh_gradient(n, x, y);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, y, n);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x58, %rsp
movaps 0x5a4b(%rip), %xmm0     # 0x70b0
leaq 0x40(%rsp), %rsi
movaps %xmm0, (%rsi)
movabsq $-0x3dc8b78918000000, %rax # imm = 0xC2374876E8000000
movq %rax, 0x10(%rsi)
movaps 0x5a4e(%rip), %xmm0     # 0x70d0
movq %rsp, %rbx
movaps %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
leaq 0x20(%rsp), %r14
movl $0x3, %edi
movq %r14, %rdx
callq 0x3e62
movl $0x38, %r8d
movq %rbx, %rdi
movq %r14, %rsi
movl $0x3, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
addq $0x58, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/aligusnet[P]morpheus/tests/gradient_descent_test.c
// Function: test_gradient_descent
void test_gradient_descent() {
  double X[] = {
    1, 3,
    1, 5,
    1, 10,
    1, 0,
    1, 4
  };
  double y[] = {9, 13, 23, 3, 11};

  double theta[] = {1, 1};
  double tmp_buffer[2*5];

  morpheus_params_t data;
  data.data.x = X;
  data.data.y = y;
  data.data.num_features = 2;
  data.data.num_examples = 5;
  data.data.layout = morpheus_row_major;
  data.memory_buffer = tmp_buffer;
  data.reg.type = morpheus_reg_none;

  double tmp_buffer2[2*5];
  morpheus_gradient_descent_params_t params;
  params.f = (morpheus_f)morpheus_ls_cost;
  params.df = (morpheus_df)morpheus_ls_gradient;
  params.max_iters = 4000;
  params.epsilon = 1e-10;
  params.alpha = 1e-2;
  params.memory_buffer = tmp_buffer2;
  params.num_variables = data.data.num_features;

  double theta_expected[] = {3, 2};
  morpheus_gradient_descent(&params, theta, &data);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(theta_expected, theta, data.data.num_features);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
leaq 0x5a65(%rip), %rsi      # 0x7140
leaq 0x160(%rsp), %rax
movl $0xa, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
movaps 0x59fb(%rip), %xmm0     # 0x70f0
leaq 0x20(%rsp), %rcx
movaps %xmm0, (%rcx)
movaps 0x59fc(%rip), %xmm0     # 0x7100
movaps %xmm0, 0x10(%rcx)
movabsq $0x4026000000000000, %rdx # imm = 0x4026000000000000
movq %rdx, 0x20(%rcx)
movaps 0x5a03(%rip), %xmm0     # 0x7120
leaq 0x10(%rsp), %rbx
movaps %xmm0, (%rbx)
leaq 0x88(%rsp), %r14
movq %rax, (%r14)
movq %rcx, 0x8(%r14)
movabsq $0x500000002, %rax      # imm = 0x500000002
movq %rax, 0x10(%r14)
movl $0x15, 0x18(%r14)
leaq 0x110(%rsp), %rax
movq %rax, 0x30(%r14)
movl $0x0, 0x20(%r14)
leaq 0x2a86(%rip), %rax      # 0x41eb
leaq 0x50(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x2a87(%rip), %rax      # 0x41fb
movq %rax, 0x8(%rdi)
movl $0xfa0, 0x10(%rdi)      # imm = 0xFA0
movaps 0x598a(%rip), %xmm0     # 0x7110
movups %xmm0, 0x18(%rdi)
leaq 0xc0(%rsp), %rax
movq %rax, 0x30(%rdi)
movl $0x2, 0x28(%rdi)
movaps 0x598c(%rip), %xmm0     # 0x7130
movq %rsp, %r15
movaps %xmm0, (%r15)
movq %rbx, %rsi
movq %r14, %rdx
callq 0x3fa0
movl 0x10(%r14), %edx
movl $0x28, %r8d
movq %r15, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/aligusnet[P]morpheus/tests/matrix_reduce_test.c
// Function: test_column_pred
void test_column_pred() {
  double x[] = {
    71, 11, 3,  9, 7,
    21, 7,  2,  23, 11,
    11, 32, 53, 49, 37,
    1,  24, 78, 90, 17
  };

  double y[5];

  double expected_row_major[] = {1, 7, 2, 9, 7};
  morpheus_column_predicate(fmin, morpheus_row_major, 4, 5, x, y);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected_row_major, y, 5);

  double expected_col_major[] = {3, 2, 11, 1};
  morpheus_column_predicate(fmin, morpheus_col_major, 5, 4, x, y);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected_col_major, y, 4);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
leaq 0x5817(%rip), %rsi      # 0x75e0
leaq 0x80(%rsp), %rbx
movl $0xa0, %edx
movq %rbx, %rdi
callq 0x1150
movaps 0x573b(%rip), %xmm0     # 0x7520
leaq 0x20(%rsp), %r12
movaps %xmm0, (%r12)
movaps 0x573a(%rip), %xmm0     # 0x7530
movaps %xmm0, 0x10(%r12)
movabsq $0x401c000000000000, %rax # imm = 0x401C000000000000
movq %rax, 0x20(%r12)
movq 0xa1b6(%rip), %r15      # 0xbfc8
leaq 0x50(%rsp), %r14
movq %r15, %rdi
movl $0x15, %esi
movl $0x4, %edx
movl $0x5, %ecx
movq %rbx, %r8
movq %r14, %r9
callq 0x4210
movl $0x13, %r8d
movq %r12, %rdi
movq %r14, %rsi
movl $0x5, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
movaps 0x5857(%rip), %xmm0     # 0x76b0
movq %rsp, %r12
movaps %xmm0, 0x10(%r12)
movaps 0x5837(%rip), %xmm0     # 0x76a0
movaps %xmm0, (%r12)
movq %r15, %rdi
movl $0x16, %esi
movl $0x5, %edx
movl $0x4, %ecx
movq %rbx, %r8
movq %r14, %r9
callq 0x4210
movl $0x17, %r8d
movq %r12, %rdi
movq %r14, %rsi
movl $0x4, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/aligusnet[P]morpheus/tests/matrix_reduce_test.c
// Function: test_row_pred
void test_row_pred() {
  double x[] = {
    71, 11, 3,  9, 7,
    21, 7,  2,  23, 11,
    11, 32, 53, 49, 37,
    1,  24, 78, 90, 17
  };

  double y[5];

  double expected_row_major[] = {71, 23, 53, 90};
  morpheus_row_predicate(fmax, morpheus_row_major, 4, 5, x, y);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected_row_major, y, 4);

  double expected_col_major[] = {71, 32, 78, 90, 37};
  morpheus_row_predicate(fmax, morpheus_col_major, 5, 4, x, y);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected_col_major, y, 5);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
leaq 0x5713(%rip), %rsi      # 0x75e0
leaq 0x80(%rsp), %rbx
movl $0xa0, %edx
movq %rbx, %rdi
callq 0x1150
movaps 0x57a7(%rip), %xmm0     # 0x7690
movq %rsp, %r12
movaps %xmm0, 0x10(%r12)
movaps 0x5787(%rip), %xmm0     # 0x7680
movaps %xmm0, (%r12)
movq 0xa0e3(%rip), %r15      # 0xbfe8
leaq 0x50(%rsp), %r14
movq %r15, %rdi
movl $0x15, %esi
movl $0x4, %edx
movl $0x5, %ecx
movq %rbx, %r8
movq %r14, %r9
callq 0x4352
movl $0x26, %r8d
movq %r12, %rdi
movq %r14, %rsi
movl $0x4, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
movaps 0x55f4(%rip), %xmm0     # 0x7540
leaq 0x20(%rsp), %r12
movaps %xmm0, (%r12)
movaps 0x55f3(%rip), %xmm0     # 0x7550
movaps %xmm0, 0x10(%r12)
movabsq $0x4042800000000000, %rax # imm = 0x4042800000000000
movq %rax, 0x20(%r12)
movq %r15, %rdi
movl $0x16, %esi
movl $0x5, %edx
movl $0x4, %ecx
movq %rbx, %r8
movq %r14, %r9
callq 0x4352
movl $0x2a, %r8d
movq %r12, %rdi
movq %r14, %rsi
movl $0x5, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/aligusnet[P]morpheus/tests/matrix_reduce_test.c
// Function: test_column_max_index
void test_column_max_index() {
  double x[] = {
    71, 11, 3,  9, 7,
    21, 7,  2,  23, 11,
    11, 32, 53, 49, 37,
    1,  24, 78, 90, 17
  };

  double y[5];
  int is[5];

  double expected_y_row_major[] = {71, 32, 78, 90, 37};
  int expected_is_row_major[] = {0, 2, 3, 3, 2};
  morpheus_column_max_index(morpheus_row_major, 4, 5, x, y, is);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected_y_row_major, y, 5);
  TEST_ASSERT_EQUAL_INT_ARRAY(expected_is_row_major, is, 5);

  double expected_y_col_major[] = {71, 23, 53, 90};
  int expected_is_col_major[] = {0, 3, 2, 3};
  morpheus_column_max_index(morpheus_col_major, 5, 4, x, y, is);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected_y_col_major, y, 4);
  TEST_ASSERT_EQUAL_INT_ARRAY(expected_is_col_major, is, 4);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
leaq 0x560c(%rip), %rsi      # 0x75e0
leaq 0xe0(%rsp), %r14
movl $0xa0, %edx
movq %r14, %rdi
callq 0x1150
movaps 0x5550(%rip), %xmm0     # 0x7540
leaq 0x80(%rsp), %r13
movaps %xmm0, (%r13)
movaps 0x554c(%rip), %xmm0     # 0x7550
movaps %xmm0, 0x10(%r13)
movabsq $0x4042800000000000, %rax # imm = 0x4042800000000000
movq %rax, 0x20(%r13)
movaps 0x5582(%rip), %xmm0     # 0x75a0
leaq 0x20(%rsp), %r12
movaps %xmm0, (%r12)
movl $0x2, 0x10(%r12)
leaq 0xb0(%rsp), %r15
leaq 0x40(%rsp), %rbx
movl $0x15, %edi
movl $0x4, %esi
movl $0x5, %edx
movq %r14, %rcx
movq %r15, %r8
movq %rbx, %r9
callq 0x448f
movl $0x1, %ebp
movl $0x3b, %r8d
movq %r13, %rdi
movq %r15, %rsi
movl $0x5, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
movl %ebp, (%rsp)
movl $0x3c, %r8d
movq %r12, %rdi
movq %rbx, %rsi
movl $0x5, %edx
xorl %ecx, %ecx
movl $0x14, %r9d
callq 0x5ab7
movaps 0x55ea(%rip), %xmm0     # 0x7690
leaq 0x60(%rsp), %r13
movaps %xmm0, 0x10(%r13)
movaps 0x55c9(%rip), %xmm0     # 0x7680
movaps %xmm0, (%r13)
movaps 0x54bd(%rip), %xmm0     # 0x7580
leaq 0x10(%rsp), %r12
movaps %xmm0, (%r12)
movl $0x16, %edi
movl $0x5, %esi
movl $0x4, %edx
movq %r14, %rcx
movq %r15, %r8
movq %rbx, %r9
callq 0x448f
movl $0x41, %r8d
movq %r13, %rdi
movq %r15, %rsi
movl $0x4, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
movl %ebp, (%rsp)
movl $0x42, %r8d
movq %r12, %rdi
movq %rbx, %rsi
movl $0x4, %edx
xorl %ecx, %ecx
movl $0x14, %r9d
callq 0x5ab7
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aligusnet[P]morpheus/tests/matrix_reduce_test.c
// Function: test_column_min_index
void test_column_min_index() {
  double x[] = {
    71, 11, 3,  9, 7,
    21, 7,  2,  23, 11,
    11, 32, 53, 49, 37,
    1,  24, 78, 90, 17
  };

  double y[5];
  int is[5];

  double expected_y_row_major[] = {1, 7, 2, 9, 7};
  int expected_is_row_major[] = {3, 1, 1, 0, 0};
  morpheus_column_min_index(morpheus_row_major, 4, 5, x, y, is);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected_y_row_major, y, 5);
  TEST_ASSERT_EQUAL_INT_ARRAY(expected_is_row_major, is, 5);

  double expected_y_col_major[] = {3, 2, 11, 1};
  int expected_is_col_major[] = {2, 2, 0, 0};
  morpheus_column_min_index(morpheus_col_major, 5, 4, x, y, is);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected_y_col_major, y, 4);
  TEST_ASSERT_EQUAL_INT_ARRAY(expected_is_col_major, is, 4);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
leaq 0x548d(%rip), %rsi      # 0x75e0
leaq 0xe0(%rsp), %r14
movl $0xa0, %edx
movq %r14, %rdi
callq 0x1150
movaps 0x53b1(%rip), %xmm0     # 0x7520
leaq 0x80(%rsp), %r13
movaps %xmm0, (%r13)
movaps 0x53ad(%rip), %xmm0     # 0x7530
movaps %xmm0, 0x10(%r13)
movabsq $0x401c000000000000, %rax # imm = 0x401C000000000000
movq %rax, 0x20(%r13)
movaps 0x5423(%rip), %xmm0     # 0x75c0
leaq 0x20(%rsp), %r12
movaps %xmm0, (%r12)
movl $0x0, 0x10(%r12)
leaq 0xb0(%rsp), %r15
leaq 0x40(%rsp), %rbx
movl $0x15, %edi
movl $0x4, %esi
movl $0x5, %edx
movq %r14, %rcx
movq %r15, %r8
movq %rbx, %r9
callq 0x458a
movl $0x1, %ebp
movl $0x53, %r8d
movq %r13, %rdi
movq %r15, %rsi
movl $0x5, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
movl %ebp, (%rsp)
movl $0x54, %r8d
movq %r12, %rdi
movq %rbx, %rsi
movl $0x5, %edx
xorl %ecx, %ecx
movl $0x14, %r9d
callq 0x5ab7
movaps 0x548b(%rip), %xmm0     # 0x76b0
leaq 0x60(%rsp), %r13
movaps %xmm0, 0x10(%r13)
movaps 0x546a(%rip), %xmm0     # 0x76a0
movaps %xmm0, (%r13)
movaps 0x534e(%rip), %xmm0     # 0x7590
leaq 0x10(%rsp), %r12
movaps %xmm0, (%r12)
movl $0x16, %edi
movl $0x5, %esi
movl $0x4, %edx
movq %r14, %rcx
movq %r15, %r8
movq %rbx, %r9
callq 0x458a
movl $0x59, %r8d
movq %r13, %rdi
movq %r15, %rsi
movl $0x4, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
movl %ebp, (%rsp)
movl $0x5a, %r8d
movq %r12, %rdi
movq %rbx, %rsi
movl $0x4, %edx
xorl %ecx, %ecx
movl $0x14, %r9d
callq 0x5ab7
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aligusnet[P]morpheus/tests/matrix_reduce_test.c
// Function: test_row_max_index
void test_row_max_index() {
  double x[] = {
    71, 11, 3,  9, 7,
    21, 7,  2,  23, 11,
    11, 32, 53, 49, 37,
    1,  24, 78, 90, 17
  };

  double y[5];
  int is[5];

  double expected_y_row_major[] = {71, 23, 53, 90};
  int expected_is_row_major[] = {0, 3, 2, 3};
  morpheus_row_max_index(morpheus_row_major, 4, 5, x, y, is);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected_y_row_major, y, 4);

  double expected_y_col_major[] = {71, 32, 78, 90, 37};
  int expected_is_col_major[] = {0, 2, 3, 3, 2};
  morpheus_row_max_index(morpheus_col_major, 5, 4, x, y, is);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected_y_col_major, y, 5);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
leaq 0x5311(%rip), %rsi      # 0x75e0
leaq 0xa0(%rsp), %rbx
movl $0xa0, %edx
movq %rbx, %rdi
callq 0x1150
movaps 0x53a5(%rip), %xmm0     # 0x7690
leaq 0x20(%rsp), %r12
movaps %xmm0, 0x10(%r12)
movaps 0x5383(%rip), %xmm0     # 0x7680
movaps %xmm0, (%r12)
leaq 0x70(%rsp), %r14
movq %rsp, %r15
movl $0x15, %edi
movl $0x4, %esi
movl $0x5, %edx
movq %rbx, %rcx
movq %r14, %r8
movq %r15, %r9
callq 0x4689
movl $0x6b, %r8d
movq %r12, %rdi
movq %r14, %rsi
movl $0x4, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
movaps 0x51f4(%rip), %xmm0     # 0x7540
leaq 0x40(%rsp), %r12
movaps %xmm0, (%r12)
movaps 0x51f3(%rip), %xmm0     # 0x7550
movaps %xmm0, 0x10(%r12)
movabsq $0x4042800000000000, %rax # imm = 0x4042800000000000
movq %rax, 0x20(%r12)
movl $0x16, %edi
movl $0x5, %esi
movl $0x4, %edx
movq %rbx, %rcx
movq %r14, %r8
movq %r15, %r9
callq 0x4689
movl $0x70, %r8d
movq %r12, %rdi
movq %r14, %rsi
movl $0x5, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/aligusnet[P]morpheus/tests/matrix_reduce_test.c
// Function: test_row_min_index
void test_row_min_index() {
  double x[] = {
    71, 11, 3,  9, 7,
    21, 7,  2,  23, 11,
    11, 32, 53, 49, 37,
    1,  24, 78, 90, 17
  };

  double y[5];
  int is[5];

  double expected_y_row_major[] = {3, 2, 11, 1};
  int expected_is_row_major[] = {2, 2, 0, 0};
  morpheus_row_min_index(morpheus_row_major, 4, 5, x, y, is);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected_y_row_major, y, 4);

  double expected_y_col_major[] = {1, 7, 2, 9, 7};
  int expected_is_col_major[] = {3, 1, 1, 0, 0};
  morpheus_row_min_index(morpheus_col_major, 5, 4, x, y, is);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected_y_col_major, y, 5);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
leaq 0x520f(%rip), %rsi      # 0x75e0
leaq 0xa0(%rsp), %rbx
movl $0xa0, %edx
movq %rbx, %rdi
callq 0x1150
movaps 0x52c3(%rip), %xmm0     # 0x76b0
leaq 0x20(%rsp), %r12
movaps %xmm0, 0x10(%r12)
movaps 0x52a1(%rip), %xmm0     # 0x76a0
movaps %xmm0, (%r12)
leaq 0x70(%rsp), %r14
movq %rsp, %r15
movl $0x15, %edi
movl $0x4, %esi
movl $0x5, %edx
movq %rbx, %rcx
movq %r14, %r8
movq %r15, %r9
callq 0x478d
movl $0x81, %r8d
movq %r12, %rdi
movq %r14, %rsi
movl $0x4, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
movaps 0x50d2(%rip), %xmm0     # 0x7520
leaq 0x40(%rsp), %r12
movaps %xmm0, (%r12)
movaps 0x50d1(%rip), %xmm0     # 0x7530
movaps %xmm0, 0x10(%r12)
movabsq $0x401c000000000000, %rax # imm = 0x401C000000000000
movq %rax, 0x20(%r12)
movl $0x16, %edi
movl $0x5, %esi
movl $0x4, %edx
movq %rbx, %rcx
movq %r14, %r8
movq %r15, %r9
callq 0x478d
movl $0x86, %r8d
movq %r12, %rdi
movq %r14, %rsi
movl $0x5, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/aligusnet[P]morpheus/tests/matrix_reduce_test.c
// Function: test_column_sum
void test_column_sum() {
  double x[] = {
    71, 11, 3,  9, 7,
    21, 7,  2,  23, 11,
    11, 32, 53, 49, 37,
    1,  24, 78, 90, 17
  };

  double y[5];

  double expected_y_row_major[] = {104, 74, 136, 171, 72};
  morpheus_column_sum(morpheus_row_major, 4, 5, x, y);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected_y_row_major, y, 5);

  double expected_y_col_major[] = {101, 64,182, 210};
  morpheus_column_sum(morpheus_col_major, 5, 4, x, y);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected_y_col_major, y, 4);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x120, %rsp            # imm = 0x120
leaq 0x510f(%rip), %rsi      # 0x75e0
leaq 0x80(%rsp), %rbx
movl $0xa0, %edx
movq %rbx, %rdi
callq 0x1150
movaps 0x5073(%rip), %xmm0     # 0x7560
leaq 0x20(%rsp), %r15
movaps %xmm0, (%r15)
movaps 0x5073(%rip), %xmm0     # 0x7570
movaps %xmm0, 0x10(%r15)
movabsq $0x4052000000000000, %rax # imm = 0x4052000000000000
movq %rax, 0x20(%r15)
leaq 0x50(%rsp), %r14
movl $0x15, %edi
movl $0x4, %esi
movl $0x5, %edx
movq %rbx, %rcx
movq %r14, %r8
callq 0x4899
movl $0x95, %r8d
movq %r15, %rdi
movq %r14, %rsi
movl $0x5, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
movaps 0x517c(%rip), %xmm0     # 0x76d0
movq %rsp, %r15
movaps %xmm0, 0x10(%r15)
movaps 0x515d(%rip), %xmm0     # 0x76c0
movaps %xmm0, (%r15)
movl $0x16, %edi
movl $0x5, %esi
movl $0x4, %edx
movq %rbx, %rcx
movq %r14, %r8
callq 0x4899
movl $0x99, %r8d
movq %r15, %rdi
movq %r14, %rsi
movl $0x4, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
addq $0x120, %rsp            # imm = 0x120
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/aligusnet[P]morpheus/tests/matrix_reduce_test.c
// Function: test_row_sum
void test_row_sum() {
  double x[] = {
    71, 11, 3,  9, 7,
    21, 7,  2,  23, 11,
    11, 32, 53, 49, 37,
    1,  24, 78, 90, 17
  };

  double y[5];

  double expected_y_row_major[] = {101, 64,182, 210};
  morpheus_row_sum(morpheus_row_major, 4, 5, x, y);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected_y_row_major, y, 4);

  double expected_y_col_major[] = {104, 74, 136, 171, 72};
  morpheus_row_sum(morpheus_col_major, 5, 4, x, y);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected_y_col_major, y, 5);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x120, %rsp            # imm = 0x120
leaq 0x5021(%rip), %rsi      # 0x75e0
leaq 0x80(%rsp), %rbx
movl $0xa0, %edx
movq %rbx, %rdi
callq 0x1150
movaps 0x50f5(%rip), %xmm0     # 0x76d0
movq %rsp, %r15
movaps %xmm0, 0x10(%r15)
movaps 0x50d6(%rip), %xmm0     # 0x76c0
movaps %xmm0, (%r15)
leaq 0x50(%rsp), %r14
movl $0x15, %edi
movl $0x4, %esi
movl $0x5, %edx
movq %rbx, %rcx
movq %r14, %r8
callq 0x4965
movl $0xa8, %r8d
movq %r15, %rdi
movq %r14, %rsi
movl $0x4, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
movaps 0x4f2e(%rip), %xmm0     # 0x7560
leaq 0x20(%rsp), %r15
movaps %xmm0, (%r15)
movaps 0x4f2e(%rip), %xmm0     # 0x7570
movaps %xmm0, 0x10(%r15)
movabsq $0x4052000000000000, %rax # imm = 0x4052000000000000
movq %rax, 0x20(%r15)
movl $0x16, %edi
movl $0x5, %esi
movl $0x4, %edx
movq %rbx, %rcx
movq %r14, %r8
callq 0x4965
movl $0xac, %r8d
movq %r15, %rdi
movq %r14, %rsi
movl $0x5, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
addq $0x120, %rsp            # imm = 0x120
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/aligusnet[P]morpheus/tests/numeric_gradient_test.c
// Function: test_numeric_gradient
void test_numeric_gradient() {
  morpheus_reg_t reg_none;
  reg_none.type = morpheus_reg_none;

  morpheus_reg_t reg_l2;
  reg_l2.type = morpheus_reg_l2;
  reg_l2.lambda = 1;

  double X[] = {
    1, 3,
    1, 5,
    1, 10,
    1, 0,
    1, 4
  };
  double y[] = {9, 13, 23, 3, 11};

  double tmp_buffer[2*5];

  morpheus_params_t data;
  data.data.x = X;
  data.data.y = y;
  data.data.num_features = 2;
  data.data.num_examples = 5;
  data.data.layout = morpheus_row_major;
  data.memory_buffer = tmp_buffer;

  double tmp_buffer2[2*5];
  morpheus_numeric_gradient_params_t params;
  params.f = (morpheus_f)morpheus_ls_cost;
  params.num_variables = data.data.num_features;
  params.eps = 1e-5;
  params.memory_buffer = tmp_buffer2;

  double theta[] = {3, 3};

  double grad[2];
  double num_grad[2];

  // No regularization
  data.reg = reg_none;
  morpheus_ls_gradient(theta, &data, grad);

  morpheus_numeric_gradient(&params, theta, &data, num_grad);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(num_grad, grad, 2);

  // L2 regularization
  data.reg = reg_l2;
  morpheus_ls_gradient(theta, &data, grad);

  morpheus_numeric_gradient(&params, theta, &data, num_grad);
  TEST_ASSERT_EQUAL_DOUBLE_ARRAY(num_grad, grad, 2);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a0, %rsp            # imm = 0x1A0
leaq 0x503d(%rip), %rsi      # 0x76f0
leaq 0x150(%rsp), %rax
movl $0xa, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
movaps 0x4a23(%rip), %xmm0     # 0x70f0
leaq 0x50(%rsp), %rcx
movaps %xmm0, (%rcx)
movaps 0x4a24(%rip), %xmm0     # 0x7100
movaps %xmm0, 0x10(%rcx)
movabsq $0x4026000000000000, %rdx # imm = 0x4026000000000000
movq %rdx, 0x20(%rcx)
leaq 0x78(%rsp), %rbx
movq %rax, (%rbx)
movq %rcx, 0x8(%rbx)
movabsq $0x500000002, %rax      # imm = 0x500000002
movq %rax, 0x10(%rbx)
movl $0x15, 0x18(%rbx)
leaq 0x100(%rsp), %rax
movq %rax, 0x30(%rbx)
leaq 0x1ac9(%rip), %rax      # 0x41eb
leaq 0x30(%rsp), %r15
movq %rax, (%r15)
movl $0x2, 0x8(%r15)
movabsq $0x3ee4f8b588e368f1, %rax # imm = 0x3EE4F8B588E368F1
movq %rax, 0x10(%r15)
leaq 0xb0(%rsp), %rax
movq %rax, 0x18(%r15)
movaps 0x4f8d(%rip), %xmm0     # 0x76e0
leaq 0x20(%rsp), %r12
movaps %xmm0, (%r12)
movl $0x0, 0x20(%rbx)
leaq 0x10(%rsp), %r14
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x41fb
movq %rsp, %r13
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x3eb0
movl $0x32, %r8d
movq %r13, %rdi
movq %r14, %rsi
movl $0x2, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
movl $0x1, 0x20(%rbx)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x28(%rbx)
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x41fb
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x3eb0
movl $0x39, %r8d
movq %r13, %rdi
movq %r14, %rsi
movl $0x2, %edx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x6030
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq