// File: /workspace/github_c_makefile_star2_O0/FH0[P]tun_direct/lwip-2.1.2/src/core/netif.c
// Function: netif_do_set_ipaddr
static int
netif_do_set_ipaddr(struct netif *netif, const ip4_addr_t *ipaddr, ip_addr_t *old_addr)
{
  LWIP_ASSERT("invalid pointer", ipaddr != NULL);
  LWIP_ASSERT("invalid pointer", old_addr != NULL);

  /* address is actually being changed? */
  if (ip4_addr_cmp(ipaddr, netif_ip4_addr(netif)) == 0) {
    ip_addr_t new_addr;
    *ip_2_ip4(&new_addr) = *ipaddr;
    IP_SET_TYPE_VAL(new_addr, IPADDR_TYPE_V4);

    ip_addr_copy(*old_addr, *netif_ip_addr4(netif));

    LWIP_DEBUGF(NETIF_DEBUG | LWIP_DBG_STATE, ("netif_set_ipaddr: netif address being changed\n"));
    netif_do_ip_addr_changed(old_addr, &new_addr);

    mib2_remove_ip4(netif);
    mib2_remove_route_ip4(0, netif);
    /* set new IP address to netif */
    ip4_addr_set(ip_2_ip4(&netif->ip_addr), ipaddr);
    IP_SET_TYPE_VAL(netif->ip_addr, IPADDR_TYPE_V4);
    mib2_add_ip4(netif);
    mib2_add_route_ip4(0, netif);

    netif_issue_reports(netif, NETIF_REPORT_TYPE_IPV4);

    NETIF_STATUS_CALLBACK(netif);
    return 1; /* address changed */
  }
  return 0; /* address unchanged */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x55bc
jmp 0x558d
leaq 0x21d38(%rip), %rdi     # 0x272cc
leaq 0x222ae(%rip), %rsi     # 0x27849
movl $0x1cb, %edx            # imm = 0x1CB
leaq 0x21ee6(%rip), %rcx     # 0x2748d
movb $0x0, %al
callq 0x20d0
xorl %eax, %eax
movl %eax, %edi
callq 0x21b0
callq 0x2040
jmp 0x55be
jmp 0x55c0
cmpq $0x0, -0x20(%rbp)
jne 0x55f8
jmp 0x55c9
leaq 0x21cfc(%rip), %rdi     # 0x272cc
leaq 0x22272(%rip), %rsi     # 0x27849
movl $0x1cc, %edx            # imm = 0x1CC
leaq 0x21eaa(%rip), %rcx     # 0x2748d
movb $0x0, %al
callq 0x20d0
xorl %eax, %eax
movl %eax, %edi
callq 0x21b0
callq 0x2040
jmp 0x55fa
movq -0x18(%rbp), %rax
movl (%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x5718
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x38(%rbp)
movb $0x0, -0x24(%rbp)
jmp 0x5627
jmp 0x5629
movq -0x10(%rbp), %rax
movb 0x1c(%rax), %cl
movq -0x20(%rbp), %rax
movb %cl, 0x14(%rax)
movq -0x10(%rbp), %rax
movzbl 0x1c(%rax), %eax
cmpl $0x6, %eax
jne 0x568d
jmp 0x5646
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movl 0x14(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rax
movb 0x18(%rax), %cl
movq -0x20(%rbp), %rax
movb %cl, 0x10(%rax)
jmp 0x56c5
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0x20(%rbp), %rax
movb $0x0, 0x10(%rax)
jmp 0x56c5
jmp 0x56c7
jmp 0x56c9
jmp 0x56cb
movq -0x20(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x5a70
cmpq $0x0, -0x18(%rbp)
jne 0x56e6
xorl %eax, %eax
movl %eax, -0x3c(%rbp)
jmp 0x56ef
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x1c(%rax)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x5b70
movl $0x1, -0x4(%rbp)
jmp 0x571f
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)