// File: /workspace/github_c_makefile_star2_O2/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 $0x258, %rsp            # imm = 0x258
movq %rdi, %r14
leaq 0xaa(%rdi), %r15
pushq $0x1
popq %rsi
callq 0x1a9e4
leaq 0xca(%r14), %rbx
cmpb $0x0, 0xca(%r14)
cmoveq %r15, %rbx
cmpl $0x0, 0x11a(%r14)
je 0x1b002
cmpl $0x0, 0x126(%r14)
je 0x1b002
movl 0x13a(%r14), %r12d
testl %r12d, %r12d
je 0x1b002
pushq $0x2
popq %rdi
movl %edi, %esi
xorl %edx, %edx
callq 0x55b0
testl %eax, %eax
jle 0x1b002
movl %eax, %ebp
leaq 0x20(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1bc9e
movl $0x8921, %esi           # imm = 0x8921
movl %ebp, %edi
movq %r13, %rdx
xorl %eax, %eax
callq 0x5210
testl %eax, %eax
jne 0x1affb
cmpl %r12d, 0x30(%rsp)
je 0x1affb
movq 0xe026(%rip), %rax      # 0x28fb8
movq (%rax), %r13
callq 0xe343
movl 0x30(%rsp), %ecx
leaq 0x694b(%rip), %rsi      # 0x218f0
movq %r13, %rdi
movq %rax, %rdx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x52c0
leaq 0xecec(%rip), %rax      # 0x29ca8
movq (%rax), %r13
testq %r13, %r13
je 0x1afe4
callq 0xe343
movl 0x30(%rsp), %ecx
leaq 0x691c(%rip), %rsi      # 0x218f0
movq %r13, %rdi
movq %rax, %rdx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x52c0
leaq 0x20(%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 0x1b0b4
leaq 0x6210(%rip), %rdx      # 0x2122c
leaq 0x1a0(%rsp), %r12
movl $0x80, %esi
movq %r12, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x51c0
movq %r12, %rdi
callq 0x1abc9
pushq $0x2
popq %rdi
movl %edi, %esi
xorl %edx, %edx
callq 0x55b0
testl %eax, %eax
jle 0x1b0b4
movl %eax, %ebp
leaq 0x20(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1bc9e
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 0x1b0b4
andl $0x1, %r15d
je 0x1b0b4
leaq 0x65d7(%rip), %rdx      # 0x21669
leaq 0x1a0(%rsp), %r15
movl $0x80, %esi
movq %r15, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x51c0
movq %r15, %rdi
callq 0x1abc9
leaq 0x6171(%rip), %rdx      # 0x2122c
leaq 0x1a0(%rsp), %r15
movl $0x80, %esi
movq %r15, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x51c0
movq %r15, %rdi
callq 0x1abc9
cmpl $0x0, 0x126(%r14)
je 0x1b1ed
cmpl $0x0, 0x194(%r14)
je 0x1b16c
movq 0xdebc(%rip), %rax      # 0x28fb8
movq (%rax), %r15
callq 0xe343
movq %rax, %r12
movl 0x194(%r14), %edi
callq 0x1adaa
leaq 0x6672(%rip), %rsi      # 0x2178c
leaq 0xe1ff(%rip), %rcx      # 0x29320
movq %r15, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0xeb73(%rip), %rax      # 0x29ca8
movq (%rax), %r15
testq %r15, %r15
je 0x1b16c
callq 0xe343
movq %rax, %r12
movl 0x194(%r14), %edi
callq 0x1adaa
leaq 0x6634(%rip), %rsi      # 0x2178c
leaq 0xe1c1(%rip), %rcx      # 0x29320
movq %r15, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x52c0
cmpl $0x0, 0x198(%r14)
je 0x1b1ed
movq 0xde3b(%rip), %rax      # 0x28fb8
movq (%rax), %r15
callq 0xe343
movq %rax, %r12
movl 0x198(%r14), %edi
callq 0x1adaa
leaq 0x6602(%rip), %rsi      # 0x2179d
leaq 0xe17e(%rip), %rcx      # 0x29320
movq %r15, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0xeaf2(%rip), %rax      # 0x29ca8
movq (%rax), %r15
testq %r15, %r15
je 0x1b1ed
callq 0xe343
movq %rax, %r12
movl 0x198(%r14), %edi
callq 0x1adaa
leaq 0x65c4(%rip), %rsi      # 0x2179d
leaq 0xe140(%rip), %rcx      # 0x29320
movq %r15, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x52c0
cmpb $0x0, 0x13e(%r14)
je 0x1b309
cmpb $0x0, 0x18e(%r14)
je 0x1b309
cmpb $0x0, 0x19c(%r14)
je 0x1b289
leaq 0x19c(%r14), %r15
movq 0xdd97(%rip), %rax      # 0x28fb8
movq (%rax), %r12
callq 0xe343
movq %rax, %r13
movq %r15, %rdi
callq 0x1b859
leaq 0x6551(%rip), %rsi      # 0x2178c
leaq 0x101ae(%rip), %rcx     # 0x2b3f0
movq %r12, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0xea52(%rip), %rax      # 0x29ca8
movq (%rax), %r12
testq %r12, %r12
je 0x1b289
callq 0xe343
movq %rax, %r13
movq %r15, %rdi
callq 0x1b859
leaq 0x6517(%rip), %rsi      # 0x2178c
leaq 0x10174(%rip), %rcx     # 0x2b3f0
movq %r12, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x52c0
cmpb $0x0, 0x1ac(%r14)
je 0x1b309
leaq 0x1ac(%r14), %r15
movq 0xdd17(%rip), %rax      # 0x28fb8
movq (%rax), %r12
callq 0xe343
movq %rax, %r13
movq %r15, %rdi
callq 0x1b859
leaq 0x64e2(%rip), %rsi      # 0x2179d
leaq 0x1012e(%rip), %rcx     # 0x2b3f0
movq %r12, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0xe9d2(%rip), %rax      # 0x29ca8
movq (%rax), %r12
testq %r12, %r12
je 0x1b309
callq 0xe343
movq %rax, %r13
movq %r15, %rdi
callq 0x1b859
leaq 0x64a8(%rip), %rsi      # 0x2179d
leaq 0x100f4(%rip), %rcx     # 0x2b3f0
movq %r12, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x52c0
movq %r14, %rdi
callq 0xf080
testl %eax, %eax
je 0x1b327
addq $0x258, %rsp            # imm = 0x258
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 0x1b507
movq 0x326(%r14), %rax
cmpq 0xdc92(%rip), %rax      # 0x28fe0
je 0x1b4fa
leaq 0x220(%rsp), %r13
movq %r13, %rdi
callq 0x5260
pushq $0x1
popq %rbp
movq %r13, %rdi
movl %ebp, %esi
callq 0x5330
leaq 0x6436(%rip), %rdi      # 0x217ae
movl %ebp, %esi
callq 0x5460
testl %eax, %eax
je 0x1b3e1
leaq 0x6445(%rip), %rdi      # 0x217cf
pushq $0x1
popq %rsi
callq 0x5460
testl %eax, %eax
je 0x1b3e1
movq 0xdc1b(%rip), %rax      # 0x28fb8
movq (%rax), %r13
callq 0xe343
leaq 0x643f(%rip), %rsi      # 0x217eb
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0xe8e8(%rip), %rax      # 0x29ca8
movq (%rax), %r13
testq %r13, %r13
je 0x1b3e1
callq 0xe343
leaq 0x6417(%rip), %rsi      # 0x217eb
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0x6478(%rip), %rdx      # 0x21860
leaq 0x120(%rsp), %rdi
movl $0x80, %esi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x51c0
leaq 0x647d(%rip), %rdi      # 0x21883
pushq $0x1
popq %rsi
callq 0x5460
testl %eax, %eax
jne 0x1b434
leaq 0x6482(%rip), %rdi      # 0x2189b
pushq $0x1
popq %rsi
callq 0x5460
testl %eax, %eax
jne 0x1b434
leaq 0x647a(%rip), %rdi      # 0x218a6
pushq $0x1
popq %rsi
callq 0x5460
leaq 0x120(%rsp), %rdi
callq 0x5530
leaq 0x63d(%rip), %rdx       # 0x1ba85
leaq 0x18(%rsp), %r13
movq %r13, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0x53e0
movq (%r13), %rdi
xorl %esi, %esi
callq 0x5520
movq 0x326(%r14), %rax
cmpq 0xdb4d(%rip), %rax      # 0x28fc0
jne 0x1b496
movl (%r12), %esi
bswapl %esi
movq %rbx, %rdi
callq 0x1bbb5
testl %eax, %eax
jne 0x1b48f
movq %rbx, %rdi
callq 0x16b3c
movq 0x326(%r14), %rax
cmpq 0xdb33(%rip), %rax      # 0x28fd0
jne 0x1b507
movl (%r12), %esi
movw $0x58, 0x6(%rsp)
bswapl %esi
movq %rbx, %rdi
callq 0x1bbb5
testl %eax, %eax
jne 0x1b4e8
leaq 0x6463(%rip), %rdx      # 0x21922
leaq 0x20(%rsp), %r13
movl $0x80, %esi
movq %r13, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x51c0
movq %r13, %rdi
xorl %esi, %esi
callq 0x5460
testl %eax, %eax
je 0x1b5f9
movl (%r12), %esi
bswapl %esi
movq %rbx, %rdi
callq 0x1bbb5
testl %eax, %eax
jne 0x1b507
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x1b8d7
cmpb $0x0, (%r15)
je 0x1b315
cmpb $0x0, 0x18e(%r14)
je 0x1b315
leaq 0x638f(%rip), %rdi      # 0x218b5
xorl %esi, %esi
xorl %eax, %eax
callq 0x5450
testl %eax, %eax
jle 0x1b54b
movl %eax, %ebp
leaq 0x20(%rsp), %rsi
pushq $0x2
popq %rdx
movl %eax, %edi
callq 0x5250
movl %ebp, %edi
callq 0x5230
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x1b8d7
leaq 0x16e(%r14), %r15
cmpb $0x0, 0x16e(%r14)
je 0x1b595
movq %r15, %rdi
callq 0x1b859
leaq 0xfe78(%rip), %rsi      # 0x2b3f0
leaq 0x20(%rsp), %rdi
callq 0x50a0
leaq 0x17e(%r14), %r12
cmpb $0x0, 0x17e(%r14)
jne 0x1b5ad
jmp 0x1b5c9
cmpb $0x0, 0x17e(%r14)
je 0x1b315
addq $0x17e, %r14            # imm = 0x17E
movq %r14, %r12
movq %r12, %rdi
callq 0x1b859
leaq 0xfe34(%rip), %rsi      # 0x2b3f0
leaq 0xa0(%rsp), %rdi
callq 0x50a0
xorl %eax, %eax
cmpb $0x0, (%r15)
leaq 0x20(%rsp), %rdx
cmoveq %rax, %rdx
cmpb $0x0, (%r12)
leaq 0xa0(%rsp), %rcx
cmoveq %rax, %rcx
pushq $0x6
popq %rdi
movq %rbx, %rsi
callq 0xe74f
jmp 0x1b315
leaq 0x20(%rsp), %rdi
movl $0x902, %esi            # imm = 0x902
xorl %eax, %eax
callq 0x5450
testl %eax, %eax
js 0x1b790
movl %eax, %ebp
leaq 0x6(%rsp), %r13
pushq $0x2
popq %rdx
movl %eax, %edi
movq %r13, %rsi
callq 0x5250
movzbl (%r13), %eax
cmpl $0x4e, %eax
je 0x1b639
cmpl $0x30, %eax
jne 0x1b84d
movq 0xd978(%rip), %rax      # 0x28fb8
movq (%rax), %r13
callq 0xe343
leaq 0x6325(%rip), %rsi      # 0x21974
leaq 0x635d(%rip), %rcx      # 0x219b3
movq %r13, %rdi
movq %rax, %rdx
movl $0x89, %r8d
xorl %eax, %eax
callq 0x52c0
leaq 0xe638(%rip), %rax      # 0x29ca8
movq (%rax), %r13
testq %r13, %r13
je 0x1b69e
callq 0xe343
leaq 0x62f0(%rip), %rsi      # 0x21974
leaq 0x6328(%rip), %rcx      # 0x219b3
movq %r13, %rdi
movq %rax, %rdx
movl $0x89, %r8d
xorl %eax, %eax
callq 0x52c0
leaq 0x5fc4(%rip), %rdx      # 0x21669
leaq 0xa0(%rsp), %r13
movl $0x80, %esi
movq %r13, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x51c0
movq %r13, %rdi
callq 0x1abc9
movq 0xd8ea(%rip), %rax      # 0x28fb8
movq (%rax), %r13
callq 0xe343
leaq 0x62eb(%rip), %rsi      # 0x219c8
movq %r13, %rdi
movq %rax, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x52c0
leaq 0xe5b4(%rip), %rax      # 0x29ca8
movq (%rax), %r13
testq %r13, %r13
je 0x1b718
callq 0xe343
leaq 0x62c0(%rip), %rsi      # 0x219c8
movq %r13, %rdi
movq %rax, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x52c0
leaq 0x6(%rsp), %rsi
movb $0x59, (%rsi)
pushq $0x2
popq %rdx
movl %ebp, %edi
callq 0x5100
leaq 0x5afb(%rip), %rdx      # 0x2122c
leaq 0xa0(%rsp), %r13
movl $0x80, %esi
movq %r13, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x51c0
movq %r13, %rdi
callq 0x1abc9
movl %ebp, %edi
callq 0x5230
leaq 0x120(%rsp), %rdi
callq 0x5530
leaq 0x317(%rip), %rdx       # 0x1ba85
leaq 0x18(%rsp), %r13
movq %r13, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0x53e0
movq (%r13), %rdi
xorl %esi, %esi
callq 0x5520
jmp 0x1b4e8
movq 0xd821(%rip), %rax      # 0x28fb8
movq (%rax), %rax
movq %rax, 0x8(%rsp)
callq 0xe343
movq %rax, %r13
callq 0x5070
movq %rax, 0x10(%rsp)
movl (%rax), %ebp
movl %ebp, %edi
callq 0x5540
movq %rax, %r10
leaq 0x617b(%rip), %rsi      # 0x2193f
leaq 0x61a0(%rip), %rcx      # 0x2196b
leaq 0x20(%rsp), %r9
movq 0x8(%rsp), %rdi
movq %r13, %rdx
movl $0x83, %r8d
xorl %eax, %eax
pushq %r10
pushq %rbp
callq 0x52c0
popq %rcx
popq %rdx
leaq 0xe4b7(%rip), %rax      # 0x29ca8
movq (%rax), %rbp
testq %rbp, %rbp
je 0x1b4e8
callq 0xe343
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
movl (%rax), %r13d
movl %r13d, %edi
callq 0x5540
movq %rax, %r10
leaq 0x611e(%rip), %rsi      # 0x2193f
leaq 0x6143(%rip), %rcx      # 0x2196b
leaq 0x20(%rsp), %r9
movq %rbp, %rdi
movq 0x8(%rsp), %rdx
movl $0x83, %r8d
xorl %eax, %eax
pushq %r10
pushq %r13
callq 0x52c0
popq %rcx
popq %rdx
jmp 0x1b4e8
movl %ebp, %edi
callq 0x5230
jmp 0x1b4e8