LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv6/nd6.c
// Function: nd6_get_router
static s8_t
nd6_get_router(const ip6_addr_t *router_addr, struct netif *netif)
{
  s8_t i;

  IP6_ADDR_ZONECHECK_NETIF(router_addr, netif);

  /* Look for router. */
  for (i = 0; i < LWIP_ND6_NUM_ROUTERS; i++) {
    if ((default_router_list[i].neighbor_entry != NULL) &&
        ((netif != NULL) ? netif == default_router_list[i].neighbor_entry->netif : 1) &&
        ip6_addr_cmp(router_addr, &(default_router_list[i].neighbor_entry->next_hop_address))) {
      return i;
    }
  }

  /* router not found. */
  return -1;
}

// Assembly:
leaq 0xa407(%rip), %rax      # 0x1c770
movl 0x24(%rax), %ecx
movl 0x28(%rax), %edx
movl 0x2c(%rax), %esi
movl 0x30(%rax), %r8d
movb 0x34(%rax), %r9b
leaq 0xa8bf(%rip), %r10      # 0x1cc40
xorl %eax, %eax
movq (%r10), %r11
testq %r11, %r11
je 0x123b3
testq %rdi, %rdi
je 0x12396
cmpq %rdi, 0x18(%r11)
jne 0x123b3
cmpl (%r11), %ecx
jne 0x123b3
cmpl 0x4(%r11), %edx
jne 0x123b3
cmpl 0x8(%r11), %esi
jne 0x123b3
cmpl 0xc(%r11), %r8d
jne 0x123b3
cmpb 0x10(%r11), %r9b
je 0x123c2
incq %rax
addq $0x10, %r10
cmpq $0x3, %rax
jne 0x12383
movb $-0x1, %al
retq
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv6/nd6.c
// Function: nd6_free_neighbor_cache_entry
static void
nd6_free_neighbor_cache_entry(s8_t i)
{
  if ((i < 0) || (i >= LWIP_ND6_NUM_NEIGHBORS)) {
    return;
  }
  if (neighbor_cache[i].isrouter) {
    /* isrouter needs to be cleared before deleting a neighbor cache entry */
    return;
  }

  /* Free any queued packets. */
  if (neighbor_cache[i].q != NULL) {
    nd6_free_q(neighbor_cache[i].q);
    neighbor_cache[i].q = NULL;
  }

  neighbor_cache[i].state = ND6_NO_ENTRY;
  neighbor_cache[i].isrouter = 0;
  neighbor_cache[i].netif = NULL;
  neighbor_cache[i].counter.reachable_time = 0;
  ip6_addr_set_zero(&(neighbor_cache[i].next_hop_address));
}

// Assembly:
pushq %rbx
cmpb $0x9, %dil
ja 0x12a99
movzbl %dil, %eax
imulq $0x38, %rax, %rax
leaq 0x9fb6(%rip), %rbx      # 0x1ca10
cmpb $0x0, 0x31(%rax,%rbx)
jne 0x12a99
addq %rax, %rbx
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x12a7a
callq 0x134f0
movq $0x0, 0x28(%rbx)
movw $0x0, 0x30(%rbx)
movq $0x0, 0x18(%rbx)
movl $0x0, 0x34(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movb $0x0, 0x10(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv6/nd6.c
// Function: nd6_find_route
struct netif *
nd6_find_route(const ip6_addr_t *ip6addr)
{
  struct netif *netif;
  s8_t i;

  /* @todo decide if it makes sense to check the destination cache first */

  /* Check if there is a matching on-link prefix. There may be multiple
   * matches. Pick the first one that is associated with a suitable netif. */
  for (i = 0; i < LWIP_ND6_NUM_PREFIXES; ++i) {
    netif = prefix_list[i].netif;
    if ((netif != NULL) && ip6_addr_netcmp(&prefix_list[i].prefix, ip6addr) &&
        netif_is_up(netif) && netif_is_link_up(netif)) {
      return netif;
    }
  }

  /* No on-link prefix match. Find a router that can forward the packet. */
  i = nd6_select_router(ip6addr, NULL);
  if (i >= 0) {
    LWIP_ASSERT("selected router must have a neighbor entry",
      default_router_list[i].neighbor_entry != NULL);
    return default_router_list[i].neighbor_entry->netif;
  }

  return NULL;
}

// Assembly:
pushq %rbx
xorl %eax, %eax
leaq 0xa021(%rip), %rcx      # 0x1cc90
movq 0x18(%rax,%rcx), %rbx
testq %rbx, %rbx
je 0x12c9f
movl (%rax,%rcx), %edx
cmpl (%rdi), %edx
jne 0x12c9f
movl 0x4(%rax,%rcx), %edx
cmpl 0x4(%rdi), %edx
jne 0x12c9f
movb 0x10(%rax,%rcx), %dl
cmpb 0x10(%rdi), %dl
jne 0x12c9f
movb 0xeb(%rbx), %dl
notb %dl
testb $0x5, %dl
je 0x12cd2
addq $0x28, %rax
cmpq $0xc8, %rax
jne 0x12c6f
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x12d04
testb %al, %al
js 0x12cd2
movzbl %al, %eax
shll $0x4, %eax
leaq 0x9f7b(%rip), %rcx      # 0x1cc40
movq (%rax,%rcx), %rax
testq %rax, %rax
je 0x12cd7
movq 0x18(%rax), %rbx
movq %rbx, %rax
popq %rbx
retq
leaq 0x15ee(%rip), %rdi      # 0x142cc
leaq 0x3aca(%rip), %rsi      # 0x167af
leaq 0x3aa4(%rip), %rcx      # 0x16790
movl $0x6e3, %edx            # imm = 0x6E3
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv6/nd6.c
// Function: nd6_get_destination_mtu
u16_t
nd6_get_destination_mtu(const ip6_addr_t *ip6addr, struct netif *netif)
{
  s16_t i;

  i = nd6_find_destination_cache_entry(ip6addr);
  if (i >= 0) {
    if (destination_cache[i].pmtu > 0) {
      return destination_cache[i].pmtu;
    }
  }

  if (netif != NULL) {
    return netif_mtu6(netif);
  }

  return 1280; /* Minimum MTU */
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
callq 0x12695
testw %ax, %ax
js 0x13360
movzwl %ax, %eax
leaq (%rax,%rax,2), %rax
shll $0x4, %eax
leaq 0x9a0a(%rip), %rcx      # 0x1cd60
movzwl 0x28(%rax,%rcx), %eax
testw %ax, %ax
jne 0x13372
testq %rbx, %rbx
je 0x1336e
movzwl 0xe2(%rbx), %eax
jmp 0x13372
movw $0x500, %ax             # imm = 0x500
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv6/nd6.c
// Function: nd6_reachability_hint
void
nd6_reachability_hint(const ip6_addr_t *ip6addr)
{
  s8_t i;
  s16_t dst_idx;

  /* Find destination in cache. */
  if (ip6_addr_cmp(ip6addr, &(destination_cache[nd6_cached_destination_index].destination_addr))) {
    dst_idx = nd6_cached_destination_index;
    ND6_STATS_INC(nd6.cachehit);
  } else {
    dst_idx = nd6_find_destination_cache_entry(ip6addr);
  }
  if (dst_idx < 0) {
    return;
  }

  /* Find next hop neighbor in cache. */
  if (ip6_addr_cmp(&(destination_cache[dst_idx].next_hop_addr), &(neighbor_cache[nd6_cached_neighbor_index].next_hop_address))) {
    i = nd6_cached_neighbor_index;
    ND6_STATS_INC(nd6.cachehit);
  } else {
    i = nd6_find_neighbor_cache_entry(&(destination_cache[dst_idx].next_hop_addr));
  }
  if (i < 0) {
    return;
  }

  /* For safety: don't set as reachable if we don't have a LL address yet. Misuse protection. */
  if (neighbor_cache[i].state == ND6_INCOMPLETE || neighbor_cache[i].state == ND6_NO_ENTRY) {
    return;
  }

  /* Set reachability state. */
  neighbor_cache[i].state = ND6_REACHABLE;
  neighbor_cache[i].counter.reachable_time = reachable_time;
}

// Assembly:
pushq %rbx
movl (%rdi), %edx
movzbl 0x9bc3(%rip), %eax      # 0x1cf41
leaq (%rax,%rax,2), %rcx
shll $0x4, %ecx
leaq 0x99d4(%rip), %rbx      # 0x1cd60
cmpl (%rcx,%rbx), %edx
jne 0x133b4
addq %rbx, %rcx
movl 0x4(%rdi), %edx
cmpl 0x4(%rcx), %edx
jne 0x133b4
movl 0x8(%rdi), %edx
cmpl 0x8(%rcx), %edx
jne 0x133b4
movl 0xc(%rdi), %edx
cmpl 0xc(%rcx), %edx
jne 0x133b4
movb 0x10(%rdi), %dl
cmpb 0x10(%rcx), %dl
je 0x133be
callq 0x12695
testw %ax, %ax
js 0x13433
movzwl %ax, %eax
leaq (%rax,%rax,2), %rax
shll $0x4, %eax
leaq (%rax,%rbx), %rdi
addq $0x14, %rdi
movl (%rdi), %edx
movzbl 0x9b69(%rip), %eax      # 0x1cf42
imulq $0x38, %rax, %rcx
leaq 0x962c(%rip), %rbx      # 0x1ca10
cmpl (%rcx,%rbx), %edx
jne 0x1340c
addq %rbx, %rcx
movl 0x4(%rdi), %edx
cmpl 0x4(%rcx), %edx
jne 0x1340c
movl 0x8(%rdi), %edx
cmpl 0x8(%rcx), %edx
jne 0x1340c
movl 0xc(%rdi), %edx
cmpl 0xc(%rcx), %edx
jne 0x1340c
movb 0x10(%rdi), %dl
cmpb 0x10(%rcx), %dl
je 0x13411
callq 0x11e3c
testb %al, %al
js 0x13433
movzbl %al, %eax
imulq $0x38, %rax, %rax
cmpb $0x2, 0x30(%rax,%rbx)
jb 0x13433
addq %rax, %rbx
movb $0x2, 0x30(%rbx)
movl 0x8d24(%rip), %eax      # 0x1c154
movl %eax, 0x34(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv6/nd6.c
// Function: nd6_cleanup_netif
void
nd6_cleanup_netif(struct netif *netif)
{
  u8_t i;
  s8_t router_index;
  for (i = 0; i < LWIP_ND6_NUM_PREFIXES; i++) {
    if (prefix_list[i].netif == netif) {
      prefix_list[i].netif = NULL;
    }
  }
  for (i = 0; i < LWIP_ND6_NUM_NEIGHBORS; i++) {
    if (neighbor_cache[i].netif == netif) {
      for (router_index = 0; router_index < LWIP_ND6_NUM_ROUTERS; router_index++) {
        if (default_router_list[router_index].neighbor_entry == &neighbor_cache[i]) {
          default_router_list[router_index].neighbor_entry = NULL;
          default_router_list[router_index].flags = 0;
        }
      }
      neighbor_cache[i].isrouter = 0;
      nd6_free_neighbor_cache_entry(i);
    }
  }
  /* Clear the destination cache, since many entries may now have become
   * invalid for one of several reasons. As destination cache entries have no
   * netif association, use a sledgehammer approach (this can be improved). */
  nd6_clear_destination_cache();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x18, %eax
leaq 0x9844(%rip), %rcx      # 0x1cc90
cmpq %rbx, (%rax,%rcx)
jne 0x1345a
movq $0x0, (%rax,%rcx)
addq $0x28, %rax
cmpq $0xe0, %rax
jne 0x1344c
xorl %r14d, %r14d
leaq 0x95a0(%rip), %r15      # 0x1ca10
leaq 0x97c9(%rip), %r12      # 0x1cc40
imulq $0x38, %r14, %rax
cmpq %rbx, 0x18(%rax,%r15)
jne 0x134b2
addq %r15, %rax
xorl %ecx, %ecx
cmpq %rax, (%rcx,%r12)
jne 0x1349b
movq $0x0, (%rcx,%r12)
movb $0x0, 0xc(%rcx,%r12)
addq $0x10, %rcx
cmpq $0x30, %rcx
jne 0x13487
movb $0x0, 0x31(%rax)
movsbl %r14b, %edi
callq 0x12a44
incq %r14
cmpq $0xa, %r14
jne 0x13477
xorl %eax, %eax
leaq 0x989c(%rip), %rcx      # 0x1cd60
xorps %xmm0, %xmm0
movaps %xmm0, (%rax,%rcx)
movb $0x0, 0x10(%rax,%rcx)
addq $0x30, %rax
cmpq $0x1e0, %rax            # imm = 0x1E0
jne 0x134c7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv6/nd6.c
// Function: nd6_free_q
static void
nd6_free_q(struct nd6_q_entry *q)
{
  struct nd6_q_entry *r;
  LWIP_ASSERT("q != NULL", q != NULL);
  LWIP_ASSERT("q->p != NULL", q->p != NULL);
  while (q) {
    r = q;
    q = q->next;
    LWIP_ASSERT("r->p != NULL", (r->p != NULL));
    pbuf_free(r->p);
    memp_free(MEMP_ND6_QUEUE, r);
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpq $0x0, 0x8(%rdi)
je 0x13559
movq %rdi, %rbx
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x1352c
movq (%rbx), %r14
callq 0x4fdf
movl $0x8, %edi
movq %rbx, %rsi
callq 0x3cf8
movq %r14, %rbx
testq %r14, %r14
jne 0x134fe
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xd99(%rip), %rdi       # 0x142cc
leaq 0x32c8(%rip), %rsi      # 0x16802
leaq 0x324f(%rip), %rcx      # 0x16790
movl $0x873, %edx            # imm = 0x873
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
leaq 0xd6c(%rip), %rdi       # 0x142cc
leaq 0x328e(%rip), %rsi      # 0x167f5
leaq 0x3222(%rip), %rcx      # 0x16790
movl $0x86f, %edx            # imm = 0x86F
jmp 0x13546
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/def.c
// Function: lwip_strnstr
char *
lwip_strnstr(const char *buffer, const char *token, size_t n)
{
  const char *p;
  size_t tokenlen = strlen(token);
  if (tokenlen == 0) {
    return LWIP_CONST_CAST(char *, buffer);
  }
  for (p = buffer; *p && (p + tokenlen <= buffer + n); p++) {
    if ((*p == *token) && (strncmp(p, token, tokenlen) == 0)) {
      return LWIP_CONST_CAST(char *, p);
    }
  }
  return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x20c0
testq %rax, %rax
je 0x135ff
movq %rax, %r12
movb (%rbx), %al
testb %al, %al
sete %cl
cmpq %r14, %r12
setg %dl
orb %cl, %dl
je 0x13605
movq $0x0, (%rsp)
jmp 0x13649
movq %rbx, (%rsp)
jmp 0x13649
addq %rbx, %r14
movb (%r15), %bpl
incq %rbx
movq $0x0, (%rsp)
cmpb %bpl, %al
jne 0x13631
leaq -0x1(%rbx), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2080
testl %eax, %eax
je 0x13645
movb (%rbx), %al
testb %al, %al
je 0x13649
leaq (%rbx,%r12), %rcx
incq %rbx
cmpq %r14, %rcx
jbe 0x13616
jmp 0x13649
movq %r13, (%rsp)
movq (%rsp), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
movl %edx, %ecx
negl %ecx
cmovsl %edx, %ecx
cmpq $0x1, %rsi
ja 0x136ed
je 0x13781
jmp 0x1378b
leaq (%rdi,%rsi), %r8
decq %r8
movq %rdi, %rax
testl %edx, %edx
jns 0x13702
leaq 0x1(%rdi), %rax
movb $0x2d, (%rdi)
movb $0x0, (%r8)
testl %edx, %edx
setne %r9b
cmpq %rax, %r8
seta %r8b
andb %r9b, %r8b
cmpb $0x1, %r8b
jne 0x1377d
leaq (%rsi,%rdi), %r9
addq $-0x2, %r9
movl $0x1, %edx
movl $0xcccccccd, %r10d      # imm = 0xCCCCCCCD
movl %ecx, %r11d
movl %ecx, %ecx
imulq %r10, %rcx
shrq $0x23, %rcx
leal (%rcx,%rcx), %esi
leal (%rsi,%rsi,4), %esi
movl %r11d, %ebx
subl %esi, %ebx
orb $0x30, %bl
movb %bl, (%r9)
addl $-0xa, %r11d
incq %rdx
leaq -0x1(%r9), %rsi
cmpl $-0x14, %r11d
ja 0x13766
cmpq %rax, %r9
movq %rsi, %r9
ja 0x1372f
cmpl $-0x13, %r11d
jb 0x13781
testb %r8b, %r8b
je 0x13786
incq %rsi
movq %rax, %rdi
popq %rbx
jmp 0x21d0
testl %edx, %edx
je 0x13786
movb $0x0, (%rdi)
jmp 0x1378b
movw $0x30, (%rax)
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/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:
testb $0x1, %dil
sete %cl
testl %esi, %esi
setle %dl
xorl %eax, %eax
orb %cl, %dl
jne 0x137b0
leaq 0x1(%rdi), %rdx
movzbl (%rdi), %ecx
decl %esi
shll $0x8, %ecx
jmp 0x137b5
movq %rdi, %rdx
xorl %ecx, %ecx
cmpl $0x2, %esi
jl 0x137d5
xorl %eax, %eax
movzwl (%rdx), %r8d
addq $0x2, %rdx
addl %r8d, %eax
leal -0x2(%rsi), %r8d
cmpl $0x3, %esi
movl %r8d, %esi
ja 0x137bc
jmp 0x137d8
movl %esi, %r8d
xorl %esi, %esi
cmpl $0x1, %r8d
jne 0x137e3
movzbl (%rdx), %esi
orl %ecx, %esi
addl %eax, %esi
movl %esi, %eax
shrl $0x10, %eax
movzwl %si, %ecx
addl %eax, %ecx
movl %ecx, %edx
shrl $0x10, %edx
addl %ecx, %edx
movl %edx, %eax
rolw $0x8, %ax
testb $0x1, %dil
cmovel %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/inet_chksum.c
// Function: inet_cksum_pseudo_base
static u16_t
inet_cksum_pseudo_base(struct pbuf *p, u8_t proto, u16_t proto_len, u32_t acc)
{
  struct pbuf *q;
  int swapped = 0;

  /* iterate through all pbuf in chain */
  for (q = p; q != NULL; q = q->next) {
    LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): checksumming pbuf %p (has next %p) \n",
                             (void *)q, (void *)q->next));
    acc += LWIP_CHKSUM(q->payload, q->len);
    /*LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): unwrapped lwip_chksum()=%"X32_F" \n", acc));*/
    /* just executing this next line is probably faster that the if statement needed
       to check whether we really need to execute it, and does no harm */
    acc = FOLD_U32T(acc);
    if (q->len % 2 != 0) {
      swapped = !swapped;
      acc = SWAP_BYTES_IN_WORD(acc);
    }
    /*LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): wrapped lwip_chksum()=%"X32_F" \n", acc));*/
  }

  if (swapped) {
    acc = SWAP_BYTES_IN_WORD(acc);
  }

  acc += (u32_t)lwip_htons((u16_t)proto);
  acc += (u32_t)lwip_htons(proto_len);

  /* Fold 32-bit sum to 16 bits
     calling this twice is probably faster than if statements... */
  acc = FOLD_U32T(acc);
  acc = FOLD_U32T(acc);
  LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): pbuf chain lwip_chksum()=%"X32_F"\n", acc));
  return (u16_t)~(acc & 0xffffUL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movl %edx, %ebx
movl %esi, %r14d
testq %rdi, %rdi
je 0x138a9
movq %rdi, %r15
xorl %r13d, %r13d
movq 0x8(%r15), %rdi
movzwl 0x12(%r15), %r12d
movl %r12d, %esi
callq 0x13790
movzwl %ax, %eax
addl %ebp, %eax
movzwl %ax, %ebp
shrl $0x10, %eax
addl %eax, %ebp
testb $0x1, %r12b
je 0x13892
xorl %eax, %eax
testl %r13d, %r13d
sete %al
rolw $0x8, %bp
movzwl %bp, %ebp
movl %eax, %r13d
movq (%r15), %r15
testq %r15, %r15
jne 0x1385c
movl %ebp, %eax
rolw $0x8, %ax
testl %r13d, %r13d
movzwl %ax, %eax
cmovnel %eax, %ebp
movzbl %r14b, %edi
callq 0x135b4
movzwl %ax, %r14d
addl %ebp, %r14d
movzwl %bx, %edi
callq 0x135b4
movzwl %ax, %eax
addl %r14d, %eax
movzwl %ax, %ecx
shrl $0x10, %eax
addl %eax, %ecx
movl %ecx, %eax
shrl $0x10, %eax
addl %ecx, %eax
notl %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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:
movdqu (%rcx), %xmm0
movdqa 0x2f2d(%rip), %xmm1     # 0x16820
movdqa %xmm0, %xmm2
pand %xmm1, %xmm2
psrld $0x10, %xmm0
paddd %xmm2, %xmm0
movdqu (%r8), %xmm2
pand %xmm2, %xmm1
psrld $0x10, %xmm2
paddd %xmm1, %xmm2
paddd %xmm0, %xmm2
pshufd $0xee, %xmm2, %xmm0     # xmm0 = xmm2[2,3,2,3]
paddd %xmm2, %xmm0
pshufd $0x55, %xmm0, %xmm1     # xmm1 = xmm0[1,1,1,1]
paddd %xmm0, %xmm1
movd %xmm1, %ecx
movl %ecx, %eax
shrl $0x10, %eax
movl $0xffff, %r8d           # imm = 0xFFFF
andl %r8d, %ecx
addl %eax, %ecx
movl %ecx, %eax
shrl $0x10, %eax
andl %r8d, %ecx
addl %eax, %ecx
jmp 0x1383f
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/inet_chksum.c
// Function: ip_chksum_pseudo
u16_t
ip_chksum_pseudo(struct pbuf *p, u8_t proto, u16_t proto_len,
                 const ip_addr_t *src, const ip_addr_t *dest)
{
#if LWIP_IPV6
  if (IP_IS_V6(dest)) {
    return ip6_chksum_pseudo(p, proto, proto_len, ip_2_ip6(src), ip_2_ip6(dest));
  }
#endif /* LWIP_IPV6 */
#if LWIP_IPV4 && LWIP_IPV6
  else
#endif /* LWIP_IPV4 && LWIP_IPV6 */
#if LWIP_IPV4
  {
    return inet_chksum_pseudo(p, proto, proto_len, ip_2_ip4(src), ip_2_ip4(dest));
  }
#endif /* LWIP_IPV4 */
}

// Assembly:
cmpb $0x6, 0x14(%r8)
jne 0x13962
movzbl %sil, %esi
movzwl %dx, %edx
jmp 0x138e7
movl (%rcx), %eax
movl $0xffff, %r9d           # imm = 0xFFFF
movl %eax, %ecx
andl %r9d, %ecx
shrl $0x10, %eax
addl %ecx, %eax
movl (%r8), %ecx
movl %ecx, %r8d
andl %r9d, %r8d
shrl $0x10, %ecx
addl %r8d, %ecx
addl %eax, %ecx
movl %ecx, %eax
shrl $0x10, %eax
andl %r9d, %ecx
addl %eax, %ecx
movl %ecx, %eax
shrl $0x10, %eax
andl %r9d, %ecx
addl %eax, %ecx
movzbl %sil, %esi
movzwl %dx, %edx
jmp 0x1383f
// File: /workspace/github_c_makefile_star2_O3/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:
movdqu (%r8), %xmm0
movdqa 0x2d01(%rip), %xmm1     # 0x16820
movdqa %xmm0, %xmm2
pand %xmm1, %xmm2
psrld $0x10, %xmm0
paddd %xmm2, %xmm0
movdqu (%r9), %xmm2
pand %xmm2, %xmm1
psrld $0x10, %xmm2
paddd %xmm1, %xmm2
paddd %xmm0, %xmm2
pshufd $0xee, %xmm2, %xmm0     # xmm0 = xmm2[2,3,2,3]
paddd %xmm2, %xmm0
pshufd $0x55, %xmm0, %xmm1     # xmm1 = xmm0[1,1,1,1]
paddd %xmm0, %xmm1
movd %xmm1, %r8d
movl %r8d, %eax
shrl $0x10, %eax
movl $0xffff, %r9d           # imm = 0xFFFF
andl %r9d, %r8d
addl %eax, %r8d
movl %r8d, %eax
shrl $0x10, %eax
andl %r9d, %r8d
addl %eax, %r8d
jmp 0x139e7
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/inet_chksum.c
// Function: ip_chksum_pseudo_partial
u16_t
ip_chksum_pseudo_partial(struct pbuf *p, u8_t proto, u16_t proto_len,
                         u16_t chksum_len, const ip_addr_t *src, const ip_addr_t *dest)
{
#if LWIP_IPV6
  if (IP_IS_V6(dest)) {
    return ip6_chksum_pseudo_partial(p, proto, proto_len, chksum_len, ip_2_ip6(src), ip_2_ip6(dest));
  }
#endif /* LWIP_IPV6 */
#if LWIP_IPV4 && LWIP_IPV6
  else
#endif /* LWIP_IPV4 && LWIP_IPV6 */
#if LWIP_IPV4
  {
    return inet_chksum_pseudo_partial(p, proto, proto_len, chksum_len, ip_2_ip4(src), ip_2_ip4(dest));
  }
#endif /* LWIP_IPV4 */
}

// Assembly:
cmpb $0x6, 0x14(%r9)
jne 0x13b96
movzbl %sil, %esi
movzwl %dx, %edx
movzwl %cx, %ecx
jmp 0x13b12
movl (%r8), %eax
movl $0xffff, %r10d          # imm = 0xFFFF
movl %eax, %r8d
andl %r10d, %r8d
shrl $0x10, %eax
addl %r8d, %eax
movl (%r9), %r8d
movl %r8d, %r9d
andl %r10d, %r9d
shrl $0x10, %r8d
addl %r9d, %r8d
addl %eax, %r8d
movl %r8d, %eax
shrl $0x10, %eax
andl %r10d, %r8d
addl %eax, %r8d
movl %r8d, %eax
shrl $0x10, %eax
andl %r10d, %r8d
addl %eax, %r8d
movzbl %sil, %esi
movzwl %dx, %edx
movzwl %cx, %ecx
jmp 0x139e7
// File: /workspace/github_c_makefile_star2_O3/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:
testq %rdi, %rdi
je 0x13c60
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r15d, %r15d
xorl %r14d, %r14d
movq 0x8(%rbx), %rdi
movzwl 0x12(%rbx), %ebp
movl %ebp, %esi
callq 0x13790
movzwl %ax, %eax
addl %r14d, %eax
movzwl %ax, %r14d
shrl $0x10, %eax
addl %eax, %r14d
testb $0x1, %bpl
je 0x13c3d
xorl %eax, %eax
testl %r15d, %r15d
sete %al
rolw $0x8, %r14w
movzwl %r14w, %r14d
movl %eax, %r15d
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x13c04
movl %r14d, %eax
rolw $0x8, %ax
testl %r15d, %r15d
cmovel %r14d, %eax
notl %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movw $0xffff, %ax            # imm = 0xFFFF
retq
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movups 0x608(%rip), %xmm0      # 0x231c
movq %rsp, %rdi
movups %xmm0, 0xc(%rdi)
movaps 0x5ee(%rip), %xmm0      # 0x2310
movaps %xmm0, (%rdi)
callq 0x11f0
testl %eax, %eax
js 0x1dc4
movl %eax, %ebp
movq %rsp, %rdi
callq 0x1080
movl $0x2000, %ecx           # imm = 0x2000
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1170
movl %eax, %r15d
callq 0x1070
movq %rax, %r14
cmpl $0x4, (%rax)
je 0x1d61
testl %r15d, %r15d
jne 0x1da5
xorl %r15d, %r15d
addq $0x2000, %r15           # imm = 0x2000
cmpq $0x100000, %r15         # imm = 0x100000
jb 0x1d87
movl %ebp, %edi
xorl %esi, %esi
callq 0x1120
movl $0x0, %r15d
testl %eax, %eax
jne 0x1de3
incq (%rbx)
movl $0x2000, %ecx           # imm = 0x2000
movl %ebp, %edi
xorl %esi, %esi
movq %r15, %rdx
callq 0x1170
cmpl $0x4, (%r14)
je 0x1d64
testl %eax, %eax
je 0x1d64
leaq 0x550(%rip), %rdi       # 0x22fc
leaq 0x503(%rip), %rsi       # 0x22b6
leaq 0x50f(%rip), %rcx       # 0x22c9
movl $0x1a, %edx
callq 0x1130
leaq 0x4e3(%rip), %rdi       # 0x22ae
leaq 0x4e4(%rip), %rsi       # 0x22b6
leaq 0x4f0(%rip), %rcx       # 0x22c9
movl $0x14, %edx
callq 0x1130
leaq 0x512(%rip), %rdi       # 0x22fc
leaq 0x4c5(%rip), %rsi       # 0x22b6
leaq 0x4d1(%rip), %rcx       # 0x22c9
movl $0x1e, %edx
callq 0x1130
// File: /workspace/github_c_makefile_star2_O3/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 %rax
cmpl %esi, -0x4(%rdi)
jle 0x1319
leaq 0x24(%rdi), %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movabsq $-0x100000000, %r8      # imm = 0xFFFFFFFF00000000
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rdx, %r9
addq %rax, %r8
addq $0x4, %rdx
incl %ecx
cmpl %esi, (%r9)
jl 0x12b6
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
je 0x1317
movslq -0x8(%rdi), %r9
leal 0x1(%r9), %r10d
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpl 0x20(%rdi), %r10d
je 0x1317
cmpl %ecx, %r9d
jl 0x130e
sarq $0x20, %r8
addq $0xa, %r9
movl -0x4(%rdi,%r9,4), %eax
movl %eax, (%rdi,%r9,4)
leaq -0x1(%r9), %rax
addq $-0xa, %r9
cmpq %r8, %r9
movq %rax, %r9
jg 0x12ee
movl -0x8(%rdi), %r10d
incl %r10d
movl %esi, -0x4(%rdx)
movl %r10d, -0x8(%rdi)
movl %ecx, %eax
popq %rcx
retq
leaq 0xd10(%rip), %rdi       # 0x2030
leaq 0xd14(%rip), %rsi       # 0x203b
leaq 0xd14(%rip), %rcx       # 0x2042
movl $0x26, %edx
callq 0x1080
// File: /workspace/github_c_makefile_star2_O3/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:
cmpl $0x0, -0x8(%rdi)
jle 0x1355
xorl %eax, %eax
movl 0x24(%rdi,%rax,4), %ecx
movl %ecx, (%rsi,%rax,4)
incq %rax
movslq -0x8(%rdi), %rcx
cmpq %rcx, %rax
jl 0x1340
jmp 0x1357
xorl %eax, %eax
movl 0x24(%rdi,%rax,4), %ecx
movl %ecx, (%rsi,%rax,4)
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r14
pushq %rbx
movq %rsi, %rbx
cmpl $0x2, %edi
jge 0x11f4
xorl %r14d, %r14d
xorl %edi, %edi
callq 0x1070
testq %rax, %rax
je 0x1249
movq %rax, %rdi
callq 0x1040
jmp 0x1241
movq 0x8(%rbx), %r14
leaq 0xe05(%rip), %rsi       # 0x2004
movq %r14, %rdi
callq 0x1050
testl %eax, %eax
jne 0x1232
cmpb $0x2d, (%r14)
jne 0x1232
cmpb $0x73, 0x1(%r14)
jne 0x1232
cmpb $0x0, 0x2(%r14)
jne 0x1232
leaq 0xde6(%rip), %rsi       # 0x200c
movq %r14, %rdi
callq 0x1050
testl %eax, %eax
je 0x1259
xorl %r14d, %r14d
xorl %edi, %edi
callq 0x1070
testq %rax, %rax
je 0x1249
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, %rdi
callq 0x10a0
movl $0x1, %r14d
jmp 0x1241
movq 0x2d98(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq (%rbx), %rdx
leaq 0xda8(%rip), %rsi       # 0x2015
movq %r14, %rcx
xorl %eax, %eax
callq 0x1060
jmp 0x1251
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq 0x5bd6(%rip), %rdi      # 0x8298
leaq -0x18(%rbp), %r14
leaq -0x14(%rbp), %rbx
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2110
movl (%r14), %esi
movl (%rbx), %edx
leaq 0x2b57(%rip), %rdi      # 0x5238
xorl %eax, %eax
callq 0x2040
movl (%r14), %eax
movl $0xfffffc00, %ecx       # imm = 0xFFFFFC00
movl %eax, %edx
addl %ecx, %edx
shrl $0x1f, %edx
addl %edx, %eax
addl $0xfffffc00, %eax       # imm = 0xFFFFFC00
sarl %eax
movl %eax, 0x5b9a(%rip)      # 0x82a0
movl (%rbx), %eax
addl %eax, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
addl $0xfffffc00, %eax       # imm = 0xFFFFFC00
sarl %eax
movl %eax, 0x5b88(%rip)      # 0x82a4
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/aap[P]rx-0/misc/crt.c
// Function: keydn
void
keydn(int scancode)
{
	int i;
	u32 ojoys[NUMJOYS];

	for(i = 0; i < NUMJOYS; i++)
		ojoys[i] = joys[i].b;
	switch(scancode){
	case SDL_SCANCODE_ESCAPE:
		exit(0);
		break;

	case SDL_SCANCODE_E: KEY1(04);
	case SDL_SCANCODE_X: KEY1(010);
	case SDL_SCANCODE_C: KEY1(020000);
	case SDL_SCANCODE_A: KEY1(020);
	case SDL_SCANCODE_D: KEY1(040);
	case SDL_SCANCODE_S: KEY1(0100);
	case SDL_SCANCODE_W: KEY1(0200);

	case SDL_SCANCODE_U: KEY2(04);
	case SDL_SCANCODE_N: KEY2(010);
	case SDL_SCANCODE_M: KEY2(020000);
	case SDL_SCANCODE_J: KEY2(020);
	case SDL_SCANCODE_L: KEY2(040);
	case SDL_SCANCODE_K: KEY2(0100);
	case SDL_SCANCODE_I: KEY2(0200);

	case SDL_SCANCODE_F:
		fullscreen = !fullscreen;
		SDL_SetWindowFullscreen(window, modes[fullscreen]);
		resize();
		break;
	}
	for(i = 0; i < NUMJOYS; i++)
		if(joys[i].b != ojoys[i])
			updatejoy(&joys[i]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
xorl %eax, %eax
leaq 0x5b75(%rip), %r14      # 0x82b0
movl 0x4(%r14,%rax,4), %ecx
movl %ecx, -0x30(%rbp,%rax)
addq $0x4, %rax
cmpq $0x10, %rax
jne 0x273b
addl $-0x4, %edi
cmpl $0x25, %edi
ja 0x2821
leaq 0x2937(%rip), %rax      # 0x5098
movslq (%rax,%rdi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
orb $0x10, 0x5b43(%rip)     # 0x82b4
jmp 0x2821
orb $-0x80, 0x5b37(%rip)    # 0x82b4
jmp 0x2821
orb $0x8, 0x5b3b(%rip)      # 0x82c4
jmp 0x2821
orb $0x4, 0x5b2f(%rip)      # 0x82c4
jmp 0x2821
orb $0x20, 0x5b13(%rip)     # 0x82b4
jmp 0x2821
orb $-0x80, 0x5b1a(%rip)    # 0x82c4
jmp 0x2821
orb $0x40, 0x5b01(%rip)     # 0x82b4
jmp 0x2821
orb $0x20, 0x5af9(%rip)     # 0x82b5
jmp 0x2821
orb $0x10, 0x5aff(%rip)     # 0x82c4
jmp 0x2821
orb $0x40, 0x5af6(%rip)     # 0x82c4
jmp 0x2821
orb $0x8, 0x5add(%rip)      # 0x82b4
jmp 0x2821
orb $0x4, 0x5ad4(%rip)      # 0x82b4
jmp 0x2821
xorl %eax, %eax
cmpl $0x0, 0x5b05(%rip)      # 0x82f0
sete %al
movl %eax, 0x5afc(%rip)      # 0x82f0
movq 0x5a9d(%rip), %rdi      # 0x8298
leaq 0x5a6a(%rip), %rcx      # 0x826c
movl (%rcx,%rax,4), %esi
callq 0x2290
callq 0x26b0
jmp 0x2821
orb $0x20, 0x5aad(%rip)     # 0x82c5
jmp 0x2821
orb $0x20, 0x5aa3(%rip)     # 0x82c4
xorl %r15d, %r15d
leaq -0x1c(%rbp), %rbx
movl 0x4(%r14,%r15,4), %eax
cmpl -0x30(%rbp,%r15), %eax
je 0x285b
leaq (,%r15,4), %rcx
movl (%rcx,%r14), %ecx
shll $0x18, %ecx
orl %eax, %ecx
movl %ecx, -0x1c(%rbp)
movl 0x5a42(%rip), %edi      # 0x8290
movl $0x4, %edx
movq %rbx, %rsi
callq 0x20f0
addq $0x4, %r15
cmpq $0x10, %r15
jne 0x2828
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %edi, %edi
callq 0x22d0
// File: /workspace/github_c_makefile_star2_O3/aap[P]rx-0/misc/crt.c
// Function: keyup
void
keyup(int scancode)
{
	int i;
	u32 ojoys[NUMJOYS];

	for(i = 0; i < NUMJOYS; i++)
		ojoys[i] = joys[i].b;
	switch(scancode){
	case SDL_SCANCODE_E: KEY1(04);
	case SDL_SCANCODE_X: KEY1(010);
	case SDL_SCANCODE_C: KEY1(020000);
	case SDL_SCANCODE_A: KEY1(020);
	case SDL_SCANCODE_D: KEY1(040);
	case SDL_SCANCODE_S: KEY1(0100);
	case SDL_SCANCODE_W: KEY1(0200);

	case SDL_SCANCODE_U: KEY2(04);
	case SDL_SCANCODE_N: KEY2(010);
	case SDL_SCANCODE_M: KEY2(020000);
	case SDL_SCANCODE_J: KEY2(020);
	case SDL_SCANCODE_L: KEY2(040);
	case SDL_SCANCODE_K: KEY2(0100);
	case SDL_SCANCODE_I: KEY2(0200);
	}
	for(i = 0; i < NUMJOYS; i++)
		if(joys[i].b != ojoys[i])
			updatejoy(&joys[i]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
xorl %eax, %eax
leaq 0x5a23(%rip), %r14      # 0x82b0
movl 0x4(%r14,%rax,4), %ecx
movl %ecx, -0x30(%rbp,%rax)
addq $0x4, %rax
cmpq $0x10, %rax
jne 0x288d
addl $-0x4, %edi
cmpl $0x17, %edi
ja 0x28cb
movl $0xd43f1d, %eax         # imm = 0xD43F1D
btl %edi, %eax
jae 0x28cb
movl %edi, %eax
leaq 0x5455(%rip), %rcx      # 0x7d10
movq (%rcx,%rax,8), %rcx
leaq 0x286a(%rip), %rdx      # 0x5130
movl (%rdx,%rax,4), %eax
andl %eax, (%rcx)
xorl %r15d, %r15d
leaq -0x1c(%rbp), %rbx
movl 0x4(%r14,%r15,4), %eax
cmpl -0x30(%rbp,%r15), %eax
je 0x2905
leaq (,%r15,4), %rcx
movl (%rcx,%r14), %ecx
shll $0x18, %ecx
orl %eax, %ecx
movl %ecx, -0x1c(%rbp)
movl 0x5998(%rip), %edi      # 0x8290
movl $0x4, %edx
movq %rbx, %rsi
callq 0x20f0
addq $0x4, %r15
cmpq $0x10, %r15
jne 0x28d2
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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:
movl 0x8(%rdi), %eax
cmpq $0x3, %rax
ja 0x29b3
movb 0xd(%rdi), %dl
decb %dl
xorl %ecx, %ecx
cmpb $0xb, %dl
ja 0x296e
movzbl %dl, %ecx
leaq 0x2869(%rip), %rdx      # 0x51d4
movl (%rdx,%rcx,4), %ecx
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
shlq $0x4, %rax
leaq 0x592f(%rip), %rdx      # 0x82b0
movl $0xffffff0f, %esi       # imm = 0xFFFFFF0F
andl 0x4(%rax,%rdx), %esi
orl %ecx, %esi
movl %esi, 0x4(%rax,%rdx)
movl (%rax,%rdx), %eax
shll $0x18, %eax
orl %esi, %eax
leaq -0x4(%rbp), %rsi
movl %eax, (%rsi)
movl 0x58ec(%rip), %edi      # 0x8290
movl $0x4, %edx
callq 0x20f0
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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:
movl 0x8(%rdi), %eax
cmpq $0x3, %rax
ja 0x2a2e
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
shlq $0x4, %rax
leaq 0x58da(%rip), %rcx      # 0x82b0
leaq (%rcx,%rax), %r14
movzbl 0xc(%rdi), %edi
callq *0x8(%rax,%rcx)
cmpb $0x0, 0xd(%rbx)
je 0x29fe
orl 0x4(%r14), %eax
movl %eax, 0x4(%r14)
movl (%r14), %ecx
shll $0x18, %ecx
orl %eax, %ecx
leaq -0x14(%rbp), %rsi
jmp 0x2a14
notl %eax
andl 0x4(%r14), %eax
movl %eax, 0x4(%r14)
movl (%r14), %ecx
shll $0x18, %ecx
orl %eax, %ecx
leaq -0x18(%rbp), %rsi
movl %ecx, (%rsi)
movl 0x5874(%rip), %edi      # 0x8290
movl $0x4, %edx
callq 0x20f0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0x1, %edi
callq 0x2240
leaq 0x586a(%rip), %rax      # 0x82b8
xorl %ecx, %ecx
leaq -0x124(%rip), %rdx      # 0x2933
movl %ecx, -0x8(%rax)
movq %rdx, (%rax)
incq %rcx
addq $0x10, %rax
cmpq $0x4, %rcx
jne 0x2a57
callq 0x2170
testl %eax, %eax
jle 0x2af0
decl %eax
cmpl $0x3, %eax
movl $0x3, %r12d
cmovbl %eax, %r12d
incl %r12d
leaq 0x582c(%rip), %r13      # 0x82b8
leaq 0x27b3(%rip), %rbx      # 0x5246
leaq 0x27be(%rip), %r14      # 0x5258
xorl %r15d, %r15d
movl %r15d, %edi
callq 0x2120
testq %rax, %rax
je 0x2ae4
movl %r15d, %edi
callq 0x2330
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2350
testl %eax, %eax
jne 0x2acc
leaq -0x1ae(%rip), %rax      # 0x291a
movq %rax, (%r13)
movl %r15d, %edi
callq 0x2330
movq %r14, %rdi
movl %r15d, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2040
incq %r15
addq $0x10, %r13
cmpq %r15, %r12
jne 0x2a9d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
pushq %rbx
pushq %rax
movl %esi, %ebx
shll $0xa, %ecx
xorl %eax, %eax
testl %esi, %esi
setne %al
shll $0x14, %eax
orl %edx, %ecx
orl %eax, %ecx
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, -0xc(%rbp)
movl 0x57cd(%rip), %eax      # 0x82f4
orl %esi, %eax
je 0x2b3f
movl 0x575f(%rip), %edi      # 0x8290
leaq -0xc(%rbp), %rsi
movl $0x4, %edx
callq 0x20f0
xorl %eax, %eax
testl %ebx, %ebx
setne %al
movl %eax, 0x57a8(%rip)      # 0x82f4
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
pushq %rbx
pushq %rax
movl %edi, 0x571f(%rip)      # 0x8290
leaq 0x2a(%rip), %rdi        # 0x2ba2
leaq 0x5779(%rip), %rbx      # 0x82f8
movq %rbx, %rsi
callq 0x3a90
leaq 0x11f(%rip), %rdi       # 0x2cad
movq %rbx, %rsi
callq 0x3a90
movl $0x1, %edi
callq 0x21c0
jmp 0x2b96
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, -0x38(%rbp)
movl 0x56d3(%rip), %edi      # 0x8290
leaq -0x2c(%rbp), %rsi
movl $0x4, %edx
callq 0x4118
testl %eax, %eax
jne 0x2ca3
leaq 0x1d0574e(%rip), %rdi   # 0x1d08328
movl -0x2c(%rbp), %eax
movl %eax, %r13d
andl $0x3ff, %r13d           # imm = 0x3FF
movl %eax, %r12d
notl %r12d
shrl $0xa, %r12d
andl $0x3ff, %r12d           # imm = 0x3FF
shrl $0x14, %eax
andl $0x7, %eax
leaq 0x1d05717(%rip), %rcx   # 0x1d0831c
movb (%rax,%rcx), %r15b
movl %r12d, %r14d
shll $0xa, %r14d
orq %r13, %r14
movq -0x38(%rbp), %rax
movb 0x1600014(%rax,%r14), %bl
callq 0x38ec
testb $-0x80, -0x2a(%rbp)
je 0x2c30
incl 0x1d056e8(%rip)         # 0x1d08318
testb %r15b, %r15b
je 0x2c74
testb %bl, %bl
je 0x2c40
cmpb %bl, %r15b
ja 0x2c68
jmp 0x2c74
movq -0x38(%rbp), %rdx
movslq 0x600000(%rdx), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x600000(%rdx)
leaq (%rax,%rax,2), %rax
movw %r13w, (%rdx,%rax,2)
movw %r12w, 0x2(%rdx,%rax,2)
movb $0x4, 0x4(%rdx,%rax,2)
movq -0x38(%rbp), %rax
movb %r15b, 0x1600014(%rax,%r14)
leaq 0x1d056ad(%rip), %rdi   # 0x1d08328
callq 0x39c2
movl 0x560a(%rip), %edi      # 0x8290
leaq -0x2c(%rbp), %rsi
movl $0x4, %edx
callq 0x4118
leaq 0x1d0568d(%rip), %rdi   # 0x1d08328
testl %eax, %eax
je 0x2bda
movl $0x1, %edi
callq 0x22d0
// File: /workspace/github_c_makefile_star2_O3/aap[P]rx-0/misc/crt.c
// Function: threadmain
int
threadmain(int argc, char *argv[])
{
	int port = 3400;
	ARGBEGIN{
	case 'p':
		port = atoi(EARGF(usage()));
		break;
	case 's':
		winsize = atoi(EARGF(usage()));
		break;
	}ARGEND;

	serve(port, startcrt, nil);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
cmpq $0x0, 0x1d04d0f(%rip)   # 0x1d08310
jne 0x360d
movq (%rbx), %rax
movq %rax, 0x1d04d03(%rip)   # 0x1d08310
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x36a8
addq $0x8, %rbx
movl $0xd48, %r14d           # imm = 0xD48
leaq 0x1c5a(%rip), %r15      # 0x5285
cmpb $0x2d, (%rdi)
jne 0x36ae
movzbl 0x1(%rdi), %eax
cmpl $0x2d, %eax
je 0x363f
testl %eax, %eax
jne 0x3645
jmp 0x36ae
cmpb $0x0, 0x2(%rdi)
je 0x36ae
incq %rdi
incq %rdi
cmpb $0x73, %al
je 0x3673
movzbl %al, %eax
cmpl $0x70, %eax
jne 0x3693
cmpb $0x0, (%rdi)
jne 0x3669
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x36cc
addq $0x8, %rbx
callq 0x23e0
movl %eax, %r14d
jmp 0x3690
cmpb $0x0, (%rdi)
jne 0x3685
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x36cc
addq $0x8, %rbx
callq 0x23e0
movl %eax, 0x4bd8(%rip)      # 0x8268
movq %r15, %rdi
movb (%rdi), %al
testb %al, %al
jne 0x3648
movq 0x8(%rbx), %rdi
addq $0x8, %rbx
testq %rdi, %rdi
jne 0x362b
jmp 0x36ae
movl $0xd48, %r14d           # imm = 0xD48
leaq -0xb50(%rip), %rsi      # 0x2b65
movl %r14d, %edi
xorl %edx, %edx
callq 0x4247
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x35bf
// File: /workspace/github_c_makefile_star2_O3/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:
movl $0x1, %eax
xchgl %eax, 0x2e84(%rip)      # 0x40e0
testl %eax, %eax
jne 0x1251
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x2e7b(%rip), %rdi      # 0x40e8
movl 0x10(%rdi), %ebx
testl %ebx, %ebx
jle 0x1298
movq 0x2e6d(%rip), %rdi      # 0x40e8
callq 0x174d
testq %rax, %rax
je 0x128d
movq %rax, %rdi
callq 0x1030
decl %ebx
jne 0x1274
movq 0x2e50(%rip), %rdi      # 0x40e8
callq 0x1030
cmpl $0x1, 0x2e3c(%rip)      # 0x40e0
leaq 0x8(%rsp), %rsp
popq %rbx
popq %rbp
jne 0x12b7
movl $0x0, 0x2e29(%rip)      # 0x40e0
retq
// File: /workspace/github_c_makefile_star2_O3/deepika9294[P]Threading-Library/one-one/singlyll.c
// Function: insert_beg
void insert_beg(list *t, dthread *td) {
    //add condition for maximum
    node *ptr;
    ptr = (node*)malloc(sizeof(node));
    if(ptr == NULL) {
        printf("\nMemory full");
        return;
    }
    ptr->td = td;
    ptr->next = NULL;
    if(t->head == NULL) {
        t->head = ptr;
        t->tail = ptr;
    }
    else {
        ptr->next = t->head;
        t->head = ptr;
    }
    t->count = t->count + 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl $0x10, %edi
callq 0x10b0
testq %rax, %rax
je 0x16c4
movq %r14, (%rax)
movq $0x0, 0x8(%rax)
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x16d6
movq %rcx, 0x8(%rax)
jmp 0x16da
leaq 0x941(%rip), %rdi       # 0x200c
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x1080
movq %rax, 0x8(%rbx)
movq %rax, (%rbx)
incl 0x10(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/deepika9294[P]Threading-Library/one-one/singlyll.c
// Function: remove_last
dthread* remove_last(list *t) {
    node *temp;
    dthread *td;
    if(t->count == 0) {
        printf("\nEmpty list");
        return NULL;
    }
    temp = t->head;
    if(t->count == 1) {
        td = temp->td;
        t->tail = NULL;
        t->head = NULL;
        t->count = t->count -1;
        return td;
    }
    
    while(temp->next != t->tail ) {
        temp = temp->next;
    }
    td = t->tail->td;
    t->tail = temp;
    t->tail->next = NULL;
    t->count = t->count -1;
    return td;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl 0x10(%rdi), %eax
testl %eax, %eax
je 0x1774
movq (%rdi), %rcx
cmpl $0x1, %eax
jne 0x1786
movq (%rcx), %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movl $0x0, 0x10(%rdi)
jmp 0x17aa
leaq 0x8ba(%rip), %rdi       # 0x2035
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1080
jmp 0x17aa
movq 0x8(%rdi), %rdx
movq %rcx, %rsi
movq 0x8(%rcx), %rcx
cmpq %rdx, %rcx
jne 0x178a
movq (%rdx), %rbx
movq %rsi, 0x8(%rdi)
movq $0x0, 0x8(%rsi)
decl %eax
movl %eax, 0x10(%rdi)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/deepika9294[P]Threading-Library/one-one/singlyll.c
// Function: get_node_by_tid
dthread* get_node_by_tid(list *t, dthread_t tid) {
    node *temp;
    dthread *td;
    if(t->tail == NULL) {
        return NULL;
    }
    temp = t->head;
    while(temp != NULL) {
        if(tid == temp->td->tid) {
            return temp->td;
        }
        else {
            temp = temp->next;
        }
    }
    return NULL;
}

// Assembly:
cmpq $0x0, 0x8(%rdi)
je 0x17dc
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x17dc
pushq %rbp
movq %rsp, %rbp
movq (%rcx), %rax
cmpq %rsi, (%rax)
je 0x17da
movq 0x8(%rcx), %rcx
testq %rcx, %rcx
jne 0x17c7
xorl %eax, %eax
popq %rbp
retq
xorl %eax, %eax
retq
nop