// File: /workspace/github_c_makefile_star2_O2/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, 0x10(%rsp)
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %r15
movl (%rdx), %ebx
movzbl 0xb786(%rip), %r12d     # 0x1df51
imulq $0x30, %r12, %rax
leaq 0xb59a(%rip), %rbp      # 0x1dd70
cmpl (%rax,%rbp), %ebx
jne 0x12806
addq %rbp, %rax
movl 0x4(%r13), %ecx
cmpl 0x4(%rax), %ecx
jne 0x12806
movl 0x8(%r13), %ecx
cmpl 0x8(%rax), %ecx
jne 0x12806
movl 0xc(%r13), %ecx
cmpl 0xc(%rax), %ecx
jne 0x12806
movb 0x10(%r13), %cl
cmpb 0x10(%rax), %cl
je 0x129fb
movq %r13, %rdi
callq 0x1206c
testw %ax, %ax
js 0x1282c
movl %eax, %r12d
cmpw $0x7f, %ax
jae 0x12c40
movb %r12b, 0xb72a(%rip)     # 0x1df51
jmp 0x129fb
leaq 0xb549(%rip), %rax      # 0x1dd7c
xorl %r12d, %r12d
cmpq $0xa, %r12
je 0x1285c
cmpl $0x0, -0xc(%rax)
jne 0x12853
cmpl $0x0, -0x8(%rax)
jne 0x12853
cmpl $0x0, -0x4(%rax)
jne 0x12853
cmpl $0x0, (%rax)
je 0x12880
incq %r12
addq $0x30, %rax
jmp 0x12836
movw $0x9, %r12w
leaq 0xb534(%rip), %rax      # 0x1dd9c
xorl %ecx, %ecx
cmpq $0xa, %rcx
je 0x12880
cmpl $0x0, (%rax)
cmovnel %ecx, %r12d
incq %rcx
addq $0x30, %rax
jmp 0x1286a
testw %r12w, %r12w
js 0x12c22
movq %r14, 0x8(%rsp)
cmpw $0x7f, %r12w
jae 0x12c5c
movb %r12b, 0xb6b0(%rip)     # 0x1df51
movzwl %r12w, %eax
imulq $0x30, %rax, %r14
leaq (%r14,%rbp), %r11
movl %ebx, (%r14,%rbp)
movl 0x4(%r13), %eax
movl %eax, 0x4(%r14,%rbp)
movl 0x8(%r13), %ecx
movl %ecx, 0x8(%r14,%rbp)
movl 0xc(%r13), %edx
movl %edx, 0xc(%r14,%rbp)
movb 0x10(%r13), %sil
movb %sil, 0x10(%r14,%rbp)
movl (%r13), %edi
movl %edi, %r8d
andl $0xc0ff, %r8d           # imm = 0xC0FF
cmpl $0x80fe, %r8d           # imm = 0x80FE
jne 0x12913
movzwl 0xe2(%r15), %edi
movw %di, 0x28(%r14,%rbp)
movl %ebx, 0x14(%r11)
movl %eax, 0x18(%r11)
movl %ecx, 0x1c(%r11)
movl %edx, 0x20(%r11)
movb %sil, 0x24(%r11)
jmp 0x129f6
pushq $0x20
popq %r8
leaq 0xb382(%rip), %r9       # 0x1dca0
cmpq $0xe8, %r8
je 0x12956
cmpq %r15, -0x8(%r8,%r9)
je 0x12934
addq $0x28, %r8
jmp 0x1291e
cmpl $0x0, (%r8,%r9)
je 0x1292e
cmpl -0x20(%r8,%r9), %edi
jne 0x1292e
movl 0x4(%r13), %r10d
cmpl -0x1c(%r8,%r9), %r10d
jne 0x1292e
cmpb -0x10(%r8,%r9), %sil
jne 0x1292e
jmp 0x128ec
leaq 0x50(%r15), %r8
movl $0x98, %r9d
cmpq $0x9b, %r9
je 0x1299d
testb $0x10, (%r15,%r9)
je 0x12994
cmpl $0x0, -0x1c4(%r15,%r9,4)
jne 0x12994
cmpl (%r8), %edi
jne 0x12994
movl 0x4(%r13), %r10d
cmpl 0x4(%r8), %r10d
jne 0x12994
cmpb 0x10(%r8), %sil
je 0x128ec
addq $0x18, %r8
incq %r9
jmp 0x12960
movq %r11, %rbx
movq %r15, %rdi
callq 0x126ca
testb %al, %al
js 0x12b40
movzwl 0xe2(%r15), %ecx
movw %cx, 0x28(%r14,%rbp)
movzbl %al, %eax
shll $0x4, %eax
leaq 0xb285(%rip), %rcx      # 0x1dc50
movq (%rax,%rcx), %rax
movl (%rax), %ecx
movl %ecx, 0x14(%r14,%rbp)
movl 0x4(%rax), %ecx
movl %ecx, 0x18(%r14,%rbp)
movl 0x8(%rax), %ecx
movl %ecx, 0x1c(%r14,%rbp)
movl 0xc(%rax), %ecx
movl %ecx, 0x20(%r14,%rbp)
movb 0x10(%rax), %al
movb %al, 0x24(%r14,%rbp)
movq 0x8(%rsp), %r14
movzbl %r12b, %ecx
imulq $0x30, %rcx, %rbx
leaq (%rbx,%rbp), %rdi
addq $0x14, %rdi
movl (%rdi), %esi
movzbl 0xb53e(%rip), %eax      # 0x1df52
imulq $0x38, %rax, %rdx
leaq 0xb001(%rip), %r12      # 0x1da20
cmpl (%rdx,%r12), %esi
jne 0x12a4a
addq %r12, %rdx
movl 0x4(%rdi), %esi
cmpl 0x4(%rdx), %esi
jne 0x12a4a
movl 0x8(%rdi), %esi
cmpl 0x8(%rdx), %esi
jne 0x12a4a
movl 0xc(%rdi), %esi
cmpl 0xc(%rdx), %esi
jne 0x12a4a
movb 0x10(%rdi), %sil
cmpb 0x10(%rdx), %sil
je 0x12ac7
callq 0x11b54
testb %al, %al
js 0x12a60
movb %al, 0xb4f9(%rip)       # 0x1df52
andl $0x0, 0x2c(%rbx,%rbp)
jmp 0x12ad8
callq 0x11df2
testb %al, %al
js 0x12c22
movb %al, 0xb4df(%rip)       # 0x1df52
movzbl 0xb4d7(%rip), %ecx      # 0x1df51
imulq $0x30, %rcx, %rcx
movzbl %al, %eax
imulq $0x38, %rax, %rax
leaq (%r12,%rax), %rdi
movups 0x14(%rcx,%rbp), %xmm0
movups %xmm0, (%rax,%r12)
movb 0x24(%rcx,%rbp), %cl
movb %cl, 0x10(%rax,%r12)
movq %r15, 0x18(%rax,%r12)
movw $0x1, 0x30(%rax,%r12)
movl $0x1, 0x34(%rax,%r12)
pushq $0x1
popq %rsi
callq 0x12456
movzbl 0xb490(%rip), %ecx      # 0x1df51
movb 0xb48b(%rip), %al       # 0x1df52
imulq $0x30, %rcx, %rcx
andl $0x0, 0x2c(%rcx,%rbp)
testb %al, %al
js 0x12c24
movzbl %al, %ecx
imulq $0x38, %rcx, %rbx
leaq (%r12,%rbx), %rax
movzbl 0x30(%rbx,%r12), %edx
leal -0x4(%rdx), %esi
cmpl $0x2, %esi
jb 0x12b06
cmpl $0x2, %edx
je 0x12b06
cmpl $0x3, %edx
jne 0x12b19
movb $0x4, 0x30(%rax)
movl $0x5, 0x34(%rax)
addq $0x20, %rax
movq 0x10(%rsp), %rcx
movq %rax, (%rcx)
xorl %eax, %eax
jmp 0x12c24
movq 0x10(%rsp), %rax
andq $0x0, (%rax)
movb $-0x10, %al
cmpb $0x9, %cl
ja 0x12c24
movq %r14, %rax
testq %rax, %rax
je 0x12b51
testb $0x40, 0x14(%rax)
jne 0x12b98
movq (%rax), %rax
jmp 0x12b30
xorps %xmm0, %xmm0
movaps %xmm0, (%rbx)
movb $0x0, 0x10(%rbx)
movb $-0x4, %al
jmp 0x12c24
movq %r14, %rdi
callq 0x51d4
testq %r14, %r14
je 0x12c22
pushq $0x8
popq %rdi
callq 0x3b4a
testq %rax, %rax
je 0x12be8
andq $0x0, (%rax)
movq %r14, 0x8(%rax)
movq 0x28(%rbx,%r12), %rcx
testq %rcx, %rcx
je 0x12c33
movq %rcx, %rdx
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0x12b85
movq %rax, (%rdx)
jmp 0x12b12
pushq $0xe
popq %rbp
movl %ebp, %edi
movl $0x280, %esi            # imm = 0x280
movq %r14, %r13
movq %r14, %rdx
callq 0x58cc
movq %rax, %r14
leaq (%rbx,%r12), %r15
addq $0x28, %r15
testq %r14, %r14
jne 0x12b62
movq (%r15), %rdi
testq %rdi, %rdi
je 0x12c22
movq (%rdi), %rax
movq %rax, (%r15)
andq $0x0, (%rdi)
callq 0x12e1a
movl %ebp, %edi
movl $0x280, %esi            # imm = 0x280
movq %r13, %rdx
callq 0x58cc
movq %rax, %r14
jmp 0x12bb8
movq 0x28(%rbx,%r12), %rdi
testq %rdi, %rdi
je 0x12c1a
leaq (%rbx,%r12), %rax
addq $0x28, %rax
movq (%rdi), %rcx
movq %rcx, (%rax)
andq $0x0, (%rdi)
callq 0x12e1a
pushq $0x8
popq %rdi
callq 0x3b4a
testq %rax, %rax
jne 0x12b6f
movq %r14, %rdi
callq 0x4e16
movb $-0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq (%rbx,%r12), %rcx
addq $0x28, %rcx
jmp 0x12b0f
leaq 0x1685(%rip), %rdi      # 0x142cc
leaq 0x3c31(%rip), %rsi      # 0x1687f
leaq 0x3bab(%rip), %rcx      # 0x16800
movl $0x7a2, %edx            # imm = 0x7A2
jmp 0x12c76
leaq 0x1669(%rip), %rdi      # 0x142cc
leaq 0x3c15(%rip), %rsi      # 0x1687f
leaq 0x3b8f(%rip), %rcx      # 0x16800
movl $0x7a9, %edx            # imm = 0x7A9
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050