// File: /workspace/github_c_makefile_star2_O1/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, %r12
movq %rsi, %r14
movq %rdi, %r15
movl (%rdx), %ebp
movzbl 0xaa9e(%rip), %eax      # 0x1df41
leaq (%rax,%rax,2), %rax
shll $0x4, %eax
leaq 0xa8af(%rip), %r13      # 0x1dd60
cmpl (%rax,%r13), %ebp
jne 0x134e6
addq %r13, %rax
movl 0x4(%r12), %ecx
cmpl 0x4(%rax), %ecx
jne 0x134e6
movl 0x8(%r12), %ecx
cmpl 0x8(%rax), %ecx
jne 0x134e6
movl 0xc(%r12), %ecx
cmpl 0xc(%rax), %ecx
jne 0x134e6
movb 0x10(%r12), %cl
cmpb 0x10(%rax), %cl
je 0x136e7
movq %r12, %rdi
callq 0x12d3c
testw %ax, %ax
js 0x13508
cmpw $0x7f, %ax
jae 0x13988
movb %al, 0xaa3e(%rip)       # 0x1df41
jmp 0x136e7
leaq 0xa85d(%rip), %rcx      # 0x1dd6c
xorl %eax, %eax
cmpl $0x0, -0xc(%rcx)
jne 0x13528
cmpl $0x0, -0x8(%rcx)
jne 0x13528
cmpl $0x0, -0x4(%rcx)
jne 0x13528
cmpl $0x0, (%rcx)
je 0x13555
incq %rax
addq $0x30, %rcx
cmpq $0xa, %rax
jne 0x13511
movw $0x9, %ax
leaq 0xa84c(%rip), %rcx      # 0x1dd8c
xorl %edx, %edx
cmpl $0x0, (%rcx)
cmovnel %edx, %eax
incq %rdx
addq $0x30, %rcx
cmpq $0xa, %rdx
jne 0x13542
testw %ax, %ax
js 0x137e7
movq %r14, 0x8(%rsp)
cmpw $0x7f, %ax
jae 0x139a4
movb %al, 0xa9ce(%rip)       # 0x1df41
movzwl %ax, %eax
leaq (%rax,%rax,2), %rbx
movl %ebx, %eax
shll $0x4, %eax
leaq (%rax,%r13), %r14
movl %ebp, (%rax,%r13)
movl 0x4(%r12), %ecx
movl %ecx, 0x4(%rax,%r13)
movl 0x8(%r12), %ecx
movl %ecx, 0x8(%rax,%r13)
movl 0xc(%r12), %ecx
movl %ecx, 0xc(%rax,%r13)
movb 0x10(%r12), %cl
movb %cl, 0x10(%rax,%r13)
movl (%r12), %eax
movl %eax, %ecx
andl $0xc0ff, %ecx           # imm = 0xC0FF
cmpl $0x80fe, %ecx           # imm = 0x80FE
jne 0x135f5
movzwl 0xe2(%r15), %eax
shll $0x4, %ebx
movw %ax, 0x28(%rbx,%r13)
movl %ebp, 0x14(%r14)
movl 0x4(%r14), %eax
movl %eax, 0x18(%r14)
movq 0x8(%r14), %rax
movq %rax, 0x1c(%r14)
movb 0x10(%r14), %al
movb %al, 0x24(%r14)
jmp 0x136e2
movl $0x20, %ecx
leaq 0xa68f(%rip), %rdx      # 0x1dc90
cmpq %r15, -0x8(%rcx,%rdx)
je 0x13617
addq $0x28, %rcx
cmpq $0xe8, %rcx
jne 0x13601
jmp 0x1363c
cmpl $0x0, (%rcx,%rdx)
je 0x13608
cmpl -0x20(%rcx,%rdx), %eax
jne 0x13608
movl 0x4(%r12), %esi
cmpl -0x1c(%rcx,%rdx), %esi
jne 0x13608
movb 0x10(%r12), %sil
cmpb -0x10(%rcx,%rdx), %sil
jne 0x13608
jmp 0x135c3
leaq 0x50(%r15), %rcx
movl $0x98, %edx
testb $0x10, (%r15,%rdx)
je 0x13679
testq %r15, %r15
je 0x1365c
cmpl $0x0, -0x1c4(%r15,%rdx,4)
jne 0x13679
cmpl (%rcx), %eax
jne 0x13679
movl 0x4(%r12), %esi
cmpl 0x4(%rcx), %esi
jne 0x13679
movb 0x10(%r12), %sil
cmpb 0x10(%rcx), %sil
je 0x135c3
addq $0x18, %rcx
incq %rdx
cmpq $0x9b, %rdx
jne 0x13645
movq %r15, %rdi
callq 0x133a2
testb %al, %al
js 0x1387c
movzwl 0xe2(%r15), %ecx
shll $0x4, %ebx
movw %cx, 0x28(%rbx,%r13)
movzbl %al, %eax
shll $0x4, %eax
leaq 0xa589(%rip), %rcx      # 0x1dc40
movq (%rax,%rcx), %rax
movl (%rax), %ecx
movl %ecx, 0x14(%rbx,%r13)
movl 0x4(%rax), %ecx
movl %ecx, 0x18(%rbx,%r13)
movl 0x8(%rax), %ecx
movl %ecx, 0x1c(%rbx,%r13)
movl 0xc(%rax), %ecx
movl %ecx, 0x20(%rbx,%r13)
movb 0x10(%rax), %al
movb %al, 0x24(%rbx,%r13)
movq 0x8(%rsp), %r14
movzbl 0xa853(%rip), %eax      # 0x1df41
leaq (%rax,%rax,2), %rax
shll $0x4, %eax
leaq (%rax,%r13), %rdi
addq $0x14, %rdi
movl (%rdi), %ecx
movzbl 0xa83c(%rip), %eax      # 0x1df42
imulq $0x38, %rax, %rax
leaq 0xa2ff(%rip), %rbx      # 0x1da10
cmpl (%rax,%rbx), %ecx
jne 0x1373d
addq %rbx, %rax
movl 0x4(%rdi), %ecx
cmpl 0x4(%rax), %ecx
jne 0x1373d
movl 0x8(%rdi), %ecx
cmpl 0x8(%rax), %ecx
jne 0x1373d
movl 0xc(%rdi), %ecx
cmpl 0xc(%rax), %ecx
jne 0x1373d
movb 0x10(%rdi), %cl
cmpb 0x10(%rax), %cl
je 0x137c7
callq 0x123f7
testb %al, %al
js 0x1374e
movb %al, 0xa7f6(%rip)       # 0x1df42
jmp 0x137c7
callq 0x126cc
testb %al, %al
js 0x137e7
movb %al, 0xa7e1(%rip)       # 0x1df42
movzbl 0xa7d9(%rip), %ecx      # 0x1df41
leaq (%rcx,%rcx,2), %rcx
shll $0x4, %ecx
movl 0x14(%rcx,%r13), %edx
movzbl %al, %eax
imulq $0x38, %rax, %rax
leaq (%rbx,%rax), %rsi
movl %edx, (%rax,%rbx)
movl 0x18(%rcx,%r13), %edx
movl %edx, 0x4(%rax,%rbx)
movl 0x1c(%rcx,%r13), %edx
movl %edx, 0x8(%rax,%rbx)
movl 0x20(%rcx,%r13), %edx
movl %edx, 0xc(%rax,%rbx)
movb 0x24(%rcx,%r13), %cl
movb %cl, 0x10(%rax,%rbx)
movq %r15, 0x18(%rax,%rbx)
movw $0x1, 0x30(%rax,%rbx)
movl $0x1, 0x34(%rax,%rbx)
movq %r15, %rdi
movl $0x1, %edx
callq 0x13132
movzbl 0xa773(%rip), %eax      # 0x1df41
leaq (%rax,%rax,2), %rax
shll $0x4, %eax
movl $0x0, 0x2c(%rax,%r13)
movb 0xa75d(%rip), %bpl      # 0x1df42
jmp 0x137ea
movb $-0x1, %bpl
testb %bpl, %bpl
js 0x13836
movzbl %bpl, %eax
imulq $0x38, %rax, %r15
leaq 0xa212(%rip), %r12      # 0x1da10
leaq (%r12,%r15), %rax
cmpb $0x3, 0x30(%r15,%r12)
jne 0x13815
movb $0x4, 0x30(%rax)
movl $0x5, 0x34(%rax)
movzbl 0x30(%rax), %ecx
cmpl $0x5, %ecx
ja 0x13847
movl $0x34, %edx
btl %ecx, %edx
jae 0x13847
addq $0x20, %rax
movq 0x10(%rsp), %rcx
movq %rax, (%rcx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rax
movq $0x0, (%rax)
cmpb $0x9, %bpl
movb $-0x10, %bpl
ja 0x13836
testq %r14, %r14
je 0x13872
movq %r14, %rax
testb $0x40, 0x14(%rax)
jne 0x13895
movq (%rax), %rax
testq %rax, %rax
jne 0x13864
movq %r14, %rdi
callq 0x5434
jmp 0x138ec
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
movb $0x0, 0x10(%r14)
movb $-0x4, %bpl
movq 0x8(%rsp), %r14
jmp 0x137ea
movl $0xe, %edi
movl $0x280, %esi            # imm = 0x280
movq %r14, %rdx
callq 0x5b54
testq %rax, %rax
jne 0x138e9
leaq (%r15,%r12), %rbx
addq $0x28, %rbx
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x13980
movq (%rdi), %rax
movq %rax, (%rbx)
movq $0x0, (%rdi)
callq 0x13b8a
movl $0xe, %edi
movl $0x280, %esi            # imm = 0x280
movq %r14, %rdx
callq 0x5b54
testq %rax, %rax
je 0x138b4
movq %rax, %r14
movb $-0x1, %bpl
testq %r14, %r14
je 0x13836
movl $0x8, %edi
callq 0x3c9e
testq %rax, %rax
jne 0x13939
movq 0x28(%r15,%r12), %rdi
testq %rdi, %rdi
je 0x13937
leaq (%r15,%r12), %rax
addq $0x28, %rax
movq (%rdi), %rcx
movq %rcx, (%rax)
movq $0x0, (%rdi)
callq 0x13b8a
movl $0x8, %edi
callq 0x3c9e
jmp 0x13939
xorl %eax, %eax
testq %rax, %rax
je 0x13966
movq $0x0, (%rax)
movq %r14, 0x8(%rax)
movq 0x28(%r15,%r12), %rcx
testq %rcx, %rcx
je 0x13973
movq %rcx, %rdx
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0x13953
movq %rax, (%rdx)
jmp 0x13834
movq %r14, %rdi
callq 0x5069
jmp 0x13836
leaq (%r15,%r12), %rcx
addq $0x28, %rcx
jmp 0x13831
xorl %r14d, %r14d
jmp 0x138ec
leaq 0x193d(%rip), %rdi      # 0x152cc
leaq 0x3f3c(%rip), %rsi      # 0x178d2
leaq 0x3eb6(%rip), %rcx      # 0x17853
movl $0x7a2, %edx            # imm = 0x7A2
jmp 0x139be
leaq 0x1921(%rip), %rdi      # 0x152cc
leaq 0x3f20(%rip), %rsi      # 0x178d2
leaq 0x3e9a(%rip), %rcx      # 0x17853
movl $0x7a9, %edx            # imm = 0x7A9
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050