LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/arachsys[P]containers/inject.c
// Function: join
static void join(pid_t pid, char *type) {
  char *path;
  int fd;

  path = string("/proc/%u/ns/%s", pid, type);

  if ((fd = open(path, O_RDONLY)) >= 0) {
    if (syscall(__NR_setns, fd, 0) < 0 && strcmp(type, "user") == 0)
      errx(EXIT_FAILURE, "Failed to join user namespace");
    close(fd);
  } else if (errno != ENOENT) {
    errx(EXIT_FAILURE, "PID %u does not belong to you", pid);
  } else if (strcmp(type, "user") == 0) {
    errx(EXIT_FAILURE, "PID %u not found or user namespace unavailable", pid);
  }

  free(path);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebp
leaq 0x1886(%rip), %rdi      # 0x4129
movl %ebp, %esi
movq %r14, %rdx
xorl %eax, %eax
callq 0x35be
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x2290
testl %eax, %eax
js 0x28f7
movl %eax, %r15d
movl $0x134, %edi            # imm = 0x134
movl %eax, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x21b0
testq %rax, %rax
jns 0x28ed
leaq 0x175f(%rip), %rsi      # 0x4040
movq %r14, %rdi
callq 0x2170
testl %eax, %eax
je 0x2944
movl %r15d, %edi
callq 0x2140
jmp 0x2914
callq 0x2050
cmpl $0x2, (%rax)
jne 0x2926
leaq 0x1738(%rip), %rsi      # 0x4040
movq %r14, %rdi
callq 0x2170
testl %eax, %eax
je 0x292f
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2040
leaq 0x1829(%rip), %rsi      # 0x4156
jmp 0x2936
leaq 0x183e(%rip), %rsi      # 0x4174
movl $0x1, %edi
movl %ebp, %edx
xorl %eax, %eax
callq 0x2110
leaq 0x17ed(%rip), %rsi      # 0x4138
movl $0x1, %edi
xorl %eax, %eax
callq 0x2110
nop
// File: /workspace/github_c_makefile_star2_O3/arachsys[P]containers/map.c
// Function: denysetgroups
void denysetgroups(pid_t pid) {
  char *path, *text = "deny";
  int fd;

  path = string("/proc/%d/setgroups", pid);
  if ((fd = open(path, O_WRONLY)) < 0)
    errx(EXIT_FAILURE, "Failed to disable setgroups() in container");
  else if (write(fd, text, strlen(text)) != (ssize_t) strlen(text))
    errx(EXIT_FAILURE, "Failed to disable setgroups() in container");
  close(fd);
  free(path);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %esi
leaq 0x1852(%rip), %rdi      # 0x41b6
xorl %eax, %eax
callq 0x35be
movq %rax, %rbx
movq %rax, %rdi
movl $0x1, %esi
xorl %eax, %eax
callq 0x2290
testl %eax, %eax
js 0x29b1
movl %eax, %ebp
leaq 0x1827(%rip), %rsi      # 0x41b1
movl $0x4, %edx
movl %eax, %edi
callq 0x2090
cmpq $0x4, %rax
jne 0x29b1
movl %ebp, %edi
callq 0x2140
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2040
leaq 0x1811(%rip), %rsi      # 0x41c9
movl $0x1, %edi
xorl %eax, %eax
callq 0x2110
// File: /workspace/github_c_makefile_star2_O3/arachsys[P]containers/map.c
// Function: writemap
void writemap(pid_t pid, int type, char *map) {
  char *path, *range, *text = NULL;
  int fd;
  unsigned count, first, lower;

  if (!map) {
    map = (getuid() == 0 ? rootdefault : userdefault)(type);
  } else if (getuid() != 0) {
    range = readranges(type);
    verifymap(map, range);
    free(range);
  }

  while ((map = mapitem(map, &first, &lower, &count)))
    append(&text, "%u %u %u\n", first, lower, count);

  path = string("/proc/%d/%s", pid, idfile(type));
  if ((fd = open(path, O_WRONLY)) < 0)
    errx(EXIT_FAILURE, "Failed to set container %s map", idname(type));
  else if (write(fd, text, strlen(text)) != (ssize_t) strlen(text))
    errx(EXIT_FAILURE, "Failed to set container %s map", idname(type));

  close(fd);
  free(path);
  free(text);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movl %esi, %ebx
movl %edi, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
callq 0x2100
testq %r14, %r14
movl %ebx, 0x24(%rsp)
je 0x2a65
testl %eax, %eax
je 0x2a80
movl %ebx, %edi
callq 0x2f03
movq %rax, %r15
leaq 0x14(%rsp), %rsi
leaq 0xc(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
callq 0x30fd
testq %rax, %rax
je 0x2a5b
movq %rax, %r12
leaq 0x14(%rsp), %rbx
leaq 0xc(%rsp), %r13
leaq 0x10(%rsp), %rbp
movl 0xc(%rsp), %esi
movl 0x10(%rsp), %edx
movq %r15, %rdi
callq 0x3339
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0x30fd
movq %rax, %r12
testq %rax, %rax
jne 0x2a32
movq %r15, %rdi
callq 0x2040
jmp 0x2a80
testl %eax, %eax
leaq 0x13f(%rip), %rax       # 0x2bad
leaq 0x2fc(%rip), %rcx       # 0x2d71
cmoveq %rax, %rcx
movl %ebx, %edi
callq *%rcx
movq %rax, %r14
leaq 0x14(%rsp), %rsi
leaq 0xc(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
callq 0x30fd
testq %rax, %rax
je 0x2aed
movq %rax, %r15
leaq 0x174e(%rip), %r14      # 0x41f4
leaq 0x18(%rsp), %r12
leaq 0x14(%rsp), %r13
leaq 0xc(%rsp), %rbp
leaq 0x10(%rsp), %rbx
movl 0x14(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x10(%rsp), %r8d
movq %r12, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x33e0
movq %r15, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %rbx, %rcx
callq 0x30fd
movq %rax, %r15
testq %rax, %rax
jne 0x2aba
movl 0x24(%rsp), %r15d
testl %r15d, %r15d
leaq 0x170e(%rip), %rax      # 0x420a
leaq 0x170f(%rip), %rdx      # 0x4212
cmoveq %rax, %rdx
leaq 0x16f0(%rip), %rdi      # 0x41fe
movl 0x20(%rsp), %esi
xorl %eax, %eax
callq 0x35be
movq %rax, %r14
movq %rax, %rdi
movl $0x1, %esi
xorl %eax, %eax
callq 0x2290
testl %eax, %eax
js 0x2b85
movl %eax, %ebp
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x20e0
movl %ebp, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x2090
movq %rax, %rbx
movq 0x18(%rsp), %rdi
callq 0x20e0
cmpq %rax, %rbx
jne 0x2b85
movl %ebp, %edi
callq 0x2140
movq %r14, %rdi
callq 0x2040
movq 0x18(%rsp), %rdi
callq 0x2040
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %r15d, %r15d
leaq 0x16aa(%rip), %rax      # 0x4239
leaq 0x16a7(%rip), %rdx      # 0x423d
cmoveq %rax, %rdx
leaq 0x1679(%rip), %rsi      # 0x421a
movl $0x1, %edi
xorl %eax, %eax
callq 0x2110
// File: /workspace/github_c_makefile_star2_O3/arachsys[P]containers/map.c
// Function: rootdefault
static char *rootdefault(int type) {
  char *cursor, *map, *result;
  unsigned count, first, last = INVALID, lower;

  cursor = map = getmap(-1, type);
  while ((cursor = mapitem(cursor, &first, &lower, &count)))
    if (last == INVALID || last < first + count - 1)
      last = first + count - 1;
  result = string("0:%u:1", last);

  cursor = map;
  while ((cursor = mapitem(cursor, &first, &lower, &count))) {
    if (first == 0) {
      if (count == 1 && first >= last)
        errx(EXIT_FAILURE, "No unprivileged %s available\n", idname(type));
      first++, lower++, count--;
    }

    if (last <= first + count - 1 && count > 0)
      count--;

    if (count > 0)
      append(&result, "%s%u:%u:%u", result ? "," : "", first, first, count);
  }

  free(map);
  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edi, 0x1c(%rsp)
callq 0x316c
movq %rax, %rbp
leaq 0x8(%rsp), %rsi
leaq 0xc(%rsp), %rdx
leaq 0x4(%rsp), %rcx
movq %rax, %rdi
callq 0x30fd
testq %rax, %rax
je 0x2c2e
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
leaq 0x8(%rsp), %rbx
leaq 0xc(%rsp), %r15
leaq 0x4(%rsp), %r12
movl 0x8(%rsp), %edx
movl 0x4(%rsp), %esi
addl %esi, %edx
decl %edx
cmpl %edx, %ecx
movl %edx, %r14d
cmoval %ecx, %r14d
cmpl $-0x1, %ecx
cmovel %edx, %r14d
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x30fd
movl %r14d, %ecx
testq %rax, %rax
jne 0x2bf7
jmp 0x2c34
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
leaq 0x1606(%rip), %rdi      # 0x4241
movl %r14d, %esi
xorl %eax, %eax
callq 0x35be
movq %rax, %rbx
movq %rax, 0x10(%rsp)
leaq 0x8(%rsp), %rsi
leaq 0xc(%rsp), %rdx
leaq 0x4(%rsp), %rcx
movq %rbp, %rdi
callq 0x30fd
testq %rax, %rax
je 0x2d2d
movq %rax, %r13
movq %rbp, 0x20(%rsp)
leaq 0x8(%rsp), %r15
leaq 0xc(%rsp), %r12
leaq 0x4(%rsp), %rbp
leaq 0x10(%rsp), %rbx
movl 0x8(%rsp), %ecx
movl 0x4(%rsp), %r9d
testl %ecx, %ecx
jne 0x2cbe
cmpl $0x1, %r9d
jne 0x2ca5
testl %r14d, %r14d
je 0x2d47
incl 0xc(%rsp)
movl $0x1, 0x8(%rsp)
decl %r9d
movl %r9d, 0x4(%rsp)
movl $0x1, %ecx
movl %r9d, %eax
addl $-0x1, %eax
jae 0x2cd5
leal (%rax,%rcx), %edx
cmpl %edx, %r14d
ja 0x2cd5
movl %eax, 0x4(%rsp)
movl %eax, %r9d
testl %r9d, %r9d
je 0x2d06
cmpq $0x0, 0x10(%rsp)
leaq 0x158a(%rip), %rdx      # 0x4271
leaq 0x143a(%rip), %rax      # 0x4128
cmoveq %rax, %rdx
movq %rbx, %rdi
leaq 0x156a(%rip), %rsi      # 0x4266
movl %ecx, %r8d
xorl %eax, %eax
callq 0x33e0
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbp, %rcx
callq 0x30fd
movq %rax, %r13
testq %rax, %rax
jne 0x2c89
movq 0x10(%rsp), %rbx
movq 0x20(%rsp), %rbp
movq %rbp, %rdi
callq 0x2040
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x1c(%rsp)
leaq 0x14e6(%rip), %rax      # 0x4239
leaq 0x14e3(%rip), %rdx      # 0x423d
cmoveq %rax, %rdx
leaq 0x14e3(%rip), %rsi      # 0x4248
movl $0x1, %edi
xorl %eax, %eax
callq 0x2110
// File: /workspace/github_c_makefile_star2_O3/arachsys[P]containers/map.c
// Function: userdefault
static char *userdefault(int type) {
  char *cursor, *map, *range, *result = NULL;
  unsigned count, first, index = 0, length, lower, start;

  if (geteuid() != 0)
    return string("0:%u:1", getid(type));

  map = getmap(-1, type);
  range = readranges(type);

  while ((range = rangeitem(range, &start, &length))) {
    cursor = map;
    while ((cursor = mapitem(cursor, &first, &lower, &count))) {
      if (start + length <= first || first + count <= start)
        continue;
      if (first + count < start + length)
        length = start - first + count;
      if (start < first) {
        index += first - start;
        length -= first - start;
        start = first;
      }
      append(&result, "%s%u:%u:%u", result ? "," : "", index, start, length);
      index += length;
    }
  }

  free(map);
  free(range);
  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edi, %ebx
movq $0x0, 0x8(%rsp)
callq 0x2130
testl %eax, %eax
je 0x2da5
testl %ebx, %ebx
je 0x2ee0
callq 0x2100
jmp 0x2ee5
movl %ebx, %edi
callq 0x316c
movq %rax, 0x18(%rsp)
movl %ebx, %edi
callq 0x2f03
leaq 0x4(%rsp), %rsi
movq %rsp, %rdx
movq %rax, %rdi
callq 0x32cd
xorl %ebx, %ebx
testq %rax, %rax
je 0x2ec4
movq %rax, %r14
leaq 0x10(%rsp), %r15
leaq 0x24(%rsp), %r12
leaq 0x14(%rsp), %r13
xorl %ebp, %ebp
movq 0x18(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x30fd
testq %rax, %rax
je 0x2ea3
movq %rax, %rbx
movl 0x4(%rsp), %eax
movl (%rsp), %r9d
leal (%r9,%rax), %edx
movl 0x10(%rsp), %r8d
cmpl %r8d, %edx
jbe 0x2e28
movl 0x14(%rsp), %ecx
leal (%rcx,%r8), %esi
cmpl %eax, %esi
ja 0x2e43
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x30fd
movq %rax, %rbx
testq %rax, %rax
jne 0x2e06
jmp 0x2ea3
cmpl %edx, %esi
jae 0x2e54
movl %eax, %r9d
subl %r8d, %r9d
addl %ecx, %r9d
movl %r9d, (%rsp)
cmpl %r8d, %eax
jae 0x2e6e
movl %r8d, %ecx
subl %eax, %ecx
addl %ecx, %ebp
subl %ecx, %r9d
movl %r9d, (%rsp)
movl %r8d, 0x4(%rsp)
jmp 0x2e71
movl %eax, %r8d
cmpq $0x0, 0x8(%rsp)
leaq 0x13f3(%rip), %rdx      # 0x4271
leaq 0x12a3(%rip), %rax      # 0x4128
cmoveq %rax, %rdx
leaq 0x8(%rsp), %rdi
leaq 0x13d1(%rip), %rsi      # 0x4266
movl %ebp, %ecx
xorl %eax, %eax
callq 0x33e0
addl (%rsp), %ebp
jmp 0x2e28
movq %r14, %rdi
leaq 0x4(%rsp), %rsi
movq %rsp, %rdx
callq 0x32cd
movq %rax, %r14
testq %rax, %rax
jne 0x2de7
movq 0x8(%rsp), %rbx
movq 0x18(%rsp), %rdi
callq 0x2040
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x21d0
leaq 0x1355(%rip), %rdi      # 0x4241
movl %eax, %esi
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x35be
// File: /workspace/github_c_makefile_star2_O3/arachsys[P]containers/map.c
// Function: mapitem
static char *mapitem(char *map, unsigned *first, unsigned *lower,
    unsigned *count) {
  ssize_t skip;

  while (map && *map && strchr(",;", *map))
    map++;
  if (map == NULL || *map == '\0')
    return NULL;
  if (sscanf(map, "%u:%u:%u%zn", first, lower, count, &skip) < 3)
    errx(EXIT_FAILURE, "Invalid ID map '%s'", map);
  return map + skip;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
testq %rdi, %rdi
je 0x3129
movq %rcx, %r8
movq %rdx, %rcx
movq %rsi, %rdx
movq %rdi, %rbx
movzbl (%rbx), %eax
cmpl $0x2c, %eax
je 0x3120
cmpl $0x3b, %eax
jne 0x3125
incq %rbx
jmp 0x3113
testl %eax, %eax
jne 0x312d
xorl %ebx, %ebx
jmp 0x314d
leaq 0x1212(%rip), %rsi      # 0x4346
leaq 0x8(%rsp), %r9
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2200
cmpl $0x2, %eax
jle 0x3156
addq 0x8(%rsp), %rbx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
leaq 0x11f5(%rip), %rsi      # 0x4352
movl $0x1, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2110
// File: /workspace/github_c_makefile_star2_O3/arachsys[P]containers/map.c
// Function: getmap
static char *getmap(pid_t pid, int type) {
  char *line = NULL, *result = NULL, *path;
  size_t size;
  unsigned count, first, lower;
  FILE *file;

  if (pid == -1)
    path = string("/proc/self/%s", idfile(type));
  else
    path = string("/proc/%d/%s", pid, idfile(type));
  if (!(file = fopen(path, "r")))
    errx(EXIT_FAILURE, "Cannot read %s", path);

  while (getline(&line, &size, file) >= 0) {
    if (sscanf(line, " %u %u %u", &first, &lower, &count) != 3)
      errx(EXIT_FAILURE, "Invalid map data in %s", path);
    append(&result, "%s%u:%u:%u", result ? "," : "", first, lower, count);
  }

  if (!result)
    errx(EXIT_FAILURE, "Invalid map data in %s", path);

  fclose(file);
  free(line);
  free(path);
  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
xorl %eax, %eax
movq %rax, 0x10(%rsp)
movq %rax, 0x8(%rsp)
testl %edi, %edi
leaq 0x107b(%rip), %rax      # 0x420a
leaq 0x107c(%rip), %rsi      # 0x4212
cmoveq %rax, %rsi
leaq 0x10d2(%rip), %rdi      # 0x4273
xorl %eax, %eax
callq 0x35be
movq %rax, %rbx
leaq 0x1040(%rip), %rsi      # 0x41f2
movq %rax, %rdi
callq 0x22a0
testq %rax, %rax
je 0x32bc
movq %rax, %r14
movq %rbx, 0x18(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movq %rax, %rdx
callq 0x22c0
testq %rax, %rax
js 0x32a4
leaq 0x1084(%rip), %rbp      # 0x4271
leaq 0x1072(%rip), %rbx      # 0x4266
leaq 0x8(%rsp), %r15
leaq 0x10(%rsp), %r12
leaq 0x30(%rsp), %r13
movq 0x10(%rsp), %rdi
leaq 0x1081(%rip), %rsi      # 0x4290
leaq 0x28(%rsp), %rdx
leaq 0x24(%rsp), %rcx
leaq 0x2c(%rsp), %r8
xorl %eax, %eax
callq 0x2200
cmpl $0x3, %eax
jne 0x32a4
cmpq $0x0, 0x8(%rsp)
movq %rbp, %rdx
leaq 0xeee(%rip), %rax       # 0x4128
cmoveq %rax, %rdx
movl 0x28(%rsp), %ecx
movl 0x24(%rsp), %r8d
movl 0x2c(%rsp), %r9d
movq %r15, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x33e0
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x22c0
testq %rax, %rax
jns 0x3203
cmpq $0x0, 0x8(%rsp)
je 0x32a4
movq %r14, %rdi
callq 0x20b0
movq 0x10(%rsp), %rdi
callq 0x2040
movq 0x18(%rsp), %rdi
callq 0x2040
movq 0x8(%rsp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xfef(%rip), %rsi       # 0x429a
movl $0x1, %edi
movq 0x18(%rsp), %rdx
xorl %eax, %eax
callq 0x2110
leaq 0xfbe(%rip), %rsi       # 0x4281
movl $0x1, %edi
movq %rbx, %rdx
jmp 0x32b5
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
subq $0x10, %rsp
testq %rdi, %rdi
je 0x32f6
movq %rdx, %rcx
movq %rsi, %rdx
movq %rdi, %rbx
movzbl (%rbx), %eax
cmpl $0x2c, %eax
je 0x32ed
cmpl $0x3b, %eax
jne 0x32f2
incq %rbx
jmp 0x32e0
testl %eax, %eax
jne 0x32fa
xorl %ebx, %ebx
jmp 0x331a
leaq 0x1048(%rip), %rsi      # 0x4349
leaq 0x8(%rsp), %r8
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2200
cmpl $0x1, %eax
jle 0x3323
addq 0x8(%rsp), %rbx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
leaq 0xf87(%rip), %rsi       # 0x42b1
movl $0x1, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2110
// File: /workspace/github_c_makefile_star2_O3/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 0x32cd
testq %rax, %rax
je 0x339a
movq %rax, %r14
addl %ebp, %ebx
leaq 0x8(%rsp), %r15
leaq 0xc(%rsp), %r12
movl 0x8(%rsp), %edx
movl 0xc(%rsp), %esi
addl %edx, %esi
cmpl %ebp, %esi
setbe %al
cmpl %ebx, %edx
setae %cl
orb %al, %cl
je 0x33ad
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x32cd
movq %rax, %r14
testq %rax, %rax
jne 0x336c
leaq 0xf73(%rip), %rsi       # 0x4314
movl $0x1, %edi
xorl %eax, %eax
callq 0x2110
subl %ebp, %edx
jbe 0x33c3
movq %r14, %rdi
movl %ebp, %esi
callq 0x3339
movl 0xc(%rsp), %esi
addl 0x8(%rsp), %esi
subl %esi, %ebx
jbe 0x33d1
movq %r14, %rdi
movl %ebx, %edx
callq 0x3339
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x3440
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 0x34b9
movq (%rbx), %rdx
testq %rdx, %rdx
je 0x34a8
movq (%rsp), %rcx
leaq 0xeeb(%rip), %rsi       # 0x436f
leaq 0x8(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2250
testl %eax, %eax
js 0x34b9
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 0xea6(%rip), %rsi       # 0x4366
movl $0x1, %edi
xorl %eax, %eax
callq 0x21f0
// File: /workspace/github_c_makefile_star2_O3/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 0xe99(%rip), %rdi       # 0x4379
xorl %esi, %esi
xorl %eax, %eax
callq 0x2290
testl %eax, %eax
js 0x3513
movl %eax, %ebp
movl %eax, %edi
movl $0x40a, %esi            # imm = 0x40A
xorl %eax, %eax
callq 0x2080
cmpl $0xf, %eax
jne 0x351f
movl %ebp, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2140
leaq 0xe5a(%rip), %rsi       # 0x4374
jmp 0x35b2
leaq 0xe53(%rip), %rdi       # 0x4379
movl $0x3, %esi
callq 0x2060
testl %eax, %eax
jns 0x353d
leaq 0xe4d(%rip), %rsi       # 0x4388
jmp 0x35b2
movl %eax, %r15d
movl $0x2000, %ecx           # imm = 0x2000
movl %r15d, %edi
movl %ebp, %esi
xorl %edx, %edx
callq 0x2240
testq %rax, %rax
je 0x3575
testq %rax, %rax
jns 0x3540
callq 0x2050
movl (%rax), %eax
cmpl $0x4, %eax
je 0x3540
cmpl $0xb, %eax
je 0x3540
leaq 0xe22(%rip), %rsi       # 0x4395
jmp 0x35b2
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 0x359d
leaq 0xe03(%rip), %rsi       # 0x439e
jmp 0x35b2
movl %r15d, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2190
leaq 0xdfe(%rip), %rsi       # 0x43b0
movl $0x1, %edi
xorl %eax, %eax
callq 0x21f0
// File: /workspace/github_c_makefile_star2_O3/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 0x361f
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 0x365f
movq 0x8(%rsp), %rax
addq $0xe8, %rsp
retq
leaq 0xd00(%rip), %rsi       # 0x4366
movl $0x1, %edi
xorl %eax, %eax
callq 0x21f0
// File: /workspace/github_c_makefile_star2_O3/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 0xd3e(%rip), %rdi       # 0x43b8
callq 0x22f0
testq %rax, %rax
je 0x3699
movq %rax, %rbx
movq %rax, %rdi
callq 0x2260
testq %rax, %rax
je 0x36ac
movq %rbx, %rax
popq %rbx
retq
leaq 0xd24(%rip), %rsi       # 0x43c4
movl $0x1, %edi
xorl %eax, %eax
callq 0x21f0
leaq 0xd18(%rip), %rsi       # 0x43cb
movl $0x1, %edi
xorl %eax, %eax
callq 0x2110
// File: /workspace/github_c_makefile_star2_O3/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 0x2280
testl %eax, %eax
js 0x36db
movzbl 0x5(%rsp), %edi
testl %edi, %edi
jne 0x36ee
popq %rax
retq
leaq 0xd0e(%rip), %rsi       # 0x43f0
movl $0x1, %edi
xorl %eax, %eax
callq 0x21f0
callq 0x22d0
// File: /workspace/github_c_makefile_star2_O3/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 0x2280
testl %eax, %eax
js 0x3711
movl 0x4(%rsp), %eax
cmpb $0x7f, %al
jne 0x3724
popq %rax
retq
leaq 0xcd8(%rip), %rsi       # 0x43f0
movl $0x1, %edi
xorl %eax, %eax
callq 0x21f0
movzbl %ah, %edi
callq 0x22d0
// File: /workspace/github_c_makefile_star2_O3/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 0x1494
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), %rcx
movq %rcx, 0x2c6c(%rip)      # 0x4088
movq 0x8(%rbx), %r14
movq 0x10(%rbx), %rcx
movq %rcx, 0x18(%rsp)
cmpq %r14, %rcx
jge 0x1476
leaq 0x18(%rsp), %rbx
movq 0x20(%rsp), %rax
leaq (%rcx,%rcx,2), %rcx
movq 0x2c4d(%rip), %rdi      # 0x4090
movq 0x10(%rax,%rcx,8), %rdx
movq %rdx, 0x10(%rsp)
movups (%rax,%rcx,8), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rsi
callq 0x149c
movq 0x18(%rsp), %rcx
incq %rcx
movq %rcx, 0x18(%rsp)
cmpq %r14, %rcx
jl 0x1433
movq 0x2c0a(%rip), %rax      # 0x4080
movq %rax, %rdi
callq 0x1030
movq 0x20(%rsp), %rdi
callq 0x1030
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
callq 0x1128
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/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 0x16cc
cmpl $0x1, %eax
je 0x16be
cmpl $0x2, %eax
jne 0x16e0
leaq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
leaq (%rdi,%rax,8), %rsi
leaq 0xa42(%rip), %rdi       # 0x20f8
xorl %eax, %eax
popq %rcx
jmp 0x10a0
callq 0x136e
leaq 0xa32(%rip), %rdi       # 0x20fc
jmp 0x16d8
callq 0x136e
leaq 0xa20(%rip), %rdi       # 0x20f8
movb $0x1, %al
popq %rcx
jmp 0x1060
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/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), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x1030
movq %r14, %rdi
movl $0x2e, %esi
callq 0x1090
testq %rax, %rax
je 0x1247
movb $0x0, 0x4(%rax)
movl $0x77656e2e, (%rax)     # imm = 0x77656E2E
movq (%rbx,%rbp,8), %r12
jmp 0x125c
movq %r14, %rdi
callq 0x1070
movl $0x77656e2e, 0x10(%rsp,%rax) # imm = 0x77656E2E
movb $0x0, 0x14(%rsp,%rax)
movq %r12, %rdi
leaq 0xda3(%rip), %rsi       # 0x2009
callq 0x10a0
testq %rax, %rax
je 0x130b
movq %rax, %r12
movq %r14, %rdi
leaq 0xda3(%rip), %rsi       # 0x2024
callq 0x10a0
testq %rax, %rax
je 0x1318
movq %rax, %r13
movq (%rbx,%rbp,8), %rsi
leaq 0xd8a(%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 0x12e9
movslq %eax, %rdx
movl $0x1, %esi
movq %r15, %rdi
movq %r13, %rcx
callq 0x10c0
jmp 0x12bb
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 0xcf6(%rip), %rdi       # 0x200c
jmp 0x1324
leaq 0xced(%rip), %rdi       # 0x200c
leaq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x1080
jmp 0x11f7
// File: /workspace/github_c_makefile_star2_O3/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 0x3fc0
cmpb $0x0, (%rax)
sete %cl
decq %rdx
setne %r8b
sete %dil
orb %cl, %dil
jne 0x3f76
xorl %ecx, %ecx
movq %rcx, %rdi
incq %rcx
cmpq %rdx, %rcx
setb %r8b
cmpb $0x0, 0x1(%rax,%rdi)
je 0x3f6e
cmpq %rdx, %rcx
jb 0x3f55
movq %rcx, %rdi
addq %rax, %rdi
jmp 0x3f7b
xorl %ecx, %ecx
movq %rax, %rdi
testb %r8b, %r8b
je 0x3fc0
movb (%rsi), %r8b
testb %r8b, %r8b
setne %r9b
cmpq %rdx, %rcx
setb %r10b
andb %r9b, %r10b
cmpb $0x1, %r10b
jne 0x3fbd
incq %rcx
incq %rsi
movb %r8b, (%rdi)
incq %rdi
movb (%rsi), %r8b
testb %r8b, %r8b
je 0x3fbd
leaq 0x1(%rcx), %r9
incq %rsi
cmpq %rdx, %rcx
movq %r9, %rcx
jb 0x3fa0
movb $0x0, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4057
decq %rdx
testq %rcx, %rcx
sete %r8b
movq %rcx, %rdi
subq %rax, %rdi
sete %r9b
orb %r8b, %r9b
jne 0x3ff3
movslq %edx, %r8
cmpq %r8, %rdi
jge 0x3ff3
incq %rdi
jmp 0x4024
cmpb $0x0, (%rax)
sete %cl
testq %rdx, %rdx
sete %dil
orb %cl, %dil
jne 0x401f
xorl %edi, %edi
cmpb $0x0, 0x1(%rax,%rdi)
leaq 0x1(%rdi), %rdi
je 0x4017
cmpq %rdx, %rdi
jb 0x4007
movq %rdi, %rcx
addq %rax, %rcx
jmp 0x4024
xorl %edi, %edi
movq %rax, %rcx
cmpq %rdx, %rdi
jae 0x4057
movb (%rsi), %r8b
testb %r8b, %r8b
je 0x4054
incq %rdi
incq %rsi
movb %r8b, (%rcx)
incq %rcx
movb (%rsi), %r8b
testb %r8b, %r8b
je 0x4054
leaq 0x1(%rdi), %r9
incq %rsi
cmpq %rdx, %rdi
movq %r9, %rdi
jb 0x4037
movb $0x0, (%rcx)
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4098
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x11d0
movq (%rax), %rcx
movl %ebp, %edx
xorl %esi, %esi
movsbq (%r14,%rsi), %rax
movsbl (%rcx,%rax,4), %edi
movsbq (%rbx,%rsi), %rax
movsbl (%rcx,%rax,4), %eax
subl %edi, %eax
jne 0x4093
incq %rsi
cmpl %esi, %edx
jne 0x4074
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4153
movq (%rbx), %rcx
cmpq %rcx, %rax
je 0x4565
movq %rax, (%rbx)
movq %rax, %rcx
movq %rcx, %rax
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x45d6
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 0x465a
movl $0x400, %r15d           # imm = 0x400
leaq 0x110(%rsp), %rbp
movabsq $0x3000000008, %r13     # imm = 0x3000000008
movq %rsp, %r12
movq %rax, %r14
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %rbp, 0x8(%rsp)
movq %r13, (%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 0x465d
leal 0x1(%rax), %ecx
addl %r15d, %r15d
testl %eax, %eax
cmovnsl %ecx, %r15d
movq %r14, %rdi
movq %r15, %rsi
callq 0x1160
testq %rax, %rax
jne 0x4600
movq %r14, %rdi
callq 0x1030
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_O3/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 0x49ea
movq %rbx, %rdi
movl $0x1, %esi
callq 0x13dc
cmpl $0x1, 0x4(%r14)
jne 0x49fe
movq %rbx, %rdi
movl $0x1, %esi
callq 0x13bf
cmpl $0x1, 0x8(%r14)
jne 0x4a12
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_O3/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, %r14
movl %edi, %ebx
movl $0x1, %r12d
cmpl $0x2, %edi
jl 0x1e09
movl $0x1, %r12d
movslq %r12d, %rax
movq (%r14,%rax,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x1e09
movb 0x2(%rsi), %r13b
testb %r13b, %r13b
je 0x1d93
leaq 0x2(%rsi), %rdi
jmp 0x1d98
movq 0x8(%r14,%rax,8), %rdi
movzbl 0x1(%rsi), %eax
cmpl $0x73, %eax
jg 0x1db5
cmpl $0x61, %eax
jne 0x1dca
callq 0x1090
movsd %xmm0, 0x63bd(%rip)     # 0x8170
jmp 0x1dc5
cmpl $0x74, %eax
jne 0x1dd4
callq 0x1210
movl %eax, 0x63a3(%rip)      # 0x8168
movb $0x1, %r15b
jmp 0x1dee
cmpl $0x68, %eax
jne 0x1ddd
jmp 0x1ec6
cmpl $0x76, %eax
je 0x1ea8
xorl %r15d, %r15d
leaq 0x32d6(%rip), %rdi      # 0x50bd
xorl %eax, %eax
callq 0x20a4
testb %r13b, %r13b
sete %al
andb %r15b, %al
movzbl %al, %eax
addl %eax, %r12d
incl %r12d
cmpl %ebx, %r12d
jl 0x1d74
subl %r12d, %ebx
cmpl $0x1, %ebx
jne 0x1e33
movslq %r12d, %rax
movq (%r14,%rax,8), %rdi
leaq 0x39f3(%rip), %rsi      # 0x5812
callq 0x213e
movq 0x61ad(%rip), %rcx      # 0x7fd8
movq (%rcx), %rsi
movq %rax, %rdi
jmp 0x1e86
jle 0x1ee2
movslq %r12d, %rax
leaq (%r14,%rax,8), %r14
movq 0x8(%r14), %rdi
leaq 0x31be(%rip), %rsi      # 0x5009
callq 0x1270
testq %rax, %rax
jne 0x1e9c
cmpl $0x2, %ebx
jne 0x1ee2
movq (%r14), %rdi
leaq 0x39aa(%rip), %rsi      # 0x5812
callq 0x213e
movq %rax, %rbx
movq 0x8(%r14), %rdi
leaq 0x3193(%rip), %rsi      # 0x500e
callq 0x213e
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1f04
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ebx, %edi
movq %r14, %rsi
callq 0x12a0
jmp 0x1e8b
movq 0x62a9(%rip), %rsi      # 0x8158
movq 0x62aa(%rip), %rdx      # 0x8160
leaq 0x31f1(%rip), %rdi      # 0x50ae
xorl %eax, %eax
callq 0x10c0
jmp 0x1edb
movq 0x628b(%rip), %rsi      # 0x8158
leaq 0x31ac(%rip), %rdi      # 0x5080
xorl %eax, %eax
callq 0x10c0
xorl %edi, %edi
callq 0x1230
leaq 0x31ee(%rip), %rdi      # 0x50d7
callq 0x1070
leaq 0x3216(%rip), %rdi      # 0x510b
callq 0x1070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1230
// File: /workspace/github_c_makefile_star2_O3/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 0xaf5a(%rip), %rax      # 0xc820
movl (%rdi), %edi
callq *(%rax)
movl 0x28(%rbx), %eax
testl %eax, %eax
jle 0x1971
movl $0x10, %r14d
xorl %r15d, %r15d
leaq 0xaecb(%rip), %r13      # 0xc7b0
leaq 0xaa74(%rip), %rbp      # 0xc360
movq 0x30(%rbx), %r12
movl -0x10(%r12,%r14), %esi
testl %esi, %esi
je 0x195e
movl $0x8892, %edi           # imm = 0x8892
leaq 0xab3b(%rip), %rax      # 0xc440
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 0x75b6
movl (%r12,%r14), %edx
movl $0x6, %edi
xorl %esi, %esi
callq *(%rbp)
movl 0x28(%rbx), %eax
incq %r15
movslq %eax, %rcx
addq $0x20, %r14
cmpq %rcx, %r15
jl 0x18ec
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x19aa
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x75ca
incq %r14
movslq 0x4(%rbx), %rax
cmpq %rax, %r14
jl 0x1991
cmpl $0x0, 0x28(%rbx)
jle 0x19d6
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 0x19b9
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
// File: /workspace/github_c_makefile_star2_O3/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 0x6628(%rip), %xmm0     # 0x8058
movups %xmm0, 0x14(%rax)
movss 0x6620(%rip), %xmm0     # 0x805c
movups %xmm0, 0x24(%rax)
movlps %xmm0, 0x34(%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/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
subss %xmm0, %xmm2
addss 0x1c(%rdi), %xmm1
addss 0x659b(%rip), %xmm2     # 0x8060
movss %xmm1, 0x1c(%rdi)
movss 0x6592(%rip), %xmm0     # 0x8064
ucomiss %xmm0, %xmm2
jae 0x1ae5
xorps %xmm0, %xmm0
ucomiss %xmm2, %xmm0
movaps %xmm2, %xmm0
jb 0x1ae5
xorps %xmm0, %xmm0
ucomiss 0x657c(%rip), %xmm1     # 0x8068
jbe 0x1af8
addss 0x6576(%rip), %xmm1     # 0x806c
jmp 0x1b1b
movss 0x656c(%rip), %xmm2     # 0x806c
ucomiss %xmm1, %xmm2
jbe 0x1b20
andps 0x6574(%rip), %xmm1     # 0x8080
addss 0x6558(%rip), %xmm1     # 0x806c
xorps 0x64f5(%rip), %xmm1     # 0x8010
movss %xmm1, 0x1c(%rbx)
addss 0x6548(%rip), %xmm0     # 0x8070
addss 0x6530(%rip), %xmm0     # 0x8060
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 0x6487(%rip), %xmm0     # 0x8010
mulss 0x4(%rsp), %xmm0
movss %xmm0, 0x14(%rbx)
movss 0x64d4(%rip), %xmm0     # 0x8070
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 0x7702
// File: /workspace/github_c_makefile_star2_O3/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 0x6075(%rip), %rdi      # 0x815d
callq 0x1120
movq %rax, 0xa15c(%rip)      # 0xc250
xorl %ebx, %ebx
testq %rax, %rax
je 0x2151
leaq 0x6069(%rip), %rdi      # 0x816b
callq 0x1120
movq %rax, 0xa80a(%rip)      # 0xc918
testq %rax, %rax
je 0x2151
leaq 0xc(%rsp), %rbx
movl $0x0, (%rbx)
movl $0x821d, %edi           # imm = 0x821D
movq %rbx, %rsi
callq *0xa124(%rip)           # 0xc250
cmpl $0x0, (%rbx)
jle 0x2148
xorl %ebx, %ebx
movl $0x1f03, %edi           # imm = 0x1F03
movl %ebx, %esi
callq *0xa7d8(%rip)           # 0xc918
incl %ebx
cmpl 0xc(%rsp), %ebx
jl 0x2133
callq 0x2159
movl %eax, %ebx
incl %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
retq