LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/jwang11[P]intel_avx_perf/matrix_int16.c
// Function: calc_avx512
void calc_avx512(void) {
  #define VLEN (512/8/sizeof(int16_t))
  const int col_aligned = col - col % VLEN;
  int16_t dst_arr[VLEN];

  __m512i op0, op1, tmp_vec;
  volatile __m512i  tgt;

  for (int i = 0; i < row; i++) {
    int sum = 0;

    tgt = _mm512_setzero_si512();
    for (int j = 0; j < col_aligned; j += VLEN) {
      op0 = _mm512_load_si512(&mutiplier[j]);
      op1 = _mm512_load_si512(&mat[i][j]);
      tmp_vec = _mm512_mullo_epi16(op0, op1);
      tgt = _mm512_add_epi16(tmp_vec, tgt);
    }

    _mm512_store_epi64(dst_arr, tgt);
    for (int k = 0; k < VLEN; k++)
      sum += dst_arr[k];

    for (int l = col_aligned; l < col; l++)
      sum += mat[i][l] * mutiplier[l];

    result[i] = sum;
  }
  #undef VLEN
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
andq $-0x40, %rsp
subq $0xc0, %rsp
leaq 0x2d20(%rip), %rax      # 0x4070
xorl %ecx, %ecx
vxorps %xmm0, %xmm0, %xmm0
leaq 0x82d13(%rip), %rdx     # 0x84070
leaq 0x84d0c(%rip), %rsi     # 0x86070
vmovaps %zmm0, (%rsp)
movq $-0x20, %rdi
movq %rdx, %r8
vmovdqa64 0x40(%rax,%rdi,2), %zmm1
vpmullw (%r8), %zmm1, %zmm1
vpaddw (%rsp), %zmm1, %zmm1
vmovdqa64 %zmm1, (%rsp)
addq $0x20, %rdi
addq $0x40, %r8
cmpq $0xfe0, %rdi            # imm = 0xFE0
jb 0x1375
vmovdqa64 (%rsp), %zmm1
vmovdqa64 %zmm1, 0x70(%rsp)
vpxor %xmm1, %xmm1, %xmm1
xorl %edi, %edi
vpmovzxwd 0x70(%rsp,%rdi,2), %zmm2
vpaddd %zmm2, %zmm1, %zmm1
addq $0x10, %rdi
cmpq $0x20, %rdi
jne 0x13ba
vextracti64x4 $0x1, %zmm1, %ymm2
vpaddd %zmm2, %zmm1, %zmm1
vextracti128 $0x1, %ymm1, %xmm2
vpaddd %xmm2, %xmm1, %xmm1
vpshufd $0xee, %xmm1, %xmm2     # xmm2 = xmm1[2,3,2,3]
vpaddd %xmm2, %xmm1, %xmm1
vpshufd $0x55, %xmm1, %xmm2     # xmm2 = xmm1[1,1,1,1]
vpaddd %xmm2, %xmm1, %xmm1
vpextrw $0x0, %xmm1, (%rsi,%rcx,2)
incq %rcx
addq $0x2000, %rax           # imm = 0x2000
cmpq $0x40, %rcx
jne 0x1364
movq %rbp, %rsp
popq %rbp
vzeroupper
retq
// File: /workspace/github_c_makefile_star2_O1/kkanellis[P]matvec-sparse/mmio.c
// Function: mm_typecode_to_str
char  *mm_typecode_to_str(MM_typecode matcode)
{
    char buffer[MM_MAX_LINE_LENGTH];
    char *types[4];
	char *mm_strdup(const char *);

    /* check for MTX type */
    if (mm_is_matrix(matcode)) 
        types[0] = MM_MTX_STR;
    else
        return NULL;

    /* check for CRD or ARR matrix */
    if (mm_is_sparse(matcode))
        types[1] = MM_SPARSE_STR;
    else
    if (mm_is_dense(matcode))
        types[1] = MM_DENSE_STR;
    else
        return NULL;

    /* check for element data type */
    if (mm_is_real(matcode))
        types[2] = MM_REAL_STR;
    else
    if (mm_is_complex(matcode))
        types[2] = MM_COMPLEX_STR;
    else
    if (mm_is_pattern(matcode))
        types[2] = MM_PATTERN_STR;
    else
    if (mm_is_integer(matcode))
        types[2] = MM_INT_STR;
    else
        return NULL;


    /* check for symmetry type */
    if (mm_is_general(matcode))
        types[3] = MM_GENERAL_STR;
    else
    if (mm_is_symmetric(matcode))
        types[3] = MM_SYMM_STR;
    else 
    if (mm_is_hermitian(matcode))
        types[3] = MM_HERM_STR;
    else 
    if (mm_is_skew(matcode))
        types[3] = MM_SKEW_STR;
    else
        return NULL;

    sprintf(buffer,"%s %s %s %s", types[0], types[1], types[2], types[3]);
    return mm_strdup(buffer);

}

// Assembly:
cmpb $0x4d, (%rdi)
jne 0x1833
movzbl 0x1(%rdi), %eax
cmpl $0x43, %eax
je 0x1836
cmpl $0x41, %eax
jne 0x1833
leaq 0x18d6(%rip), %rcx      # 0x3107
jmp 0x183d
xorl %eax, %eax
retq
leaq 0x18bf(%rip), %rcx      # 0x30fc
movzbl 0x2(%rdi), %edx
xorl %eax, %eax
cmpl $0x4f, %edx
jg 0x185f
cmpl $0x43, %edx
je 0x1876
cmpl $0x49, %edx
jne 0x18fa
leaq 0x18c5(%rip), %r8       # 0x3122
jmp 0x1886
cmpl $0x50, %edx
je 0x187f
cmpl $0x52, %edx
jne 0x18fa
leaq 0x1899(%rip), %r8       # 0x310d
jmp 0x1886
leaq 0x1895(%rip), %r8       # 0x3112
jmp 0x1886
leaq 0x1894(%rip), %r8       # 0x311a
movzbl 0x3(%rdi), %edx
xorl %eax, %eax
cmpl $0x4a, %edx
jg 0x18a4
cmpl $0x47, %edx
je 0x18b7
cmpl $0x48, %edx
jne 0x18fa
leaq 0x1890(%rip), %r9       # 0x3132
jmp 0x18c7
cmpl $0x4b, %edx
je 0x18c0
cmpl $0x53, %edx
jne 0x18fa
leaq 0x188c(%rip), %r9       # 0x3141
jmp 0x18c7
leaq 0x186c(%rip), %r9       # 0x312a
jmp 0x18c7
leaq 0x1875(%rip), %r9       # 0x313c
pushq %rbx
subq $0x410, %rsp            # imm = 0x410
leaq 0x1804(%rip), %rsi      # 0x30da
leaq 0x1818(%rip), %rdx      # 0x30f5
movq %rsp, %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1130
movq %rbx, %rdi
callq 0x1ff7
addq $0x410, %rsp            # imm = 0x410
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/kkanellis[P]matvec-sparse/mmio.c
// Function: mm_read_mtx_crd_size
int mm_read_mtx_crd_size(FILE *f, int *M, int *N, int *nz )
{
    char line[MM_MAX_LINE_LENGTH];
    int num_items_read;

    /* set return null parameter values, in case we exit with errors */
    *M = *N = *nz = 0;

    /* now continue scanning until you reach the end-of-comments */
    do 
    {
        if (fgets(line,MM_MAX_LINE_LENGTH,f) == NULL) 
            return MM_PREMATURE_EOF;
    }while (line[0] == '%');

    /* line[] is either blank or has M,N, nz */
    if (sscanf(line, "%d %d %d", M, N, nz) == 3)
        return 0;
        
    else
    do
    { 
        num_items_read = fscanf(f, "%d %d %d", M, N, nz); 
        if (num_items_read == EOF) return MM_PREMATURE_EOF;
    }
    while (num_items_read != 3);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %eax, %eax
movl %eax, (%rcx)
movl %eax, (%rdx)
movl %eax, (%rsi)
movq %rsp, %r13
movl $0xc, %ebp
movq %r13, %rdi
movl $0x401, %esi            # imm = 0x401
movq %r12, %rdx
callq 0x10c0
testq %rax, %rax
je 0x1994
cmpb $0x25, (%rsp)
je 0x1928
leaq 0x180b(%rip), %rsi      # 0x3155
xorl %ebp, %ebp
movq %rsp, %rdi
movq %r15, %rdx
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x1110
cmpl $0x3, %eax
je 0x1994
leaq 0x17ea(%rip), %r13      # 0x3155
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x1050
cmpl $-0x1, %eax
je 0x198f
cmpl $0x3, %eax
jne 0x196b
xorl %ebp, %ebp
jmp 0x1994
movl $0xc, %ebp
movl %ebp, %eax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kkanellis[P]matvec-sparse/mmio.c
// Function: mm_is_valid
int mm_is_valid(MM_typecode matcode)
{
    if (!mm_is_matrix(matcode)) return 0;
    if (mm_is_dense(matcode) && mm_is_pattern(matcode)) return 0;
    if (mm_is_real(matcode) && mm_is_hermitian(matcode)) return 0;
    if (mm_is_pattern(matcode) && (mm_is_hermitian(matcode) || 
                mm_is_skew(matcode))) return 0;
    return 1;
}

// Assembly:
xorl %eax, %eax
cmpb $0x4d, (%rdi)
jne 0x19eb
cmpb $0x41, 0x1(%rdi)
jne 0x19bb
cmpb $0x50, 0x2(%rdi)
je 0x19eb
movzbl 0x2(%rdi), %ecx
cmpl $0x50, %ecx
je 0x19d9
cmpl $0x52, %ecx
jne 0x19ec
cmpb $0x48, 0x3(%rdi)
je 0x19eb
movl $0x1, %eax
cmpb $0x50, %cl
jne 0x19eb
movb 0x3(%rdi), %al
cmpb $0x48, %al
setne %cl
cmpb $0x4b, %al
setne %al
andb %cl, %al
movzbl %al, %eax
retq
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/kkanellis[P]matvec-sparse/mmio.c
// Function: mm_read_mtx_array_size
int mm_read_mtx_array_size(FILE *f, int *M, int *N)
{
    char line[MM_MAX_LINE_LENGTH];
    int num_items_read;
    /* set return null parameter values, in case we exit with errors */
    *M = *N = 0;
	
    /* now continue scanning until you reach the end-of-comments */
    do 
    {
        if (fgets(line,MM_MAX_LINE_LENGTH,f) == NULL) 
            return MM_PREMATURE_EOF;
    }while (line[0] == '%');

    /* line[] is either blank or has M,N, nz */
    if (sscanf(line, "%d %d", M, N) == 2)
        return 0;
        
    else /* we have a blank line */
    do
    { 
        num_items_read = fscanf(f, "%d %d", M, N); 
        if (num_items_read == EOF) return MM_PREMATURE_EOF;
    }
    while (num_items_read != 2);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x410, %rsp            # imm = 0x410
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %eax, %eax
movl %eax, (%rdx)
movl %eax, (%rsi)
movq %rsp, %r12
movl $0xc, %ebp
movq %r12, %rdi
movl $0x401, %esi            # imm = 0x401
movq %r15, %rdx
callq 0x10c0
testq %rax, %rax
je 0x1aa3
cmpb $0x25, (%rsp)
je 0x1a3d
leaq 0x16f9(%rip), %rsi      # 0x3158
xorl %ebp, %ebp
movq %rsp, %rdi
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1110
cmpl $0x2, %eax
je 0x1aa3
leaq 0x16db(%rip), %r12      # 0x3158
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1050
cmpl $-0x1, %eax
je 0x1a9e
cmpl $0x2, %eax
jne 0x1a7d
xorl %ebp, %ebp
jmp 0x1aa3
movl $0xc, %ebp
movl %ebp, %eax
addq $0x410, %rsp            # imm = 0x410
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kkanellis[P]matvec-sparse/mmio.c
// Function: mm_read_mtx_crd_data
int mm_read_mtx_crd_data(FILE *f, int M, int N, int nz, int I[], int J[],
        double val[], MM_typecode matcode)
{
    int i;
    if (mm_is_complex(matcode))
    {
        for (i=0; i<nz; i++)
            if (fscanf(f, "%d %d %lg %lg", &I[i], &J[i], &val[2*i], &val[2*i+1])
                != 4) return MM_PREMATURE_EOF;
    }
    else if (mm_is_real(matcode))
    {
        for (i=0; i<nz; i++)
        {
            if (fscanf(f, "%d %d %lg\n", &I[i], &J[i], &val[i])
                != 3) return MM_PREMATURE_EOF;

        }
    }

    else if (mm_is_pattern(matcode))
    {
        for (i=0; i<nz; i++)
            if (fscanf(f, "%d %d", &I[i], &J[i])
                != 2) return MM_PREMATURE_EOF;
    }
    else
        return MM_UNSUPPORTED_TYPE;

    return 0;
        
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %r14
movq %rdi, %r15
movq 0x40(%rsp), %r12
movq 0x48(%rsp), %rax
movzbl 0x2(%rax), %edx
cmpl $0x43, %edx
je 0x1b8d
cmpl $0x52, %edx
je 0x1b52
movl $0xf, %eax
cmpl $0x50, %edx
jne 0x1bd4
testl %ecx, %ecx
jle 0x1bcb
movl %ecx, %r13d
leaq 0x1631(%rip), %r12      # 0x3158
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1050
cmpl $0x2, %eax
jne 0x1bcf
addq $0x4, %rbx
addq $0x4, %r14
decq %r13
jne 0x1b27
jmp 0x1bcb
testl %ecx, %ecx
jle 0x1bcb
movl %ecx, %ebp
leaq 0x156d(%rip), %r13      # 0x30cc
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %rbx, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x1050
cmpl $0x3, %eax
jne 0x1bcf
addq $0x8, %r12
addq $0x4, %rbx
addq $0x4, %r14
decq %rbp
jne 0x1b5f
jmp 0x1bcb
testl %ecx, %ecx
jle 0x1bcb
movl %ecx, %ebp
leaq 0x15c4(%rip), %r13      # 0x315e
leaq 0x8(%r12), %r9
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %rbx, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x1050
cmpl $0x4, %eax
jne 0x1bcf
addq $0x4, %rbx
addq $0x4, %r14
addq $0x10, %r12
decq %rbp
jne 0x1b9a
xorl %eax, %eax
jmp 0x1bd4
movl $0xc, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kkanellis[P]matvec-sparse/mmio.c
// Function: mm_read_mtx_crd_entry
int mm_read_mtx_crd_entry(FILE *f, int *I, int *J,
        double *real, double *imag, MM_typecode matcode)
{
    if (mm_is_complex(matcode))
    {
            if (fscanf(f, "%d %d %lg %lg", I, J, real, imag)
                != 4) return MM_PREMATURE_EOF;
    }
    else if (mm_is_real(matcode))
    {
            if (fscanf(f, "%d %d %lg\n", I, J, real)
                != 3) return MM_PREMATURE_EOF;

    }

    else if (mm_is_pattern(matcode))
    {
            if (fscanf(f, "%d %d", I, J) != 2) return MM_PREMATURE_EOF;
    }
    else
        return MM_UNSUPPORTED_TYPE;

    return 0;
        
}

// Assembly:
pushq %rax
movq %r8, %r10
movq %rcx, %r8
movq %rdx, %rcx
movq %rsi, %rdx
movzbl 0x2(%r9), %esi
cmpl $0x52, %esi
je 0x1c46
cmpl $0x50, %esi
je 0x1c28
movl $0xf, %eax
cmpl $0x43, %esi
jne 0x1c44
leaq 0x154e(%rip), %rsi      # 0x315e
movq %r10, %r9
xorl %eax, %eax
callq 0x1050
movl %eax, %ecx
movl $0xc, %eax
cmpl $0x4, %ecx
je 0x1c42
jmp 0x1c44
leaq 0x1529(%rip), %rsi      # 0x3158
xorl %eax, %eax
callq 0x1050
movl %eax, %ecx
movl $0xc, %eax
cmpl $0x2, %ecx
jne 0x1c44
xorl %eax, %eax
popq %rcx
retq
leaq 0x147f(%rip), %rsi      # 0x30cc
xorl %eax, %eax
callq 0x1050
movl %eax, %ecx
movl $0xc, %eax
cmpl $0x3, %ecx
je 0x1c42
jmp 0x1c44
// File: /workspace/github_c_makefile_star2_O1/kkanellis[P]matvec-sparse/mmio.c
// Function: mm_write_banner
int mm_write_banner(FILE *f, MM_typecode matcode)
{
    char *str = mm_typecode_to_str(matcode);
    int ret_code;

    ret_code = fprintf(f, "%s %s\n", MatrixMarketBanner, str);
    free(str);
    if (ret_code !=2 )
        return MM_COULD_NOT_WRITE_FILE;
    else
        return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x1817
movq %rax, %r14
leaq 0x1354(%rip), %rsi      # 0x3172
leaq 0x12c1(%rip), %rdx      # 0x30e6
xorl %ebp, %ebp
movq %rbx, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x10f0
movl %eax, %ebx
movq %r14, %rdi
callq 0x1030
cmpl $0x2, %ebx
movl $0x11, %eax
cmovel %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kkanellis[P]matvec-sparse/mmio-wrapper.c
// Function: write_matrix
int write_matrix (const char *filename, const int *i_idx, const int *j_idx, const double *values, int N, int NZ)
{
    FILE* f;
    MM_typecode matcode;

    /* open the file */
    if ( (f = fopen(filename, "w")) == NULL ) {
        fprintf(stderr, "Cannot open '%s'\n", filename);
        return 1;
    }

    /* init and set proper flags for matrix */
    mm_initialize_typecode(&matcode);
    mm_set_matrix(&matcode);
    mm_set_real(&matcode);
    mm_set_sparse(&matcode);

    /* write banner and matrix size info */
    mm_write_banner(f, matcode);
    mm_write_mtx_crd_size(f, N, N, NZ);

    /* write matrix elements */
    for (int i = 0; i < NZ; i++) {
        fprintf(f, "%d %d %.9lf\n", i_idx[i] + 1, j_idx[i] + 1, values[i]);
    }

    /* close the file */
    if ( fclose(f) != 0 ) {
        fprintf(stderr, "Cannot close file (fil:'%s')\n", filename);
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %ebp
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
leaq 0xf36(%rip), %rsi       # 0x3180
movq %rdi, 0x8(%rsp)
callq 0x1120
testq %rax, %rax
je 0x22d2
movq %rax, %r13
leaq 0x14(%rsp), %rsi
movl $0x47524320, (%rsi)     # imm = 0x47524320
movb $0x4d, (%rsi)
movq %rax, %rdi
callq 0x1e05
movq %r13, %rdi
movl %ebx, %esi
movl %ebx, %edx
movl %ebp, %ecx
callq 0x19f2
testl %ebp, %ebp
jle 0x22b3
movl %ebp, %ebx
xorl %ebp, %ebp
movl (%r12,%rbp,4), %edx
incl %edx
movl (%r15,%rbp,4), %ecx
incl %ecx
movsd (%r14,%rbp,8), %xmm0
movq %r13, %rdi
leaq 0xff3(%rip), %rsi       # 0x3297
movb $0x1, %al
callq 0x10f0
incq %rbp
cmpq %rbp, %rbx
jne 0x2288
movq %r13, %rdi
callq 0x1080
xorl %ebp, %ebp
testl %eax, %eax
jne 0x22e0
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %ebp
leaq 0xece(%rip), %rsi       # 0x31ac
jmp 0x22e7
leaq 0xf92(%rip), %rsi       # 0x3279
movq 0x2d0a(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
movq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x10f0
jmp 0x22c1
nop
// File: /workspace/github_c_makefile_star2_O1/kkanellis[P]matvec-sparse/partition.c
// Function: partition_equal_rows
void partition_equal_rows(proc_info_t *proc_info, int nprocs, const int *row_idx)
{
    /* rows for each process */
    double row_chunk = ((double)proc_info[0].N) / nprocs; 

    int last_row, i = 0;
    for (int k = 0; k < nprocs; k++) {
        proc_info[k].nz_count = 0;
        proc_info[k].nz_start_idx = i;

        last_row = (int)((k + 1) * row_chunk - 1);

        proc_info[k].row_start_idx = (int)(k * row_chunk);
        proc_info[k].row_count = last_row - proc_info[k].row_start_idx + 1;

        while (i < proc_info[0].NZ && row_idx[i] <= last_row) {
            proc_info[k].nz_count++; 
            i++;
        }

        debug("Processor %d takes rows %3d till %3d [%3d] (entries %6d till %6d) [%6d]\n", 
                        k, 
                        proc_info[k].row_start_idx, 
                        proc_info[k].row_start_idx + proc_info[k].row_count - 1,
                        proc_info[k].row_count,
                        proc_info[k].nz_start_idx, 
                        proc_info[k].nz_start_idx + proc_info[k].nz_count - 1,
                        proc_info[k].nz_count
        );
    }
    /* add remaining elements (if any) to last task */
    proc_info[nprocs - 1].nz_count += proc_info[0].NZ - i;  
}

// Assembly:
testl %esi, %esi
jle 0x23c5
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cvtsi2sdl (%rdi), %xmm0
cvtsi2sd %esi, %xmm1
divsd %xmm1, %xmm0
movl 0x4(%rdi), %eax
movslq %eax, %rcx
movl %esi, %r8d
xorl %r10d, %r10d
movsd 0xf78(%rip), %xmm1      # 0x32a8
xorl %r9d, %r9d
movq %r10, %rbx
xorps %xmm2, %xmm2
cvtsi2sd %ebx, %xmm2
incq %r10
xorps %xmm3, %xmm3
cvtsi2sd %r10d, %xmm3
mulsd %xmm0, %xmm3
addsd %xmm1, %xmm3
cvttsd2si %xmm3, %r11d
leaq (%rbx,%rbx,2), %rbx
movl $0x0, 0x8(%rdi,%rbx,8)
movl %r9d, 0xc(%rdi,%rbx,8)
mulsd %xmm0, %xmm2
cvttsd2si %xmm2, %ebp
movl %ebp, 0x14(%rdi,%rbx,8)
movl %r11d, %r14d
subl %ebp, %r14d
incl %r14d
movl %r14d, 0x10(%rdi,%rbx,8)
cmpl %eax, %r9d
jge 0x23b2
leaq (%rdi,%rbx,8), %rbx
movslq %r9d, %r15
leaq (%rdx,%r15,4), %r14
movq %rcx, %r12
subq %r15, %r12
xorl %r15d, %r15d
cmpl %r11d, (%r14,%r15,4)
jg 0x23af
incl 0x8(%rbx)
incq %r15
cmpq %r15, %r12
jne 0x2399
movl %eax, %r9d
jmp 0x23b2
addl %r15d, %r9d
cmpq %r8, %r10
jne 0x2333
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x23c8
xorl %r9d, %r9d
movl 0x4(%rdi), %eax
subl %r9d, %eax
movslq %esi, %rcx
leaq (%rcx,%rcx,2), %rcx
addl %eax, -0x10(%rdi,%rcx,8)
retq
// File: /workspace/github_c_makefile_star2_O1/kkanellis[P]matvec-sparse/util.c
// Function: random_vec
void random_vec (double *v, int N, int limit)
{
    /* fill v with random doubles */
    limit--;
    srand( 410 );
    for (int i = 0; i < N; i++) {
        v[i] = ((double)rand()) / (((double)RAND_MAX) / limit) + \
               ((double)rand()) / ((double)RAND_MAX);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
movl $0x19a, %edi            # imm = 0x19A
callq 0x10b0
testl %ebp, %ebp
jle 0x2560
decl %r14d
cvtsi2sd %r14d, %xmm0
movsd 0xda0(%rip), %xmm1      # 0x32b0
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movl %ebp, %r14d
xorl %r15d, %r15d
callq 0x1160
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
callq 0x1160
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0xd64(%rip), %xmm0      # 0x32b0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rbx,%r15,8)
incq %r15
cmpq %r15, %r14
jne 0x2520
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kkanellis[P]matvec-sparse/util.c
// Function: malloc_or_exit
void * malloc_or_exit(size_t size) {
    void * ptr = malloc( size );
    if ( !ptr ) {
        fprintf(stderr, "malloc: failed to allocate memory\n");
        exit(EXIT_FAILURE);
    }
    return ptr;
}

// Assembly:
pushq %rax
callq 0x1100
testq %rax, %rax
je 0x2578
popq %rcx
retq
callq 0x1221
// File: /workspace/github_c_makefile_star2_O1/kkanellis[P]matvec-sparse/util.c
// Function: calloc_or_exit
void * calloc_or_exit(size_t nmemb, size_t size) {
    void * ptr = calloc(nmemb, size);
    if ( !ptr ) {
        fprintf(stderr, "calloc: failed to allocate memory\n");
        exit(EXIT_FAILURE);
    }
    return ptr;
}

// Assembly:
pushq %rax
callq 0x10d0
testq %rax, %rax
je 0x258a
popq %rcx
retq
callq 0x1246
// File: /workspace/github_c_makefile_star2_O1/kkanellis[P]matvec-sparse/stopwatch.c
// Function: _sw_stop
void __sw_stop(const int id, double * value) {
    clock_gettime(CLOCK_MONOTONIC_RAW, sw + N_STOPWATCHES);
    *value += (
        (double) ((sw[N_STOPWATCHES].tv_nsec - sw[id].tv_nsec) / 1000000.0 )+
        (double) ((sw[N_STOPWATCHES].tv_sec - sw[id].tv_sec) * 1000.0)
    );
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x2b66(%rip), %rsi      # 0x5130
movl $0x4, %edi
callq 0x1070
leaq 0x2b05(%rip), %rax      # 0x50e0
movq 0x2b56(%rip), %rcx      # 0x5138
movslq %ebp, %rdx
shlq $0x4, %rdx
subq 0x8(%rdx,%rax), %rcx
cvtsi2sd %rcx, %xmm0
divsd 0xd05(%rip), %xmm0      # 0x3300
movq 0x2b2e(%rip), %rcx      # 0x5130
subq (%rdx,%rax), %rcx
cvtsi2sd %rcx, %xmm1
mulsd 0xcf5(%rip), %xmm1      # 0x3308
addsd %xmm0, %xmm1
addsd (%rbx), %xmm1
movsd %xmm1, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_3/exercise_3_05/itob.c
// Function: itob
void itob(int n, char s[], int b)
{
  int i = 0, sign = n;

  do
  {
    s[i++] = itoc(abs(n) % b);
    n /= b;
  } while (n);

  switch (b)
  {
  case 2:
    s[i++] = 'b';
    s[i++] = '0';
    break;

  case 16:
    s[i++] = 'x';
    s[i++] = '0';
    break;
  }

  if (sign < 0)
  {
    s[i++] = '-';
  }

  s[i] = '\0';

  int s_len = strlen(s);
  str_reverse(s, 0, s_len - 1);
}

// Assembly:
pushq %rbx
movl %edx, %ecx
movq %rsi, %rbx
xorl %r8d, %r8d
movl $0x30, %r9d
movl %edi, %esi
movl %esi, %eax
negl %eax
cmovsl %esi, %eax
cltd
idivl %ecx
cmpl $0xa, %edx
movl $0x57, %eax
cmovbl %r9d, %eax
addb %dl, %al
movb %al, (%rbx,%r8)
incq %r8
movl %esi, %eax
cltd
idivl %ecx
movl %eax, %esi
testl %eax, %eax
jne 0x1190
cmpl $0x2, %ecx
je 0x11c8
cmpl $0x10, %ecx
jne 0x11dc
movb $0x78, %al
jmp 0x11ca
movb $0x62, %al
movl %r8d, %ecx
movb %al, (%rbx,%rcx)
leal 0x2(%r8), %eax
movb $0x30, 0x1(%rbx,%r8)
jmp 0x11df
movl %r8d, %eax
testl %edi, %edi
jns 0x11ec
movslq %eax, %rcx
incl %eax
movb $0x2d, (%rbx,%rcx)
cltq
movb $0x0, (%rbx,%rax)
movq %rbx, %rdi
callq 0x1030
leal -0x1(%rax), %edx
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
jmp 0x121c
// File: /workspace/github_c_makefile_star2_O1/ughman[P]c2c/src/main.c
// Function: main
int main(int argc,char **argv)
{
	if (SDL_Init(0) < 0)
	{
		// no logging available because init failed
		fprintf(stderr,"SDL_Init failed: %s\n",SDL_GetError());
		SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,APP_TITLE,SDL_GetError(),NULL);
		return EXIT_FAILURE;
	}
#ifdef NDEBUG
	SDL_LogSetAllPriority(SDL_LOG_PRIORITY_INFO);
#else
	SDL_LogSetAllPriority(SDL_LOG_PRIORITY_DEBUG);
#endif
	EMU_Init();
	CORE_Start();
	SDL_Quit();
	return EXIT_SUCCESS;
}

// Assembly:
pushq %rbx
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x10b0
testl %eax, %eax
js 0x1343
movl $0x2, %edi
callq 0x1040
callq 0x161e0d
callq 0x164897
callq 0x1030
movl %ebx, %eax
popq %rbx
retq
callq 0x1120
movl $0x1, %ebx
jmp 0x133f
nop
// File: /workspace/github_c_makefile_star2_O1/ughman[P]c2c/src/bios.c
// Function: BIOS_StrCat
uint32_t BIOS_StrCat(uint32_t dest,uint32_t src)
{
	uint32_t len;
	uint32_t i = 0;
	uint8_t c = 1;
	for (len = 0;EMU_ReadU8(dest + len);len++);
	while (c)
	{
		EMU_Write8(dest + len + i,c = EMU_ReadU8(src + i));
		i++;
	}
	return dest;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movl %edi, %ebx
movl %edi, %r14d
movl %r14d, %edi
callq 0x161e72
incl %r14d
testb %al, %al
jne 0x161145
decl %r14d
movl %ebp, %edi
callq 0x161e72
movzbl %al, %r15d
movl %r14d, %edi
movl %r15d, %esi
callq 0x16234a
incl %r14d
incl %ebp
testb %r15b, %r15b
jne 0x161157
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ughman[P]c2c/src/bios.c
// Function: BIOS_StrCmp
int32_t BIOS_StrCmp(uint32_t str1,uint32_t str2)
{
	uint32_t i = 0;
	while (1)
	{
		int8_t c1 = EMU_ReadS8(str1 + i);
		int8_t c2 = EMU_ReadS8(str2 + i);
		if (c1 != c2)
			return c1 - c2;
		else if (c1 == 0)
			return 0;
		i++;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movl %edi, %r14d
xorl %r12d, %r12d
leal (%r12,%r14), %edi
callq 0x161e6a
movl %eax, %r15d
leal (%r12,%rbx), %edi
callq 0x161e6a
cmpb %al, %r15b
jne 0x1611ba
testb %r15b, %r15b
je 0x1611c5
incl %r12d
movb $0x1, %al
jmp 0x1611c9
movsbl %r15b, %ebp
movsbl %al, %eax
subl %eax, %ebp
jmp 0x1611c7
xorl %ebp, %ebp
xorl %eax, %eax
testb %al, %al
jne 0x161194
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ughman[P]c2c/src/bios.c
// Function: BIOS_StrNCmp
int32_t BIOS_StrNCmp(uint32_t str1,uint32_t str2,uint32_t maxlen)
{
	uint32_t i = 0;
	while (i < maxlen)
	{
		int8_t c1 = EMU_ReadS8(str1 + i);
		int8_t c2 = EMU_ReadS8(str2 + i);
		if (c1 != c2)
			return c1 - c2;
		else if (c1 == 0)
			return 0;
		i++;
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r14d
movl %edi, %r15d
xorl %r13d, %r13d
cmpl %ebx, %r13d
jae 0x16122e
leal (%r15,%r13), %edi
callq 0x161e6a
movl %eax, %r12d
leal (%r14,%r13), %edi
callq 0x161e6a
cmpb %al, %r12b
jne 0x161219
testb %r12b, %r12b
je 0x161224
incl %r13d
movb $0x1, %al
jmp 0x161228
movsbl %r12b, %ebp
movsbl %al, %eax
subl %eax, %ebp
jmp 0x161226
xorl %ebp, %ebp
xorl %eax, %eax
testb %al, %al
jne 0x1611ee
jmp 0x161230
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ughman[P]c2c/src/bios.c
// Function: BIOS_DeliverEvent
void BIOS_DeliverEvent(uint32_t evclass,uint32_t spec)
{
	for (int i = 0;i < BIOS_MAXEVENTS;i++)
	{
		struct biosevent *event = &events[i];
		if (!event->enabled)
			continue;
		if (event->evclass != evclass)
			continue;
		if (event->spec != spec)
			continue;
		if (event->mode == 0x1000)
			EMU_Invoke(event->func,0);
		else
			event->busy = 0;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
movl $0x18, %r14d
leaq 0x9cbe(%rip), %r15      # 0x16b0b0
cmpl $0x0, -0x14(%r14,%r15)
je 0x16142b
cmpl %ebp, -0xc(%r14,%r15)
jne 0x16142b
cmpl %ebx, -0x8(%r14,%r15)
jne 0x16142b
cmpl $0x1000, -0x4(%r14,%r15) # imm = 0x1000
jne 0x161422
movl (%r14,%r15), %edi
xorl %esi, %esi
xorl %eax, %eax
callq 0x162cdf
jmp 0x16142b
movl $0x0, -0x10(%r14,%r15)
addq $0x1c, %r14
cmpq $0x1d8, %r14            # imm = 0x1D8
jne 0x1613f2
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ughman[P]c2c/src/bios.c
// Function: BIOS_OpenEvent
uint32_t BIOS_OpenEvent(uint32_t evclass,uint32_t spec,uint32_t mode,uint32_t func)
{
	for (int i = 0;i < BIOS_MAXEVENTS;i++)
	{
		struct biosevent *event = &events[i];
		if (!event->allocated)
		{
			event->allocated = 1;
			event->busy = 1;
			event->evclass = evclass;
			event->spec = spec;
			event->mode = mode;
			event->func = func;
			return i;
		}
	}
	abort();
}

// Assembly:
pushq %rbx
leaq 0x9c65(%rip), %r8       # 0x16b0b0
xorl %r10d, %r10d
movl $0x1, %r9d
xorl %r11d, %r11d
movl (%r8), %ebx
testl %ebx, %ebx
jne 0x161478
movl %r9d, (%r8)
movl %r9d, 0x8(%r8)
movl %edi, 0xc(%r8)
movl %esi, 0x10(%r8)
movl %edx, 0x14(%r8)
movl %ecx, 0x18(%r8)
movl %r10d, %eax
testl %ebx, %ebx
je 0x161495
cmpq $0xf, %r10
leaq 0x1(%r10), %rbx
setae %r11b
addq $0x1c, %r8
movq %rbx, %r10
cmpq $0x10, %rbx
jne 0x161457
testb $0x1, %r11b
jne 0x16149d
popq %rbx
retq
callq 0x1070
// File: /workspace/github_c_makefile_star2_O1/ughman[P]c2c/src/bios.c
// Function: BIOS_TestEvent
int BIOS_TestEvent(uint32_t event)
{
	if (event >= BIOS_MAXEVENTS)
		abort();
	if (!events[event].enabled)
		return 0;
	if (events[event].busy)
		return 0;
	events[event].busy = 1;
	return 1;
}

// Assembly:
cmpl $0x10, %edi
jae 0x1614db
movl %edi, %eax
leaq (%rax,%rax,8), %rcx
leaq (%rcx,%rcx,2), %rdx
addq %rax, %rdx
leaq 0x9bf5(%rip), %rcx      # 0x16b0b0
xorl %eax, %eax
cmpl $0x0, 0x4(%rcx,%rdx)
je 0x1614cd
addq %rdx, %rcx
cmpl $0x0, 0x8(%rcx)
je 0x1614ce
retq
movl $0x1, 0x8(%rcx)
movl $0x1, %eax
retq
pushq %rax
callq 0x1070
// File: /workspace/github_c_makefile_star2_O1/ughman[P]c2c/src/bios.c
// Function: BIOS_EnableEvent
int BIOS_EnableEvent(uint32_t event)
{
	if (event >= BIOS_MAXEVENTS)
		abort();
	events[event].enabled = 1;
	return 1;
}

// Assembly:
cmpl $0x10, %edi
jae 0x161508
movl %edi, %eax
leaq (%rax,%rax,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %rax, %rcx
leaq 0x9bb6(%rip), %rax      # 0x16b0b0
movl $0x1, 0x4(%rax,%rcx)
movl $0x1, %eax
retq
pushq %rax
callq 0x1070
// File: /workspace/github_c_makefile_star2_O1/ughman[P]c2c/src/emu.c
// Function: EMU_Init
void EMU_Init(void)
{
	extern void ZZ_Init(void);
	PCSX_Init();
	EMU_codemap[0x28] = BIOS_Execute;
	EMU_codemap[0x2C] = BIOS_Execute;
	EMU_codemap[0x30] = BIOS_Execute;
	EMU_codemap[0x221] = EMU_DummyMethod;
	for (int i = 0;i < EMU_RAMWORDS;i++)
	{
		if (!EMU_codemap[i])
			EMU_codemap[i] = EMU_ExecuteUnrecognizedCode;
	}
	ZZ_Init();
}

// Assembly:
pushq %rax
callq 0x1618c8
leaq -0x90c(%rip), %rax      # 0x16150e
movq %rax, 0x967f(%rip)      # 0x16b4a0
movq %rax, 0x9698(%rip)      # 0x16b4c0
movq %rax, 0x96b1(%rip)      # 0x16b4e0
leaq -0x34(%rip), %rax       # 0x161e02
movq %rax, 0xa62b(%rip)      # 0x16c468
xorl %eax, %eax
leaq 0x951a(%rip), %rcx      # 0x16b360
leaq -0x81(%rip), %rdx       # 0x161dcc
cmpq $0x0, (%rax,%rcx)
jne 0x161e58
movq %rdx, (%rax,%rcx)
addq $0x8, %rax
cmpq $0x400000, %rax         # imm = 0x400000
jne 0x161e4d
popq %rax
jmp 0x1350
// File: /workspace/github_c_makefile_star2_O1/ughman[P]c2c/src/emu.c
// Function: EMU_ReadU8
uint8_t EMU_ReadU8(uint32_t address)
{
	if (address >= 0x80000000 && address <= 0x801FFFFF)
	{
normal:
		{
			uint32_t (*codehandler)(uint32_t) = EMU_codemap[(address & 0x1FFFFF) >> 2];
			if (codehandler != EMU_ExecuteUnrecognizedCode)
			{
				SDL_LogError(LOG_EMU,"Reading code as data");
			}
		}
		return EMU_ram[(address & 0x1FFFFF) >> 2] >> (address & 3) * 8;
	}
	else if (address >= 0x0 && address <= 0x1FFFFF)
	{
		goto normal;
	}
	else if (address >= 0xA0000000 && address <= 0xA01FFFFF)
	{
		goto normal;
	}
	else if (address >= 0x1F800000 && address <= 0x1F8003FF)
	{
		return EMU_scratch[(address & 0x3FF) >> 2] >> (address & 3) * 8;
	}
	else switch (address)
	{
	case 0x1F801040:
		return PAD_Read();
	case 0x1F801800:
		return CDR_GetStatus();
	case 0x1F801801:
		return CDR_ReadResponse();
	case 0x1F801802:
		return CDR_Read();
	case 0x1F801803:
		return CDR_Read3();
	default:
		SDL_LogError(LOG_EMU,"Unrecognized 8-bit read address %.8X",address);
		return PCSX_Read8(address);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
testl $0x7fe00000, %edi       # imm = 0x7FE00000
setne %al
movl %edi, %ecx
andl $0xffe00000, %ecx       # imm = 0xFFE00000
cmpl $0xa0000000, %ecx       # imm = 0xA0000000
setne %cl
testb %cl, %al
jne 0x161ed8
movl %ebx, %r14d
shrl $0x2, %r14d
andl $0x7ffff, %r14d         # imm = 0x7FFFF
leaq 0x94b5(%rip), %rax      # 0x16b360
leaq -0xe6(%rip), %rcx       # 0x161dcc
cmpq %rcx, (%rax,%r14,8)
je 0x161ecb
leaq 0x4b3b(%rip), %rsi      # 0x1669fa
movl $0x13, %edi
xorl %eax, %eax
callq 0x10d0
movq 0x40948e(%rip), %rax    # 0x56b360
movl (%rax,%r14,4), %eax
jmp 0x161ef8
movl %ebx, %eax
andl $0xfffffc00, %eax       # imm = 0xFFFFFC00
cmpl $0x1f800000, %eax       # imm = 0x1F800000
jne 0x161f07
movq 0x40947b(%rip), %rax    # 0x56b368
movl %ebx, %ecx
andl $0x3fc, %ecx            # imm = 0x3FC
movl (%rax,%rcx), %eax
shll $0x3, %ebx
movl %ebx, %ecx
shrl %cl, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leal -0x1f801800(%rbx), %eax
cmpl $0x3, %eax
ja 0x161f2e
leaq 0x38ef(%rip), %rcx      # 0x165808
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1290
cmpl $0x1f801040, %ebx       # imm = 0x1F801040
jne 0x161f42
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x124c
leaq 0x4ac6(%rip), %rsi      # 0x166a0f
movl $0x13, %edi
movl %ebx, %edx
xorl %eax, %eax
callq 0x10d0
leaq 0x9322(%rip), %rax      # 0x16b280
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x12b3
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x12cf
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x12c1
// File: /workspace/github_c_makefile_star2_O1/ughman[P]c2c/src/emu.c
// Function: EMU_ReadLeft
void EMU_ReadLeft(uint32_t address,uint32_t *valueref)
{
	static uint32_t mask[4] = {0xFFFFFF,0xFFFF,0xFF,0};
	static int shift[4] = {24,16,8,0};
	uint32_t value = EMU_ReadU32(address & ~3);
	*valueref &= mask[address & 3];
	*valueref |= value << shift[address & 3];
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
andl $-0x4, %edi
callq 0x1621d5
andl $0x3, %r14d
shll $0x2, %r14d
leaq 0x4043(%rip), %rdx      # 0x166b80
leaq 0x405c(%rip), %rcx      # 0x166ba0
movb (%r14,%rcx), %cl
movl (%rbx), %esi
shll %cl, %eax
andl (%r14,%rdx), %esi
orl %esi, %eax
movl %eax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/ughman[P]c2c/src/emu.c
// Function: EMU_ReadRight
void EMU_ReadRight(uint32_t address,uint32_t *valueref)
{
	static uint32_t mask[4] = {0,0xFF000000,0xFFFF0000,0xFFFFFF00};
	static int shift[4] = {0,8,16,24};
	uint32_t value = EMU_ReadU32(address & ~3);
	*valueref &= mask[address & 3];
	*valueref |= value >> shift[address & 3];
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
andl $-0x4, %edi
callq 0x1621d5
andl $0x3, %r14d
shll $0x2, %r14d
leaq 0x4033(%rip), %rdx      # 0x166bb0
leaq 0x404c(%rip), %rcx      # 0x166bd0
movb (%r14,%rcx), %cl
movl (%rbx), %esi
shrl %cl, %eax
andl (%r14,%rdx), %esi
orl %esi, %eax
movl %eax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/ughman[P]c2c/src/emu.c
// Function: EMU_WriteLeft
void EMU_WriteLeft(uint32_t address,uint32_t value)
{
	static uint32_t mask[4] = {0xFFFFFF00,0xFFFF0000,0xFF000000,0};
	static int shift[4] = {24,16,8,0};
	uint32_t memvalue = EMU_ReadU32(address & ~3);
	memvalue &= mask[address & 3];
	memvalue |= value >> shift[address & 3];
	EMU_Write32(address & ~3,memvalue);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movl %edi, %r14d
movl %edi, %ebp
andl $-0x4, %ebp
movl %ebp, %edi
callq 0x1621d5
andl $0x3, %r14d
shll $0x2, %r14d
leaq 0x3fd0(%rip), %rcx      # 0x166b90
andl (%r14,%rcx), %eax
leaq 0x3fd5(%rip), %rcx      # 0x166ba0
movb (%r14,%rcx), %cl
shrl %cl, %ebx
orl %eax, %ebx
movl %ebp, %edi
movl %ebx, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x162869
// File: /workspace/github_c_makefile_star2_O1/ughman[P]c2c/src/emu.c
// Function: EMU_WriteRight
void EMU_WriteRight(uint32_t address,uint32_t value)
{
	static uint32_t mask[4] = {0,0xFF,0xFFFF,0xFFFFFF};
	static int shift[4] = {0,8,16,24};
	uint32_t memvalue = EMU_ReadU32(address & ~3);
	memvalue &= mask[address & 3];
	memvalue |= value << shift[address & 3];
	EMU_Write32(address & ~3,memvalue);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movl %edi, %r14d
movl %edi, %ebp
andl $-0x4, %ebp
movl %ebp, %edi
callq 0x1621d5
andl $0x3, %r14d
shll $0x2, %r14d
leaq 0x3fbc(%rip), %rcx      # 0x166bc0
andl (%r14,%rcx), %eax
leaq 0x3fc1(%rip), %rcx      # 0x166bd0
movb (%r14,%rcx), %cl
shll %cl, %ebx
orl %eax, %ebx
movl %ebp, %edi
movl %ebx, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x162869
// File: /workspace/github_c_makefile_star2_O1/ughman[P]c2c/src/emu.c
// Function: EMU_SDivide
void EMU_SDivide(int32_t a,int32_t b)
{
	if (b)
	{
		LO = a / b;
		HI = a % b;
	}
	else
	{
		LO = 0xFFFFFFFF;
		HI = a;
	}
}

// Assembly:
testl %esi, %esi
je 0x162c94
movq 0x86cb(%rip), %rcx      # 0x16b350
movl %edi, %eax
cltd
idivl %esi
movl %eax, 0x80(%rcx)
movl %edx, %edi
jmp 0x162ca5
movq 0x86b5(%rip), %rcx      # 0x16b350
movl $0xffffffff, 0x80(%rcx) # imm = 0xFFFFFFFF
movl %edi, 0x84(%rcx)
retq
// File: /workspace/github_c_makefile_star2_O1/ughman[P]c2c/src/emu.c
// Function: EMU_UDivide
void EMU_UDivide(uint32_t a,uint32_t b)
{
	if (b)
	{
		LO = a / b;
		HI = a % b;
	}
	else
	{
		LO = 0xFFFFFFFF;
		HI = a;
	}
}

// Assembly:
testl %esi, %esi
je 0x162cc7
movq 0x8699(%rip), %rcx      # 0x16b350
movl %edi, %eax
xorl %edx, %edx
divl %esi
movl %eax, 0x80(%rcx)
movl %edx, %edi
jmp 0x162cd8
movq 0x8682(%rip), %rcx      # 0x16b350
movl $0xffffffff, 0x80(%rcx) # imm = 0xFFFFFFFF
movl %edi, 0x84(%rcx)
retq
// File: /workspace/github_c_makefile_star2_O1/ughman[P]c2c/src/emu.c
// Function: EMU_NativeCall
void EMU_NativeCall(void *method)
{
	static uint32_t stackbuffer[16];
	memcpy(stackbuffer,(uint8_t *)EMU_ram + (SP & 0x1FFFFF),sizeof(stackbuffer));
	stackbuffer[0] = A0;
	stackbuffer[1] = A1;
	stackbuffer[2] = A2;
	stackbuffer[3] = A3;
	__asm__
	(
		"movl %2,%%ecx;"
		"subl %%ecx,%%esp;"
		"shr $2,%%ecx;"
		"movl %%esp,%%edi;"
		"rep movsd;"
		"call *%1;"
		"addl %2,%%esp;"
		: "=a"(V0)
		: "m"(method),"i"(sizeof(stackbuffer)),"S"(stackbuffer)
		: "%ecx","%edx","%edi","flags","memory"
	);
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq 0x408406(%rip), %rax    # 0x56b360
movq 0x83ef(%rip), %r8       # 0x16b350
movl 0x74(%r8), %ecx
andl $0x1fffff, %ecx         # imm = 0x1FFFFF
movups (%rax,%rcx), %xmm0
movups 0x10(%rax,%rcx), %xmm1
movups 0x20(%rax,%rcx), %xmm2
movups 0x30(%rax,%rcx), %xmm3
movaps %xmm0, 0x4083eb(%rip)   # 0x56b370
movaps %xmm1, 0x4083f4(%rip)   # 0x56b380
movaps %xmm2, 0x4083fd(%rip)   # 0x56b390
movaps %xmm3, 0x408406(%rip)   # 0x56b3a0
leaq 0x4083cf(%rip), %rsi    # 0x56b370
movl 0x10(%r8), %eax
movl %eax, 0x4083c5(%rip)    # 0x56b370
movl 0x14(%r8), %eax
movl %eax, 0x4083bf(%rip)    # 0x56b374
movl 0x18(%r8), %eax
movl %eax, 0x4083b9(%rip)    # 0x56b378
movl 0x1c(%r8), %eax
movl %eax, 0x4083b3(%rip)    # 0x56b37c
movl $0x40, %ecx
subl %ecx, %esp
shrl $0x2, %ecx
movl %esp, %edi
rep  movsl (%rsi), %es:(%rdi)
callq *-0x8(%rsp)
addl $0x40, %esp
movl %eax, 0x8(%r8)
retq
// File: /workspace/github_c_makefile_star2_O1/ughman[P]c2c/src/emu.c
// Function: EMU_RunInterrupts
void EMU_RunInterrupts(void)
{
	uint32_t pc = PCSX_RunInterrupts(0xDEADBEEF);
	while (pc != 0xDEADBEEF)
	{
		if (pc & 3)
			SDL_LogError(LOG_EMU,"Program counter is unaligned");
		pc = EMU_codemap[(pc & 0x1FFFFF) >> 2](pc);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0x82f0(%rip), %rax      # 0x16b2e8
movl $0xdeadbeef, %edi       # imm = 0xDEADBEEF
callq *(%rax)
cmpl $0xdeadbeef, %eax       # imm = 0xDEADBEEF
je 0x163040
movl %eax, %ebx
leaq 0x8351(%rip), %r15      # 0x16b360
leaq 0x3b4a(%rip), %r14      # 0x166b60
testb $0x3, %bl
je 0x16302a
movl $0x13, %edi
movq %r14, %rsi
xorl %eax, %eax
callq 0x10d0
movl %ebx, %eax
andl $0x1ffffc, %eax         # imm = 0x1FFFFC
movl %ebx, %edi
callq *(%r15,%rax,2)
movl %eax, %ebx
cmpl $0xdeadbeef, %eax       # imm = 0xDEADBEEF
jne 0x163016
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/ughman[P]c2c/src/gool_mips.cc
// Function: GOOL_MIPS_ExecuteFromZZ
void GOOL_MIPS_ExecuteFromZZ(uint32_t pc)
{
	struct goolenv env;
	env.pc = pc;
	env.pcfar = pc + 4;
	env.language = env.languagefar = GOOL_LANGUAGE_MIPS;
	RA = 0xDEADBEEF;
	while (env.pc != 0xDEADBEEF)
	{
		uint32_t instruction = EMU_ReadU32(env.pc);
		env.oldpc = env.pc;
		env.pc = env.pcfar;
		env.pcfar = env.pcfar + 4;
		env.language = env.languagefar;
		GOOL_MIPS_ExecuteOnce(&env,instruction);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edi, 0x10(%rsp)
addl $0x4, %edi
movl %edi, 0x14(%rsp)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x18(%rsp)
leaq 0x7ee3(%rip), %rax      # 0x16b350
movq (%rax), %rax
movl $0xdeadbeef, %ecx       # imm = 0xDEADBEEF
movl %ecx, 0x7c(%rax)
movl 0x10(%rsp), %edi
cmpl %ecx, %edi
je 0x1634da
leaq 0x7329(%rip), %r14      # 0x16a7b0
leaq -0x72(%rip), %r15       # 0x16341c
leaq 0xc(%rsp), %rbx
callq 0x1621d5
movl 0x10(%rsp), %ecx
movl 0x14(%rsp), %edx
movl %ecx, 0xc(%rsp)
movl %edx, 0x10(%rsp)
addl $0x4, %edx
movl %edx, 0x14(%rsp)
movl 0x1c(%rsp), %ecx
movl %ecx, 0x18(%rsp)
movl %eax, %ecx
shrl $0x1a, %ecx
movq (%r14,%rcx,8), %rcx
testq %rcx, %rcx
cmoveq %r15, %rcx
movq %rbx, %rdi
movl %eax, %esi
callq *%rcx
movl 0x10(%rsp), %edi
cmpl $0xdeadbeef, %edi       # imm = 0xDEADBEEF
jne 0x163493
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/ughman[P]c2c/src/ns.cc
// Function: NS_1254C
int32_t NS_1254C(emuptr<struct nspage> nspage)
{
	if (nspage->type == 0x1)
	{
		return -255;
	}
	if (nspage->magic != 0x1234)
	{
		return -18;
	}
	for (int32_t i = nspage->entrycount - 1;i >= 0;i--)
	{
		*(uint32_t *)&nspage->entries[i] += (uint32_t)nspage;
		for (int32_t ii = nspage->entries[i]->itemcount;ii >= 0;ii--)
		{
			*(uint32_t *)&nspage->entries[i]->items[ii] += (uint32_t)nspage->entries[i];
		}
	}
	*(uint32_t *)&nspage->entries[nspage->entrycount] += (uint32_t)nspage;
	return -255;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edi, %ebx
callq 0x162c24
movq %rax, %rcx
movl $0xffffff01, %eax       # imm = 0xFFFFFF01
cmpw $0x1, 0x2(%rcx)
je 0x163b98
movl %ebx, %edi
callq 0x162c24
movq %rax, %rcx
movl $0xffffffee, %eax       # imm = 0xFFFFFFEE
cmpw $0x1234, (%rcx)         # imm = 0x1234
jne 0x163b98
movl %ebx, %edi
callq 0x162c24
movslq 0x8(%rax), %r14
testq %r14, %r14
jle 0x163b79
movq %r14, %r15
decq %r14
movl %ebx, %edi
callq 0x162c24
addl %ebx, 0xc(%rax,%r15,4)
movl %ebx, %edi
callq 0x162c24
movl 0xc(%rax,%r15,4), %edi
callq 0x162c24
movslq 0xc(%rax), %r12
testq %r12, %r12
js 0x163b73
movl %ebx, %edi
callq 0x162c24
movl 0x10(%rax,%r14,4), %ebp
movl %ebx, %edi
callq 0x162c24
movl 0x10(%rax,%r14,4), %edi
callq 0x162c24
addl %ebp, 0x10(%rax,%r12,4)
leaq -0x1(%r12), %rax
testq %r12, %r12
movq %rax, %r12
jg 0x163b44
cmpq $0x1, %r15
jg 0x163b18
movl %ebx, %edi
callq 0x162c24
movq %rax, %r14
movl %ebx, %edi
callq 0x162c24
movslq 0x8(%rax), %rax
addl %ebx, 0x10(%r14,%rax,4)
movl $0xffffff01, %eax       # imm = 0xFFFFFF01
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ughman[P]c2c/src/core.cc
// Function: CORE_Main
int CORE_Main(void)
{
	EMU_Invoke(0x80049E6C,0);
	EMU_Write32(0x8005F43C,1);
	EMU_Invoke(0x80015738,0);
	CORE_Loop(0x3C);
	EMU_Invoke(0x800158C4,0);
	return 0;
}

// Assembly:
pushq %rax
movl $0x80049e6c, %edi       # imm = 0x80049E6C
xorl %esi, %esi
xorl %eax, %eax
callq 0x162cdf
movl $0x8005f43c, %edi       # imm = 0x8005F43C
movl $0x1, %esi
callq 0x162869
movl $0x80015738, %edi       # imm = 0x80015738
xorl %esi, %esi
xorl %eax, %eax
callq 0x162cdf
movl $0x3c, %edi
callq 0x163ec8
movl $0x800158c4, %edi       # imm = 0x800158C4
xorl %esi, %esi
xorl %eax, %eax
callq 0x162cdf
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/ughman[P]c2c/src/core.cc
// Function: CORE_Start
void CORE_Start(void)
{
	for (uint32_t i = 0x8005F53C;i < 0x8006F488;i += 4)
	{
		EMU_Write32(i,0);
	}
	V0 = EMU_ReadU32(0x8005F420);
	V0 = EMU_CheckedAdd(V0,-8);
	SP = V0 | 0x80000000;
	A1 = V0 - EMU_ReadU32(0x8005F41C) - 0x6F488;
	EMU_Write32(0x8005CDC4,A1);
	EMU_Write32(0x8005CDC0,0x8006F488);
	EMU_Write32(0x8005F5B8,RA); // $RA is garbage here
	GP = 0x8005F414;
	FP = SP;
	EMU_Invoke(0x8001144C,2,0x8006F48C,A1);
	CORE_Main();
	EMU_Break(1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0x8005f538, %ebx       # imm = 0x8005F538
addl $0x4, %ebx
movl %ebx, %edi
xorl %esi, %esi
callq 0x162869
cmpl $0x8006f484, %ebx       # imm = 0x8006F484
jb 0x1648a0
movl $0x8005f420, %edi       # imm = 0x8005F420
callq 0x1621d5
leaq 0x6a8b(%rip), %r14      # 0x16b350
movq (%r14), %rcx
leal -0x8(%rax), %ebx
movl %ebx, 0x8(%rcx)
movl %ebx, %eax
orl $0x80000000, %eax       # imm = 0x80000000
movl %eax, 0x74(%rcx)
movl $0x8005f41c, %edi       # imm = 0x8005F41C
callq 0x1621d5
subl %eax, %ebx
addl $0xfff90b78, %ebx       # imm = 0xFFF90B78
movq (%r14), %rax
movl %ebx, 0x14(%rax)
movl $0x8005cdc4, %edi       # imm = 0x8005CDC4
movl %ebx, %esi
callq 0x162869
movl $0x8005cdc0, %edi       # imm = 0x8005CDC0
movl $0x8006f488, %esi       # imm = 0x8006F488
callq 0x162869
movq (%r14), %rax
movl 0x7c(%rax), %esi
movl $0x8005f5b8, %edi       # imm = 0x8005F5B8
callq 0x162869
movq (%r14), %rax
movl $0x8005f414, 0x70(%rax) # imm = 0x8005F414
movl 0x14(%rax), %ecx
movl 0x74(%rax), %edx
movl %edx, 0x78(%rax)
movl $0x8001144c, %edi       # imm = 0x8001144C
movl $0x2, %esi
movl $0x8006f48c, %edx       # imm = 0x8006F48C
xorl %eax, %eax
callq 0x162cdf
callq 0x163e80
movl $0x1, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x162f4d
// File: /workspace/github_c_makefile_star2_O1/ughman[P]c2c/src/core.cc
// Function: CORE_VSync
void CORE_VSync(int32_t count,int32_t timeout)
{
	timeout <<= 15;
	while ((int32_t)EMU_ReadU32(0x8005DF30) < count)
	{
		if (!timeout--)
		{
			EMU_Invoke(0x80049424,1,0x80010CE0);
			EMU_Invoke(0x8004A054,1,0);
			EMU_Invoke(0x8004A900,2,3,0);
			break;
		}
		EMU_Cycle(20);
		EMU_RunInterrupts();
	}
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
movl $0x8005df30, %edi       # imm = 0x8005DF30
callq 0x1621d5
cmpl %ebp, %eax
jge 0x164995
shll $0xf, %ebx
notl %ebx
incl %ebx
je 0x16499c
movl $0x14, %edi
callq 0x162fe3
callq 0x162fec
movl $0x8005df30, %edi       # imm = 0x8005DF30
callq 0x1621d5
cmpl %ebp, %eax
jl 0x164974
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl $0x80049424, %edi       # imm = 0x80049424
movl $0x1, %esi
movl $0x80010ce0, %edx       # imm = 0x80010CE0
xorl %eax, %eax
callq 0x162cdf
movl $0x8004a054, %edi       # imm = 0x8004A054
movl $0x1, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x162cdf
movl $0x8004a900, %edi       # imm = 0x8004A900
movl $0x2, %esi
movl $0x3, %edx
xorl %ecx, %ecx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x162cdf
// File: /workspace/github_c_makefile_star2_O1/cinemast[P]sudoku/sudoku.c
// Function: findmoves
static
int
findmoves (void)
{
    int el;

    idx_possible = 0;
    for (el = 0; el < 9; ++el) {
        if (-1 == singles(el, idx_row, HINT_ROW)        ||
            -1 == singles(el, idx_column, HINT_COLUMN)  ||
            -1 == singles(el, idx_block, HINT_BLOCK)) {
            return -1;
        }
    }
    return idx_possible;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl $0x0, 0xc6e2(%rip)      # 0xf460
xorl %ebx, %ebx
leaq 0xf6(%rip), %r14        # 0x2e7d
leaq 0xf5(%rip), %r15        # 0x2e83
leaq 0xf4(%rip), %r12        # 0x2e89
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebx, %edi
movq %r14, %rsi
movl $0x1000000, %edx        # imm = 0x1000000
callq 0x5d09
cmpl $-0x1, %eax
je 0x2de3
movl %ebx, %edi
movq %r15, %rsi
movl $0x2000000, %edx        # imm = 0x2000000
callq 0x5d09
cmpl $-0x1, %eax
je 0x2de3
movl %ebx, %edi
movq %r12, %rsi
movl $0x4000000, %edx        # imm = 0x4000000
callq 0x5d09
cmpl $-0x1, %eax
je 0x2de3
incl %ebx
cmpl $0x9, %ebx
jne 0x2d9a
movl 0xc67d(%rip), %ebp      # 0xf460
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/cinemast[P]sudoku/sudoku.c
// Function: count_set_digits
static
void
count_set_digits (int el, int (*idx_fn)(int, int))
{
    int i;
    memset(counts, 0x00, sizeof(counts));
    for (i = 0; i < 9; ++i) {
        digits[i] = numset(board[(*idx_fn)(el, i)]);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
xorps %xmm0, %xmm0
movaps %xmm0, 0xc678(%rip)     # 0xf480
movaps %xmm0, 0xc661(%rip)     # 0xf470
movl $0x0, 0xc677(%rip)      # 0xf490
xorl %r14d, %r14d
leaq 0xc67d(%rip), %r15      # 0xf4a0
leaq 0xc646(%rip), %r12      # 0xf470
leaq 0xc7bf(%rip), %r13      # 0xf5f0
movl %ebp, %edi
movl %r14d, %esi
callq *%rbx
cltq
movl (%r15,%rax,4), %eax
movl $0x7, %ecx
xorl %esi, %esi
xorl %edx, %edx
btl %ecx, %eax
jae 0x2e50
incl %edx
jmp 0x2e54
incl (%rsi,%r12)
addq $0x4, %rsi
incl %ecx
cmpq $0x24, %rsi
jne 0x2e47
movl %edx, (%r13,%r14,4)
incq %r14
cmpq $0x9, %r14
jne 0x2e31
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq