// File: /workspace/github_c_makefile_star2_O3/Carton32[P]quectel-CM/udhcpc.c
// Function: udhcpc_start
void udhcpc_start(PROFILE_T *profile) {
    char *ifname = profile->usbnet_adapter;
    char shell_cmd[128];

    ql_set_driver_link_state(profile, 1);

    if (profile->qmapnet_adapter[0]) {
        ifname = profile->qmapnet_adapter;
    }

    if (profile->rawIP && profile->ipv4.Address && profile->ipv4.Mtu) {
        ql_set_mtu(ifname, (profile->ipv4.Mtu));
    }

    if (strcmp(ifname, profile->usbnet_adapter)) {
        snprintf(shell_cmd, sizeof(shell_cmd), "ifconfig %s up", profile->usbnet_adapter);
        ql_system(shell_cmd);
        if (ifc_get_flags(ifname)&IFF_UP) {
            snprintf(shell_cmd, sizeof(shell_cmd), "ifconfig %s down", ifname);
            ql_system(shell_cmd);
        }
    }

    snprintf(shell_cmd, sizeof(shell_cmd), "ifconfig %s up", ifname);
    ql_system(shell_cmd);
	
    if (profile->ipv4.Address) {
        if (profile->PCSCFIpv4Addr1)
            dbg_time("pcscf1: %s", ipv4Str(profile->PCSCFIpv4Addr1));
        if (profile->PCSCFIpv4Addr2)
            dbg_time("pcscf2: %s", ipv4Str(profile->PCSCFIpv4Addr2));
    }

    if (profile->ipv6.Address[0] && profile->ipv6.PrefixLengthIPAddr) {
        if (profile->PCSCFIpv6Addr1[0])
            dbg_time("pcscf1: %s", ipv6Str(profile->PCSCFIpv6Addr1));
        if (profile->PCSCFIpv6Addr2[0])
            dbg_time("pcscf2: %s", ipv6Str(profile->PCSCFIpv6Addr2));
    }

#if 1 //for bridge mode, only one public IP, so do udhcpc manually
    if (ql_bridge_mode_detect(profile)) {
        return;
    }
#endif

//because must use udhcpc to obtain IP when working on ETH mode,
//so it is better also use udhcpc to obtain IP when working on IP mode.
//use the same policy for all modules
#if 0
    if (profile->rawIP != 0) //mdm9x07/ec25,ec20 R2.0
    {
        update_ip_address_by_qmi(ifname, &profile->ipv4, &profile->ipv6);
        return;
    }
#endif

    if (profile->ipv4.Address == 0)
        goto set_ipv6;

    if (profile->request_ops == &mbim_request_ops) { //lots of mbim modem do not support DHCP
        update_ip_address_by_qmi(ifname, &profile->ipv4, NULL);
    }
    else
/* Do DHCP using busybox tools */
    {
        char udhcpc_cmd[128];
        pthread_attr_t udhcpc_thread_attr;
        pthread_t udhcpc_thread_id;

        pthread_attr_init(&udhcpc_thread_attr);
        pthread_attr_setdetachstate(&udhcpc_thread_attr, PTHREAD_CREATE_DETACHED);

#ifdef USE_DHCLIENT
            snprintf(udhcpc_cmd, sizeof(udhcpc_cmd), "dhclient -4 -d --no-pid %s", ifname);
            dhclient_alive++;
#else
            if (access("/usr/share/udhcpc/default.script", X_OK)
                && access("/etc//udhcpc/default.script", X_OK)) {
                dbg_time("No default.script found, it should be in '/usr/share/udhcpc/' or '/etc//udhcpc' depend on your udhcpc version!");
            }

            //-f,--foreground    Run in foreground
            //-b,--background    Background if lease is not obtained
            //-n,--now        Exit if lease is not obtained
            //-q,--quit        Exit after obtaining lease
            //-t,--retries N        Send up to N discover packets (default 3)
            snprintf(udhcpc_cmd, sizeof(udhcpc_cmd), "busybox udhcpc -f -n -q -t 5 -i %s", ifname);
#endif

#if 1 //for OpenWrt
            if (!access("/lib/netifd/dhcp.script", X_OK) && !access("/sbin/ifup", X_OK) && !access("/sbin/ifstatus", X_OK)) {
#if 0 //20210415 do not promot these message
                dbg_time("you are use OpenWrt?");
                dbg_time("should not calling udhcpc manually?");
                dbg_time("should modify /etc/config/network as below?");
                dbg_time("config interface wan");
                dbg_time("\toption ifname	%s", ifname);
                dbg_time("\toption proto	dhcp");
                dbg_time("should use \"/sbin/ifstaus wan\" to check %s 's status?", ifname);
#endif
            }
#endif

#ifdef USE_DHCLIENT            
            pthread_create(&udhcpc_thread_id, &udhcpc_thread_attr, udhcpc_thread_function, (void*)strdup(udhcpc_cmd));
            sleep(1);
#else
            pthread_create(&udhcpc_thread_id, NULL, udhcpc_thread_function, (void*)strdup(udhcpc_cmd));
            pthread_join(udhcpc_thread_id, NULL);

            if (profile->request_ops == &atc_request_ops
                && !ql_netcard_ipv4_address_check(ifname, qmi2addr(profile->ipv4.Address))) {
                ql_get_netcard_carrier_state(ifname);
            }

            if (profile->request_ops != &qmi_request_ops) { //only QMI modem support next fixup!
                goto set_ipv6;
            }

            if (ql_raw_ip_mode_check(ifname, profile->ipv4.Address)) {
                pthread_create(&udhcpc_thread_id, NULL, udhcpc_thread_function, (void*)strdup(udhcpc_cmd));
                pthread_join(udhcpc_thread_id, NULL);
            }

            if (!ql_netcard_ipv4_address_check(ifname, qmi2addr(profile->ipv4.Address))) {
                //no udhcpc's default.script exist, directly set ip and dns
                update_ip_address_by_qmi(ifname, &profile->ipv4, NULL);
            }
#endif
    }

#ifdef QL_OPENWER_NETWORK_SETUP
    ql_openwrt_setup_wan(ifname, &profile->ipv4);
#endif

set_ipv6:
    if (profile->ipv6.Address[0] && profile->ipv6.PrefixLengthIPAddr) {
#if 1
        //module do not support DHCPv6, only support 'Router Solicit'
        //and it seem if enable /proc/sys/net/ipv6/conf/all/forwarding, Kernel do not send RS
        const char *forward_file = "/proc/sys/net/ipv6/conf/all/forwarding";
        int forward_fd = open(forward_file, O_RDONLY);
        if (forward_fd > 0) {
            char forward_state[2];
            if (read(forward_fd, forward_state, 2) == -1) {};
            if (forward_state[0] == '1') {
                //dbg_time("%s enabled, kernel maybe donot send 'Router Solicit'", forward_file);
            }
            close(forward_fd);
        }

        update_ip_address_by_qmi(ifname, NULL, &profile->ipv6);

        if (profile->ipv6.DnsPrimary[0] || profile->ipv6.DnsSecondary[0]) {
            char dns1str[64], dns2str[64];

            if (profile->ipv6.DnsPrimary[0]) {
                strcpy(dns1str, ipv6Str(profile->ipv6.DnsPrimary));
            }

            if (profile->ipv6.DnsSecondary[0]) {
                strcpy(dns2str, ipv6Str(profile->ipv6.DnsSecondary));
            }

            update_resolv_conf(6, ifname, profile->ipv6.DnsPrimary[0] ? dns1str : NULL,
                               profile->ipv6.DnsSecondary[0] != '\0' ? dns2str : NULL);
        }

#ifdef QL_OPENWER_NETWORK_SETUP
            ql_openwrt_setup_wan6(ifname, &profile->ipv6);
#endif
#else
#ifdef USE_DHCLIENT
        snprintf(udhcpc_cmd, sizeof(udhcpc_cmd), "dhclient -6 -d --no-pid %s",  ifname);
        dhclient_alive++;
#else
        /*
            DHCPv6: Dibbler - a portable DHCPv6
            1. download from http://klub.com.pl/dhcpv6/
            2. cross-compile
                2.1 ./configure --host=arm-linux-gnueabihf
                2.2 copy dibbler-client to your board
            3. mkdir -p /var/log/dibbler/ /var/lib/ on your board
            4. create /etc/dibbler/client.conf on your board, the content is
                log-mode short
                log-level 7
                iface wwan0 {
                    ia
                    option dns-server
                }
             5. run "dibbler-client start" to get ipV6 address
             6. run "route -A inet6 add default dev wwan0" to add default route
        */
        snprintf(shell_cmd, sizeof(shell_cmd), "route -A inet6 add default %s", ifname);
        ql_system(shell_cmd);
        snprintf(udhcpc_cmd, sizeof(udhcpc_cmd), "dibbler-client run");
        dibbler_client_alive++;
#endif

        pthread_create(&udhcpc_thread_id, &udhcpc_thread_attr, udhcpc_thread_function, (void*)strdup(udhcpc_cmd));
#endif
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movq %rdi, %r14
leaq 0xaa(%rdi), %r15
movl $0x1, %esi
callq 0x1bd54
leaq 0xca(%r14), %rbx
cmpb $0x0, 0xca(%r14)
cmoveq %r15, %rbx
cmpl $0x0, 0x11a(%r14)
je 0x1c37f
cmpl $0x0, 0x126(%r14)
je 0x1c37f
movl 0x13a(%r14), %r12d
testl %r12d, %r12d
je 0x1c37f
movl $0x2, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x55a0
testl %eax, %eax
jle 0x1c37f
movl %eax, %ebp
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %r13
movups %xmm0, 0x10(%r13)
movq $0x0, 0x20(%r13)
movl $0x10, %edx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x5080
movb $0x0, 0xf(%r13)
movl $0x8921, %esi           # imm = 0x8921
movl %ebp, %edi
movq %r13, %rdx
xorl %eax, %eax
callq 0x5210
testl %eax, %eax
jne 0x1c378
cmpl %r12d, 0x40(%rsp)
je 0x1c378
movq 0xdcb1(%rip), %rax      # 0x29fc0
movq (%rax), %r13
callq 0xea3b
movl 0x40(%rsp), %ecx
leaq 0x75af(%rip), %rsi      # 0x238d1
movq %r13, %rdi
movq %rax, %rdx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x52c0
leaq 0xe96f(%rip), %rax      # 0x2aca8
movq (%rax), %r13
testq %r13, %r13
je 0x1c361
callq 0xea3b
movl 0x40(%rsp), %ecx
leaq 0x7580(%rip), %rsi      # 0x238d1
movq %r13, %rdi
movq %rax, %rdx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x52c0
leaq 0x30(%rsp), %rdx
movl %r12d, 0x10(%rdx)
movl $0x8922, %esi           # imm = 0x8922
movl %ebp, %edi
xorl %eax, %eax
callq 0x5210
movl %ebp, %edi
callq 0x5230
movq %rbx, %rdi
movq %r15, %rsi
callq 0x52a0
testl %eax, %eax
je 0x1c454
leaq 0x6e73(%rip), %rdx      # 0x2320c
leaq 0x1b0(%rsp), %r12
movl $0x80, %esi
movq %r12, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x51c0
movq %r12, %rdi
callq 0x1bf3d
movl $0x2, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x55a0
testl %eax, %eax
jle 0x1c454
movl %eax, %ebp
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %r15
movups %xmm0, 0x10(%r15)
movq $0x0, 0x20(%r15)
movl $0x10, %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5080
movb $0x0, 0xf(%r15)
movl $0x8913, %esi           # imm = 0x8913
movl %ebp, %edi
movq %r15, %rdx
xorl %eax, %eax
callq 0x5210
movl %eax, %r12d
movzwl 0x10(%r15), %r15d
movl %ebp, %edi
callq 0x5230
testl %r12d, %r12d
jne 0x1c454
andl $0x1, %r15d
je 0x1c454
leaq 0x7218(%rip), %rdx      # 0x2364a
leaq 0x1b0(%rsp), %r15
movl $0x80, %esi
movq %r15, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x51c0
movq %r15, %rdi
callq 0x1bf3d
leaq 0x6db1(%rip), %rdx      # 0x2320c
leaq 0x1b0(%rsp), %r15
movl $0x80, %esi
movq %r15, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x51c0
movq %r15, %rdi
callq 0x1bf3d
cmpl $0x0, 0x126(%r14)
je 0x1c667
cmpl $0x0, 0x194(%r14)
je 0x1c579
movq 0xdb20(%rip), %rax      # 0x29fc0
movq (%rax), %r15
callq 0xea3b
movq %rax, %r12
movl 0x194(%r14), %eax
movl %eax, %r9d
shrl $0x8, %r9d
movl %eax, %r8d
shrl $0x10, %r8d
movl %eax, %ecx
shrl $0x18, %ecx
movl $0xff, %ebp
andl %ebp, %r8d
andl %ebp, %r9d
andl %ebp, %eax
movl %eax, (%rsp)
leaq 0xde44(%rip), %r13      # 0x2a320
leaq 0x6dcb(%rip), %rdx      # 0x232ae
movl $0x10, %esi
movq %r13, %rdi
xorl %eax, %eax
callq 0x51c0
leaq 0x7274(%rip), %rsi      # 0x2376d
movq %r15, %rdi
movq %r12, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x52c0
leaq 0xe798(%rip), %rax      # 0x2aca8
movq (%rax), %r15
testq %r15, %r15
je 0x1c579
callq 0xea3b
movq %rax, %r12
movl 0x194(%r14), %eax
movl %eax, %r9d
shrl $0x8, %r9d
movl %eax, %r8d
shrl $0x10, %r8d
movl %eax, %ecx
shrl $0x18, %ecx
andl %ebp, %r8d
andl %ebp, %r9d
andl %ebp, %eax
movl %eax, (%rsp)
leaq 0xddd4(%rip), %r13      # 0x2a320
leaq 0x6d5b(%rip), %rdx      # 0x232ae
movl $0x10, %esi
movq %r13, %rdi
xorl %eax, %eax
callq 0x51c0
leaq 0x7204(%rip), %rsi      # 0x2376d
movq %r15, %rdi
movq %r12, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x52c0
cmpl $0x0, 0x198(%r14)
je 0x1c667
movq 0xda32(%rip), %rax      # 0x29fc0
movq (%rax), %r15
callq 0xea3b
movq %rax, %r12
movl 0x198(%r14), %eax
movl %eax, %r9d
shrl $0x8, %r9d
movl %eax, %r8d
shrl $0x10, %r8d
movl %eax, %ecx
shrl $0x18, %ecx
movl $0xff, %ebp
andl %ebp, %r8d
andl %ebp, %r9d
andl %ebp, %eax
movl %eax, (%rsp)
leaq 0xdd56(%rip), %r13      # 0x2a320
leaq 0x6cdd(%rip), %rdx      # 0x232ae
movl $0x10, %esi
movq %r13, %rdi
xorl %eax, %eax
callq 0x51c0
leaq 0x7197(%rip), %rsi      # 0x2377e
movq %r15, %rdi
movq %r12, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x52c0
leaq 0xe6aa(%rip), %rax      # 0x2aca8
movq (%rax), %r15
testq %r15, %r15
je 0x1c667
callq 0xea3b
movq %rax, %r12
movl 0x198(%r14), %eax
movl %eax, %r9d
shrl $0x8, %r9d
movl %eax, %r8d
shrl $0x10, %r8d
movl %eax, %ecx
shrl $0x18, %ecx
andl %ebp, %r8d
andl %ebp, %r9d
andl %ebp, %eax
movl %eax, (%rsp)
leaq 0xdce6(%rip), %r13      # 0x2a320
leaq 0x6c6d(%rip), %rdx      # 0x232ae
movl $0x10, %esi
movq %r13, %rdi
xorl %eax, %eax
callq 0x51c0
leaq 0x7127(%rip), %rsi      # 0x2377e
movq %r15, %rdi
movq %r12, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x52c0
cmpb $0x0, 0x13e(%r14)
je 0x1c783
cmpb $0x0, 0x18e(%r14)
je 0x1c783
cmpb $0x0, 0x19c(%r14)
je 0x1c703
leaq 0x19c(%r14), %r15
movq 0xd925(%rip), %rax      # 0x29fc0
movq (%rax), %r12
callq 0xea3b
movq %rax, %r13
movq %r15, %rdi
callq 0x1cce4
leaq 0x70b8(%rip), %rsi      # 0x2376d
leaq 0xfd34(%rip), %rcx      # 0x2c3f0
movq %r12, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0xe5d8(%rip), %rax      # 0x2aca8
movq (%rax), %r12
testq %r12, %r12
je 0x1c703
callq 0xea3b
movq %rax, %r13
movq %r15, %rdi
callq 0x1cce4
leaq 0x707e(%rip), %rsi      # 0x2376d
leaq 0xfcfa(%rip), %rcx      # 0x2c3f0
movq %r12, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x52c0
cmpb $0x0, 0x1ac(%r14)
je 0x1c783
leaq 0x1ac(%r14), %r15
movq 0xd8a5(%rip), %rax      # 0x29fc0
movq (%rax), %r12
callq 0xea3b
movq %rax, %r13
movq %r15, %rdi
callq 0x1cce4
leaq 0x7049(%rip), %rsi      # 0x2377e
leaq 0xfcb4(%rip), %rcx      # 0x2c3f0
movq %r12, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0xe558(%rip), %rax      # 0x2aca8
movq (%rax), %r12
testq %r12, %r12
je 0x1c783
callq 0xea3b
movq %rax, %r13
movq %r15, %rdi
callq 0x1cce4
leaq 0x700f(%rip), %rsi      # 0x2377e
leaq 0xfc7a(%rip), %rcx      # 0x2c3f0
movq %r12, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x52c0
movq %r14, %rdi
callq 0xf7f0
testl %eax, %eax
je 0x1c7a1
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x126(%r14), %r12
leaq 0x13e(%r14), %r15
cmpl $0x0, (%r12)
je 0x1c98c
movq 0x326(%r14), %rax
cmpq 0xd820(%rip), %rax      # 0x29fe8
je 0x1c97f
leaq 0x230(%rsp), %r13
movq %r13, %rdi
callq 0x5260
movq %r13, %rdi
movl $0x1, %esi
callq 0x5330
leaq 0x6f9d(%rip), %rdi      # 0x2378f
movl $0x1, %esi
callq 0x5450
testl %eax, %eax
je 0x1c860
leaq 0x6fa9(%rip), %rdi      # 0x237b0
movl $0x1, %esi
callq 0x5450
testl %eax, %eax
je 0x1c860
movq 0xd7a4(%rip), %rax      # 0x29fc0
movq (%rax), %r13
callq 0xea3b
leaq 0x6fa1(%rip), %rsi      # 0x237cc
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0xe469(%rip), %rax      # 0x2aca8
movq (%rax), %r13
testq %r13, %r13
je 0x1c860
callq 0xea3b
leaq 0x6f79(%rip), %rsi      # 0x237cc
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0x6fda(%rip), %rdx      # 0x23841
leaq 0x130(%rsp), %rdi
movl $0x80, %esi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x51c0
leaq 0x6fdf(%rip), %rdi      # 0x23864
movl $0x1, %esi
callq 0x5450
testl %eax, %eax
jne 0x1c8b9
leaq 0x6fe2(%rip), %rdi      # 0x2387c
movl $0x1, %esi
callq 0x5450
testl %eax, %eax
jne 0x1c8b9
leaq 0x6fd8(%rip), %rdi      # 0x23887
movl $0x1, %esi
callq 0x5450
leaq 0x130(%rsp), %rdi
callq 0x5520
leaq 0x7ad(%rip), %rdx       # 0x1d07a
leaq 0x28(%rsp), %r13
movq %r13, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0x53d0
movq (%r13), %rdi
xorl %esi, %esi
callq 0x5510
movq 0x326(%r14), %rax
cmpq 0xd6d0(%rip), %rax      # 0x29fc8
jne 0x1c91b
movl (%r12), %esi
bswapl %esi
movq %rbx, %rdi
callq 0x1d1bd
testl %eax, %eax
jne 0x1c914
movq %rbx, %rdi
callq 0x17c17
movq 0x326(%r14), %rax
cmpq 0xd6b6(%rip), %rax      # 0x29fd8
jne 0x1c98c
movl (%r12), %esi
movw $0x58, 0x16(%rsp)
bswapl %esi
movq %rbx, %rdi
callq 0x1d1bd
testl %eax, %eax
jne 0x1c96d
leaq 0x6fbf(%rip), %rdx      # 0x23903
leaq 0x30(%rsp), %r13
movl $0x80, %esi
movq %r13, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x51c0
movq %r13, %rdi
xorl %esi, %esi
callq 0x5450
testl %eax, %eax
je 0x1ca82
movl (%r12), %esi
bswapl %esi
movq %rbx, %rdi
callq 0x1d1bd
testl %eax, %eax
jne 0x1c98c
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x1cd5e
cmpb $0x0, (%r15)
je 0x1c78f
cmpb $0x0, 0x18e(%r14)
je 0x1c78f
leaq 0x6eeb(%rip), %rdi      # 0x23896
xorl %esi, %esi
xorl %eax, %eax
callq 0x5440
testl %eax, %eax
jle 0x1c9d2
movl %eax, %ebp
leaq 0x30(%rsp), %rsi
movl $0x2, %edx
movl %eax, %edi
callq 0x5250
movl %ebp, %edi
callq 0x5230
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x1cd5e
leaq 0x16e(%r14), %r15
cmpb $0x0, 0x16e(%r14)
je 0x1ca1c
movq %r15, %rdi
callq 0x1cce4
leaq 0xf9f1(%rip), %rsi      # 0x2c3f0
leaq 0x30(%rsp), %rdi
callq 0x50a0
leaq 0x17e(%r14), %r12
cmpb $0x0, 0x17e(%r14)
jne 0x1ca34
jmp 0x1ca50
cmpb $0x0, 0x17e(%r14)
je 0x1c78f
addq $0x17e, %r14            # imm = 0x17E
movq %r14, %r12
movq %r12, %rdi
callq 0x1cce4
leaq 0xf9ad(%rip), %rsi      # 0x2c3f0
leaq 0xb0(%rsp), %rdi
callq 0x50a0
xorl %eax, %eax
cmpb $0x0, (%r15)
leaq 0x30(%rsp), %rdx
cmoveq %rax, %rdx
cmpb $0x0, (%r12)
leaq 0xb0(%rsp), %rcx
cmoveq %rax, %rcx
movl $0x6, %edi
movq %rbx, %rsi
callq 0xee84
jmp 0x1c78f
leaq 0x30(%rsp), %rdi
movl $0x902, %esi            # imm = 0x902
xorl %eax, %eax
callq 0x5440
testl %eax, %eax
js 0x1cc1d
movl %eax, %ebp
leaq 0x16(%rsp), %r13
movl $0x2, %edx
movl %eax, %edi
movq %r13, %rsi
callq 0x5250
movzbl (%r13), %eax
cmpl $0x30, %eax
je 0x1cac4
cmpl $0x4e, %eax
jne 0x1ccd8
movq 0xd4f5(%rip), %rax      # 0x29fc0
movq (%rax), %r13
callq 0xea3b
leaq 0x6e7b(%rip), %rsi      # 0x23955
leaq 0x6eb3(%rip), %rcx      # 0x23994
movq %r13, %rdi
movq %rax, %rdx
movl $0x89, %r8d
xorl %eax, %eax
callq 0x52c0
leaq 0xe1ad(%rip), %rax      # 0x2aca8
movq (%rax), %r13
testq %r13, %r13
je 0x1cb29
callq 0xea3b
leaq 0x6e46(%rip), %rsi      # 0x23955
leaq 0x6e7e(%rip), %rcx      # 0x23994
movq %r13, %rdi
movq %rax, %rdx
movl $0x89, %r8d
xorl %eax, %eax
callq 0x52c0
leaq 0x6b1a(%rip), %rdx      # 0x2364a
leaq 0xb0(%rsp), %r13
movl $0x80, %esi
movq %r13, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x51c0
movq %r13, %rdi
callq 0x1bf3d
movq 0xd467(%rip), %rax      # 0x29fc0
movq (%rax), %r13
callq 0xea3b
leaq 0x6e41(%rip), %rsi      # 0x239a9
movq %r13, %rdi
movq %rax, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x52c0
leaq 0xe129(%rip), %rax      # 0x2aca8
movq (%rax), %r13
testq %r13, %r13
je 0x1cba3
callq 0xea3b
leaq 0x6e16(%rip), %rsi      # 0x239a9
movq %r13, %rdi
movq %rax, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x52c0
leaq 0x16(%rsp), %rsi
movb $0x59, (%rsi)
movl $0x2, %edx
movl %ebp, %edi
callq 0x5100
leaq 0x664e(%rip), %rdx      # 0x2320c
leaq 0xb0(%rsp), %r13
movl $0x80, %esi
movq %r13, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x51c0
movq %r13, %rdi
callq 0x1bf3d
movl %ebp, %edi
callq 0x5230
leaq 0x130(%rsp), %rdi
callq 0x5520
leaq 0x47f(%rip), %rdx       # 0x1d07a
leaq 0x28(%rsp), %r13
movq %r13, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0x53d0
movq (%r13), %rdi
xorl %esi, %esi
callq 0x5510
jmp 0x1c96d
movq 0xd39c(%rip), %rax      # 0x29fc0
movq (%rax), %rax
movq %rax, 0x18(%rsp)
callq 0xea3b
movq %rax, 0x20(%rsp)
callq 0x5070
movq %rax, %r13
movl (%rax), %ebp
movl %ebp, %edi
callq 0x5530
movq %rax, 0x8(%rsp)
movl %ebp, (%rsp)
leaq 0x6cca(%rip), %rsi      # 0x23920
leaq 0x6cef(%rip), %rcx      # 0x2394c
leaq 0x30(%rsp), %r9
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rdx
movl $0x83, %r8d
xorl %eax, %eax
callq 0x52c0
leaq 0xe028(%rip), %rax      # 0x2aca8
movq (%rax), %rbp
testq %rbp, %rbp
je 0x1c96d
callq 0xea3b
movq %rax, 0x18(%rsp)
movl (%r13), %r13d
movl %r13d, %edi
callq 0x5530
movq %rax, 0x8(%rsp)
movl %r13d, (%rsp)
leaq 0x6c6e(%rip), %rsi      # 0x23920
leaq 0x6c93(%rip), %rcx      # 0x2394c
leaq 0x30(%rsp), %r9
movq %rbp, %rdi
movq 0x18(%rsp), %rdx
movl $0x83, %r8d
xorl %eax, %eax
callq 0x52c0
jmp 0x1c96d
movl %ebp, %edi
callq 0x5230
jmp 0x1c96d