// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv6/nd6.c
// Function: nd6_get_next_hop_addr_or_queue
err_t
nd6_get_next_hop_addr_or_queue(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr, const u8_t **hwaddrp)
{
  s8_t i;

  /* Get next hop record. */
  i = nd6_get_next_hop_entry(ip6addr, netif);
  if (i < 0) {
    /* failed to get a next hop neighbor record. */
    return i;
  }

  /* Now that we have a destination record, send or queue the packet. */
  if (neighbor_cache[i].state == ND6_STALE) {
    /* Switch to delay state. */
    neighbor_cache[i].state = ND6_DELAY;
    neighbor_cache[i].counter.delay_time = LWIP_ND6_DELAY_FIRST_PROBE_TIME / ND6_TMR_INTERVAL;
  }
  /* @todo should we send or queue if PROBE? send for now, to let unicast NS pass. */
  if ((neighbor_cache[i].state == ND6_REACHABLE) ||
      (neighbor_cache[i].state == ND6_DELAY) ||
      (neighbor_cache[i].state == ND6_PROBE)) {

    /* Tell the caller to send out the packet now. */
    *hwaddrp = neighbor_cache[i].lladdr;
    return ERR_OK;
  }

  /* We should queue packet on this interface. */
  *hwaddrp = NULL;
  return nd6_queue_packet(i, q);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r15
movl (%rdx), %ebp
movzbl 0xa144(%rip), %eax      # 0x1cf41
leaq (%rax,%rax,2), %rcx
shll $0x4, %ecx
leaq 0x9f55(%rip), %r13      # 0x1cd60
cmpl (%rcx,%r13), %ebp
jne 0x12e3c
addq %r13, %rcx
movl 0x4(%r12), %edx
cmpl 0x4(%rcx), %edx
jne 0x12e3c
movl 0x8(%r12), %edx
cmpl 0x8(%rcx), %edx
jne 0x12e3c
movl 0xc(%r12), %edx
cmpl 0xc(%rcx), %edx
jne 0x12e3c
movb 0x10(%r12), %dl
cmpb 0x10(%rcx), %dl
je 0x12e5d
movq %r12, %rdi
callq 0x12695
testw %ax, %ax
js 0x12ed8
cmpw $0x7f, %ax
jae 0x132ee
movb %al, 0xa0e4(%rip)       # 0x1cf41
movzbl %al, %ecx
leaq (%rcx,%rcx,2), %rbp
movl %ebp, %eax
shll $0x4, %eax
leaq (%rax,%r13), %rdi
addq $0x14, %rdi
movl (%rdi), %esi
movzbl 0xa0c8(%rip), %eax      # 0x1cf42
imulq $0x38, %rax, %rdx
leaq 0x9b8b(%rip), %r12      # 0x1ca10
cmpl (%rdx,%r12), %esi
jne 0x12eb4
addq %r12, %rdx
movl 0x4(%rdi), %esi
cmpl 0x4(%rdx), %esi
jne 0x12eb4
movl 0x8(%rdi), %esi
cmpl 0x8(%rdx), %esi
jne 0x12eb4
movl 0xc(%rdi), %esi
cmpl 0xc(%rdx), %esi
jne 0x12eb4
movb 0x10(%rdi), %sil
cmpb 0x10(%rdx), %sil
je 0x1303e
callq 0x11e3c
testb %al, %al
js 0x12fcd
movb %al, 0xa07b(%rip)       # 0x1cf42
shll $0x4, %ebp
movl $0x0, 0x2c(%rbp,%r13)
jmp 0x13056
leaq 0x9e8d(%rip), %rcx      # 0x1cd6c
xorl %eax, %eax
cmpl $0x0, -0xc(%rcx)
jne 0x12ef8
cmpl $0x0, -0x8(%rcx)
jne 0x12ef8
cmpl $0x0, -0x4(%rcx)
jne 0x12ef8
cmpl $0x0, (%rcx)
je 0x12f25
incq %rax
addq $0x30, %rcx
cmpq $0xa, %rax
jne 0x12ee1
movw $0x9, %ax
leaq 0x9e7c(%rip), %rcx      # 0x1cd8c
xorl %edx, %edx
cmpl $0x0, (%rcx)
cmovnel %edx, %eax
incq %rdx
addq $0x30, %rcx
cmpq $0xa, %rdx
jne 0x12f12
testw %ax, %ax
js 0x132cd
movq %rbx, 0x10(%rsp)
cmpw $0x7f, %ax
jae 0x1330a
movb %al, 0x9ffe(%rip)       # 0x1cf41
movzwl %ax, %ecx
leaq (%rcx,%rcx,2), %rdx
movl %edx, %ecx
shll $0x4, %ecx
movl %ebp, (%rcx,%r13)
movl 0x4(%r12), %esi
movl %esi, 0xc(%rsp)
movl %esi, 0x4(%rcx,%r13)
movl 0x8(%r12), %edi
movl %edi, 0x8(%rcx,%r13)
movl 0xc(%r12), %r8d
movl %r8d, 0xc(%rcx,%r13)
movb 0x10(%r12), %r9b
movb %r9b, 0x10(%rcx,%r13)
movl (%r12), %r10d
movl %r10d, %r11d
andl $0xc0ff, %r11d          # imm = 0xC0FF
cmpl $0x80fe, %r11d          # imm = 0x80FE
jne 0x130cf
addq %r13, %rcx
movzwl 0xe2(%r15), %r10d
shll $0x4, %edx
movw %r10w, 0x28(%rdx,%r13)
movl %ebp, 0x14(%rcx)
movl 0xc(%rsp), %edx
movl %edx, 0x18(%rcx)
movl %edi, 0x1c(%rcx)
movl %r8d, 0x20(%rcx)
movb %r9b, 0x24(%rcx)
movq 0x10(%rsp), %rbx
jmp 0x12e5d
callq 0x120ee
testb %al, %al
js 0x132cd
movb %al, 0x9f62(%rip)       # 0x1cf42
movzbl 0x9f5a(%rip), %ecx      # 0x1cf41
leaq (%rcx,%rcx,2), %rcx
shll $0x4, %ecx
movzbl %al, %eax
imulq $0x38, %rax, %rax
leaq (%r12,%rax), %rsi
movups 0x14(%rcx,%r13), %xmm0
movups %xmm0, (%rax,%r12)
movb 0x24(%rcx,%r13), %cl
movb %cl, 0x10(%rax,%r12)
movq %r15, 0x18(%rax,%r12)
movw $0x1, 0x30(%rax,%r12)
movl $0x1, 0x34(%rax,%r12)
movq %r15, %rdi
movl $0x1, %edx
callq 0x12a9b
movzbl 0x9f09(%rip), %ecx      # 0x1cf41
movb 0x9f04(%rip), %al       # 0x1cf42
leaq (%rcx,%rcx,2), %rcx
shll $0x4, %ecx
movl $0x0, 0x2c(%rcx,%r13)
testb %al, %al
js 0x132cf
movzbl %al, %ecx
imulq $0x38, %rcx, %r15
leaq (%r12,%r15), %rax
movzbl 0x30(%r15,%r12), %edx
leal -0x4(%rdx), %esi
cmpl $0x2, %esi
jb 0x13084
cmpl $0x2, %edx
je 0x13084
cmpl $0x3, %edx
jne 0x13092
movb $0x4, 0x30(%rax)
movl $0x5, 0x34(%rax)
addq $0x20, %rax
movq %rax, (%r14)
xorl %eax, %eax
jmp 0x132cf
movq $0x0, (%r14)
movb $-0x10, %al
cmpb $0x9, %cl
ja 0x132cf
testq %rbx, %rbx
je 0x131f5
movq %rbx, %rax
testb $0x40, 0x14(%rax)
jne 0x13201
movq (%rax), %rax
testq %rax, %rax
jne 0x130b0
movq %rbx, %rdi
callq 0x53ad
jmp 0x1325b
movl $0x20, %r11d
leaq 0x9bb4(%rip), %rbx      # 0x1cc90
movq %r14, %rsi
cmpq %r15, -0x8(%r11,%rbx)
je 0x130f5
addq $0x28, %r11
cmpq $0xe8, %r11
jne 0x130df
jmp 0x1311e
cmpl $0x0, (%r11,%rbx)
je 0x130e6
cmpl -0x20(%r11,%rbx), %r10d
jne 0x130e6
movl 0x4(%r12), %r14d
cmpl -0x1c(%r11,%rbx), %r14d
movq %rsi, %r14
jne 0x130e6
cmpb -0x10(%r11,%rbx), %r9b
jne 0x130e6
jmp 0x12f9a
leaq 0x50(%r15), %r11
movl $0x98, %ebx
testb $0x10, (%r15,%rbx)
je 0x13156
cmpl $0x0, -0x1c4(%r15,%rbx,4)
jne 0x13156
cmpl (%r11), %r10d
jne 0x13156
movl 0x4(%r12), %r14d
cmpl 0x4(%r11), %r14d
movq %rsi, %r14
jne 0x13156
cmpb 0x10(%r11), %r9b
je 0x12f9a
addq $0x18, %r11
incq %rbx
cmpq $0x9b, %rbx
jne 0x13127
movq %r15, %rdi
callq 0x12d04
testb %al, %al
movq 0x10(%rsp), %rbx
js 0x131d2
movl %eax, %ecx
movzwl 0xe2(%r15), %edx
movzbl 0x9db9(%rip), %eax      # 0x1cf41
leaq (%rax,%rax,2), %rsi
shll $0x4, %esi
movw %dx, 0x28(%rsi,%r13)
movzbl %cl, %ecx
shll $0x4, %ecx
leaq 0x9a9e(%rip), %rdx      # 0x1cc40
movq (%rcx,%rdx), %rcx
movl (%rcx), %edx
movl %edx, 0x14(%rsi,%r13)
movl 0x4(%rcx), %edx
movl %edx, 0x18(%rsi,%r13)
movl 0x8(%rcx), %edx
movl %edx, 0x1c(%rsi,%r13)
movl 0xc(%rcx), %edx
movl %edx, 0x20(%rsi,%r13)
movb 0x10(%rcx), %cl
movb %cl, 0x24(%rsi,%r13)
jmp 0x12e5d
movzbl 0x9d68(%rip), %eax      # 0x1cf41
leaq (%rax,%rax,2), %rax
shll $0x4, %eax
xorps %xmm0, %xmm0
movaps %xmm0, (%rax,%r13)
movb $0x0, 0x10(%rax,%r13)
movb $-0x4, %al
jmp 0x132cf
xorl %edi, %edi
callq 0x53ad
jmp 0x132cd
movl $0xe, %edi
movl $0x280, %esi            # imm = 0x280
movq %rbx, %rdx
callq 0x5a8b
testq %rax, %rax
jne 0x13258
movq %rbx, %r14
leaq (%r15,%r12), %rbx
addq $0x28, %rbx
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x132cd
movq (%rdi), %rax
movq %rax, (%rbx)
movq $0x0, (%rdi)
callq 0x134f0
movl $0xe, %edi
movl $0x280, %esi            # imm = 0x280
movq %r14, %rdx
callq 0x5a8b
testq %rax, %rax
je 0x13223
movq %rax, %rbx
movl $0x8, %edi
callq 0x3c6e
testq %rax, %rax
je 0x13292
movq $0x0, (%rax)
movq %rbx, 0x8(%rax)
movq 0x28(%r15,%r12), %rcx
testq %rcx, %rcx
je 0x132de
movq %rcx, %rdx
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0x1327f
movq %rax, (%rdx)
jmp 0x1308b
movq 0x28(%r15,%r12), %rdi
testq %rdi, %rdi
je 0x132c5
leaq (%r15,%r12), %rax
addq $0x28, %rax
movq (%rdi), %rcx
movq %rcx, (%rax)
movq $0x0, (%rdi)
callq 0x134f0
movl $0x8, %edi
callq 0x3c6e
testq %rax, %rax
jne 0x1326a
movq %rbx, %rdi
callq 0x4fdf
movb $-0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq (%r15,%r12), %rcx
addq $0x28, %rcx
movq %rax, (%rcx)
jmp 0x1308b
leaq 0xfd7(%rip), %rdi       # 0x142cc
leaq 0x3513(%rip), %rsi      # 0x1680f
leaq 0x348d(%rip), %rcx      # 0x16790
movl $0x7a2, %edx            # imm = 0x7A2
jmp 0x13324
leaq 0xfbb(%rip), %rdi       # 0x142cc
leaq 0x34f7(%rip), %rsi      # 0x1680f
leaq 0x3471(%rip), %rcx      # 0x16790
movl $0x7a9, %edx            # imm = 0x7A9
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050