LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/FH0[P]tun_direct/lwip-2.1.2/src/core/def.c
// Function: lwip_stricmp
int
lwip_stricmp(const char *str1, const char *str2)
{
  char c1, c2;

  do {
    c1 = *str1++;
    c2 = *str2++;
    if (c1 != c2) {
      char c1_upc = c1 | 0x20;
      if ((c1_upc >= 'a') && (c1_upc <= 'z')) {
        /* characters are not equal an one is in the alphabet range:
        downcase both chars and check again */
        char c2_upc = c2 | 0x20;
        if (c1_upc != c2_upc) {
          /* still not equal */
          /* don't care for < or > */
          return 1;
        }
      } else {
        /* characters are not equal but none is in the alphabet range */
        return 1;
      }
    }
  } while (c1 != 0);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb (%rax), %al
movb %al, -0x19(%rbp)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb (%rax), %al
movb %al, -0x1a(%rbp)
movsbl -0x19(%rbp), %eax
movsbl -0x1a(%rbp), %ecx
cmpl %ecx, %eax
je 0x25388
movsbl -0x19(%rbp), %eax
orl $0x20, %eax
movb %al, -0x1b(%rbp)
movsbl -0x1b(%rbp), %eax
cmpl $0x61, %eax
jl 0x2537d
movsbl -0x1b(%rbp), %eax
cmpl $0x7a, %eax
jg 0x2537d
movsbl -0x1a(%rbp), %eax
orl $0x20, %eax
movb %al, -0x1c(%rbp)
movsbl -0x1b(%rbp), %eax
movsbl -0x1c(%rbp), %ecx
cmpl %ecx, %eax
je 0x2537b
movl $0x1, -0x4(%rbp)
jmp 0x2539e
jmp 0x25386
movl $0x1, -0x4(%rbp)
jmp 0x2539e
jmp 0x25388
jmp 0x2538a
movsbl -0x19(%rbp), %eax
cmpl $0x0, %eax
jne 0x2530c
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/FH0[P]tun_direct/lwip-2.1.2/src/core/def.c
// Function: lwip_strnicmp
int
lwip_strnicmp(const char *str1, const char *str2, size_t len)
{
  char c1, c2;

  do {
    c1 = *str1++;
    c2 = *str2++;
    if (c1 != c2) {
      char c1_upc = c1 | 0x20;
      if ((c1_upc >= 'a') && (c1_upc <= 'z')) {
        /* characters are not equal an one is in the alphabet range:
        downcase both chars and check again */
        char c2_upc = c2 | 0x20;
        if (c1_upc != c2_upc) {
          /* still not equal */
          /* don't care for < or > */
          return 1;
        }
      } else {
        /* characters are not equal but none is in the alphabet range */
        return 1;
      }
    }
    len--;
  } while ((len != 0) && (c1 != 0));
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb (%rax), %al
movb %al, -0x21(%rbp)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb (%rax), %al
movb %al, -0x22(%rbp)
movsbl -0x21(%rbp), %eax
movsbl -0x22(%rbp), %ecx
cmpl %ecx, %eax
je 0x2543c
movsbl -0x21(%rbp), %eax
orl $0x20, %eax
movb %al, -0x23(%rbp)
movsbl -0x23(%rbp), %eax
cmpl $0x61, %eax
jl 0x25431
movsbl -0x23(%rbp), %eax
cmpl $0x7a, %eax
jg 0x25431
movsbl -0x22(%rbp), %eax
orl $0x20, %eax
movb %al, -0x24(%rbp)
movsbl -0x23(%rbp), %eax
movsbl -0x24(%rbp), %ecx
cmpl %ecx, %eax
je 0x2542f
movl $0x1, -0x4(%rbp)
jmp 0x25473
jmp 0x2543a
movl $0x1, -0x4(%rbp)
jmp 0x25473
jmp 0x2543c
movq -0x20(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x20(%rbp)
movb %al, -0x25(%rbp)
je 0x25461
movsbl -0x21(%rbp), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x25(%rbp)
movb -0x25(%rbp), %al
testb $0x1, %al
jne 0x253c0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/FH0[P]tun_direct/lwip-2.1.2/src/core/def.c
// Function: lwip_itoa
void
lwip_itoa(char *result, size_t bufsize, int number)
{
  char *res = result;
  char *tmp = result + bufsize - 1;
  int n = (number >= 0) ? number : -number;

  /* handle invalid bufsize */
  if (bufsize < 2) {
    if (bufsize == 1) {
      *result = 0;
    }
    return;
  }

  /* First, add sign */
  if (number < 0) {
    *res++ = '-';
  }
  /* Then create the string from the end and stop if buffer full,
     and ensure output string is zero terminated */
  *tmp = 0;
  while ((n != 0) && (tmp > res)) {
    char val = (char)('0' + (n % 10));
    tmp--;
    *tmp = val;
    n = n / 10;
  }
  if (n) {
    /* buffer is too small */
    *result = 0;
    return;
  }
  if (*tmp == 0) {
    /* Nothing added? */
    *res++ = '0';
    *res++ = 0;
    return;
  }
  /* move from temporary buffer to output buffer (sign is not moved) */
  memmove(res, tmp, (size_t)((result + bufsize) - tmp));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
addq -0x10(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0x254b9
movl -0x14(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0x254c1
xorl %eax, %eax
subl -0x14(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x2c(%rbp)
cmpq $0x2, -0x10(%rbp)
jae 0x254e1
cmpq $0x1, -0x10(%rbp)
jne 0x254dc
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
jmp 0x255b7
cmpl $0x0, -0x14(%rbp)
jge 0x254f9
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x2d, (%rax)
movq -0x28(%rbp), %rax
movb $0x0, (%rax)
xorl %eax, %eax
cmpl $0x0, -0x2c(%rbp)
movb %al, -0x35(%rbp)
je 0x25519
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
seta %al
movb %al, -0x35(%rbp)
movb -0x35(%rbp), %al
testb $0x1, %al
jne 0x25522
jmp 0x2555a
movl -0x2c(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
addl $0x30, %edx
movb %dl, %al
movb %al, -0x2d(%rbp)
movq -0x28(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
movb -0x2d(%rbp), %cl
movq -0x28(%rbp), %rax
movb %cl, (%rax)
movl -0x2c(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %eax, -0x2c(%rbp)
jmp 0x25500
cmpl $0x0, -0x2c(%rbp)
je 0x25569
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
jmp 0x255b7
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x2559b
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x30, (%rax)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x0, (%rax)
jmp 0x255b7
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x8(%rbp), %rdx
addq -0x10(%rbp), %rdx
movq -0x28(%rbp), %rax
subq %rax, %rdx
callq 0x21d0
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/FH0[P]tun_direct/lwip-2.1.2/src/core/inet_chksum.c
// Function: lwip_standard_chksum
u16_t
lwip_standard_chksum(const void *dataptr, int len)
{
  const u8_t *pb = (const u8_t *)dataptr;
  const u16_t *ps;
  u16_t t = 0;
  u32_t sum = 0;
  int odd = ((mem_ptr_t)pb & 1);

  /* Get aligned to u16_t */
  if (odd && len > 0) {
    ((u8_t *)&t)[1] = *pb++;
    len--;
  }

  /* Add the bulk of the data */
  ps = (const u16_t *)(const void *)pb;
  while (len > 1) {
    sum += *ps++;
    len -= 2;
  }

  /* Consume left-over byte, if any */
  if (len > 0) {
    ((u8_t *)&t)[0] = *(const u8_t *)ps;
  }

  /* Add end bytes */
  sum += t;

  /* Fold 32-bit sum to 16 bits
     calling this twice is probably faster than if statements... */
  sum = FOLD_U32T(sum);
  sum = FOLD_U32T(sum);

  /* Swap if alignment was odd */
  if (odd) {
    sum = SWAP_BYTES_IN_WORD(sum);
  }

  return (u16_t)sum;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movw $0x0, -0x22(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rax
andq $0x1, %rax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x25614
cmpl $0x0, -0xc(%rbp)
jle 0x25614
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb (%rax), %al
movb %al, -0x21(%rbp)
movl -0xc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpl $0x1, -0xc(%rbp)
jle 0x25645
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x2, %rcx
movq %rcx, -0x20(%rbp)
movzwl (%rax), %eax
addl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0xc(%rbp), %eax
subl $0x2, %eax
movl %eax, -0xc(%rbp)
jmp 0x2561c
cmpl $0x0, -0xc(%rbp)
jle 0x25654
movq -0x20(%rbp), %rax
movb (%rax), %al
movb %al, -0x22(%rbp)
movzwl -0x22(%rbp), %eax
addl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
shrl $0x10, %eax
movl %eax, %eax
movl -0x28(%rbp), %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
shrl $0x10, %eax
movl %eax, %eax
movl -0x28(%rbp), %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x256b0
movl -0x28(%rbp), %eax
andl $0xff, %eax
shll $0x8, %eax
movl -0x28(%rbp), %ecx
andl $0xff00, %ecx           # imm = 0xFF00
shrl $0x8, %ecx
orl %ecx, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/FH0[P]tun_direct/lwip-2.1.2/src/core/inet_chksum.c
// Function: inet_chksum_pseudo
u16_t
inet_chksum_pseudo(struct pbuf *p, u8_t proto, u16_t proto_len,
                   const ip4_addr_t *src, const ip4_addr_t *dest)
{
  u32_t acc;
  u32_t addr;

  addr = ip4_addr_get_u32(src);
  acc = (addr & 0xffffUL);
  acc = (u32_t)(acc + ((addr >> 16) & 0xffffUL));
  addr = ip4_addr_get_u32(dest);
  acc = (u32_t)(acc + (addr & 0xffffUL));
  acc = (u32_t)(acc + ((addr >> 16) & 0xffffUL));
  /* fold down to 16 bits */
  acc = FOLD_U32T(acc);
  acc = FOLD_U32T(acc);

  return inet_cksum_pseudo_base(p, proto, proto_len, acc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movw %dx, %ax
movb %sil, %dl
movq %rdi, -0x8(%rbp)
movb %dl, -0x9(%rbp)
movw %ax, -0xc(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
andq $0xffff, %rax           # imm = 0xFFFF
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl -0x28(%rbp), %ecx
shrl $0x10, %ecx
movl %ecx, %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
movl -0x28(%rbp), %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl -0x28(%rbp), %ecx
shrl $0x10, %ecx
movl %ecx, %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
shrl $0x10, %eax
movl %eax, %eax
movl -0x24(%rbp), %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
shrl $0x10, %eax
movl %eax, %eax
movl -0x24(%rbp), %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movb -0x9(%rbp), %dl
movw -0xc(%rbp), %ax
movl -0x24(%rbp), %ecx
movzbl %dl, %esi
movzwl %ax, %edx
callq 0x257a0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/FH0[P]tun_direct/lwip-2.1.2/src/core/inet_chksum.c
// Function: ip6_chksum_pseudo
u16_t
ip6_chksum_pseudo(struct pbuf *p, u8_t proto, u16_t proto_len,
                  const ip6_addr_t *src, const ip6_addr_t *dest)
{
  u32_t acc = 0;
  u32_t addr;
  u8_t addr_part;

  for (addr_part = 0; addr_part < 4; addr_part++) {
    addr = src->addr[addr_part];
    acc = (u32_t)(acc + (addr & 0xffffUL));
    acc = (u32_t)(acc + ((addr >> 16) & 0xffffUL));
    addr = dest->addr[addr_part];
    acc = (u32_t)(acc + (addr & 0xffffUL));
    acc = (u32_t)(acc + ((addr >> 16) & 0xffffUL));
  }
  /* fold down to 16 bits */
  acc = FOLD_U32T(acc);
  acc = FOLD_U32T(acc);

  return inet_cksum_pseudo_base(p, proto, proto_len, acc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movw %dx, %ax
movb %sil, %dl
movq %rdi, -0x8(%rbp)
movb %dl, -0x9(%rbp)
movw %ax, -0xc(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movb $0x0, -0x29(%rbp)
movzbl -0x29(%rbp), %eax
cmpl $0x4, %eax
jge 0x259b4
movq -0x18(%rbp), %rax
movzbl -0x29(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
movl -0x28(%rbp), %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl -0x28(%rbp), %ecx
shrl $0x10, %ecx
movl %ecx, %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rax
movzbl -0x29(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
movl -0x28(%rbp), %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl -0x28(%rbp), %ecx
shrl $0x10, %ecx
movl %ecx, %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movb -0x29(%rbp), %al
addb $0x1, %al
movb %al, -0x29(%rbp)
jmp 0x2592c
movl -0x24(%rbp), %eax
shrl $0x10, %eax
movl %eax, %eax
movl -0x24(%rbp), %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
shrl $0x10, %eax
movl %eax, %eax
movl -0x24(%rbp), %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movb -0x9(%rbp), %dl
movw -0xc(%rbp), %ax
movl -0x24(%rbp), %ecx
movzbl %dl, %esi
movzwl %ax, %edx
callq 0x257a0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/FH0[P]tun_direct/lwip-2.1.2/src/core/inet_chksum.c
// Function: inet_chksum_pseudo_partial
u16_t
inet_chksum_pseudo_partial(struct pbuf *p, u8_t proto, u16_t proto_len,
                           u16_t chksum_len, const ip4_addr_t *src, const ip4_addr_t *dest)
{
  u32_t acc;
  u32_t addr;

  addr = ip4_addr_get_u32(src);
  acc = (addr & 0xffffUL);
  acc = (u32_t)(acc + ((addr >> 16) & 0xffffUL));
  addr = ip4_addr_get_u32(dest);
  acc = (u32_t)(acc + (addr & 0xffffUL));
  acc = (u32_t)(acc + ((addr >> 16) & 0xffffUL));
  /* fold down to 16 bits */
  acc = FOLD_U32T(acc);
  acc = FOLD_U32T(acc);

  return inet_cksum_pseudo_partial_base(p, proto, proto_len, chksum_len, acc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movw %cx, %ax
movw %dx, %cx
movb %sil, %dl
movq %rdi, -0x8(%rbp)
movb %dl, -0x9(%rbp)
movw %cx, -0xc(%rbp)
movw %ax, -0xe(%rbp)
movq %r8, -0x18(%rbp)
movq %r9, -0x20(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
andq $0xffff, %rax           # imm = 0xFFFF
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl -0x28(%rbp), %ecx
shrl $0x10, %ecx
movl %ecx, %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
movl -0x28(%rbp), %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl -0x28(%rbp), %ecx
shrl $0x10, %ecx
movl %ecx, %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
shrl $0x10, %eax
movl %eax, %eax
movl -0x24(%rbp), %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
shrl $0x10, %eax
movl %eax, %eax
movl -0x24(%rbp), %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movb -0x9(%rbp), %dl
movw -0xc(%rbp), %cx
movw -0xe(%rbp), %ax
movl -0x24(%rbp), %r8d
movzbl %dl, %esi
movzwl %cx, %edx
movzwl %ax, %ecx
callq 0x25b80
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/FH0[P]tun_direct/lwip-2.1.2/src/core/inet_chksum.c
// Function: ip6_chksum_pseudo_partial
u16_t
ip6_chksum_pseudo_partial(struct pbuf *p, u8_t proto, u16_t proto_len,
                          u16_t chksum_len, const ip6_addr_t *src, const ip6_addr_t *dest)
{
  u32_t acc = 0;
  u32_t addr;
  u8_t addr_part;

  for (addr_part = 0; addr_part < 4; addr_part++) {
    addr = src->addr[addr_part];
    acc = (u32_t)(acc + (addr & 0xffffUL));
    acc = (u32_t)(acc + ((addr >> 16) & 0xffffUL));
    addr = dest->addr[addr_part];
    acc = (u32_t)(acc + (addr & 0xffffUL));
    acc = (u32_t)(acc + ((addr >> 16) & 0xffffUL));
  }
  /* fold down to 16 bits */
  acc = FOLD_U32T(acc);
  acc = FOLD_U32T(acc);

  return inet_cksum_pseudo_partial_base(p, proto, proto_len, chksum_len, acc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movw %cx, %ax
movw %dx, %cx
movb %sil, %dl
movq %rdi, -0x8(%rbp)
movb %dl, -0x9(%rbp)
movw %cx, -0xc(%rbp)
movw %ax, -0xe(%rbp)
movq %r8, -0x18(%rbp)
movq %r9, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movb $0x0, -0x29(%rbp)
movzbl -0x29(%rbp), %eax
cmpl $0x4, %eax
jge 0x25e1b
movq -0x18(%rbp), %rax
movzbl -0x29(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
movl -0x28(%rbp), %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl -0x28(%rbp), %ecx
shrl $0x10, %ecx
movl %ecx, %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rax
movzbl -0x29(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
movl -0x28(%rbp), %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl -0x28(%rbp), %ecx
shrl $0x10, %ecx
movl %ecx, %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movb -0x29(%rbp), %al
addb $0x1, %al
movb %al, -0x29(%rbp)
jmp 0x25d93
movl -0x24(%rbp), %eax
shrl $0x10, %eax
movl %eax, %eax
movl -0x24(%rbp), %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
shrl $0x10, %eax
movl %eax, %eax
movl -0x24(%rbp), %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movb -0x9(%rbp), %dl
movw -0xc(%rbp), %cx
movw -0xe(%rbp), %ax
movl -0x24(%rbp), %r8d
movzbl %dl, %esi
movzwl %cx, %edx
movzwl %ax, %ecx
callq 0x25b80
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/FH0[P]tun_direct/lwip-2.1.2/src/core/inet_chksum.c
// Function: inet_chksum_pbuf
u16_t
inet_chksum_pbuf(struct pbuf *p)
{
  u32_t acc;
  struct pbuf *q;
  int swapped = 0;

  acc = 0;
  for (q = p; q != NULL; q = q->next) {
    acc += LWIP_CHKSUM(q->payload, q->len);
    acc = FOLD_U32T(acc);
    if (q->len % 2 != 0) {
      swapped = !swapped;
      acc = SWAP_BYTES_IN_WORD(acc);
    }
  }

  if (swapped) {
    acc = SWAP_BYTES_IN_WORD(acc);
  }
  return (u16_t)~(acc & 0xffffUL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x26007
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rax
movzwl 0x12(%rax), %esi
callq 0x255c0
movzwl %ax, %eax
addl -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
shrl $0x10, %eax
movl %eax, %eax
movl -0xc(%rbp), %ecx
andq $0xffff, %rcx           # imm = 0xFFFF
addq %rcx, %rax
movl %eax, -0xc(%rbp)
movq -0x18(%rbp), %rax
movzwl 0x12(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x25ff5
cmpl $0x0, -0x1c(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x1c(%rbp)
movl -0xc(%rbp), %eax
andl $0xff, %eax
shll $0x8, %eax
movl -0xc(%rbp), %ecx
andl $0xff00, %ecx           # imm = 0xFF00
shrl $0x8, %ecx
orl %ecx, %eax
movl %eax, -0xc(%rbp)
jmp 0x25ff7
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x25f72
cmpl $0x0, -0x1c(%rbp)
je 0x26029
movl -0xc(%rbp), %eax
andl $0xff, %eax
shll $0x8, %eax
movl -0xc(%rbp), %ecx
andl $0xff00, %ecx           # imm = 0xFF00
shrl $0x8, %ecx
orl %ecx, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
andq $0xffff, %rax           # imm = 0xFFFF
xorq $-0x1, %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/antonblanchard[P]will-it-scale/tests/fallocate1.c
// Function: testcase
void testcase(unsigned long long *iterations, unsigned long nr)
{
	char tmpfile[] = "/dev/shm/willitscale.XXXXXX";
	int fd = mkstemp(tmpfile);
	unsigned long place = 0;
	assert(fd >= 0);
	unlink(tmpfile);

	while (1) {
		int ret = fallocate(fd, 0, place, BUFLEN);
		if (errno != EINTR)
			assert(ret == 0);
		place += BUFLEN;
		if (place >= FILESIZE) {
			ret = ftruncate(fd, 0);
			assert(ret == 0);
			place = 0;
		}
		(*iterations)++;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0x12a9(%rip), %rax      # 0x32e0
movq %rax, -0x30(%rbp)
movq 0x12a6(%rip), %rax      # 0x32e8
movq %rax, -0x28(%rbp)
movq 0x12a3(%rip), %rax      # 0x32f0
movq %rax, -0x20(%rbp)
movl 0x12a1(%rip), %eax      # 0x32f8
movl %eax, -0x18(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x11e0
movl %eax, -0x34(%rbp)
movq $0x0, -0x40(%rbp)
cmpl $0x0, -0x34(%rbp)
jl 0x2076
jmp 0x2095
leaq 0x1201(%rip), %rdi      # 0x327e
leaq 0x1202(%rip), %rsi      # 0x3286
movl $0x14, %edx
leaq 0x1209(%rip), %rcx      # 0x3299
callq 0x1120
leaq -0x30(%rbp), %rdi
callq 0x1080
movl -0x34(%rbp), %edi
movq -0x40(%rbp), %rdx
xorl %esi, %esi
movl $0x2000, %ecx           # imm = 0x2000
callq 0x1160
movl %eax, -0x44(%rbp)
callq 0x1070
cmpl $0x4, (%rax)
je 0x20e7
cmpl $0x0, -0x44(%rbp)
jne 0x20c6
jmp 0x20e5
leaq 0x11ff(%rip), %rdi      # 0x32cc
leaq 0x11b2(%rip), %rsi      # 0x3286
movl $0x1a, %edx
leaq 0x11b9(%rip), %rcx      # 0x3299
callq 0x1120
jmp 0x20e7
movq -0x40(%rbp), %rax
addq $0x2000, %rax           # imm = 0x2000
movq %rax, -0x40(%rbp)
cmpq $0x100000, -0x40(%rbp)  # imm = 0x100000
jb 0x213d
movl -0x34(%rbp), %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x1110
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
jne 0x2116
jmp 0x2135
leaq 0x11af(%rip), %rdi      # 0x32cc
leaq 0x1162(%rip), %rsi      # 0x3286
movl $0x1e, %edx
leaq 0x1169(%rip), %rcx      # 0x3299
callq 0x1120
movq $0x0, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x209e
// File: /workspace/github_c_makefile_star2_O0/keithnoguchi[P]pearls-in-action/0xd/main_test.c
// Function: main
int main(void)
{
	int fail = 0;
	int i = 0;

	printf("=====================\n");
	printf("Column 0xd: Searching\n");
	printf("=====================\n");

	if (test_set1(&i))
		fail++;

	return fail;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
leaq 0xe30(%rip), %rdi       # 0x2004
movb $0x0, %al
callq 0x1060
leaq 0xe39(%rip), %rdi       # 0x201b
movb $0x0, %al
callq 0x1060
leaq 0xe14(%rip), %rdi       # 0x2004
movb $0x0, %al
callq 0x1060
leaq -0xc(%rbp), %rdi
callq 0x14d0
cmpl $0x0, %eax
je 0x120e
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/keithnoguchi[P]pearls-in-action/0xd/set1.c
// Function: alloc_set1
struct set *alloc_set1(int nr, int max)
{
	struct set1 *s;
	int i;

	s = malloc(sizeof(struct set1)+sizeof(int)*(nr+1));
	if (!s)
		return NULL;

	s->max = max;
	s->set = set;
	s->alloc = nr+1;
	for (i = 0; i < nr; i++)
		s->x[i] = 0;
	s->n = 0;	/* n does not incluse the sentinel */
	s->x[0] = max;	/* sentinel */
	return &s->set;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
addq $0x30, %rdi
callq 0x1090
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x125c
movq $0x0, -0x8(%rbp)
jmp 0x12ed
movl -0x10(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x18(%rbp), %rax
movq 0x260f(%rip), %rcx      # 0x3880
movq %rcx, 0x8(%rax)
movq 0x260c(%rip), %rcx      # 0x3888
movq %rcx, 0x10(%rax)
movq 0x2609(%rip), %rcx      # 0x3890
movq %rcx, 0x18(%rax)
movq 0x2606(%rip), %rcx      # 0x3898
movq %rcx, 0x20(%rax)
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x28(%rax)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x12cd
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl $0x0, 0x2c(%rax,%rcx,4)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x12aa
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movl -0x10(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x2c(%rax)
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/keithnoguchi[P]pearls-in-action/0xd/set1.c
// Function: insert
static int insert(struct set *b, int x)
{
	struct set1 *s = container_of(b, struct set1, set);
	int i, j;

	assert(x < s->max);

	/* find the position */
	for (i = 0; s->x[i] < x; i++)
		;

	/* ignore the duplicate */
	if (s->x[i] == x)
		return -1;

	/* array is full */
	if (s->n+1 == s->alloc)
		return -2;

	/* shift array */
	for (j = s->n+1; j > i; j--)
		s->x[j] = s->x[j-1];

	/* put the value */
	s->x[i] = x;
	s->n++;

	return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x1379
jmp 0x1398
leaq 0xcb2(%rip), %rdi       # 0x2032
leaq 0xcb6(%rip), %rsi       # 0x203d
movl $0x26, %edx
leaq 0xcb1(%rip), %rcx       # 0x2044
callq 0x1070
movl $0x0, -0x24(%rbp)
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl 0x2c(%rax,%rcx,4), %eax
cmpl -0x14(%rbp), %eax
jge 0x13bd
jmp 0x13b2
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x139f
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl 0x2c(%rax,%rcx,4), %eax
cmpl -0x14(%rbp), %eax
jne 0x13d7
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x144e
movq -0x20(%rbp), %rax
movl (%rax), %eax
addl $0x1, %eax
movq -0x20(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jne 0x13f2
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x144e
movq -0x20(%rbp), %rax
movl (%rax), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jle 0x142e
movq -0x20(%rbp), %rax
movl -0x28(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl 0x2c(%rax,%rcx,4), %edx
movq -0x20(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl %edx, 0x2c(%rax,%rcx,4)
movl -0x28(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x13fe
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl %edx, 0x2c(%rax,%rcx,4)
movq -0x20(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/keithnoguchi[P]pearls-in-action/0xd/set1.c
// Function: report
static void report(const struct set *b, int x[])
{
	struct set1 *s = container_of(b, struct set1, set);
	int i;

	for (i = 0; i < s->n; i++)
		x[i] = s->x[i];
	x[i] = s->x[i]; /* copy sentinel */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x14ac
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl 0x2c(%rax,%rcx,4), %edx
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x147f
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl 0x2c(%rax,%rcx,4), %edx
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/keithnoguchi[P]pearls-in-action/0xd/set1_test.c
// Function: test_set1
int test_set1(int *i)
{
	int fail = 0;

	if (test_set1_alloc(i))
		fail++;
	if (test_set1_insert(i))
		fail++;

	return fail;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1520
cmpl $0x0, %eax
je 0x14fa
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1700
cmpl $0x0, %eax
je 0x1511
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ikbenlike[P]nngutils/src/tty.c
// Function: main
int main(int argc, char **argv){
    bool silent = false;
    if(argc > 1){
        if(strcmp(argv[1], "--quiet")){
            silent = true;
        }
        else if(strcmp(argv[1], "-s")){
            silent = true;
        }
        else if(strcmp(argv[1], "--silent")){
            silent = true;
        }
        else {
            fprintf(stderr, "%s: incorrect argument %s\n", argv[0], argv[1]);
            return 1;
        }
    }
    char *tty = ttyname(STDIN_FILENO);
    if(tty == NULL){
        fprintf(stderr, "%s: %s\n", argv[0], strerror(errno));
        return 1;
    }
    if(silent == false){
        puts(tty);
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
cmpl $0x1, -0x8(%rbp)
jle 0x1247
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0xe41(%rip), %rsi       # 0x2004
callq 0x1050
cmpl $0x0, %eax
je 0x11d3
movb $0x1, -0x11(%rbp)
jmp 0x1245
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0xe2a(%rip), %rsi       # 0x200c
callq 0x1050
cmpl $0x0, %eax
je 0x11f2
movb $0x1, -0x11(%rbp)
jmp 0x1243
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0xe0e(%rip), %rsi       # 0x200f
callq 0x1050
cmpl $0x0, %eax
je 0x1211
movb $0x1, -0x11(%rbp)
jmp 0x1241
movq 0x2de0(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
leaq 0xde7(%rip), %rsi       # 0x2018
movb $0x0, %al
callq 0x1060
movl $0x1, -0x4(%rbp)
jmp 0x12bd
jmp 0x1243
jmp 0x1245
jmp 0x1247
xorl %edi, %edi
callq 0x1070
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x12a0
movq 0x2d98(%rip), %rax      # 0x3ff8
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
callq 0x1030
movl (%rax), %edi
callq 0x1080
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rdx
movq %rax, %rcx
leaq 0xda3(%rip), %rsi       # 0x2033
movb $0x0, %al
callq 0x1060
movl $0x1, -0x4(%rbp)
jmp 0x12bd
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x12b6
movq -0x20(%rbp), %rdi
callq 0x1040
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/misc/crt.c
// Function: err
void
err(char *fmt, ...)
{
	va_list ap;
	va_start(ap, fmt);
	fprintf(stderr, "error: ");
	vfprintf(stderr, fmt, ap);
	fprintf(stderr, "\n");
	va_end(ap);
	exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
testb %al, %al
je 0x25d5
movaps %xmm0, -0xa0(%rbp)
movaps %xmm1, -0x90(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm3, -0x70(%rbp)
movaps %xmm4, -0x60(%rbp)
movaps %xmm5, -0x50(%rbp)
movaps %xmm6, -0x40(%rbp)
movaps %xmm7, -0x30(%rbp)
movq %r9, -0xa8(%rbp)
movq %r8, -0xb0(%rbp)
movq %rcx, -0xb8(%rbp)
movq %rdx, -0xc0(%rbp)
movq %rsi, -0xc8(%rbp)
movq %rdi, -0x8(%rbp)
leaq -0x20(%rbp), %rax
leaq -0xd0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x8, (%rax)
movq 0x59b9(%rip), %rax      # 0x7fe0
movq (%rax), %rdi
leaq 0x3b9f(%rip), %rsi      # 0x61d0
movb $0x0, %al
callq 0x2360
movq 0x59a1(%rip), %rax      # 0x7fe0
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x2310
movq 0x598a(%rip), %rax      # 0x7fe0
movq (%rax), %rdi
leaq 0x3bc4(%rip), %rsi      # 0x6224
movb $0x0, %al
callq 0x2360
leaq -0x20(%rbp), %rax
movl $0x1, %edi
callq 0x22d0
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/misc/crt.c
// Function: resize
void
resize(void)
{
	int w, h;
	SDL_GetWindowSize(window, &w, &h);
	printf("resize %d %d\n", w, h);
	texrect.x = (w-1024)/2;
	texrect.y = (h-1024)/2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq 0x5be9(%rip), %rdi      # 0x82d8
leaq -0x4(%rbp), %rsi
leaq -0x8(%rbp), %rdx
callq 0x2110
movl -0x4(%rbp), %esi
movl -0x8(%rbp), %edx
leaq 0x3acf(%rip), %rdi      # 0x61d8
movb $0x0, %al
callq 0x2040
movl -0x4(%rbp), %eax
subl $0x400, %eax            # imm = 0x400
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0x5bba(%rip)      # 0x82e0
movl -0x8(%rbp), %eax
subl $0x400, %eax            # imm = 0x400
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0x5ba8(%rip)      # 0x82e4
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/misc/crt.c
// Function: btnmap_ds2
u32
btnmap_ds2(int btn)
{
	switch(btn){
	case 2: return 020000;	/* cross - beam */
	case 1: return 010;	/* circle - torpedo */
	case 0: return 0100000;	/* triangle - destruct */
	case 3: return 4;	/* square - hyperspace */
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movl -0x8(%rbp), %eax
movq %rax, -0x10(%rbp)
subq $0x3, %rax
ja 0x2b7c
movq -0x10(%rbp), %rax
leaq 0x35f9(%rip), %rcx      # 0x6148
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x2000, -0x4(%rbp)     # imm = 0x2000
jmp 0x2b83
movl $0x8, -0x4(%rbp)
jmp 0x2b83
movl $0x8000, -0x4(%rbp)     # imm = 0x8000
jmp 0x2b83
movl $0x4, -0x4(%rbp)
jmp 0x2b83
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/misc/crt.c
// Function: btnmap_ds3
u32
btnmap_ds3(int btn)
{
	switch(btn){
	case 0: return 020000;	/* cross - beam */
	case 1: return 010;	/* circle - torpedo */
	case 2: return 0100000;	/* triangle - destruct */
	case 3: return 4;	/* square - hyperspace */

	case 13: return 0200;	/* up */
	case 14: return 0100;	/* down */
	case 15: return 020;	/* left */
	case 16: return 040;	/* right */
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movl -0x8(%rbp), %eax
movq %rax, -0x10(%rbp)
subq $0x10, %rax
ja 0x2c00
movq -0x10(%rbp), %rax
leaq 0x35a9(%rip), %rcx      # 0x6158
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x2000, -0x4(%rbp)     # imm = 0x2000
jmp 0x2c07
movl $0x8, -0x4(%rbp)
jmp 0x2c07
movl $0x8000, -0x4(%rbp)     # imm = 0x8000
jmp 0x2c07
movl $0x4, -0x4(%rbp)
jmp 0x2c07
movl $0x80, -0x4(%rbp)
jmp 0x2c07
movl $0x40, -0x4(%rbp)
jmp 0x2c07
movl $0x10, -0x4(%rbp)
jmp 0x2c07
movl $0x20, -0x4(%rbp)
jmp 0x2c07
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/misc/crt.c
// Function: joyhat
void
joyhat(SDL_JoyHatEvent *he)
{
//	printf("%d %d %d\n", he->which, he->hat, he->value);
	u32 i, b;
	i = he->which;
	if(i >= NUMJOYS)
		return;

	b = 0;
	switch(he->value){
	case SDL_HAT_UP:	b = 0200; break;
	case SDL_HAT_RIGHTUP:	b = 0240; break;
	case SDL_HAT_RIGHT:	b = 0040; break;
	case SDL_HAT_RIGHTDOWN:	b = 0140; break;
	case SDL_HAT_DOWN:	b = 0100; break;
	case SDL_HAT_LEFTDOWN:	b = 0120; break;
	case SDL_HAT_LEFT:	b = 0020; break;
	case SDL_HAT_LEFTUP:	b = 0220; break;
	}

	joys[i].b &= ~0360;
	joys[i].b |= b;
	updatejoy(&joys[i]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0xc(%rbp)
cmpl $0x4, -0xc(%rbp)
jb 0x2c31
jmp 0x2cf8
movl $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movzbl 0xd(%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0xb, %eax
ja 0x2ca7
movq -0x18(%rbp), %rax
leaq 0x3544(%rip), %rcx      # 0x619c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x80, -0x10(%rbp)
jmp 0x2ca7
movl $0xa0, -0x10(%rbp)
jmp 0x2ca7
movl $0x20, -0x10(%rbp)
jmp 0x2ca7
movl $0x60, -0x10(%rbp)
jmp 0x2ca7
movl $0x40, -0x10(%rbp)
jmp 0x2ca7
movl $0x50, -0x10(%rbp)
jmp 0x2ca7
movl $0x10, -0x10(%rbp)
jmp 0x2ca7
movl $0x90, -0x10(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x563d(%rip), %rax      # 0x82f0
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
andl $0xffffff0f, %ecx       # imm = 0xFFFFFF0F
movl %ecx, 0x4(%rax)
movl -0x10(%rbp), %ecx
movl -0xc(%rbp), %eax
movl %eax, %edx
leaq 0x561b(%rip), %rax      # 0x82f0
shlq $0x4, %rdx
addq %rdx, %rax
orl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movl -0xc(%rbp), %eax
leaq 0x5604(%rip), %rdi      # 0x82f0
shlq $0x4, %rax
addq %rax, %rdi
callq 0x26a0
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/misc/crt.c
// Function: joybtn
void
joybtn(SDL_JoyButtonEvent *be)
{
	u32 i, b;
	i = be->which;
	if(i >= NUMJOYS)
		return;

	b = joys[i].map(be->button);
	if(be->state){
		joys[i].b |= b;
		updatejoy(&joys[i]);
	}else{
		joys[i].b &= ~b;
		updatejoy(&joys[i]);
	}

//	printf("%d %d %d. %o\n", be->which, be->button, be->state, joys[i].b);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0xc(%rbp)
cmpl $0x4, -0xc(%rbp)
jb 0x2d21
jmp 0x2db8
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x55c3(%rip), %rax      # 0x82f0
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movzbl 0xc(%rcx), %edi
callq *%rax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpb $0x0, 0xd(%rax)
je 0x2d83
movl -0x10(%rbp), %ecx
movl -0xc(%rbp), %eax
movl %eax, %edx
leaq 0x5592(%rip), %rax      # 0x82f0
shlq $0x4, %rdx
addq %rdx, %rax
orl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movl -0xc(%rbp), %eax
leaq 0x557b(%rip), %rdi      # 0x82f0
shlq $0x4, %rax
addq %rax, %rdi
callq 0x26a0
jmp 0x2db8
movl -0x10(%rbp), %ecx
xorl $-0x1, %ecx
movl -0xc(%rbp), %eax
movl %eax, %edx
leaq 0x555b(%rip), %rax      # 0x82f0
shlq $0x4, %rdx
addq %rdx, %rax
andl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movl -0xc(%rbp), %eax
leaq 0x5544(%rip), %rdi      # 0x82f0
shlq $0x4, %rax
addq %rax, %rdi
callq 0x26a0
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/misc/crt.c
// Function: joyinit
void
joyinit(void)
{
	int i, n;
	SDL_Joystick *j;

	SDL_JoystickEventState(SDL_ENABLE);

	for(i = 0; i < NUMJOYS; i++){
		joys[i].i = i;
		joys[i].map = btnmap_ds3;
	}

	n = SDL_NumJoysticks();
	for(i = 0; i < n && i < NUMJOYS; i++){
		j = SDL_JoystickOpen(i);
		if(j == nil)
			continue;
		if(strcmp(SDL_JoystickNameForIndex(i), "Twin USB Joystick") == 0)
			joys[i].map = btnmap_ds2;
		printf("joy %d: %s\n", i, SDL_JoystickNameForIndex(i));
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x1, %edi
callq 0x2240
movl $0x0, -0x4(%rbp)
cmpl $0x4, -0x4(%rbp)
jge 0x2e1e
movl -0x4(%rbp), %ecx
movslq -0x4(%rbp), %rdx
leaq 0x5503(%rip), %rax      # 0x82f0
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movslq -0x4(%rbp), %rcx
leaq 0x54ef(%rip), %rax      # 0x82f0
shlq $0x4, %rcx
addq %rcx, %rax
leaq -0x27f(%rip), %rcx      # 0x2b90
movq %rcx, 0x8(%rax)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x2dd9
callq 0x2170
movl %eax, -0x8(%rbp)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %ecx
xorl %eax, %eax
cmpl -0x8(%rbp), %ecx
movb %al, -0x11(%rbp)
jge 0x2e44
cmpl $0x4, -0x4(%rbp)
setl %al
movb %al, -0x11(%rbp)
movb -0x11(%rbp), %al
testb $0x1, %al
jne 0x2e4d
jmp 0x2ecb
movl -0x4(%rbp), %edi
callq 0x2120
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x2e62
jmp 0x2ebd
movl -0x4(%rbp), %edi
callq 0x2320
movq %rax, %rdi
leaq 0x3372(%rip), %rsi      # 0x61e6
callq 0x2340
cmpl $0x0, %eax
jne 0x2e9b
movslq -0x4(%rbp), %rcx
leaq 0x5467(%rip), %rax      # 0x82f0
shlq $0x4, %rcx
addq %rcx, %rax
leaq -0x367(%rip), %rcx      # 0x2b30
movq %rcx, 0x8(%rax)
movl -0x4(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x4(%rbp), %edi
callq 0x2320
movl -0x18(%rbp), %esi
movq %rax, %rdx
leaq 0x3342(%rip), %rdi      # 0x61f8
movb $0x0, %al
callq 0x2040
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x2e2d
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/misc/crt.c
// Function: mouse
void
mouse(int button, int state, int x, int y)
{
	u32 pen = 0x80000000;
	pen |= x;
	pen |= y<<10;
	if(state) pen |= 1<<20;
	if(state || penstate != !!state)
		write(sock, &pen, 4);
	penstate = !!state;
//	printf("%d %d %d %d\n", button, state, x, y);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
movl $0x80000000, -0x14(%rbp) # imm = 0x80000000
movl -0xc(%rbp), %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x10(%rbp), %eax
shll $0xa, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x8(%rbp)
je 0x2f21
movl -0x14(%rbp), %eax
orl $0x100000, %eax         # imm = 0x100000
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x8(%rbp)
jne 0x2f44
movl 0x5407(%rip), %eax      # 0x8334
cmpl $0x0, -0x8(%rbp)
setne %cl
xorb $-0x1, %cl
xorb $-0x1, %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
je 0x2f58
movl 0x5386(%rip), %edi      # 0x82d0
leaq -0x14(%rbp), %rsi
movl $0x4, %edx
callq 0x20f0
cmpl $0x0, -0x8(%rbp)
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x53c6(%rip)      # 0x8334
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/misc/crt.c
// Function: startcrt
void
startcrt(int fd, void *arg)
{
	static CRT CRT_;

	sock = fd;
	threadcreate(pixelthread, &CRT_);
	threadcreate(renderthread, &CRT_);
for(;;) sleep(1);
	exit(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x4(%rbp), %eax
movl %eax, 0x5308(%rip)      # 0x82d0
leaq 0x31(%rip), %rdi        # 0x3000
leaq 0x5362(%rip), %rsi      # 0x8338
callq 0x4810
leaq 0x18e(%rip), %rdi       # 0x3170
leaq 0x534f(%rip), %rsi      # 0x8338
callq 0x4810
movl $0x1, %edi
callq 0x21c0
jmp 0x2fee
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/misc/crt.c
// Function: pixelthread
static void*
pixelthread(void *arg)
{
	u32 cmd;
	int x;
	int y;
	int intensity;
	int i, v;
	Pixel *px;
	CRT *crt = arg;

	while(readn(sock, &cmd, 4) == 0){
		/* Queue pixel to display */
		x = cmd&01777;
		y = cmd>>10 & 01777;
//printf("%o %o\n", x, y);
		y = 1023-y;
		intensity = cmd>>20 & 7;

		intensity = pxintensity[intensity];
		i = 1024*y + x;
		v = crt->pxvals[i];

		lock(&crtlock);
		if(cmd & 1<<23)
			age++;

		if(intensity){
			if(v == 0){
				/* Add new pixel */
				px = &crt->pxlist[crt->numPixels++];
				px->x = x;
				px->y = y;
				px->l = blurLevelsDefault;
				crt->pxvals[i] = intensity;
			}else if(intensity > v)
				/* Intensify old pixel */
				crt->pxvals[i] = intensity;
		}
		unlock(&crtlock);
	}
	exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movl 0x52b6(%rip), %edi      # 0x82d0
leaq -0xc(%rbp), %rsi
movl $0x4, %edx
callq 0x5230
cmpl $0x0, %eax
jne 0x3162
movl -0xc(%rbp), %eax
andl $0x3ff, %eax            # imm = 0x3FF
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
shrl $0xa, %eax
andl $0x3ff, %eax            # imm = 0x3FF
movl %eax, -0x14(%rbp)
movl $0x3ff, %eax            # imm = 0x3FF
subl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0xc(%rbp), %eax
shrl $0x14, %eax
andl $0x7, %eax
movl %eax, -0x18(%rbp)
movslq -0x18(%rbp), %rcx
leaq 0x1d052f0(%rip), %rax   # 0x1d0835c
movzbl (%rax,%rcx), %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
shll $0xa, %eax
addl -0x10(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x30(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movzbl 0x1600014(%rax,%rcx), %eax
movl %eax, -0x20(%rbp)
leaq 0x1d052cf(%rip), %rdi   # 0x1d08368
callq 0x45a0
movl -0xc(%rbp), %eax
andl $0x800000, %eax         # imm = 0x800000
cmpl $0x0, %eax
je 0x30ba
movl 0x1d052a7(%rip), %eax   # 0x1d08358
addl $0x1, %eax
movl %eax, 0x1d0529e(%rip)   # 0x1d08358
cmpl $0x0, -0x18(%rbp)
je 0x3151
cmpl $0x0, -0x20(%rbp)
jne 0x3131
movq -0x30(%rbp), %rax
movq -0x30(%rbp), %rdx
movl 0x600000(%rdx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x600000(%rdx)
movslq %ecx, %rcx
imulq $0x6, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movl -0x10(%rbp), %eax
movw %ax, %cx
movq -0x28(%rbp), %rax
movw %cx, (%rax)
movl -0x14(%rbp), %eax
movw %ax, %cx
movq -0x28(%rbp), %rax
movw %cx, 0x2(%rax)
movl 0x515a(%rip), %eax      # 0x826c
movb %al, %cl
movq -0x28(%rbp), %rax
movb %cl, 0x4(%rax)
movl -0x18(%rbp), %eax
movb %al, %dl
movq -0x30(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movb %dl, 0x1600014(%rax,%rcx)
jmp 0x314f
movl -0x18(%rbp), %eax
cmpl -0x20(%rbp), %eax
jle 0x314d
movl -0x18(%rbp), %eax
movb %al, %dl
movq -0x30(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movb %dl, 0x1600014(%rax,%rcx)
jmp 0x314f
jmp 0x3151
leaq 0x1d05210(%rip), %rdi   # 0x1d08368
callq 0x46b0
jmp 0x3014
movl $0x1, %edi
callq 0x22d0
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/misc/crt.c
// Function: renderpixels
static void
renderpixels(CRT *crt)
{
	int i, p;
	Pixel *px;

	lock(&crtlock);
	px = crt->pxlist;
	for(i = 0; i < crt->numPixels; i++){
		p = 1024*px->y + px->x;
		renderpixel(crt, px->x, px->y, crt->pxvals[p], px->l);
		crt->pxvals[p] = 0;
		px++;
	}
	crt->numPixels = 0;
	unlock(&crtlock);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x1d04335(%rip), %rdi   # 0x1d08368
callq 0x45a0
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x600000(%rcx), %eax
jge 0x40c5
movq -0x18(%rbp), %rax
movzwl 0x2(%rax), %eax
shll $0xa, %eax
movq -0x18(%rbp), %rcx
movzwl (%rcx), %ecx
addl %ecx, %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movzwl (%rax), %esi
movq -0x18(%rbp), %rax
movzwl 0x2(%rax), %edx
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movzbl 0x1600014(%rax,%rcx), %ecx
movq -0x18(%rbp), %rax
movzbl 0x4(%rax), %r8d
callq 0x4330
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movb $0x0, 0x1600014(%rax,%rcx)
movq -0x18(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x18(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x4047
movq -0x8(%rbp), %rax
movl $0x0, 0x600000(%rax)
leaq 0x1d0428e(%rip), %rdi   # 0x1d08368
callq 0x46b0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deepika9294[P]Threading-Library/one-one/dthread.c
// Function: dthread_init
void dthread_init() {

    dthread_spin_init(&lock);

    threads = (list *)malloc(sizeof(list));
    main_thread_pid = getpid();
    init_threads(threads);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x2ee5(%rip), %rdi      # 0x40e0
callq 0x1230
movl $0x18, %edi
callq 0x10b0
movq %rax, 0x2ed7(%rip)      # 0x40e8
callq 0x1060
movl %eax, 0x2ed4(%rip)      # 0x40f0
movq 0x2ec5(%rip), %rdi      # 0x40e8
callq 0x18b0
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deepika9294[P]Threading-Library/one-one/dthread.c
// Function: dthread_cleanup
void dthread_cleanup() {
    dthread_spin_lock(&lock);
    dthread *td;
    
    int count = threads->count;

    for(int i = 0; i < count; i++){
        td = remove_last(threads);
        if(td != NULL)
            free(td);
    }
    //final threads remove
    free(threads);
    dthread_spin_unlock(&lock);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x2e81(%rip), %rdi      # 0x40e0
callq 0x12d0
movq 0x2e7d(%rip), %rax      # 0x40e8
movl 0x10(%rax), %eax
movl %eax, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x12ad
movq 0x2e61(%rip), %rdi      # 0x40e8
callq 0x1a00
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x12a0
movq -0x8(%rbp), %rdi
callq 0x1030
jmp 0x12a2
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x1278
movq 0x2e34(%rip), %rdi      # 0x40e8
callq 0x1030
leaq 0x2e20(%rip), %rdi      # 0x40e0
callq 0x12f0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)