LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/arachsys[P]containers/map.c
// Function: rangeitem
static char *rangeitem(char *range, unsigned *start, unsigned *length) {
  ssize_t skip;

  while (range && *range && strchr(",;", *range))
    range++;
  if (range == NULL || *range == '\0')
    return NULL;
  if (sscanf(range, "%u:%u%zn", start, length, &skip) < 2)
    errx(EXIT_FAILURE, "Invalid ID range '%s'", range);
  return range + skip;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x333a
movq %rdi, %rbx
movb (%rdi), %al
testb %al, %al
sete %bpl
je 0x333a
movq %rdx, %r14
movq %rsi, %r15
leaq 0xfa5(%rip), %r13       # 0x42b1
xorl %r12d, %r12d
movsbl %al, %esi
movl $0x3, %edx
movq %r13, %rdi
callq 0x2170
testq %rax, %rax
je 0x3334
movb 0x1(%rbx), %al
incq %rbx
testb %al, %al
sete %bpl
jne 0x330f
jmp 0x333d
testb $0x1, %bpl
je 0x334f
xorl %r12d, %r12d
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xff9(%rip), %rsi       # 0x434f
movq %rsp, %r8
movq %rbx, %rdi
movq %r15, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x2210
cmpl $0x1, %eax
jle 0x3377
addq (%rsp), %rbx
movq %rbx, %r12
jmp 0x333d
leaq 0xf36(%rip), %rsi       # 0x42b4
movl $0x1, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2110
// File: /workspace/github_c_makefile_star2_O1/arachsys[P]containers/map.c
// Function: validate
static void validate(char *range, unsigned first, unsigned count) {
  unsigned length, start;

  while ((range = rangeitem(range, &start, &length)))
    if (first < start + length && start < first + count) {
      if (first < start)
        validate(range, first, start - first);
      if (first + count > start + length)
        validate(range, start + length, first + count - start - length);
      return;
    }
  errx(EXIT_FAILURE, "Cannot map onto IDs that are not delegated to you");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebx
movl %esi, %ebp
leaq 0x8(%rsp), %rsi
leaq 0xc(%rsp), %rdx
callq 0x32e2
testq %rax, %rax
je 0x33ee
movq %rax, %r14
addl %ebp, %ebx
leaq 0x8(%rsp), %r15
leaq 0xc(%rsp), %r12
movl 0x8(%rsp), %edx
movl 0xc(%rsp), %eax
addl %edx, %eax
cmpl %ebp, %eax
setbe %al
cmpl %ebx, %edx
setae %cl
orb %al, %cl
je 0x3401
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x32e2
movq %rax, %r14
testq %rax, %rax
jne 0x33c0
leaq 0xf25(%rip), %rsi       # 0x431a
movl $0x1, %edi
xorl %eax, %eax
callq 0x2110
subl %ebp, %edx
jbe 0x340f
movq %r14, %rdi
movl %ebp, %esi
callq 0x338d
movl 0xc(%rsp), %esi
addl 0x8(%rsp), %esi
subl %esi, %ebx
jbe 0x3425
movq %r14, %rdi
movl %ebx, %edx
callq 0x338d
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/arachsys[P]containers/util.c
// Function: append
char *append(char **destination, const char *format, ...) {
  char *extra, *result;
  va_list args;

  va_start(args, format);
  if (vasprintf(&extra, format, args) < 0)
    err(EXIT_FAILURE, "asprintf");
  va_end(args);

  if (*destination == NULL) {
    *destination = extra;
    return extra;
  }

  if (asprintf(&result, "%s%s", *destination, extra) < 0)
      err(EXIT_FAILURE, "asprintf");
  free(*destination);
  free(extra);
  *destination = result;
  return result;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xe8, %rsp
movq %rdi, %rbx
leaq 0x30(%rsp), %rdi
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x3494
movaps %xmm0, 0x60(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm2, 0x80(%rsp)
movaps %xmm3, 0x90(%rsp)
movaps %xmm4, 0xa0(%rsp)
movaps %xmm5, 0xb0(%rsp)
movaps %xmm6, 0xc0(%rsp)
movaps %xmm7, 0xd0(%rsp)
leaq 0x10(%rsp), %rdx
movq %rdi, 0x10(%rdx)
leaq 0x100(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
movq %rsp, %r14
movq %r14, %rdi
callq 0x20a0
testl %eax, %eax
js 0x350d
movq (%rbx), %rdx
testq %rdx, %rdx
je 0x34fc
movq (%rsp), %rcx
leaq 0xe9d(%rip), %rsi       # 0x4375
leaq 0x8(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2260
testl %eax, %eax
js 0x350d
movq (%rbx), %rdi
callq 0x2040
movq (%rsp), %rdi
callq 0x2040
movq (%r14), %rax
movq %rax, (%rbx)
addq $0xe8, %rsp
popq %rbx
popq %r14
retq
leaq 0xe58(%rip), %rsi       # 0x436c
movl $0x1, %edi
xorl %eax, %eax
callq 0x2200
// File: /workspace/github_c_makefile_star2_O1/arachsys[P]containers/util.c
// Function: seal
void seal(char **argv, char **envp) {
  const int seals = F_SEAL_SEAL | F_SEAL_SHRINK | F_SEAL_GROW | F_SEAL_WRITE;
  int dst, src;
  ssize_t length;

  if ((src = open("/proc/self/exe", O_RDONLY)) < 0)
    err(EXIT_FAILURE, "open /proc/self/exe");
  if (fcntl(src, F_GET_SEALS) == seals) {
    close(src);
    return;
  }

  dst = memfd_create("/proc/self/exe", MFD_CLOEXEC | MFD_ALLOW_SEALING);
  if (dst < 0)
    err(EXIT_FAILURE, "memfd_create");

  while (length = sendfile(dst, src, NULL, BUFSIZ), length != 0)
    if (length < 0 && errno != EAGAIN && errno != EINTR)
      err(EXIT_FAILURE, "sendfile");
  close(src);

  if (fcntl(dst, F_ADD_SEALS, seals) < 0)
    err(EXIT_FAILURE, "fcntl F_ADD_SEALS");
  fexecve(dst, argv, envp);
  err(EXIT_FAILURE, "fexecve");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xe4b(%rip), %rdi       # 0x437f
xorl %esi, %esi
xorl %eax, %eax
callq 0x22a0
testl %eax, %eax
js 0x3567
movl %eax, %ebp
movl %eax, %edi
movl $0x40a, %esi            # imm = 0x40A
xorl %eax, %eax
callq 0x2080
cmpl $0xf, %eax
jne 0x3573
movl %ebp, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2140
leaq 0xe0c(%rip), %rsi       # 0x437a
jmp 0x3606
leaq 0xe05(%rip), %rdi       # 0x437f
movl $0x3, %esi
callq 0x2060
testl %eax, %eax
jns 0x3591
leaq 0xdff(%rip), %rsi       # 0x438e
jmp 0x3606
movl %eax, %r15d
movl $0x2000, %ecx           # imm = 0x2000
movl %r15d, %edi
movl %ebp, %esi
xorl %edx, %edx
callq 0x2250
testq %rax, %rax
je 0x35c9
testq %rax, %rax
jns 0x3594
callq 0x2050
movl (%rax), %eax
cmpl $0x4, %eax
je 0x3594
cmpl $0xb, %eax
je 0x3594
leaq 0xdd4(%rip), %rsi       # 0x439b
jmp 0x3606
movl %ebp, %edi
callq 0x2140
movl %r15d, %edi
movl $0x409, %esi            # imm = 0x409
movl $0xf, %edx
xorl %eax, %eax
callq 0x2080
testl %eax, %eax
jns 0x35f1
leaq 0xdb5(%rip), %rsi       # 0x43a4
jmp 0x3606
movl %r15d, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x21a0
leaq 0xdb0(%rip), %rsi       # 0x43b6
movl $0x1, %edi
xorl %eax, %eax
callq 0x2200
// File: /workspace/github_c_makefile_star2_O1/arachsys[P]containers/util.c
// Function: string
char *string(const char *format, ...) {
  char *result;
  va_list args;

  va_start(args, format);
  if (vasprintf(&result, format, args) < 0)
    err(EXIT_FAILURE, "asprintf");
  va_end(args);
  return result;
}

// Assembly:
subq $0xe8, %rsp
movq %rdi, %r10
leaq 0x30(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x3673
movaps %xmm0, 0x60(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm2, 0x80(%rsp)
movaps %xmm3, 0x90(%rsp)
movaps %xmm4, 0xa0(%rsp)
movaps %xmm5, 0xb0(%rsp)
movaps %xmm6, 0xc0(%rsp)
movaps %xmm7, 0xd0(%rsp)
leaq 0x10(%rsp), %rdx
movq %rdi, 0x10(%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
leaq 0x8(%rsp), %rdi
movq %r10, %rsi
callq 0x20a0
testl %eax, %eax
js 0x36b3
movq 0x8(%rsp), %rax
addq $0xe8, %rsp
retq
leaq 0xcb2(%rip), %rsi       # 0x436c
movl $0x1, %edi
xorl %eax, %eax
callq 0x2200
// File: /workspace/github_c_makefile_star2_O1/arachsys[P]containers/util.c
// Function: tmpdir
char *tmpdir(void) {
  char *dir;

  if (!(dir = strdup("/tmp/XXXXXX")))
    err(EXIT_FAILURE, "strdup");
  else if (!mkdtemp(dir))
    errx(EXIT_FAILURE, "Failed to create temporary directory");
  return dir;
}

// Assembly:
pushq %rbx
leaq 0xcf0(%rip), %rdi       # 0x43be
callq 0x2300
testq %rax, %rax
je 0x36ed
movq %rax, %rbx
movq %rax, %rdi
callq 0x2270
testq %rax, %rax
je 0x3700
movq %rbx, %rax
popq %rbx
retq
leaq 0xcd6(%rip), %rsi       # 0x43ca
movl $0x1, %edi
xorl %eax, %eax
callq 0x2200
leaq 0xcca(%rip), %rsi       # 0x43d1
movl $0x1, %edi
xorl %eax, %eax
callq 0x2110
// File: /workspace/github_c_makefile_star2_O1/arachsys[P]containers/util.c
// Function: waitforexit
void waitforexit(pid_t child) {
  int status;

  if (waitpid(child, &status, 0) < 0)
    err(EXIT_FAILURE, "waitpid");
  else if (WEXITSTATUS(status) != EXIT_SUCCESS)
    exit(WEXITSTATUS(status));
}

// Assembly:
pushq %rax
leaq 0x4(%rsp), %rsi
xorl %edx, %edx
callq 0x2290
testl %eax, %eax
js 0x372f
movzbl 0x5(%rsp), %edi
testl %edi, %edi
jne 0x3742
popq %rax
retq
leaq 0xcc0(%rip), %rsi       # 0x43f6
movl $0x1, %edi
xorl %eax, %eax
callq 0x2200
callq 0x22e0
// File: /workspace/github_c_makefile_star2_O1/arachsys[P]containers/util.c
// Function: waitforstop
void waitforstop(pid_t child) {
  int status;

  if (waitpid(child, &status, WUNTRACED) < 0)
    err(EXIT_FAILURE, "waitpid");
  if (!WIFSTOPPED(status))
    exit(WEXITSTATUS(status));
}

// Assembly:
pushq %rax
leaq 0x4(%rsp), %rsi
movl $0x2, %edx
callq 0x2290
testl %eax, %eax
js 0x3765
movl 0x4(%rsp), %eax
cmpb $0x7f, %al
jne 0x3778
popq %rax
retq
leaq 0xc8a(%rip), %rsi       # 0x43f6
movl $0x1, %edi
xorl %eax, %eax
callq 0x2200
movzbl %ah, %edi
callq 0x22e0
// File: /workspace/github_c_makefile_star2_O1/generot[P]VM-0/src/vm/entry.c
// Function: stack_push
bool stack_push(double val) {
    if(stack_ptr >= stack_sz) {
        ISSUE_ERROR("Stack overflow. Maximum segment size reached(%I64d)", 
            stack_sz);
    }

    code_seg[stack_ptr++] = val;
    return true;
}

// Assembly:
movq 0x2d61(%rip), %rax      # 0x40a0
movq 0x2d52(%rip), %rdi      # 0x4098
cmpq %rdi, %rax
jge 0x1368
movq 0x2d36(%rip), %rcx      # 0x4088
leaq 0x1(%rax), %rdx
movq %rdx, 0x2d43(%rip)      # 0x40a0
movsd %xmm0, (%rcx,%rax,8)
movl $0x1, %eax
retq
pushq %rax
callq 0x10e0
// File: /workspace/github_c_makefile_star2_O1/generot[P]VM-0/src/vm/entry.c
// Function: stack_pop
double stack_pop(void) {
    if(stack_ptr <= 0) {
        ISSUE_ERROR("Stack underflow. Out of bounds(stack pointer: %I64d).", stack_ptr);
    }

    double ret_val = code_seg[--stack_ptr];
    code_seg[stack_ptr] = 0;

    return ret_val;
}

// Assembly:
movq 0x2d2b(%rip), %rdi      # 0x40a0
testq %rdi, %rdi
jle 0x139c
movq 0x2d07(%rip), %rax      # 0x4088
leaq -0x1(%rdi), %rcx
movq %rcx, 0x2d14(%rip)      # 0x40a0
movsd -0x8(%rax,%rdi,8), %xmm0
movq $0x0, -0x8(%rax,%rdi,8)
retq
pushq %rax
callq 0x1104
// File: /workspace/github_c_makefile_star2_O1/generot[P]VM-0/src/vm/entry.c
// Function: main
int main(int argc, char **argv) {
    if(argc < 2) ISSUE_ERROR("Usage: ./vm <bytecode_file>");

    bcode_file bcode = read_bytecode(argv[1]);

    bool stack_size_specified = bcode.metadata.stack_size_spec == STACK_SIZE_SPECIFIED;

    size_t mem_sz = stack_size_specified
                    ? bcode.metadata.code_seg_sz + bcode.metadata.data_seg_sz
                    : DEFAULT_STACK_SIZE; 

    memory = calloc(mem_sz, sizeof(double));

    stack_sz = stack_size_specified
               ? bcode.metadata.code_seg_sz
               : CODE_SEG_SZ;

    data_seg = memory;
    code_seg = &memory[stack_size_specified ? bcode.metadata.data_seg_sz : DATA_SEG_SZ];

    size_s entry_point_addr = (size_s)bcode.metadata.entry_point_addr;
    size_s prog_sz = (size_s)bcode.metadata.program_size;
    
    for(size_s i = entry_point_addr; i < prog_sz; i++) {
        handle_instr(bcode.prog[i], data_seg, &i);
    }

    free(memory);
    free(bcode.prog);

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
cmpl $0x1, %edi
jle 0x1491
movq 0x8(%rsi), %rsi
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x12bc
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rcx
cmpl $0x0, 0x18(%rbx)
leaq (%rcx,%rax), %rdx
movl $0x800, %edi            # imm = 0x800
cmoveq %rdx, %rdi
movl $0x200, %r14d           # imm = 0x200
cmoveq %rax, %r14
movl $0x600, %r15d           # imm = 0x600
cmoveq %rcx, %r15
movl $0x8, %esi
callq 0x1070
movq %rax, 0x2c7d(%rip)      # 0x4080
movq %r14, 0x2c8e(%rip)      # 0x4098
movq %rax, 0x2c7f(%rip)      # 0x4090
leaq (%rax,%r15,8), %rax
movq %rax, 0x2c6c(%rip)      # 0x4088
movq 0x8(%rbx), %r14
movq 0x10(%rbx), %rax
movq %rax, 0x18(%rsp)
cmpq %r14, %rax
jge 0x146f
leaq 0x18(%rsp), %rbx
movq 0x20(%rsp), %rcx
leaq (%rax,%rax,2), %rax
movq 0x2c4d(%rip), %rdi      # 0x4090
movq 0x10(%rcx,%rax,8), %rdx
movq %rdx, 0x10(%rsp)
movups (%rcx,%rax,8), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rsi
callq 0x1498
movq 0x18(%rsp), %rax
incq %rax
movq %rax, 0x18(%rsp)
cmpq %r14, %rax
jl 0x1433
movq 0x2c0a(%rip), %rdi      # 0x4080
callq 0x1030
movq 0x20(%rsp), %rdi
callq 0x1030
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
callq 0x1128
nop
// File: /workspace/github_c_makefile_star2_O1/generot[P]VM-0/src/vm/handling.c
// Function: handle_syscall
void handle_syscall(instr in, double *data_segment) {
    switch(in.scall) {
    case SC_READ:
        scanf("%lf", &data_segment[in.addr]);
        break;
    case SC_WRITE:
        printf("%lf", stack_pop());
        break;
    case SC_WRITELN:
        printf("%lf\n", stack_pop());
        break;
    }
}

// Assembly:
pushq %rax
movl 0x18(%rsp), %eax
testl %eax, %eax
je 0x16c8
cmpl $0x1, %eax
je 0x16ba
cmpl $0x2, %eax
jne 0x16dc
leaq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
leaq (%rdi,%rax,8), %rsi
leaq 0xa46(%rip), %rdi       # 0x20f8
xorl %eax, %eax
popq %rcx
jmp 0x10a0
callq 0x136e
leaq 0xa36(%rip), %rdi       # 0x20fc
jmp 0x16d4
callq 0x136e
leaq 0xa24(%rip), %rdi       # 0x20f8
movb $0x1, %al
popq %rcx
jmp 0x1060
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/openshmem-org[P]openshmem-examples/c/arrput.c
// Function: main
int
main(void)
{
    int i;
    int nextpe;
    int me, npes;
    long src[N];
    long *dest;
    struct utsname u;
    int su;

    su = uname(&u);
    assert(su == 0);

    shmem_init();
    me = shmem_my_pe();
    npes = shmem_n_pes();

    for (i = 0; i < N; i += 1) {
        src[i] = (long) me;
    }

    dest = (long *) shmem_malloc(N * sizeof(*dest));

    nextpe = (me + 1) % npes;

    shmem_long_put(dest, src, N, nextpe);

    shmem_barrier_all();

    for (i = 0; i < N; i += 1) {
        printf("%d @ %s: dest[%d] = %ld\n", me, u.nodename, i, dest[i]);
    }

    shmem_free(dest);

    shmem_finalize();

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
leaq 0x42(%rsp), %rdi
callq 0x1050
testl %eax, %eax
jne 0x1300
callq 0x10c0
callq 0x1090
movl %eax, %ebx
callq 0x1070
movl %eax, %ebp
movslq %ebx, %rax
movdqa 0xdf3(%rip), %xmm0      # 0x2010
xorl %ecx, %ecx
movdqa 0xdf9(%rip), %xmm1      # 0x2020
movdqa 0xe01(%rip), %xmm2      # 0x2030
pshufd $0xf5, %xmm2, %xmm3     # xmm3 = xmm2[1,1,3,3]
movdqa 0xe04(%rip), %xmm4      # 0x2040
movdqa %xmm0, %xmm5
pxor %xmm1, %xmm5
movdqa %xmm2, %xmm6
pcmpgtd %xmm5, %xmm6
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
pcmpeqd %xmm3, %xmm5
pand %xmm6, %xmm5
movd %xmm5, %edx
testb $0x1, %dl
je 0x1266
movq %rax, (%rsp,%rcx,8)
pextrw $0x4, %xmm5, %edx
testb $0x1, %dl
je 0x1275
movq %rax, 0x8(%rsp,%rcx,8)
addq $0x2, %rcx
paddq %xmm4, %xmm0
cmpq $0x8, %rcx
jne 0x123c
movl $0x38, %edi
callq 0x10a0
movq %rax, %r14
movl %ebx, %eax
incl %eax
cltd
idivl %ebp
movl %edx, %ecx
movq %rsp, %rsi
movl $0x7, %edx
movq %r14, %rdi
callq 0x1040
callq 0x10b0
leaq 0x83(%rsp), %r15
leaq 0xdb3(%rip), %r12       # 0x2070
xorl %r13d, %r13d
movq (%r14,%r13,8), %r8
movq %r12, %rdi
movl %ebx, %esi
movq %r15, %rdx
movl %r13d, %ecx
xorl %eax, %eax
callq 0x1030
incq %r13
cmpq $0x7, %r13
jne 0x12c0
movq %r14, %rdi
callq 0x10d0
callq 0x1080
xorl %eax, %eax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd49(%rip), %rdi       # 0x2050
leaq 0xd4a(%rip), %rsi       # 0x2058
leaq 0xd4c(%rip), %rcx       # 0x2061
movl $0x4a, %edx
callq 0x1060
// File: /workspace/github_c_makefile_star2_O1/motet-a[P]libforks/tests/basic_pipe.c
// Function: main
int main() {
  libforks_ServerConn conn;

  main_process_pid = getpid();

  check(pipe(pipe_fds) == 0);

  check(libforks_start(&conn) == libforks_OK);

  check(close(pipe_fds[1]) == 0);

  check(libforks_fork(
    conn,
    NULL, // pid_ptr
    NULL, // socket_fd_ptr
    NULL, // exit_fd_ptr
    child_main
  ) == libforks_OK);

  // Make sure that we can read one and only one char written by the
  // child process
  char buffer[16];
  check(read(pipe_fds[0], buffer, sizeof buffer) == 1);
  check(buffer[0] == 'a');

  check(libforks_stop(conn) == libforks_OK);

  return 0;
}

// Assembly:
subq $0x28, %rsp
callq 0x1090
movl %eax, 0x4df1(%rip)      # 0x610c
leaq 0x4dee(%rip), %rdi      # 0x6110
callq 0x10e0
testl %eax, %eax
jne 0x139a
leaq 0x8(%rsp), %rdi
callq 0x184f
testl %eax, %eax
jne 0x13ab
movl 0x4dd5(%rip), %edi      # 0x6114
callq 0x10c0
testl %eax, %eax
jne 0x13bc
movq 0x8(%rsp), %rdi
leaq 0xe8(%rip), %r8         # 0x143c
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x22a3
testl %eax, %eax
jne 0x13cd
movl 0x4da7(%rip), %edi      # 0x6110
leaq 0x10(%rsp), %rsi
movl $0x10, %edx
callq 0x10f0
cmpq $0x1, %rax
jne 0x13de
cmpb $0x61, 0x10(%rsp)
jne 0x13ef
movq 0x8(%rsp), %rdi
callq 0x245e
testl %eax, %eax
jne 0x1400
xorl %eax, %eax
addq $0x28, %rsp
retq
leaq 0x1c63(%rip), %rdi      # 0x3004
movl $0x13, %esi
callq 0x1411
leaq 0x1c79(%rip), %rdi      # 0x302b
movl $0x15, %esi
callq 0x1411
leaq 0x1c8d(%rip), %rdi      # 0x3050
movl $0x17, %esi
callq 0x1411
leaq 0x1c94(%rip), %rdi      # 0x3068
movl $0x1f, %esi
callq 0x1411
leaq 0x1cc6(%rip), %rdi      # 0x30ab
movl $0x24, %esi
callq 0x1411
leaq 0x1ce3(%rip), %rdi      # 0x30d9
movl $0x25, %esi
callq 0x1411
leaq 0x1ce3(%rip), %rdi      # 0x30ea
movl $0x27, %esi
callq 0x1411
// File: /workspace/github_c_makefile_star2_O1/motet-a[P]libforks/tests/basic_pipe.c
// Function: child_main
static void child_main(libforks_ServerConn conn, int socket_fd) {
  check(libforks_free_conn(conn) == libforks_OK);
  check(close(pipe_fds[0]) == 0);
  check(socket_fd == -1);
  check(getpid() != main_process_pid);
  check(write(pipe_fds[1], "a", 1) == 1);
}

// Assembly:
pushq %rbx
movl %esi, %ebx
callq 0x248b
testl %eax, %eax
jne 0x1488
movl 0x4cc2(%rip), %edi      # 0x6110
callq 0x10c0
testl %eax, %eax
jne 0x1499
cmpl $-0x1, %ebx
jne 0x14aa
callq 0x1090
cmpl 0x4ca5(%rip), %eax      # 0x610c
je 0x14bb
movl 0x4ca5(%rip), %edi      # 0x6114
leaq 0x1d20(%rip), %rsi      # 0x3196
movl $0x1, %edx
callq 0x1080
cmpq $0x1, %rax
jne 0x14cc
popq %rbx
retq
leaq 0x1c9a(%rip), %rdi      # 0x3129
movl $0x7, %esi
callq 0x1411
leaq 0x1cb1(%rip), %rdi      # 0x3151
movl $0x8, %esi
callq 0x1411
leaq 0x1cb8(%rip), %rdi      # 0x3169
movl $0x9, %esi
callq 0x1411
leaq 0x1cb7(%rip), %rdi      # 0x3179
movl $0xa, %esi
callq 0x1411
leaq 0x1cc5(%rip), %rdi      # 0x3198
movl $0xb, %esi
callq 0x1411
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/converters/littcvt/littcvt.c
// Function: main
int main (int argc, char *argv[])
{
int i, k, bc;
unsigned char buf[FLPSIZ];
char *ppos, oname[256];
FILE *ifile, *ofile;

if ((argc < 2) || (argv[0] == NULL)) {
	printf ("Usage is: verb file [file...]\n");
	exit (0);  }

for (i = 1; i < argc; i++) {
	strcpy (oname, argv[i]);
        if (ppos = strrchr (oname, '.')) strcpy (ppos, ".new");
                else strcat (oname, ".new");
	ifile = fopen (argv[i], "rb");
	if (ifile == NULL) {
		printf ("Error opening file: %s\n", argv[i]);
		exit (0);  }
	ofile = fopen (oname, "wb");
	if (ofile == NULL) {
		printf ("Error opening file: %s\n", oname);
		exit (0);  }

	printf ("Processing file %s\n", argv[i]);
	fread (&bc, sizeof (int), 1, ifile);
	for (;;) {
		k = fread (buf, sizeof (char), FLPSIZ, ifile);
		if (k == 0) break;
		fwrite (buf, sizeof (char), k, ofile);  }
	fclose (ifile);
	fclose (ofile);
}

exit (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10118, %rsp          # imm = 0x10118
cmpl $0x2, %edi
jl 0x11eb
movq %rsi, %rbx
cmpq $0x0, (%rsi)
jne 0x11fe
leaq 0xe49(%rip), %rdi       # 0x203b
callq 0x1040
xorl %edi, %edi
callq 0x10b0
movl %edi, %eax
movq %rax, (%rsp)
movl $0x1, %ebp
leaq 0x10(%rsp), %r14
leaq 0x110(%rsp), %r15
movq (%rbx,%rbp,8), %rsi
movq %r14, %rdi
callq 0x1030
movq %r14, %rdi
movl $0x2e, %esi
callq 0x1090
testq %rax, %rax
je 0x1240
movb $0x0, 0x4(%rax)
movl $0x77656e2e, (%rax)     # imm = 0x77656E2E
jmp 0x1255
movq %r14, %rdi
callq 0x1070
movl $0x77656e2e, 0x10(%rsp,%rax) # imm = 0x77656E2E
movb $0x0, 0x14(%rsp,%rax)
movq (%rbx,%rbp,8), %rdi
leaq 0xda9(%rip), %rsi       # 0x2009
callq 0x10a0
testq %rax, %rax
je 0x1305
movq %rax, %r12
movq %r14, %rdi
leaq 0xda9(%rip), %rsi       # 0x2024
callq 0x10a0
testq %rax, %rax
je 0x1312
movq %rax, %r13
movq (%rbx,%rbp,8), %rsi
leaq 0xd90(%rip), %rdi       # 0x2027
xorl %eax, %eax
callq 0x1080
movl $0x4, %esi
movl $0x1, %edx
leaq 0xc(%rsp), %rdi
movq %r12, %rcx
callq 0x1050
movl $0x1, %esi
movl $0x10000, %edx          # imm = 0x10000
movq %r15, %rdi
movq %r12, %rcx
callq 0x1050
testl %eax, %eax
je 0x12e3
movslq %eax, %rdx
movl $0x1, %esi
movq %r15, %rdi
movq %r13, %rcx
callq 0x10c0
jmp 0x12b5
movq %r12, %rdi
callq 0x1060
movq %r13, %rdi
callq 0x1060
incq %rbp
cmpq (%rsp), %rbp
jne 0x1216
jmp 0x11f7
movq (%rbx,%rbp,8), %rsi
leaq 0xcfc(%rip), %rdi       # 0x200c
jmp 0x131e
leaq 0xcf3(%rip), %rdi       # 0x200c
leaq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x1080
jmp 0x11f7
// File: /workspace/github_c_makefile_star2_O1/inflex[P]ripMIME/ripOLE/pldstr.c
// Function: PLD_strncat
char *PLD_strncat( char *dst, const char *src, size_t len )
{
	char *dp = dst;
	const char *sp = src;
	size_t cc;

	if (len == 0) return dst;

	len--;

	// Locate the end of the current string.
	cc = 0;
	while ((*dp)&&(cc < len)) { dp++; cc++; }

	// If we have no more buffer space, then return the destination

	if (cc >= len) return dst;

	// While we have more source, and there's more char space left in the buffer

	while ((*sp)&&(cc < len))
	{
		cc++;
		*dp = *sp;
		dp++;
		sp++;
	}

	// Terminate dst, as a gaurantee of string ending.

	*dp = '\0';

	return dst;
}

// Assembly:
movq %rdi, %rax
testq %rdx, %rdx
je 0x409c
cmpb $0x0, (%rax)
sete %cl
decq %rdx
setne %r8b
sete %dil
orb %cl, %dil
jne 0x4052
xorl %ecx, %ecx
movq %rcx, %rdi
incq %rcx
cmpq %rdx, %rcx
setb %r8b
cmpb $0x0, 0x1(%rax,%rdi)
je 0x404a
cmpq %rdx, %rcx
jb 0x4031
movq %rcx, %rdi
addq %rax, %rdi
jmp 0x4057
xorl %ecx, %ecx
movq %rax, %rdi
testb %r8b, %r8b
je 0x409c
movb (%rsi), %r8b
testb %r8b, %r8b
setne %r9b
cmpq %rdx, %rcx
setb %r10b
andb %r9b, %r10b
cmpb $0x1, %r10b
jne 0x4099
incq %rcx
incq %rsi
movb %r8b, (%rdi)
incq %rdi
movb (%rsi), %r8b
testb %r8b, %r8b
je 0x4099
leaq 0x1(%rcx), %r9
incq %rsi
cmpq %rdx, %rcx
movq %r9, %rcx
jb 0x407c
movb $0x0, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/inflex[P]ripMIME/ripOLE/pldstr.c
// Function: PLD_strncate
char *PLD_strncate( char *dst, const char *src, size_t len, char *endpoint )
{
	char *dp = dst;
	const char *sp = src;
	size_t cc = 0;

	if (len == 0) return dst;

	len--;

	// If endpoint does not relate correctly, then force manual detection
	// of the endpoint.

	if ((!endpoint)||(endpoint == dst)||((endpoint -dst +1)>(int)len))
	{
		// Locate the end of the current string.
		cc = 0;
		while ((*dp != '\0')&&(cc < len)) { dp++; cc++; }
	}
	else {
		cc = endpoint -dst +1;
		dp = endpoint;
	}

	// If we have no more buffer space, then return the destination

	if (cc >= len) return dst;

	// While we have more source, and there's more char space left in the buffer

	while ((*sp)&&(cc < len))
	{
		cc++;
		*dp = *sp;
		dp++;
		sp++;
	}

	// Terminate dst, as a gaurantee of string ending.

	*dp = '\0';

	return dst;
}

// Assembly:
movq %rdi, %rax
testq %rdx, %rdx
je 0x4133
decq %rdx
testq %rcx, %rcx
sete %r8b
movq %rcx, %rdi
subq %rax, %rdi
sete %r9b
orb %r8b, %r9b
jne 0x40cf
movslq %edx, %r8
cmpq %r8, %rdi
jge 0x40cf
incq %rdi
jmp 0x4100
cmpb $0x0, (%rax)
sete %cl
testq %rdx, %rdx
sete %dil
orb %cl, %dil
jne 0x40fb
xorl %edi, %edi
cmpb $0x0, 0x1(%rax,%rdi)
leaq 0x1(%rdi), %rdi
je 0x40f3
cmpq %rdx, %rdi
jb 0x40e3
movq %rdi, %rcx
addq %rax, %rcx
jmp 0x4100
xorl %edi, %edi
movq %rax, %rcx
cmpq %rdx, %rdi
jae 0x4133
movb (%rsi), %r8b
testb %r8b, %r8b
je 0x4130
incq %rdi
incq %rsi
movb %r8b, (%rcx)
incq %rcx
movb (%rsi), %r8b
testb %r8b, %r8b
je 0x4130
leaq 0x1(%rdi), %r9
incq %rsi
cmpq %rdx, %rdi
movq %r9, %rdi
jb 0x4113
movb $0x0, (%rcx)
retq
// File: /workspace/github_c_makefile_star2_O1/inflex[P]ripMIME/ripOLE/pldstr.c
// Function: PLD_strncasecmp
int PLD_strncasecmp( char *s1, char *s2, int n )
{
	char *ds1 = s1, *ds2 = s2;
	char c1, c2;
	int result = 0;

	while(n > 0)
	{
		c1 = tolower(*ds1);
		c2 = tolower(*ds2);

		if (c1 == c2)
		{
			n--;
			ds1++;
			ds2++;
		}
		else
		{
			result = c2 - c1;
			n = 0;
		}

	}

	return result;

}

// Assembly:
testl %edx, %edx
jle 0x4179
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x11d0
movq (%rax), %rcx
xorl %eax, %eax
movsbq (%r14), %rdx
movsbl (%rcx,%rdx,4), %esi
movsbq (%rbx), %rdx
movsbl (%rcx,%rdx,4), %edx
subl %esi, %edx
jne 0x416c
decl %ebp
incq %r14
incq %rbx
jmp 0x4170
xorl %ebp, %ebp
movl %edx, %eax
testl %ebp, %ebp
jg 0x414e
popq %rbx
popq %r14
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/inflex[P]ripMIME/ripOLE/pldstr.c
// Function: PLD_strreplace
char *PLD_strreplace( char **source, char *searchfor, char *replacewith, int replacenumber )
{
	struct PLD_strreplace replace_details;
	char *tmp_source;

	replace_details.source = *source;
	replace_details.searchfor = searchfor;
	replace_details.replacewith = replacewith;
	replace_details.replacenumber = replacenumber;
	replace_details.preexist = NULL;
	replace_details.postexist = NULL;
	replace_details.insensitive = 0;

	tmp_source = PLD_strreplace_general( &replace_details );

	if (tmp_source != *source) *source = tmp_source;

	return *source;
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movq (%rdi), %rax
movq %rsp, %rdi
movq %rax, (%rdi)
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movl %ecx, 0x28(%rdi)
movl $0x0, 0x2c(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rdi)
callq 0x4238
cmpq (%rbx), %rax
je 0x4677
movq %rax, (%rbx)
movq (%rbx), %rax
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/inflex[P]ripMIME/ripOLE/pldstr.c
// Function: PLD_dprintf
char *PLD_dprintf(const char *format, ...) 
{
	int n, size = 1024; // Assume we don't need more than 1K to start with
	char *p;
	va_list ap;

	// Attempt to allocate and then check 
	p = malloc(size *sizeof(char));
	if (p == NULL) return NULL;

	while (1) 
	{
		// Attempt to print out string out into the allocated space
		va_start(ap, format);
		n = vsnprintf (p, size, format, ap);
		va_end(ap);

		// If things went well, then return the new string
		if ((n > -1) && (n < size)) return p;

		// If things didn't go well, then we have to allocate more space
		//	based on which glibc we're using ( fortunately, the return codes
		//	tell us which glibc is being used! *phew*
		//
		// If n > -1, then we're being told precisely how much space we need
		// else (older glibc) we have to just guess again ...

		if (n > -1) size = n+1; // Allocate precisely what is needed
		else size *= 2;  // Double the amount allocated, note, we could just increase by 1K, but if we have a long string, we'd end up using a lot of realloc's

		// We could just realloc 'blind', but that'd be wrong and potentially cause a DoS, so
		//	instead, we'll be good and first attempt to realloc to a temp variable then, if all
		//	is well, we go ahead and update
		if (1)
		{
			char *tmp_p;

			tmp_p = realloc(p, size);
			if (tmp_p == NULL){ if (p != NULL) free(p); return NULL; }
			else p = tmp_p;
		}
	}

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x46e8
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movl $0x400, %edi            # imm = 0x400
callq 0x1110
testq %rax, %rax
je 0x477e
movq %rax, %r14
movl $0x400, %r15d           # imm = 0x400
movabsq $0x3000000008, %rbp     # imm = 0x3000000008
movq %rsp, %r12
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %rbp, (%rsp)
movl %r15d, %esi
movq %r14, %rdi
movq %rbx, %rdx
movq %r12, %rcx
callq 0x1090
testl %eax, %eax
setns %cl
cmpl %r15d, %eax
setl %dl
testb %dl, %cl
jne 0x4781
leal 0x1(%rax), %ecx
addl %r15d, %r15d
testl %eax, %eax
cmovnsl %ecx, %r15d
movq %r14, %rdi
movq %r15, %rsi
callq 0x1160
movq %rax, %r13
testq %rax, %rax
jne 0x4776
movq %r14, %rdi
callq 0x1030
movq %r14, %rax
movq %rax, %r14
testq %r13, %r13
jne 0x4711
xorl %r14d, %r14d
movq %r14, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/inflex[P]ripMIME/ripOLE/ripole.c
// Function: ROLE_set_parameters
int ROLE_set_parameters( struct ripOLE_object *role, struct OLE_object *ole )
{
	if(role->debug == 1)
	{
		OLE_set_debug(ole, OLE_DEBUG_NORMAL);
	} 

	if (role->verbose == 1)
	{
		OLE_set_verbose(ole, OLE_VERBOSE_NORMAL);
	}

	if (role->save_unknown_streams == 1)
	{
		OLE_set_save_unknown_streams(ole, 1);
	}

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x1, (%rdi)
jne 0x4b36
movq %rbx, %rdi
movl $0x1, %esi
callq 0x13dc
cmpl $0x1, 0x4(%r14)
jne 0x4b4a
movq %rbx, %rdi
movl $0x1, %esi
callq 0x13bf
cmpl $0x1, 0x8(%r14)
jne 0x4b5e
movq %rbx, %rdi
movl $0x1, %esi
callq 0x140a
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/pipde[P]deos-songlib/utils/rra/wav2rra.c
// Function: main
int
main(int argc,char **argv)
    {
    int argIndex = 1;

    argIndex = processOptions(argc,argv);

    if (argc-argIndex == 1)
        {
        filter(OpenFile(argv[argIndex],"r"),stdout);
        }
    else if (argc-argIndex >= 2 && strstr(argv[argIndex+1],".wav") != 0)
        {
        batch(argc-argIndex,argv+argIndex);
        }
    else if (argc-argIndex == 2)
        {
        filter(OpenFile(argv[argIndex],"r"),OpenFile(argv[argIndex+1],"w"));
        }
    else
        {
        printf("usage: wav2rra <input wav file> [<output rra file>]\n");
        printf("       wav2rra <input wav file1> <input wav file2> ...\n");
        exit(-1);
        }

    return 0;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
movl $0x1, %r12d
cmpl $0x2, %edi
jl 0x1dfa
movl $0x1, %r12d
movslq %r12d, %rax
movq (%rbx,%rax,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x1dfa
movb 0x2(%rsi), %r13b
testb %r13b, %r13b
je 0x1d84
leaq 0x2(%rsi), %rdi
jmp 0x1d89
movq 0x8(%rbx,%rax,8), %rdi
movzbl 0x1(%rsi), %eax
cmpl $0x73, %eax
jg 0x1da6
cmpl $0x61, %eax
jne 0x1dbb
callq 0x1090
movsd %xmm0, 0x63cc(%rip)     # 0x8170
jmp 0x1db6
cmpl $0x74, %eax
jne 0x1dc5
callq 0x1210
movl %eax, 0x63b2(%rip)      # 0x8168
movb $0x1, %r15b
jmp 0x1ddf
cmpl $0x68, %eax
jne 0x1dce
jmp 0x1eb6
cmpl $0x76, %eax
je 0x1e98
xorl %r15d, %r15d
leaq 0x32e5(%rip), %rdi      # 0x50bd
xorl %eax, %eax
callq 0x2094
testb %r13b, %r13b
sete %al
andb %r15b, %al
movzbl %al, %eax
addl %eax, %r12d
incl %r12d
cmpl %r14d, %r12d
jl 0x1d65
subl %r12d, %r14d
cmpl $0x1, %r14d
jne 0x1e25
movslq %r12d, %rax
movq (%rbx,%rax,8), %rdi
leaq 0x39f4(%rip), %rsi      # 0x5805
callq 0x212e
movq 0x61bb(%rip), %rcx      # 0x7fd8
movq (%rcx), %rsi
movq %rax, %rdi
jmp 0x1e74
movslq %r12d, %r15
jle 0x1e40
movq 0x8(%rbx,%r15,8), %rdi
leaq 0x31d3(%rip), %rsi      # 0x5009
callq 0x1270
testq %rax, %rax
jne 0x1e8a
cmpl $0x2, %r14d
jne 0x1ed2
movq (%rbx,%r15,8), %rdi
leaq 0x39b0(%rip), %rsi      # 0x5805
callq 0x212e
movq %rax, %r14
movq 0x8(%rbx,%r15,8), %rdi
leaq 0x31a5(%rip), %rsi      # 0x500e
callq 0x212e
movq %r14, %rdi
movq %rax, %rsi
callq 0x1ef4
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq (%rbx,%r15,8), %rsi
movl %r14d, %edi
callq 0x12a0
jmp 0x1e79
movq 0x62b9(%rip), %rsi      # 0x8158
movq 0x62ba(%rip), %rdx      # 0x8160
leaq 0x3201(%rip), %rdi      # 0x50ae
xorl %eax, %eax
callq 0x10c0
jmp 0x1ecb
movq 0x629b(%rip), %rsi      # 0x8158
leaq 0x31bc(%rip), %rdi      # 0x5080
xorl %eax, %eax
callq 0x10c0
xorl %edi, %edi
callq 0x1230
leaq 0x31fe(%rip), %rdi      # 0x50d7
callq 0x1070
leaq 0x3226(%rip), %rdi      # 0x510b
callq 0x1070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1230
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]egap/tools/lib/utils.c
// Function: bwt
int bwt(int_t sa, unsigned char* str){

    int c;

    if(sa==0 || str[sa-1]==1)
      c = 0;
    else
      c = str[sa-1]-1;

return c;
}

// Assembly:
xorl %eax, %eax
testl %edi, %edi
je 0x435d
movslq %edi, %rcx
movzbl -0x1(%rsi,%rcx), %ecx
cmpl $0x1, %ecx
je 0x435d
decl %ecx
movl %ecx, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O1/Hazematman[P]BSP-Renderer/bsp.c
// Function: renderAllBspFaces
void renderAllBspFaces(Bsp *bsp){
	glBindVertexArray(bsp->vaoId);
	for(int f=0; f < bsp->numFaces; f++){
		Face *face = &bsp->faces[f];
		if(face->glId == 0){
			continue;
		}

		glBindBuffer(GL_ARRAY_BUFFER, face->glId);

		Vert *vert = NULL;
		glVertexAttribPointer(
				0,
				3,
				GL_FLOAT,
				GL_FALSE,
				sizeof(Vert),
				&vert->position);
		glVertexAttribPointer(
				1,
				2,
				GL_FLOAT,
				GL_FALSE,
				sizeof(Vert),
				&vert->texCoord);

		bindTexture(face->texture);

		glDrawArrays(GL_TRIANGLE_FAN, 0, face->numVerts);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x8f9a(%rip), %rax      # 0xa820
movl (%rdi), %edi
callq *(%rax)
cmpl $0x0, 0x28(%rbx)
jle 0x192a
movl $0x10, %r14d
xorl %r15d, %r15d
leaq 0x8f0c(%rip), %r13      # 0xa7b0
leaq 0x8ab5(%rip), %rbp      # 0xa360
movq 0x30(%rbx), %r12
movl -0x10(%r12,%r14), %esi
testl %esi, %esi
je 0x191a
movl $0x8892, %edi           # imm = 0x8892
leaq 0x8b7c(%rip), %rax      # 0xa440
callq *(%rax)
xorl %edi, %edi
movl $0x3, %esi
movl $0x1406, %edx           # imm = 0x1406
xorl %ecx, %ecx
movl $0x20, %r8d
xorl %r9d, %r9d
callq *(%r13)
movl $0xc, %r9d
movl $0x1, %edi
movl $0x2, %esi
movl $0x1406, %edx           # imm = 0x1406
xorl %ecx, %ecx
movl $0x20, %r8d
callq *(%r13)
movq -0x8(%r12,%r14), %rdi
callq 0x5221
movl (%r12,%r14), %edx
movl $0x6, %edi
xorl %esi, %esi
callq *(%rbp)
incq %r15
movslq 0x28(%rbx), %rax
addq $0x20, %r14
cmpq %rax, %r15
jl 0x18ab
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Hazematman[P]BSP-Renderer/bsp.c
// Function: freeBsp
void freeBsp(Bsp *bsp){
	for(int i=0; i < bsp->numTextures; i++){
		freeTex(bsp->textures[i]);
	}
	for(int i=0; i < bsp->numFaces; i++){
		free(bsp->faces[i].verts);
	}
	free(bsp->faces);
	free(bsp->textures);
	free(bsp->verts);
	free(bsp->planes);
	free(bsp->texInfo);
	free(bsp);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x4(%rdi)
jle 0x1963
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x5235
incq %r14
movslq 0x4(%rbx), %rax
cmpq %rax, %r14
jl 0x194a
cmpl $0x0, 0x28(%rbx)
jle 0x198f
movl $0x18, %r14d
xorl %r15d, %r15d
movq 0x30(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x1150
incq %r15
movslq 0x28(%rbx), %rax
addq $0x20, %r14
cmpq %rax, %r15
jl 0x1972
movq 0x30(%rbx), %rdi
callq 0x1150
movq 0x8(%rbx), %rdi
callq 0x1150
movq 0x10(%rbx), %rdi
callq 0x1150
movq 0x20(%rbx), %rdi
callq 0x1150
movq 0x18(%rbx), %rdi
callq 0x1150
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1150
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/Hazematman[P]BSP-Renderer/cam.c
// Function: makeCam
Cam *makeCam(){
	Cam *cam = malloc(sizeof(Cam));
	
	cam->pos = (vec3Float){0,0,0};
	cam->fwd = (vec3Float){0,0,-1};
	cam->angle = (vec3Float){0,0,0};
	cam->right = (vec3Float){1,0,0};
	cam->up = (vec3Float){0,1,0};
	
	return cam;
}

// Assembly:
pushq %rax
movl $0x3c, %edi
callq 0x1160
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movl $0x0, 0x10(%rax)
movss 0x466c(%rip), %xmm0     # 0x6058
movups %xmm0, 0x14(%rax)
movss 0x4664(%rip), %xmm0     # 0x605c
movups %xmm0, 0x24(%rax)
movq $0x3f800000, 0x34(%rax) # imm = 0x3F800000
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/Hazematman[P]BSP-Renderer/cam.c
// Function: turnCam
void turnCam(Cam *cam, float anglex, float angley){
	cam->angle.x -= anglex;
	cam->angle.y += angley;
	cam->angle.x += PI/2.0f;
	if(cam->angle.x >= PI){
		cam->angle.x = PI;
	} else if(cam->angle.x <= 0){
		cam->angle.x = 0;
	}

	if(cam->angle.y > 2.0*PI){
		cam->angle.y = fabs(cam->angle.y)-2.0f*PI;
	} else if(cam->angle.y < -2.0f*PI){
		cam->angle.y = -(fabs(cam->angle.y)-2.0f*PI);
	}
	cam->angle.x -= PI/2.0f;
	updateLookAt(cam);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movss 0x18(%rdi), %xmm2
addss 0x1c(%rdi), %xmm1
subss %xmm0, %xmm2
movss %xmm1, 0x1c(%rdi)
addss 0x45d6(%rip), %xmm2     # 0x6060
movss %xmm2, 0x18(%rdi)
movss 0x45cd(%rip), %xmm0     # 0x6064
ucomiss %xmm0, %xmm2
jae 0x1aa4
xorps %xmm0, %xmm0
ucomiss %xmm2, %xmm0
jb 0x1aa9
movss %xmm0, 0x18(%rbx)
ucomiss 0x45b8(%rip), %xmm1     # 0x6068
jbe 0x1abc
addss 0x45b2(%rip), %xmm1     # 0x606c
jmp 0x1adf
movss 0x45a8(%rip), %xmm0     # 0x606c
ucomiss %xmm1, %xmm0
jbe 0x1ae4
andps 0x45b0(%rip), %xmm1     # 0x6080
addss 0x4594(%rip), %xmm1     # 0x606c
xorps 0x4531(%rip), %xmm1     # 0x6010
movss %xmm1, 0x1c(%rbx)
movss 0x18(%rbx), %xmm0
addss 0x457f(%rip), %xmm0     # 0x6070
addss 0x4567(%rip), %xmm0     # 0x6060
movss %xmm0, 0x18(%rbx)
callq 0x10d0
movss %xmm0, 0x4(%rsp)
movss 0x1c(%rbx), %xmm0
callq 0x10a0
mulss 0x4(%rsp), %xmm0
leaq 0xc(%rbx), %r14
movss %xmm0, 0xc(%rbx)
movss 0x18(%rbx), %xmm0
callq 0x10a0
movss %xmm0, 0x10(%rbx)
movss 0x18(%rbx), %xmm0
callq 0x10d0
movss %xmm0, 0x4(%rsp)
movss 0x1c(%rbx), %xmm0
callq 0x10d0
xorps 0x44be(%rip), %xmm0     # 0x6010
mulss 0x4(%rsp), %xmm0
movss %xmm0, 0x14(%rbx)
movss 0x450b(%rip), %xmm0     # 0x6070
addss 0x18(%rbx), %xmm0
movss %xmm0, 0x18(%rbx)
leaq 0x24(%rbx), %rdi
addq $0x30, %rbx
movq %r14, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x53be
// File: /workspace/github_c_makefile_star2_O1/Hazematman[P]BSP-Renderer/gl/gl_3.c
// Function: ogl_LoadFunctions
int ogl_LoadFunctions()
{
	int numFailed = 0;
	ClearExtensionVars();
	
	_ptrc_glGetIntegerv = (void (CODEGEN_FUNCPTR *)(GLenum, GLint *))IntGetProcAddress("glGetIntegerv");
	if(!_ptrc_glGetIntegerv) return ogl_LOAD_FAILED;
	_ptrc_glGetStringi = (const GLubyte * (CODEGEN_FUNCPTR *)(GLenum, GLuint))IntGetProcAddress("glGetStringi");
	if(!_ptrc_glGetStringi) return ogl_LOAD_FAILED;
	
	ProcExtsFromExtList();
	numFailed = Load_Version_3_3();
	
	if(numFailed == 0)
		return ogl_LOAD_SUCCEEDED;
	else
		return ogl_LOAD_SUCCEEDED + numFailed;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0x4085(%rip), %rdi      # 0x615d
callq 0x1120
movq %rax, 0x816c(%rip)      # 0xa250
xorl %ebx, %ebx
testq %rax, %rax
je 0x2141
leaq 0x4079(%rip), %rdi      # 0x616b
callq 0x1120
movq %rax, 0x881a(%rip)      # 0xa918
testq %rax, %rax
je 0x2141
leaq 0xc(%rsp), %rbx
movl $0x0, (%rbx)
movl $0x821d, %edi           # imm = 0x821D
movq %rbx, %rsi
callq *0x8134(%rip)           # 0xa250
cmpl $0x0, (%rbx)
jle 0x2138
xorl %ebx, %ebx
movl $0x1f03, %edi           # imm = 0x1F03
movl %ebx, %esi
callq *0x87e8(%rip)           # 0xa918
incl %ebx
cmpl 0xc(%rsp), %ebx
jl 0x2123
callq 0x2149
movl %eax, %ebx
incl %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/Hazematman[P]BSP-Renderer/gl/gl_3.c
// Function: ogl_IsVersionGEQ
int ogl_IsVersionGEQ(int majorVersion, int minorVersion)
{
	if(g_major_version == 0)
		GetGLVersion();
	
	if(majorVersion < g_major_version) return 1;
	if(majorVersion > g_major_version) return 0;
	if(minorVersion <= g_minor_version) return 1;
	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
cmpl $0x0, 0x6775(%rip)      # 0xac60
jne 0x4511
leaq 0x676c(%rip), %rsi      # 0xac60
movl $0x821b, %edi           # imm = 0x821B
callq *0x5d51(%rip)           # 0xa250
leaq 0x675e(%rip), %rsi      # 0xac64
movl $0x821c, %edi           # imm = 0x821C
callq *0x5d3f(%rip)           # 0xa250
movl 0x6749(%rip), %ecx      # 0xac60
movl $0x1, %eax
cmpl %ebp, %ecx
jg 0x4531
xorl %eax, %eax
cmpl %ebp, %ecx
jl 0x4531
xorl %eax, %eax
cmpl %ebx, 0x6736(%rip)      # 0xac64
setge %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Hazematman[P]BSP-Renderer/gutils.c
// Function: createShader
void createShader(ShaderPrg *prg, const char *vs, const char *fs){
	char *vsData = readFile(vs);
	char *fsData = readFile(fs);

	prg->vs = compileShader(vsData, GL_VERTEX_SHADER);
	prg->fs = compileShader(fsData, GL_FRAGMENT_SHADER);

	linkPrg(prg);

	free(vsData);
	free(fsData);
	return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x4598
movq %rax, %r15
movq %rbx, %rdi
callq 0x4598
movq %rax, %rbx
movq %r15, %rdi
movl $0x8b31, %esi           # imm = 0x8B31
callq 0x4622
movl %eax, 0x4(%r14)
movq %rbx, %rdi
movl $0x8b30, %esi           # imm = 0x8B30
callq 0x4622
movl %eax, 0x8(%r14)
movq %r14, %rdi
callq 0x46a8
movq %r15, %rdi
callq 0x1150
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1150
// File: /workspace/github_c_makefile_star2_O1/Hazematman[P]BSP-Renderer/gutils.c
// Function: readFile
static char *readFile(const char *filename){
	FILE *fp = fopen(filename, "r");
	if(fp == NULL){
		printf("Could not open file: %s\n", filename);
		return NULL;
	}

	// Get size of file
	fseek(fp, 0, SEEK_END);
	int fileSize = ftell(fp);
	fseek(fp, 0, SEEK_SET);

	char *data = malloc(fileSize);
	fread(data, 1, fileSize, fp);
	fclose(fp);
	return data;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r15
leaq 0x1be3(%rip), %rsi      # 0x618a
callq 0x1140
testq %rax, %rax
je 0x4605
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x1130
movq %rbx, %rdi
callq 0x1030
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1130
movslq %r14d, %r15
movq %r15, %rdi
callq 0x1160
movq %rax, %r14
movl $0x1, %esi
movq %rax, %rdi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x11b0
movq %rbx, %rdi
callq 0x1100
jmp 0x4619
leaq 0x3357(%rip), %rdi      # 0x7963
xorl %r14d, %r14d
movq %r15, %rsi
xorl %eax, %eax
callq 0x1040
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Hazematman[P]BSP-Renderer/gutils.c
// Function: compileShader
GLuint compileShader(const char *shader, GLenum type){
	GLuint s = glCreateShader(type);
	glShaderSource(s, 1, &shader, NULL);
	glCompileShader(s);

	// Check if shader compiled okay
	GLint okay = GL_FALSE;
	glGetShaderiv(s, GL_COMPILE_STATUS, &okay);
	if(okay == GL_FALSE){
		printf("Error compiling shader\n");
		printErrLog(s);
		return 0;
	}

	return s;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x8(%rsp), %r14
movq %rdi, (%r14)
leaq 0x5ebf(%rip), %rax      # 0xa4f8
movl %esi, %edi
callq *(%rax)
movl %eax, %ebp
leaq 0x5f82(%rip), %rax      # 0xa5c8
xorl %ebx, %ebx
movl %ebp, %edi
movl $0x1, %esi
movq %r14, %rdx
xorl %ecx, %ecx
callq *(%rax)
leaq 0x5e8b(%rip), %rax      # 0xa4e8
movl %ebp, %edi
callq *(%rax)
leaq 0x4(%rsp), %r14
movl $0x0, (%r14)
leaq 0x5efc(%rip), %rax      # 0xa570
movl %ebp, %edi
movl $0x8b81, %esi           # imm = 0x8B81
movq %r14, %rdx
callq *(%rax)
cmpl $0x0, (%r14)
je 0x468a
movl %ebp, %ebx
jmp 0x469d
leaq 0x3312(%rip), %rdi      # 0x79a3
callq 0x11c0
movl %ebp, %edi
callq 0x472d
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Hazematman[P]BSP-Renderer/gutils.c
// Function: linkPrg
void linkPrg(ShaderPrg *prg){
	prg->prgID = glCreateProgram();
	glAttachShader(prg->prgID, prg->vs);
	glAttachShader(prg->prgID, prg->fs);
	glLinkProgram(prg->prgID);

	// Check if program linked okay
	GLint okay = GL_FALSE;
	glGetProgramiv(prg->prgID, GL_LINK_STATUS, &okay);
	if(okay == GL_FALSE){
		printf("Error linking program\n");
		printErrLog(prg->prgID);
		glDeleteProgram(prg->prgID);
		prg->prgID = 0;
		return;
	}
	return;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x5e3a(%rip), %rax      # 0xa4f0
callq *(%rax)
movl %eax, (%rbx)
leaq 0x5e0f(%rip), %r14      # 0xa4d0
movl 0x4(%rbx), %esi
movl %eax, %edi
callq *(%r14)
movl (%rbx), %edi
movl 0x8(%rbx), %esi
callq *(%r14)
leaq 0x5ee8(%rip), %rax      # 0xa5c0
movl (%rbx), %edi
callq *(%rax)
leaq 0x4(%rsp), %r14
movl $0x0, (%r14)
leaq 0x5e69(%rip), %rax      # 0xa558
movl (%rbx), %edi
movl $0x8b82, %esi           # imm = 0x8B82
movq %r14, %rdx
callq *(%rax)
cmpl $0x0, (%r14)
jne 0x4725
leaq 0x32b2(%rip), %rdi      # 0x79ba
callq 0x11c0
movl (%rbx), %edi
callq 0x472d
leaq 0x5de5(%rip), %rax      # 0xa500
movl (%rbx), %edi
callq *(%rax)
movl $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/Hazematman[P]BSP-Renderer/gutils.c
// Function: printErrLog
static void printErrLog(GLuint obj){
	GLint logLen = 0;
	bool isShader;
	if(glIsShader(obj)){
		isShader = true;
		glGetShaderiv(obj, GL_INFO_LOG_LENGTH, &logLen);
	} else if (glIsProgram(obj)){
		isShader = false;
		glGetProgramiv(obj, GL_INFO_LOG_LENGTH, &logLen);
	} else {
		printf("Object is neither shader or program");
		return;
	}

	char *log = malloc(logLen);
	if(isShader){
		glGetShaderInfoLog(obj, logLen, NULL, log);
	} else {
		glGetProgramInfoLog(obj, logLen, NULL, log);
	}

	printf("%s", log);
	free(log);
	return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
movl $0x0, 0x4(%rsp)
leaq 0x5e72(%rip), %rax      # 0xa5b8
callq *(%rax)
testb %al, %al
je 0x475c
leaq 0x5e1d(%rip), %rax      # 0xa570
leaq 0x5e06(%rip), %r12      # 0xa560
jmp 0x4779
leaq 0x5e4d(%rip), %rax      # 0xa5b0
movl %ebx, %edi
callq *(%rax)
testb %al, %al
je 0x47ce
leaq 0x5de6(%rip), %rax      # 0xa558
leaq 0x5dd7(%rip), %r12      # 0xa550
leaq 0x4(%rsp), %r14
movl %ebx, %edi
movl $0x8b84, %esi           # imm = 0x8B84
movq %r14, %rdx
callq *(%rax)
movl (%r14), %eax
movslq %eax, %r14
movq %r14, %rdi
callq 0x1160
movq %rax, %r15
movl %ebx, %edi
movl %r14d, %esi
xorl %edx, %edx
movq %rax, %rcx
callq *(%r12)
leaq 0x31f0(%rip), %rdi      # 0x79a0
movq %r15, %rsi
xorl %eax, %eax
callq 0x1040
movq %r15, %rdi
callq 0x1150
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x31a7(%rip), %rdi      # 0x797c
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O1/Hazematman[P]BSP-Renderer/gutils.c
// Function: getAttribLoc
GLint getAttribLoc(ShaderPrg *prg, const char *name){
	GLint attrib = glGetAttribLocation(prg->prgID, name);
	if(attrib == -1){
		printf("Could not find vertex attribute: %s\n", name);
		return -1;
	}
	
	return attrib;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
leaq 0x5d56(%rip), %rax      # 0xa548
movl (%rdi), %edi
callq *(%rax)
cmpl $-0x1, %eax
jne 0x4811
leaq 0x3120(%rip), %rdi      # 0x7922
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1040
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/Hazematman[P]BSP-Renderer/gutils.c
// Function: getUniformLoc
GLint getUniformLoc(ShaderPrg *prg, const char *name){
	GLint uniform = glGetUniformLocation(prg->prgID, name);
	if(uniform == -1){
		printf("Could not find uniform: %s\n", name);
		return -1;
	}

	return uniform;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
leaq 0x5d5a(%rip), %rax      # 0xa578
movl (%rdi), %edi
callq *(%rax)
cmpl $-0x1, %eax
jne 0x483d
leaq 0x3119(%rip), %rdi      # 0x7947
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1040
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
retq
nop