// File: /workspace/github_c_makefile_star2_O1/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 0x1c0bc
leaq 0xca(%r14), %rbx
cmpb $0x0, 0xca(%r14)
cmoveq %r15, %rbx
cmpl $0x0, 0x11a(%r14)
je 0x1c6ec
cmpl $0x0, 0x126(%r14)
je 0x1c6ec
movl 0x13a(%r14), %r12d
testl %r12d, %r12d
je 0x1c6ec
movl $0x2, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x55a0
testl %eax, %eax
jle 0x1c6ec
movl %eax, %ebp
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %r13
movaps %xmm0, 0x10(%r13)
movaps %xmm0, (%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 0x1c6e5
cmpl %r12d, 0x40(%rsp)
je 0x1c6e5
movq 0xd944(%rip), %rax      # 0x29fc0
movq (%rax), %r13
callq 0xeb2f
movl 0x40(%rsp), %ecx
leaq 0x71ec(%rip), %rsi      # 0x2387b
movq %r13, %rdi
movq %rax, %rdx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x52c0
leaq 0xe602(%rip), %rax      # 0x2aca8
movq (%rax), %r13
testq %r13, %r13
je 0x1c6ce
callq 0xeb2f
movl 0x40(%rsp), %ecx
leaq 0x71bd(%rip), %rsi      # 0x2387b
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 0x1c7c5
leaq 0x6ae6(%rip), %rdx      # 0x231ec
leaq 0x1b0(%rsp), %r12
movl $0x80, %esi
movq %r12, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x51c0
movq %r12, %rdi
callq 0x1c2a5
movl $0x2, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x55a0
testl %eax, %eax
jle 0x1c7c5
movl %eax, %ebp
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %r15
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%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 0x1c7c5
andl $0x1, %r15d
je 0x1c7c5
leaq 0x6e51(%rip), %rdx      # 0x235f4
leaq 0x1b0(%rsp), %r15
movl $0x80, %esi
movq %r15, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x51c0
movq %r15, %rdi
callq 0x1c2a5
leaq 0x6a20(%rip), %rdx      # 0x231ec
leaq 0x1b0(%rsp), %r15
movl $0x80, %esi
movq %r15, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x51c0
movq %r15, %rdi
callq 0x1c2a5
cmpl $0x0, 0x126(%r14)
je 0x1c9d8
cmpl $0x0, 0x194(%r14)
je 0x1c8ea
movq 0xd7af(%rip), %rax      # 0x29fc0
movq (%rax), %r15
callq 0xeb2f
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 0xdad3(%rip), %r13      # 0x2a320
leaq 0x6a3a(%rip), %rdx      # 0x2328e
movl $0x10, %esi
movq %r13, %rdi
xorl %eax, %eax
callq 0x51c0
leaq 0x6ead(%rip), %rsi      # 0x23717
movq %r15, %rdi
movq %r12, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x52c0
leaq 0xe427(%rip), %rax      # 0x2aca8
movq (%rax), %r15
testq %r15, %r15
je 0x1c8ea
callq 0xeb2f
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 0xda63(%rip), %r13      # 0x2a320
leaq 0x69ca(%rip), %rdx      # 0x2328e
movl $0x10, %esi
movq %r13, %rdi
xorl %eax, %eax
callq 0x51c0
leaq 0x6e3d(%rip), %rsi      # 0x23717
movq %r15, %rdi
movq %r12, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x52c0
cmpl $0x0, 0x198(%r14)
je 0x1c9d8
movq 0xd6c1(%rip), %rax      # 0x29fc0
movq (%rax), %r15
callq 0xeb2f
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 0xd9e5(%rip), %r13      # 0x2a320
leaq 0x694c(%rip), %rdx      # 0x2328e
movl $0x10, %esi
movq %r13, %rdi
xorl %eax, %eax
callq 0x51c0
leaq 0x6dd0(%rip), %rsi      # 0x23728
movq %r15, %rdi
movq %r12, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x52c0
leaq 0xe339(%rip), %rax      # 0x2aca8
movq (%rax), %r15
testq %r15, %r15
je 0x1c9d8
callq 0xeb2f
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 0xd975(%rip), %r13      # 0x2a320
leaq 0x68dc(%rip), %rdx      # 0x2328e
movl $0x10, %esi
movq %r13, %rdi
xorl %eax, %eax
callq 0x51c0
leaq 0x6d60(%rip), %rsi      # 0x23728
movq %r15, %rdi
movq %r12, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x52c0
cmpb $0x0, 0x13e(%r14)
je 0x1caf4
cmpb $0x0, 0x18e(%r14)
je 0x1caf4
cmpb $0x0, 0x19c(%r14)
je 0x1ca74
leaq 0x19c(%r14), %r15
movq 0xd5b4(%rip), %rax      # 0x29fc0
movq (%rax), %r12
callq 0xeb2f
movq %rax, %r13
movq %r15, %rdi
callq 0x1d06f
leaq 0x6cf1(%rip), %rsi      # 0x23717
leaq 0xf9c3(%rip), %rcx      # 0x2c3f0
movq %r12, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0xe267(%rip), %rax      # 0x2aca8
movq (%rax), %r12
testq %r12, %r12
je 0x1ca74
callq 0xeb2f
movq %rax, %r13
movq %r15, %rdi
callq 0x1d06f
leaq 0x6cb7(%rip), %rsi      # 0x23717
leaq 0xf989(%rip), %rcx      # 0x2c3f0
movq %r12, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x52c0
cmpb $0x0, 0x1ac(%r14)
je 0x1caf4
leaq 0x1ac(%r14), %r15
movq 0xd534(%rip), %rax      # 0x29fc0
movq (%rax), %r12
callq 0xeb2f
movq %rax, %r13
movq %r15, %rdi
callq 0x1d06f
leaq 0x6c82(%rip), %rsi      # 0x23728
leaq 0xf943(%rip), %rcx      # 0x2c3f0
movq %r12, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0xe1e7(%rip), %rax      # 0x2aca8
movq (%rax), %r12
testq %r12, %r12
je 0x1caf4
callq 0xeb2f
movq %rax, %r13
movq %r15, %rdi
callq 0x1d06f
leaq 0x6c48(%rip), %rsi      # 0x23728
leaq 0xf909(%rip), %rcx      # 0x2c3f0
movq %r12, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x52c0
movq %r14, %rdi
callq 0xf91c
testl %eax, %eax
je 0x1cb12
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x126(%r14), %r15
cmpl $0x0, (%r15)
je 0x1cd1b
movq 0x326(%r14), %rax
cmpq 0xd4b7(%rip), %rax      # 0x29fe8
je 0x1cd0e
leaq 0x230(%rsp), %r12
movq %r12, %rdi
callq 0x5260
movq %r12, %rdi
movl $0x1, %esi
callq 0x5330
leaq 0x6bde(%rip), %rdi      # 0x23739
movl $0x1, %esi
callq 0x5450
testl %eax, %eax
je 0x1cbc9
leaq 0x6bea(%rip), %rdi      # 0x2375a
movl $0x1, %esi
callq 0x5450
testl %eax, %eax
je 0x1cbc9
movq 0xd43b(%rip), %rax      # 0x29fc0
movq (%rax), %r12
callq 0xeb2f
leaq 0x6be2(%rip), %rsi      # 0x23776
movq %r12, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0xe100(%rip), %rax      # 0x2aca8
movq (%rax), %r12
testq %r12, %r12
je 0x1cbc9
callq 0xeb2f
leaq 0x6bba(%rip), %rsi      # 0x23776
movq %r12, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0x6c1b(%rip), %rdx      # 0x237eb
leaq 0x130(%rsp), %rdi
movl $0x80, %esi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x51c0
leaq 0x6c20(%rip), %rdi      # 0x2380e
movl $0x1, %esi
callq 0x5450
testl %eax, %eax
jne 0x1cc22
leaq 0x6c23(%rip), %rdi      # 0x23826
movl $0x1, %esi
callq 0x5450
testl %eax, %eax
jne 0x1cc22
leaq 0x6c19(%rip), %rdi      # 0x23831
movl $0x1, %esi
callq 0x5450
leaq 0x130(%rsp), %rdi
callq 0x5520
leaq 0x750(%rip), %rdx       # 0x1d386
leaq 0x28(%rsp), %r12
movq %r12, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0x53d0
movq (%r12), %rdi
xorl %esi, %esi
callq 0x5510
movq 0x326(%r14), %rax
cmpq 0xd367(%rip), %rax      # 0x29fc8
jne 0x1cc7c
movl (%r15), %esi
bswapl %esi
movq %rbx, %rdi
callq 0x1d4c9
testl %eax, %eax
jne 0x1cc7c
movq %rbx, %rdi
callq 0x17e49
movq 0x326(%r14), %rax
movl $0xa, %r12d
cmpq 0xd348(%rip), %rax      # 0x29fd8
jne 0x1ccfe
movl (%r15), %esi
movw $0x58, 0x1e(%rsp)
bswapl %esi
movq %rbx, %rdi
callq 0x1d4c9
testl %eax, %eax
jne 0x1ccda
leaq 0x6bfc(%rip), %rdx      # 0x238ad
leaq 0x30(%rsp), %r12
movl $0x80, %esi
movq %r12, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x51c0
movq %r12, %rdi
xorl %esi, %esi
callq 0x5450
testl %eax, %eax
je 0x1ce17
movl (%r15), %esi
bswapl %esi
movq %rbx, %rdi
callq 0x1d4c9
xorl %r12d, %r12d
testl %eax, %eax
jne 0x1ccfe
xorl %r12d, %r12d
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x1d0ed
cmpl $0xa, %r12d
je 0x1cd1b
testl %r12d, %r12d
je 0x1cd1b
jmp 0x1cb00
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x1d0ed
leaq 0x13e(%r14), %r15
cmpb $0x0, (%r15)
je 0x1cb00
cmpb $0x0, 0x18e(%r14)
je 0x1cb00
leaq 0x6aff(%rip), %rdi      # 0x23840
xorl %esi, %esi
xorl %eax, %eax
callq 0x5440
testl %eax, %eax
jle 0x1cd68
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 0x1d0ed
leaq 0x16e(%r14), %r15
movb 0x16e(%r14), %al
testb %al, %al
je 0x1cdff
movq %r15, %rdi
callq 0x1d06f
leaq 0xf65a(%rip), %rsi      # 0x2c3f0
leaq 0x30(%rsp), %rdi
callq 0x50a0
leaq 0x17e(%r14), %r12
cmpb $0x0, 0x17e(%r14)
je 0x1cdcd
movq %r12, %rdi
callq 0x1d06f
leaq 0xf630(%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 0xef72
jmp 0x1cb00
cmpb $0x0, 0x17e(%r14)
je 0x1cb00
testb %al, %al
jne 0x1cd87
jmp 0x1cda0
leaq 0x30(%rsp), %rdi
movl $0x902, %esi            # imm = 0x902
xorl %eax, %eax
callq 0x5440
testl %eax, %eax
js 0x1cfad
movl %eax, %ebp
leaq 0x1e(%rsp), %r12
movl $0x2, %edx
movl %eax, %edi
movq %r12, %rsi
callq 0x5250
movzbl (%r12), %eax
cmpl $0x4e, %eax
je 0x1ce59
cmpl $0x30, %eax
jne 0x1d063
movq 0xd160(%rip), %rax      # 0x29fc0
movq (%rax), %r12
callq 0xeb2f
leaq 0x6a90(%rip), %rsi      # 0x238ff
leaq 0x6ac8(%rip), %rcx      # 0x2393e
movq %r12, %rdi
movq %rax, %rdx
movl $0x89, %r8d
xorl %eax, %eax
callq 0x52c0
leaq 0xde18(%rip), %r13      # 0x2aca8
movq (%r13), %r12
testq %r12, %r12
je 0x1cebf
callq 0xeb2f
leaq 0x6a5a(%rip), %rsi      # 0x238ff
leaq 0x6a92(%rip), %rcx      # 0x2393e
movq %r12, %rdi
movq %rax, %rdx
movl $0x89, %r8d
xorl %eax, %eax
callq 0x52c0
leaq 0x672e(%rip), %rdx      # 0x235f4
leaq 0xb0(%rsp), %r12
movl $0x80, %esi
movq %r12, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x51c0
movq %r12, %rdi
callq 0x1c2a5
movq 0xd0d1(%rip), %rax      # 0x29fc0
movq (%rax), %r12
callq 0xeb2f
leaq 0x6a55(%rip), %rsi      # 0x23953
movq %r12, %rdi
movq %rax, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x52c0
movq (%r13), %r12
testq %r12, %r12
je 0x1cf33
callq 0xeb2f
leaq 0x6a30(%rip), %rsi      # 0x23953
movq %r12, %rdi
movq %rax, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x52c0
leaq 0x1e(%rsp), %rsi
movb $0x59, (%rsi)
movl $0x2, %edx
movl %ebp, %edi
callq 0x5100
leaq 0x629e(%rip), %rdx      # 0x231ec
leaq 0xb0(%rsp), %r12
movl $0x80, %esi
movq %r12, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x51c0
movq %r12, %rdi
callq 0x1c2a5
movl %ebp, %edi
callq 0x5230
leaq 0x130(%rsp), %rdi
callq 0x5520
leaq 0x3fb(%rip), %rdx       # 0x1d386
leaq 0x28(%rsp), %r12
movq %r12, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0x53d0
movq (%r12), %rdi
xorl %esi, %esi
callq 0x5510
jmp 0x1ccda
movq 0xd00c(%rip), %rax      # 0x29fc0
movq (%rax), %rax
movq %rax, 0x20(%rsp)
callq 0xeb2f
movq %rax, %rbp
callq 0x5070
movq %rax, %r12
movl (%rax), %r13d
movl %r13d, %edi
callq 0x5530
movq %rax, 0x8(%rsp)
movl %r13d, (%rsp)
leaq 0x68e3(%rip), %rsi      # 0x238ca
leaq 0x6908(%rip), %rcx      # 0x238f6
leaq 0x30(%rsp), %r9
movq 0x20(%rsp), %rdi
movq %rbp, %rdx
movl $0x83, %r8d
xorl %eax, %eax
callq 0x52c0
leaq 0xdc99(%rip), %rax      # 0x2aca8
movq (%rax), %r13
testq %r13, %r13
je 0x1ccda
callq 0xeb2f
movq %rax, %rbp
movl (%r12), %r12d
movl %r12d, %edi
callq 0x5530
movq %rax, 0x8(%rsp)
movl %r12d, (%rsp)
leaq 0x688b(%rip), %rsi      # 0x238ca
leaq 0x68b0(%rip), %rcx      # 0x238f6
leaq 0x30(%rsp), %r9
movq %r13, %rdi
movq %rbp, %rdx
movl $0x83, %r8d
xorl %eax, %eax
callq 0x52c0
jmp 0x1ccda
movl %ebp, %edi
callq 0x5230
jmp 0x1ccda