// File: /workspace/github_c_makefile_star2_O2/Carton32[P]quectel-CM/device.c
// Function: qmidevice_detect
BOOL qmidevice_detect(char *qmichannel, char *usbnet_adapter, unsigned bufsize, PROFILE_T *profile) {
    struct dirent* ent = NULL;
    DIR *pDir;
    const char *rootdir = "/sys/bus/usb/devices";
    struct {
        char path[255*2];
    } *pl;
    pl = (typeof(pl)) malloc(sizeof(*pl));
    memset(pl, 0x00, sizeof(*pl));

    pDir = opendir(rootdir);
    if (!pDir) {
        dbg_time("opendir %s failed: %s", rootdir, strerror(errno));
        goto error;
    }

    while ((ent = readdir(pDir)) != NULL)  {
        char netcard[32+1] = {'\0'};
        char devname[32+5] = {'\0'}; //+strlen("/dev/")
        int netIntf;
        int driver_type;

        if (ent->d_name[0] == 'u')
            continue;

        snprintf(pl->path, sizeof(pl->path), "%s/%s", rootdir, ent->d_name);
        query_usb_device_info(pl->path, &profile->usb_dev);
        if (profile->usb_dev.idVendor == CM_INVALID_VAL)
            continue;

        if (profile->usb_dev.idVendor == 0x2c7c || profile->usb_dev.idVendor == 0x05c6) {
            dbg_time("Find %s/%s idVendor=0x%x idProduct=0x%x, bus=0x%03x, dev=0x%03x",
                rootdir, ent->d_name, profile->usb_dev.idVendor, profile->usb_dev.idProduct,
                profile->usb_dev.busnum, profile->usb_dev.devnum);
        }

        /* get network interface */
        /* NOTICE: there is a case that, bNumberInterface=6, but the net interface is 8 */
        /* toolchain-mips_24kc_gcc-5.4.0_musl donot support GLOB_BRACE */
        /* RG500U's MBIM is at inteface 0 */
        for (netIntf = 0;  netIntf < (profile->usb_dev.bNumInterfaces + 8); netIntf++) {
            snprintf(pl->path, sizeof(pl->path), "%s/%s:1.%d/net", rootdir, ent->d_name, netIntf);
            dir_get_child(pl->path, netcard, sizeof(netcard), NULL);
            if (netcard[0])
                break;
        }

        if (netcard[0] == '\0') { //for centos 2.6.x
            const char *n= "usb0";
            const char *c = "qcqmi0";

            snprintf(pl->path, sizeof(pl->path), "%s/%s:1.4/net:%s", rootdir, ent->d_name, n);
            if (!access(pl->path, F_OK)) {
                snprintf(pl->path, sizeof(pl->path), "%s/%s:1.4/GobiQMI:%s", rootdir, ent->d_name, c);
                if (!access(pl->path, F_OK)) {
                    snprintf(qmichannel, bufsize, "/dev/%s", c);
                    snprintf(usbnet_adapter, bufsize, "%s", n);
                    snprintf(pl->path, sizeof(pl->path), "%s/%s:1.4", rootdir, ent->d_name);
                    query_usb_interface_info(pl->path, &profile->usb_intf);
                    break;
                }
            }
        }

        if (netcard[0] == '\0')
            continue;

        /* not '-i iface' */
        if (usbnet_adapter[0] && strcmp(usbnet_adapter, netcard))
            continue;

        snprintf(pl->path, sizeof(pl->path), "%s/%s:1.%d", rootdir, ent->d_name, netIntf);
        query_usb_interface_info(pl->path, &profile->usb_intf);
        driver_type = get_driver_type(profile);

        if (driver_type == SOFTWARE_QMI || driver_type == SOFTWARE_MBIM) {
            detect_path_cdc_wdm_or_qcqmi(pl->path, devname, sizeof(devname));
        }
        else if (driver_type == SOFTWARE_ECM_RNDIS_NCM)
        {
            int atIntf = -1;

            if (profile->usb_dev.idVendor == 0x2c7c) { //Quectel
                switch (profile->usb_dev.idProduct) { //EC200U
                case 0x0901: //EC200U
                case 0x8101: //RG801H
                    atIntf = 2;
                break;
                case 0x0900: //RG500U
                    atIntf = 4;
                break;
                case 0x6026: //EC200T
                case 0x6002: //EC200S
                    atIntf = 3;
                break;
                default:
                   dbg_time("unknow at interface for USB idProduct:%04x\n", profile->usb_dev.idProduct);
                break;
                }
            }

            if (atIntf != -1) {
                snprintf(pl->path, sizeof(pl->path), "%s/%s:1.%d", rootdir, ent->d_name, atIntf);
                dir_get_child(pl->path, devname, sizeof(devname), "tty");
                if (devname[0] && !strcmp(devname, "tty")) {
                    snprintf(pl->path, sizeof(pl->path), "%s/%s:1.%d/tty", rootdir, ent->d_name, atIntf);
                    dir_get_child(pl->path, devname, sizeof(devname), "tty");
                }
            }
        }
        
        if (netcard[0] && devname[0]) {
            if (devname[0] == '/')
                snprintf(qmichannel, bufsize, "%s", devname);
            else
                snprintf(qmichannel, bufsize, "/dev/%s", devname);
            snprintf(usbnet_adapter, bufsize, "%s", netcard);
            dbg_time("Auto find qmichannel = %s", qmichannel);
            dbg_time("Auto find usbnet_adapter = %s", usbnet_adapter);
            break;
        }
    }
    closedir(pDir);

    if (qmichannel[0] == '\0' || usbnet_adapter[0] == '\0') {
        dbg_time("network interface '%s' or qmidev '%s' is not exist", usbnet_adapter, qmichannel);
        goto error;
    }
    free(pl);
    return TRUE;
error:
    free(pl);
    return FALSE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rcx, %r12
movl %edx, %r15d
movq %rsi, (%rsp)
movq %rdi, %r14
pushq $0x1
popq %rdi
movl $0x1fe, %esi            # imm = 0x1FE
callq 0x5290
movq %rax, %rbx
leaq 0xb313(%rip), %rdi      # 0x20880
callq 0x5140
movq %rax, 0x60(%rsp)
testq %rax, %rax
je 0x15de8
movl %r15d, 0x14(%rsp)
movq %r14, 0x18(%rsp)
movabsq $0x6d756e7375622f, %rcx # imm = 0x6D756E7375622F
leaq 0x1c5(%r12), %rax
movq %rax, 0x58(%rsp)
leaq 0x1d9(%r12), %rax
movq %rax, 0x50(%rsp)
leaq 0x2f00200(%rcx), %rax
movq %rax, 0x68(%rsp)
movq %r12, 0x8(%rsp)
movq 0x60(%rsp), %rdi
callq 0x5320
testq %rax, %rax
je 0x15fc5
movq %rax, %r15
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x30(%rsp)
andq $0x0, 0x3d(%rsp)
movb $0x0, 0x90(%rsp)
movaps %xmm0, 0x20(%rsp)
cmpb $0x75, 0x13(%rax)
je 0x155bf
addq $0x13, %r15
movl $0x1fe, %esi            # imm = 0x1FE
movq %rbx, %rdi
leaq 0x77fc(%rip), %rdx      # 0x1ce12
leaq 0xb263(%rip), %rcx      # 0x20880
movq %r15, %r8
xorl %eax, %eax
callq 0x51c0
movq %rbx, %rdi
callq 0x5160
movq %rax, %r12
movq 0x58(%rsp), %r13
xorps %xmm0, %xmm0
movups %xmm0, (%r13)
andl $0x0, 0x10(%r13)
movb $0x0, (%rbx,%rax)
movq %rbx, %rdi
callq 0x5160
movabsq $0x6f646e655664692f, %rcx # imm = 0x6F646E655664692F
movq %rcx, (%rbx,%rax)
movw $0x72, 0x8(%rbx,%rax)
movq %rbx, %rdi
pushq $0x10
popq %rsi
callq 0x170fb
movl %eax, (%r13)
cmpl $-0x1, %eax
je 0x155bf
xorl %r14d, %r14d
movb %r14b, (%rbx,%r12)
movq %rbx, %rdi
callq 0x5160
movabsq $0x75646f725064692f, %rcx # imm = 0x75646F725064692F
movq %rcx, (%rbx,%rax)
movl $0x746375, 0x7(%rbx,%rax) # imm = 0x746375
movq %rbx, %rdi
pushq $0x10
popq %rsi
callq 0x170fb
movq 0x8(%rsp), %r13
movl %eax, 0x1c9(%r13)
movb %r14b, (%rbx,%r12)
movq %rbx, %rdi
callq 0x5160
movabsq $0x6d756e7375622f, %rcx # imm = 0x6D756E7375622F
movq %rcx, (%rbx,%rax)
movq %rbx, %rdi
pushq $0xa
popq %rbp
movl %ebp, %esi
callq 0x170fb
movl %eax, 0x1cd(%r13)
movb %r14b, (%rbx,%r12)
movq %rbx, %rdi
callq 0x5160
movq 0x68(%rsp), %rcx
movq %rcx, (%rbx,%rax)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x170fb
movl %eax, 0x1d1(%r13)
movb %r14b, (%rbx,%r12)
movq %rbx, %rdi
callq 0x5160
movups 0xb748(%rip), %xmm0     # 0x20e68
movups %xmm0, (%rbx,%rax)
movq %rbx, %rdi
movl %ebp, %esi
leaq 0x70(%rsp), %rbp
callq 0x170fb
movl %eax, 0x1d5(%r13)
movb %r14b, (%rbx,%r12)
leaq 0xb1b2(%rip), %r14      # 0x208f7
movl 0x1c5(%r13), %eax
cmpl $-0x1, %eax
je 0x155bf
cmpl $0x2c7c, %eax           # imm = 0x2C7C
je 0x15767
cmpl $0x5c6, %eax            # imm = 0x5C6
jne 0x15824
movq 0x1384a(%rip), %rax     # 0x28fb8
movq (%rax), %r12
callq 0xe343
movq 0x8(%rsp), %rcx
movl 0x1c5(%rcx), %r9d
movl 0x1c9(%rcx), %r10d
movl 0x1cd(%rcx), %r11d
movl 0x1d1(%rcx), %r13d
subq $0x8, %rsp
movq %r12, %rdi
leaq 0xb10c(%rip), %rsi      # 0x208b1
movq %rax, %rdx
leaq 0xb0d1(%rip), %rcx      # 0x20880
movq %r15, %r8
xorl %eax, %eax
pushq %r13
pushq %r11
pushq %r10
callq 0x52c0
addq $0x20, %rsp
leaq 0x144de(%rip), %rax     # 0x29ca8
movq (%rax), %r12
testq %r12, %r12
je 0x15824
callq 0xe343
movq 0x8(%rsp), %rcx
movl 0x1c5(%rcx), %r9d
movl 0x1c9(%rcx), %r10d
movl 0x1cd(%rcx), %r11d
movl 0x1d1(%rcx), %r13d
subq $0x8, %rsp
movq %r12, %rdi
leaq 0xb0ab(%rip), %rsi      # 0x208b1
movq %rax, %rdx
leaq 0xb070(%rip), %rcx      # 0x20880
movq %r15, %r8
xorl %eax, %eax
pushq %r13
pushq %r11
pushq %r10
callq 0x52c0
addq $0x20, %rsp
xorl %r12d, %r12d
movq 0x8(%rsp), %r13
movl 0x1d5(%r13), %eax
addl $0x8, %eax
movl $0x1fe, %esi            # imm = 0x1FE
movq %rbx, %rdi
cmpl %eax, %r12d
jge 0x15876
movq %r14, %rdx
leaq 0xb033(%rip), %rcx      # 0x20880
movq %r15, %r8
movl %r12d, %r9d
xorl %eax, %eax
callq 0x51c0
movq %rbx, %rdi
movq %rbp, %rsi
pushq $0x21
popq %rdx
xorl %ecx, %ecx
callq 0x16061
cmpb $0x0, 0x70(%rsp)
jne 0x158e5
incl %r12d
jmp 0x1582c
leaq 0xb095(%rip), %rdx      # 0x20912
leaq 0xaffc(%rip), %rcx      # 0x20880
movq %r15, %r8
leaq 0xb078(%rip), %r9       # 0x20906
xorl %eax, %eax
callq 0x51c0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5460
testl %eax, %eax
jne 0x155bf
movl $0x1fe, %esi            # imm = 0x1FE
movq %rbx, %rdi
leaq 0xb06d(%rip), %rdx      # 0x20923
leaq 0xafc3(%rip), %rcx      # 0x20880
movq %r15, %r8
leaq 0xb044(%rip), %r9       # 0x2090b
xorl %eax, %eax
callq 0x51c0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5460
testl %eax, %eax
jne 0x155bf
jmp 0x15f5a
movq (%rsp), %rax
cmpb $0x0, (%rax)
je 0x15902
movq (%rsp), %rdi
movq %rbp, %rsi
callq 0x52a0
testl %eax, %eax
jne 0x155bf
movl $0x1fe, %esi            # imm = 0x1FE
movq %rbx, %rdi
leaq 0xb039(%rip), %rdx      # 0x2094a
leaq 0xaf68(%rip), %rcx      # 0x20880
movq %r15, %r8
movl %r12d, %r9d
xorl %eax, %eax
callq 0x51c0
movq %rbx, %rdi
movq 0x50(%rsp), %rsi
callq 0x160ee
movq 0x8(%rsp), %rbp
movq %rbp, %rdi
callq 0x162c7
leal -0x1(%rax), %ecx
cmpl $0x1, %ecx
ja 0x15c05
movq %rbx, %rdi
callq 0x5160
movq %rax, %r15
movb $0x0, 0x20(%rsp)
movq %rbx, %rdi
pushq $0x4
popq %rsi
callq 0x5460
testl %eax, %eax
jne 0x15cde
xorl %r14d, %r14d
movb %r14b, (%rbx,%r15)
movq %rbx, %rdi
callq 0x5160
movabsq $0x494d5169626f472f, %rcx # imm = 0x494D5169626F472F
movq %rcx, (%rbx,%rax)
movb %r14b, 0x8(%rbx,%rax)
movq %rbx, %rdi
pushq $0x4
popq %rsi
callq 0x5460
testl %eax, %eax
je 0x159fe
xorl %r14d, %r14d
movb %r14b, (%rbx,%r15)
movq %rbx, %rdi
callq 0x5160
movabsq $0x6373696d6273752f, %rcx # imm = 0x6373696D6273752F
movq %rcx, (%rbx,%rax)
movb %r14b, 0x8(%rbx,%rax)
movq %rbx, %rdi
pushq $0x4
popq %rsi
callq 0x5460
testl %eax, %eax
je 0x159fe
xorl %r14d, %r14d
movb %r14b, (%rbx,%r15)
movq %rbx, %rdi
callq 0x5160
movb %r14b, 0x4(%rbx,%rax)
movl $0x6273752f, (%rbx,%rax) # imm = 0x6273752F
movq %rbx, %rdi
pushq $0x4
popq %rsi
callq 0x5460
testl %eax, %eax
jne 0x15cde
leaq 0x139cb(%rip), %rax     # 0x293d0
cmpl $0x0, (%rax)
je 0x15a5b
movq 0x135a7(%rip), %rax     # 0x28fb8
movq (%rax), %r15
callq 0xe343
movq %r15, %rdi
leaq 0x7523(%rip), %rsi      # 0x1cf46
movq %rax, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x52c0
leaq 0x14271(%rip), %rax     # 0x29ca8
movq (%rax), %r15
testq %r15, %r15
je 0x15a5b
callq 0xe343
movq %r15, %rdi
leaq 0x74f8(%rip), %rsi      # 0x1cf46
movq %rax, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x52c0
movq %rbx, %rdi
leaq 0xa0(%rsp), %rsi
pushq $0x20
popq %rdx
xorl %ecx, %ecx
callq 0x16061
cmpb $0x0, 0xa0(%rsp)
je 0x15cde
leaq 0x20(%rsp), %r14
movq %r14, %rdi
pushq $0x25
popq %rsi
leaq 0xaea8(%rip), %rdx      # 0x20938
leaq 0xa0(%rsp), %rcx
xorl %eax, %eax
callq 0x51c0
movq %r14, %rdi
pushq $0x4
popq %rsi
callq 0x5460
testl %eax, %eax
je 0x15cde
callq 0x5070
cmpl $0x2, (%rax)
jne 0x15cde
movq %rax, %r15
movq 0x134ee(%rip), %rax     # 0x28fb8
movq (%rax), %r14
callq 0xe343
movq %rax, %rbp
movl (%r15), %r12d
movl %r12d, %edi
callq 0x5540
movq %r14, %rdi
leaq 0xb40c(%rip), %r13      # 0x20ef6
movq %r13, %rsi
movq %rbp, %rdx
leaq 0x20(%rsp), %r14
movq %r14, %rcx
movl %r12d, %r8d
movq %rax, %r9
xorl %eax, %eax
callq 0x52c0
leaq 0x1419c(%rip), %rax     # 0x29ca8
movq (%rax), %r12
testq %r12, %r12
je 0x15b40
callq 0xe343
movq %rax, %rbp
movl (%r15), %r15d
movl %r15d, %edi
callq 0x5540
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %r14, %rcx
movl %r15d, %r8d
movq %rax, %r9
xorl %eax, %eax
callq 0x52c0
movq %rbx, %rdi
callq 0x5160
movw $0x2f, (%rbx,%rax)
movq %rbx, %rdi
leaq 0xa0(%rsp), %rsi
callq 0x54d0
movq %rbx, %rdi
callq 0x5160
movabsq $0x746e657665752f, %rcx # imm = 0x746E657665752F
movq %rcx, (%rbx,%rax)
movq %rbx, %rdi
leaq 0xb3a0(%rip), %rsi      # 0x20f1e
callq 0x17206
movl %eax, %r15d
movq %rbx, %rdi
leaq 0xb394(%rip), %rsi      # 0x20f24
callq 0x17206
movl %eax, %r12d
cmpl $-0x1, %r15d
sete %al
cmpl $-0x1, %r12d
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x15d48
movq 0x13400(%rip), %rax     # 0x28fb8
movq (%rax), %r15
callq 0xe343
movq %r15, %rdi
leaq 0xb360(%rip), %rsi      # 0x20f2a
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0x140cd(%rip), %rax     # 0x29ca8
movq (%rax), %r15
testq %r15, %r15
je 0x15cde
callq 0xe343
movq %r15, %rdi
leaq 0xb334(%rip), %rsi      # 0x20f2a
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
jmp 0x15cde
cmpl $0x3, %eax
jne 0x15cde
movq 0x58(%rsp), %rax
cmpl $0x2c7c, (%rax)         # imm = 0x2C7C
jne 0x15cde
movl 0x1c9(%rbp), %eax
pushq $0x2
popq %r12
cmpl $0x8101, %eax           # imm = 0x8101
je 0x15c58
cmpl $0x901, %eax            # imm = 0x901
je 0x15c58
cmpl $0x6002, %eax           # imm = 0x6002
je 0x15c54
cmpl $0x6026, %eax           # imm = 0x6026
je 0x15c54
cmpl $0x900, %eax            # imm = 0x900
jne 0x15cef
pushq $0x4
jmp 0x15c56
pushq $0x3
popq %r12
movl $0x1fe, %esi            # imm = 0x1FE
movq %rbx, %rdi
leaq 0xace3(%rip), %rdx      # 0x2094a
leaq 0xac12(%rip), %rcx      # 0x20880
movq %r15, %r8
movl %r12d, %r9d
xorl %eax, %eax
callq 0x51c0
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
pushq $0x25
popq %rdx
leaq 0xad05(%rip), %rcx      # 0x20992
callq 0x16061
movb 0x20(%rsp), %al
testb %al, %al
je 0x15ce2
cmpl $0x797474, 0x20(%rsp)   # imm = 0x797474
jne 0x15ce2
movl $0x1fe, %esi            # imm = 0x1FE
movq %rbx, %rdi
leaq 0xacd4(%rip), %rdx      # 0x20987
leaq 0xabc6(%rip), %rcx      # 0x20880
movq %r15, %r8
movl %r12d, %r9d
xorl %eax, %eax
callq 0x51c0
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
pushq $0x25
popq %rdx
leaq 0xacb9(%rip), %rcx      # 0x20992
callq 0x16061
movb 0x20(%rsp), %al
testb %al, %al
je 0x155bf
jmp 0x15e6a
movq 0x132c2(%rip), %rax     # 0x28fb8
movq (%rax), %r15
callq 0xe343
movl 0x1c9(%rbp), %ecx
movq %r15, %rdi
leaq 0xac47(%rip), %rsi      # 0x20955
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0x13f89(%rip), %rax     # 0x29ca8
movq (%rax), %r15
testq %r15, %r15
je 0x15cde
callq 0xe343
movl 0x1c9(%rbp), %ecx
movq %r15, %rdi
leaq 0xac19(%rip), %rsi      # 0x20955
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
jmp 0x15cde
movl %r15d, %eax
shll $0x8, %eax
andl $0xfff00, %eax          # imm = 0xFFF00
movzbl %r12b, %ecx
orl %eax, %ecx
movl %r12d, %eax
shll $0xc, %eax
andl $0xfff00000, %eax       # imm = 0xFFF00000
orl %ecx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movl $0x21b6, %esi           # imm = 0x21B6
callq 0x52d0
testl %eax, %eax
je 0x15cde
movq 0x13233(%rip), %rax     # 0x28fb8
movq (%rax), %r14
callq 0xe343
movq %r14, %rdi
leaq 0xb1b4(%rip), %rsi      # 0x20f4b
movq %rax, %rdx
leaq 0x20(%rsp), %rcx
movl %r15d, %r8d
movl %r12d, %r9d
xorl %eax, %eax
callq 0x52c0
leaq 0x13ef5(%rip), %rax     # 0x29ca8
movq (%rax), %r14
testq %r14, %r14
je 0x15cde
callq 0xe343
movq %r14, %rdi
leaq 0xb17d(%rip), %rsi      # 0x20f4b
movq %rax, %rdx
leaq 0x20(%rsp), %rcx
movl %r15d, %r8d
movl %r12d, %r9d
xorl %eax, %eax
callq 0x52c0
jmp 0x15cde
movq 0x131c9(%rip), %rax     # 0x28fb8
movq (%rax), %r15
callq 0xe343
movq %rax, %r12
callq 0x5070
movq %rax, %r14
movl (%rax), %edi
callq 0x5540
leaq 0xaa85(%rip), %rsi      # 0x20895
leaq 0xaa69(%rip), %rcx      # 0x20880
xorl %ebp, %ebp
movq %r15, %rdi
movq %r12, %rdx
movq %rax, %r8
xorl %eax, %eax
callq 0x52c0
leaq 0x13e78(%rip), %rax     # 0x29ca8
movq (%rax), %r15
testq %r15, %r15
je 0x16045
callq 0xe343
movq %rax, %r12
movl (%r14), %edi
callq 0x5540
leaq 0xaa42(%rip), %rsi      # 0x20895
leaq 0xaa26(%rip), %rcx      # 0x20880
xorl %ebp, %ebp
movq %r15, %rdi
movq %r12, %rdx
movq %rax, %r8
jmp 0x1603e
cmpb $0x2f, %al
movl 0x14(%rsp), %r14d
leaq 0xafd5(%rip), %r15      # 0x20e4d
leaq 0xaab9(%rip), %rdx      # 0x20938
cmoveq %r15, %rdx
leaq 0x20(%rsp), %rcx
movq 0x18(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x51c0
leaq 0x70(%rsp), %rcx
movq (%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x51c0
movq 0x13101(%rip), %rax     # 0x28fb8
movq (%rax), %r14
callq 0xe343
leaq 0xaad0(%rip), %rsi      # 0x20996
movq %r14, %rdi
movq %rax, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x52c0
leaq 0x13dcb(%rip), %rax     # 0x29ca8
movq (%rax), %r14
testq %r14, %r14
je 0x15f01
callq 0xe343
leaq 0xaaa5(%rip), %rsi      # 0x20996
movq %r14, %rdi
movq %rax, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x52c0
movq 0x130b0(%rip), %rax     # 0x28fb8
movq (%rax), %r14
callq 0xe343
leaq 0xaa9f(%rip), %rsi      # 0x209b6
movq %r14, %rdi
movq %rax, %rdx
movq (%rsp), %rcx
xorl %eax, %eax
callq 0x52c0
leaq 0x13d79(%rip), %rax     # 0x29ca8
movq (%rax), %r14
testq %r14, %r14
je 0x15fc5
callq 0xe343
leaq 0xaa6f(%rip), %rsi      # 0x209b6
movq %r14, %rdi
movq %rax, %rdx
movq (%rsp), %rcx
xorl %eax, %eax
callq 0x52c0
jmp 0x15fc5
movl 0x14(%rsp), %r14d
leaq 0xa9d2(%rip), %rdx      # 0x20938
leaq 0xa99e(%rip), %rcx      # 0x2090b
movq 0x18(%rsp), %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x51c0
leaq 0xaeca(%rip), %rdx      # 0x20e4d
leaq 0xa97c(%rip), %rcx      # 0x20906
movq (%rsp), %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x51c0
leaq 0xa9a1(%rip), %rdx      # 0x20940
leaq 0xa8da(%rip), %rcx      # 0x20880
movl $0x1fe, %esi            # imm = 0x1FE
movq %rbx, %rdi
movq %r15, %r8
xorl %eax, %eax
callq 0x51c0
movq %rbx, %rdi
movq 0x50(%rsp), %rsi
callq 0x160ee
movq 0x60(%rsp), %rdi
callq 0x5240
movq 0x18(%rsp), %r15
cmpb $0x0, (%r15)
je 0x15fe8
movq (%rsp), %rax
cmpb $0x0, (%rax)
je 0x15fe8
pushq $0x1
popq %rbp
jmp 0x16045
movq 0x12fc9(%rip), %rax     # 0x28fb8
movq (%rax), %r14
callq 0xe343
leaq 0xa9dc(%rip), %rsi      # 0x209da
xorl %ebp, %ebp
movq %r14, %rdi
movq %rax, %rdx
movq (%rsp), %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x52c0
leaq 0x13c8d(%rip), %rax     # 0x29ca8
movq (%rax), %r14
testq %r14, %r14
je 0x16045
callq 0xe343
leaq 0xa9ab(%rip), %rsi      # 0x209da
xorl %ebp, %ebp
movq %r14, %rdi
movq %rax, %rdx
movq (%rsp), %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x52c0
movq %rbx, %rdi
callq 0x5040
movl %ebp, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq