// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/main.c
// Function: qmi_main
static int qmi_main(PROFILE_T *profile)
{
    int triger_event = 0;
    int signo;
#ifdef CONFIG_SIM
    SIM_Status SIMStatus;
#endif
    UCHAR PSAttachedState = 0;
    UCHAR  IPv4ConnectionStatus = QWDS_PKT_DATA_UNKNOW;
    UCHAR  IPv6ConnectionStatus = QWDS_PKT_DATA_UNKNOW; 
    unsigned SetupCallFail = 0;
    unsigned long SetupCallAllowTime = clock_msec();
    int qmierr = 0;
    const struct request_ops *request_ops = profile ->request_ops;
    pthread_t gQmiThreadID = 0;

//sudo apt-get install udhcpc
//sudo apt-get remove ModemManager
    if (profile->reattach_flag) {
        if (!reattach_driver(profile)) 
            sleep(2);
    }

    /* try to recreate FDs*/
    if (socketpair( AF_LOCAL, SOCK_STREAM, 0, signal_control_fd) < 0 ) {
        dbg_time("%s Faild to create main_control_fd: %d (%s)", __func__, errno, strerror(errno));
        return -1;
    }

    if ( socketpair( AF_LOCAL, SOCK_STREAM, 0, qmidevice_control_fd ) < 0 ) {
        dbg_time("%s Failed to create thread control socket pair: %d (%s)", __func__, errno, strerror(errno));
        return 0;
    }

    if ((profile->qmap_mode == 0 || profile->qmap_mode == 1) && (!profile->proxy[0])) {
        kill_brothers(profile->qmichannel);
     }

    if (pthread_create( &gQmiThreadID, 0, profile->qmi_ops->read, (void *)profile) != 0) {
        dbg_time("%s Failed to create QMIThread: %d (%s)", __func__, errno, strerror(errno));
        return 0;
    }

    if ((read(qmidevice_control_fd[0], &triger_event, sizeof(triger_event)) != sizeof(triger_event))
        || (triger_event != RIL_INDICATE_DEVICE_CONNECTED)) {
        dbg_time("%s Failed to init QMIThread: %d (%s)", __func__, errno, strerror(errno));
        return 0;
    }

    if (profile->qmi_ops->init && profile->qmi_ops->init(profile)) {
        dbg_time("%s Failed to qmi init: %d (%s)", __func__, errno, strerror(errno));
        return 0;
    }

    if (request_ops->requestBaseBandVersion)
        request_ops->requestBaseBandVersion(profile);

    if (request_ops->requestSetEthMode)
        request_ops->requestSetEthMode(profile);

    if (request_ops->requestSetLoopBackState && profile->loopback_state) {
    	request_ops->requestSetLoopBackState(profile->loopback_state, profile->replication_factor);
    	profile->loopback_state = 0;
    }

    if (request_ops->requestGetSIMStatus) {
        qmierr = request_ops->requestGetSIMStatus(&SIMStatus);

        while (qmierr == QMI_ERR_OP_DEVICE_UNSUPPORTED) {
            sleep(1);
            qmierr = request_ops->requestGetSIMStatus(&SIMStatus);
        }

        if ((SIMStatus == SIM_PIN) && profile->pincode && request_ops->requestEnterSimPin) {
            request_ops->requestEnterSimPin(profile->pincode);
        }
    }

    if (SIMStatus == SIM_READY) {
        if (request_ops->requestGetICCID)
            request_ops->requestGetICCID();

        if (request_ops->requestGetIMSI)
            request_ops->requestGetIMSI();
    }

    if (request_ops->requestGetProfile)
        request_ops->requestGetProfile(profile);

    if (request_ops->requestSetProfile && (profile->apn || profile->user || profile->password)) {
        request_ops->requestSetProfile(profile);
    }

    request_ops->requestRegistrationState(&PSAttachedState);

    send_signo_to_main(SIG_EVENT_CHECK);

    while (1)
    {
        struct pollfd pollfds[] = {{signal_control_fd[1], POLLIN, 0}, {qmidevice_control_fd[0], POLLIN, 0}};
        int ne, ret, nevents = sizeof(pollfds)/sizeof(pollfds[0]);

        do {
            ret = poll(pollfds, nevents,  15*1000);
        } while ((ret < 0) && (errno == EINTR));

        if (ret == 0)
        {
            send_signo_to_main(SIG_EVENT_CHECK);
            continue;
        }

        if (ret <= 0) {
            dbg_time("%s poll=%d, errno: %d (%s)", __func__, ret, errno, strerror(errno));
            goto __main_quit;
        }

        for (ne = 0; ne < nevents; ne++) {
            int fd = pollfds[ne].fd;
            short revents = pollfds[ne].revents;

            if (revents & (POLLERR | POLLHUP | POLLNVAL)) {
                dbg_time("%s poll err/hup", __func__);
                dbg_time("epoll fd = %d, events = 0x%04x", fd, revents);
                main_send_event_to_qmidevice(RIL_REQUEST_QUIT);
                if (revents & POLLHUP)
                    goto __main_quit;
            }

            if ((revents & POLLIN) == 0)
                continue;

            if (fd == signal_control_fd[1])
            {
                if (read(fd, &signo, sizeof(signo)) == sizeof(signo))
                {
                    alarm(0);
                    switch (signo)
                    {
                        case SIG_EVENT_START:
                            if (PSAttachedState != 1 && profile->loopback_state == 0)
                                break;
                            
                            if (SetupCallAllowTime > clock_msec()) {
                                alarm((SetupCallAllowTime - clock_msec()+999)/1000);
                                break;
                            }

                            if (profile->enable_ipv4 && IPv4ConnectionStatus !=  QWDS_PKT_DATA_CONNECTED) {
                                qmierr = request_ops->requestSetupDataCall(profile, IpFamilyV4);

                                if ((qmierr > 0) && profile->user && profile->user[0] && profile->password && profile->password[0]) {
                                    int old_auto =  profile->auth;

                                    //may be fail because wrong auth mode, try pap->chap, or chap->pap
                                    profile->auth = (profile->auth == 1) ? 2 : 1;
                                	qmierr = request_ops->requestSetupDataCall(profile, IpFamilyV4);

                                    if (qmierr)
                                        profile->auth = old_auto; //still fail, restore old auth moe
                                }

                                if (!qmierr) {
                                    qmierr = request_ops->requestGetIPAddress(profile, IpFamilyV4);
                                    if (!qmierr)
                                        IPv4ConnectionStatus = QWDS_PKT_DATA_CONNECTED;
                                }
                                        
                            }

                            if (profile->enable_ipv6 && IPv6ConnectionStatus !=  QWDS_PKT_DATA_CONNECTED) {
                                if (profile->enable_ipv4 && profile->request_ops != &qmi_request_ops) {
                                    IPv6ConnectionStatus = IPv4ConnectionStatus;
                                }
                                else {
                                    qmierr = request_ops->requestSetupDataCall(profile, IpFamilyV6);

                                    if (!qmierr) {
                                        qmierr = request_ops->requestGetIPAddress(profile, IpFamilyV6);
                                        if (!qmierr)
                                            IPv6ConnectionStatus = QWDS_PKT_DATA_CONNECTED;
                                    }
                                }
                            }
                                
                            if ((profile->enable_ipv4 && IPv4ConnectionStatus ==  QWDS_PKT_DATA_DISCONNECTED)
                                    || (profile->enable_ipv6 && IPv6ConnectionStatus ==  QWDS_PKT_DATA_DISCONNECTED)) {
                                const unsigned allow_time[] = {5, 10, 20, 40, 60};

                                if (SetupCallFail < (sizeof(allow_time)/sizeof(unsigned)))
                                    SetupCallAllowTime = allow_time[SetupCallFail];
                                else
                                    SetupCallAllowTime = 60;
                                SetupCallFail++;
                                dbg_time("try to requestSetupDataCall %ld second later", SetupCallAllowTime);
                                alarm(SetupCallAllowTime);
                                SetupCallAllowTime = SetupCallAllowTime*1000 + clock_msec();
                            }
                            else if (IPv4ConnectionStatus ==  QWDS_PKT_DATA_CONNECTED || IPv6ConnectionStatus ==  QWDS_PKT_DATA_CONNECTED) {
                                SetupCallFail = 0;
                                SetupCallAllowTime = clock_msec();
                            }
                        break;

                        case SIG_EVENT_CHECK:
                            if (request_ops->requestGetSignalInfo)
                                request_ops->requestGetSignalInfo();
                            
                            if (request_ops->requestGetCellInfoList)
                                request_ops->requestGetCellInfoList();

                            if (profile->enable_ipv4 && IPv4ConnectionStatus != QWDS_PKT_DATA_DISCONNECTED
                                && !request_ops->requestQueryDataCall(&IPv4ConnectionStatus, IpFamilyV4))
                            {
                                if (QWDS_PKT_DATA_CONNECTED == IPv4ConnectionStatus && profile->ipv4.Address == 0) {
                                    //killall -9 quectel-CM for MBIM and ATC call
                                    qmierr = request_ops->requestGetIPAddress(profile, IpFamilyV4);
                                    if (qmierr)
                                        IPv4ConnectionStatus = QWDS_PKT_DATA_DISCONNECTED;
                                }

                                //local ip is different with remote ip
                                if (QWDS_PKT_DATA_CONNECTED == IPv4ConnectionStatus && check_ipv4_address(profile) == 0) {
                                    request_ops->requestDeactivateDefaultPDP(profile, IpFamilyV4);
                                    IPv4ConnectionStatus = QWDS_PKT_DATA_DISCONNECTED;
                                }
                            }
                            else {
                                IPv4ConnectionStatus = QWDS_PKT_DATA_DISCONNECTED;
                            }

                            if (profile->enable_ipv6 && IPv6ConnectionStatus != QWDS_PKT_DATA_DISCONNECTED) {
                                if (profile->enable_ipv4 && profile->request_ops != &qmi_request_ops) {
                                    IPv6ConnectionStatus = IPv4ConnectionStatus;
                                }
                                else {
                                    request_ops->requestQueryDataCall(&IPv6ConnectionStatus, IpFamilyV6);
                                }
                            }
                            else {
                                IPv6ConnectionStatus = QWDS_PKT_DATA_DISCONNECTED;
                            }

                            if (IPv4ConnectionStatus ==  QWDS_PKT_DATA_DISCONNECTED && IPv6ConnectionStatus ==  QWDS_PKT_DATA_DISCONNECTED) {
                                usbnet_link_change(0, profile);
                            }
                            else if (IPv4ConnectionStatus ==  QWDS_PKT_DATA_CONNECTED || IPv6ConnectionStatus ==  QWDS_PKT_DATA_CONNECTED) {
                                int link = 0;
                                if (IPv4ConnectionStatus == QWDS_PKT_DATA_CONNECTED)
                                    link |= (1<<IpFamilyV4);
                                if (IPv6ConnectionStatus == QWDS_PKT_DATA_CONNECTED)
                                    link |= (1<<IpFamilyV6);
                                usbnet_link_change(link, profile);
                            }
                            
                            if ((profile->enable_ipv4 && IPv4ConnectionStatus ==  QWDS_PKT_DATA_DISCONNECTED)
                                || (profile->enable_ipv6 && IPv6ConnectionStatus ==  QWDS_PKT_DATA_DISCONNECTED)) {
                                send_signo_to_main(SIG_EVENT_START);
                            }
                        break;

                        case SIG_EVENT_STOP:
                            if (profile->enable_ipv4 && IPv4ConnectionStatus ==  QWDS_PKT_DATA_CONNECTED) {
                                request_ops->requestDeactivateDefaultPDP(profile, IpFamilyV4);
                            }
                            if (profile->enable_ipv6 && IPv6ConnectionStatus ==  QWDS_PKT_DATA_CONNECTED) {
                                if (profile->enable_ipv4 && profile->request_ops != &qmi_request_ops) {
                                    
                                }
                                else {
                                    request_ops->requestDeactivateDefaultPDP(profile, IpFamilyV6);
                                }
                            }
                            usbnet_link_change(0, profile);
                            if (profile->qmi_ops->deinit)
                                profile->qmi_ops->deinit();
                            main_send_event_to_qmidevice(RIL_REQUEST_QUIT);
                            goto __main_quit;
                        break;

                        default:
                        break;
                    }
                }
            }

            if (fd == qmidevice_control_fd[0]) {
                if (read(fd, &triger_event, sizeof(triger_event)) == sizeof(triger_event)) {
                    switch (triger_event) {
                        case RIL_INDICATE_DEVICE_DISCONNECTED:
                            usbnet_link_change(0, profile);                            
                            goto __main_quit;
                        break;

                        case RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED:
                            request_ops->requestRegistrationState(&PSAttachedState);
                            if (PSAttachedState == 1) {
                                if ((profile->enable_ipv4 && IPv4ConnectionStatus ==  QWDS_PKT_DATA_DISCONNECTED)
                                    || (profile->enable_ipv6 && IPv6ConnectionStatus ==  QWDS_PKT_DATA_DISCONNECTED)) {
                                    send_signo_to_main(SIG_EVENT_START);
                                }
                             } else {
                                SetupCallAllowTime = clock_msec();
                             }
                        break;

                        case RIL_UNSOL_DATA_CALL_LIST_CHANGED:
                            if (IPv4ConnectionStatus ==  QWDS_PKT_DATA_CONNECTED || IPv6ConnectionStatus ==  QWDS_PKT_DATA_CONNECTED) {
                                SetupCallAllowTime = clock_msec() + 1000; //from connect -> disconnect, do not re-dail immediately, wait network stable
                            }
                            send_signo_to_main(SIG_EVENT_CHECK);
                        break;

                        case MODEM_REPORT_RESET_EVENT:
                        {
                            dbg_time("main recv MODEM RESET SIGNAL");
                            main_send_event_to_qmidevice(RIL_REQUEST_QUIT);
                            g_donot_exit_when_modem_hangup = 1;
                            goto __main_quit;
                        }
                        break;

                    	case RIL_UNSOL_LOOPBACK_CONFIG_IND:
                        {
                        	QMI_WDA_SET_LOOPBACK_CONFIG_IND_MSG SetLoopBackInd;
                        	if (read(fd, &SetLoopBackInd, sizeof(SetLoopBackInd)) == sizeof(SetLoopBackInd)) {
                            	profile->loopback_state = SetLoopBackInd.loopback_state.TLVVaule;
                            	profile->replication_factor = le32_to_cpu(SetLoopBackInd.replication_factor.TLVVaule);
                            	dbg_time("SetLoopBackInd: loopback_state=%d, replication_factor=%u",
                                	profile->loopback_state, profile->replication_factor);
                            	if (profile->loopback_state)
                                	send_signo_to_main(SIG_EVENT_START);
                            }
                        }
                    	break;
                        default:
                        break;
                    }
                }
            }
        }
    }

__main_quit:
    usbnet_link_change(0, profile);
    if (gQmiThreadID && pthread_join(gQmiThreadID, NULL)) {
        dbg_time("%s Error joining to listener thread (%s)", __func__, strerror(errno));
    }

    close(signal_control_fd[0]);
    close(signal_control_fd[1]);
    close(qmidevice_control_fd[0]);
    close(qmidevice_control_fd[1]);
    dbg_time("%s exit", __func__);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movb $0x0, -0x1d(%rbp)
movb $0x0, -0x1e(%rbp)
movb $0x0, -0x1f(%rbp)
movl $0x0, -0x24(%rbp)
callq 0x13e90
movq %rax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x10(%rbp), %rax
movq 0x326(%rax), %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x1bc(%rax)
je 0x9af7
movq -0x10(%rbp), %rdi
callq 0x221e0
cmpl $0x0, %eax
jne 0x9af5
movl $0x2, %edi
callq 0x5550
jmp 0x9af7
movl $0x1, %esi
xorl %edx, %edx
leaq 0x2de6b(%rip), %rcx     # 0x37970
movl %esi, %edi
callq 0x5300
cmpl $0x0, %eax
jge 0x9bf8
jmp 0x9b17
movq 0x2d4c2(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0xb8(%rbp)
callq 0x13930
movq %rax, -0xb0(%rbp)
callq 0x5070
movl (%rax), %eax
movl %eax, -0xa8(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0xb8(%rbp), %rdi
movq -0xb0(%rbp), %rdx
movl -0xa8(%rbp), %r8d
movq %rax, %r9
leaq 0x22179(%rip), %rsi     # 0x2bce5
leaq 0x221a4(%rip), %rcx     # 0x2bd17
movb $0x0, %al
callq 0x52c0
leaq 0x2e2e7(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x9bea
leaq 0x2e2da(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0xd0(%rbp)
callq 0x13930
movq %rax, -0xc8(%rbp)
callq 0x5070
movl (%rax), %eax
movl %eax, -0xbc(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0xd0(%rbp), %rdi
movq -0xc8(%rbp), %rdx
movl -0xbc(%rbp), %r8d
movq %rax, %r9
leaq 0x22109(%rip), %rsi     # 0x2bce5
leaq 0x22134(%rip), %rcx     # 0x2bd17
movb $0x0, %al
callq 0x52c0
jmp 0x9bec
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xaeee
movl $0x1, %esi
xorl %edx, %edx
leaq 0x2d98e(%rip), %rcx     # 0x37594
movl %esi, %edi
callq 0x5300
cmpl $0x0, %eax
jge 0x9cf9
jmp 0x9c18
movq 0x2d3c1(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0xe8(%rbp)
callq 0x13930
movq %rax, -0xe0(%rbp)
callq 0x5070
movl (%rax), %eax
movl %eax, -0xd4(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0xe8(%rbp), %rdi
movq -0xe0(%rbp), %rdx
movl -0xd4(%rbp), %r8d
movq %rax, %r9
leaq 0x220b3(%rip), %rsi     # 0x2bd20
leaq 0x220a3(%rip), %rcx     # 0x2bd17
movb $0x0, %al
callq 0x52c0
leaq 0x2e1e6(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x9ceb
leaq 0x2e1d9(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x100(%rbp)
callq 0x13930
movq %rax, -0xf8(%rbp)
callq 0x5070
movl (%rax), %eax
movl %eax, -0xec(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x100(%rbp), %rdi
movq -0xf8(%rbp), %rdx
movl -0xec(%rbp), %r8d
movq %rax, %r9
leaq 0x22043(%rip), %rsi     # 0x2bd20
leaq 0x22033(%rip), %rcx     # 0x2bd17
movb $0x0, %al
callq 0x52c0
jmp 0x9ced
movl $0x0, -0x4(%rbp)
jmp 0xaeee
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10a(%rax)
je 0x9d13
movq -0x10(%rbp), %rax
cmpl $0x1, 0x10a(%rax)
jne 0x9d2d
movq -0x10(%rbp), %rax
cmpb $0x0, 0x28(%rax)
jne 0x9d2d
movq -0x10(%rbp), %rdi
addq $0x8a, %rdi
callq 0xaf00
movq -0x10(%rbp), %rax
movq 0x31e(%rax), %rax
movq 0x18(%rax), %rdx
movq -0x10(%rbp), %rcx
leaq -0x48(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x53e0
cmpl $0x0, %eax
je 0x9e39
jmp 0x9d58
movq 0x2d281(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x118(%rbp)
callq 0x13930
movq %rax, -0x110(%rbp)
callq 0x5070
movl (%rax), %eax
movl %eax, -0x104(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x118(%rbp), %rdi
movq -0x110(%rbp), %rdx
movl -0x104(%rbp), %r8d
movq %rax, %r9
leaq 0x21fb1(%rip), %rsi     # 0x2bd5e
leaq 0x21f63(%rip), %rcx     # 0x2bd17
movb $0x0, %al
callq 0x52c0
leaq 0x2e0a6(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x9e2b
leaq 0x2e099(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x130(%rbp)
callq 0x13930
movq %rax, -0x128(%rbp)
callq 0x5070
movl (%rax), %eax
movl %eax, -0x11c(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x130(%rbp), %rdi
movq -0x128(%rbp), %rdx
movl -0x11c(%rbp), %r8d
movq %rax, %r9
leaq 0x21f41(%rip), %rsi     # 0x2bd5e
leaq 0x21ef3(%rip), %rcx     # 0x2bd17
movb $0x0, %al
callq 0x52c0
jmp 0x9e2d
movl $0x0, -0x4(%rbp)
jmp 0xaeee
movl 0x2d755(%rip), %edi     # 0x37594
leaq -0x14(%rbp), %rsi
movl $0x4, %edx
callq 0x5250
cmpq $0x4, %rax
jne 0x9e60
cmpl $0x1002, -0x14(%rbp)    # imm = 0x1002
je 0x9f43
jmp 0x9e62
movq 0x2d177(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x148(%rbp)
callq 0x13930
movq %rax, -0x140(%rbp)
callq 0x5070
movl (%rax), %eax
movl %eax, -0x134(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x148(%rbp), %rdi
movq -0x140(%rbp), %rdx
movl -0x134(%rbp), %r8d
movq %rax, %r9
leaq 0x21ed4(%rip), %rsi     # 0x2bd8b
leaq 0x21e59(%rip), %rcx     # 0x2bd17
movb $0x0, %al
callq 0x52c0
leaq 0x2df9c(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x9f35
leaq 0x2df8f(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x160(%rbp)
callq 0x13930
movq %rax, -0x158(%rbp)
callq 0x5070
movl (%rax), %eax
movl %eax, -0x14c(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x160(%rbp), %rdi
movq -0x158(%rbp), %rdx
movl -0x14c(%rbp), %r8d
movq %rax, %r9
leaq 0x21e64(%rip), %rsi     # 0x2bd8b
leaq 0x21de9(%rip), %rcx     # 0x2bd17
movb $0x0, %al
callq 0x52c0
jmp 0x9f37
movl $0x0, -0x4(%rbp)
jmp 0xaeee
movq -0x10(%rbp), %rax
movq 0x31e(%rax), %rax
cmpq $0x0, (%rax)
je 0xa058
movq -0x10(%rbp), %rax
movq 0x31e(%rax), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
cmpl $0x0, %eax
je 0xa058
jmp 0x9f77
movq 0x2d062(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x178(%rbp)
callq 0x13930
movq %rax, -0x170(%rbp)
callq 0x5070
movl (%rax), %eax
movl %eax, -0x164(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x178(%rbp), %rdi
movq -0x170(%rbp), %rdx
movl -0x164(%rbp), %r8d
movq %rax, %r9
leaq 0x21dea(%rip), %rsi     # 0x2bdb6
leaq 0x21d44(%rip), %rcx     # 0x2bd17
movb $0x0, %al
callq 0x52c0
leaq 0x2de87(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0xa04a
leaq 0x2de7a(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x190(%rbp)
callq 0x13930
movq %rax, -0x188(%rbp)
callq 0x5070
movl (%rax), %eax
movl %eax, -0x17c(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x190(%rbp), %rdi
movq -0x188(%rbp), %rdx
movl -0x17c(%rbp), %r8d
movq %rax, %r9
leaq 0x21d7a(%rip), %rsi     # 0x2bdb6
leaq 0x21cd4(%rip), %rcx     # 0x2bd17
movb $0x0, %al
callq 0x52c0
jmp 0xa04c
movl $0x0, -0x4(%rbp)
jmp 0xaeee
movq -0x40(%rbp), %rax
cmpq $0x0, (%rax)
je 0xa06f
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
movq -0x40(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xa088
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
movq -0x40(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0xa0cf
movq -0x10(%rbp), %rax
movzbl 0x215(%rax), %eax
cmpl $0x0, %eax
je 0xa0cf
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movb 0x215(%rcx), %cl
movq -0x10(%rbp), %rdx
movl 0x86(%rdx), %esi
movzbl %cl, %edi
callq *%rax
movq -0x10(%rbp), %rax
movb $0x0, 0x215(%rax)
movq -0x40(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xa138
movq -0x40(%rbp), %rax
leaq -0x1c(%rbp), %rdi
callq *0x18(%rax)
movl %eax, -0x34(%rbp)
cmpl $0x19, -0x34(%rbp)
jne 0xa108
movl $0x1, %edi
callq 0x5550
movq -0x40(%rbp), %rax
leaq -0x1c(%rbp), %rdi
callq *0x18(%rax)
movl %eax, -0x34(%rbp)
jmp 0xa0e8
cmpl $0x3, -0x1c(%rbp)
jne 0xa136
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0xa136
movq -0x40(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0xa136
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rdi
callq *%rax
jmp 0xa138
cmpl $0x2, -0x1c(%rbp)
jne 0xa164
movq -0x40(%rbp), %rax
cmpq $0x0, 0x70(%rax)
je 0xa150
movq -0x40(%rbp), %rax
callq *0x70(%rax)
movq -0x40(%rbp), %rax
cmpq $0x0, 0x78(%rax)
je 0xa162
movq -0x40(%rbp), %rax
callq *0x78(%rax)
jmp 0xa164
movq -0x40(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0xa17d
movq -0x40(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
movq -0x40(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0xa1b6
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0xa1a8
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0xa1a8
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0xa1b6
movq -0x40(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
movq -0x40(%rbp), %rax
leaq -0x1d(%rbp), %rdi
callq *0x38(%rax)
movl $0x1, %edi
callq 0x9a20
movl 0x2d7a3(%rip), %eax     # 0x37974
movl %eax, -0x60(%rbp)
movw $0x1, -0x5c(%rbp)
movw $0x0, -0x5a(%rbp)
movl 0x2d3ae(%rip), %eax     # 0x37594
movl %eax, -0x58(%rbp)
movw $0x1, -0x54(%rbp)
movw $0x0, -0x52(%rbp)
movl $0x2, -0x6c(%rbp)
leaq -0x60(%rbp), %rdi
movslq -0x6c(%rbp), %rsi
movl $0x3a98, %edx           # imm = 0x3A98
callq 0x53d0
movl %eax, -0x68(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x68(%rbp)
movb %al, -0x191(%rbp)
jge 0xa230
callq 0x5070
cmpl $0x4, (%rax)
sete %al
movb %al, -0x191(%rbp)
movb -0x191(%rbp), %al
testb $0x1, %al
jne 0xa1fc
cmpl $0x0, -0x68(%rbp)
jne 0xa24f
movl $0x1, %edi
callq 0x9a20
jmp 0xa1cb
cmpl $0x0, -0x68(%rbp)
jg 0xa357
jmp 0xa25b
movq 0x2cd7e(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x1b0(%rbp)
callq 0x13930
movq %rax, -0x1a8(%rbp)
movl -0x68(%rbp), %eax
movl %eax, -0x19c(%rbp)
callq 0x5070
movl (%rax), %eax
movl %eax, -0x198(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x1b0(%rbp), %rdi
movq -0x1a8(%rbp), %rdx
movl -0x19c(%rbp), %r8d
movl -0x198(%rbp), %r9d
leaq 0x20ef6(%rip), %rsi     # 0x2b1b3
leaq 0x21a53(%rip), %rcx     # 0x2bd17
movq %rax, (%rsp)
movb $0x0, %al
callq 0x52c0
leaq 0x2db92(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0xa350
leaq 0x2db85(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x1c8(%rbp)
callq 0x13930
movq %rax, -0x1c0(%rbp)
movl -0x68(%rbp), %eax
movl %eax, -0x1b8(%rbp)
callq 0x5070
movl (%rax), %eax
movl %eax, -0x1b4(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x1c8(%rbp), %rdi
movq -0x1c0(%rbp), %rdx
movl -0x1b8(%rbp), %r8d
movl -0x1b4(%rbp), %r9d
leaq 0x20e75(%rip), %rsi     # 0x2b1b3
leaq 0x219d2(%rip), %rcx     # 0x2bd17
movq %rax, (%rsp)
movb $0x0, %al
callq 0x52c0
jmp 0xa352
jmp 0xad65
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x6c(%rbp), %eax
jge 0xad60
movslq -0x64(%rbp), %rax
movl -0x60(%rbp,%rax,8), %eax
movl %eax, -0x70(%rbp)
movslq -0x64(%rbp), %rax
movw -0x5a(%rbp,%rax,8), %ax
movw %ax, -0x72(%rbp)
movswl -0x72(%rbp), %eax
andl $0x38, %eax
cmpl $0x0, %eax
je 0xa4a7
jmp 0xa394
movq 0x2cc45(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x1d0(%rbp)
callq 0x13930
movq -0x1d0(%rbp), %rdi
movq %rax, %rdx
leaq 0x21a20(%rip), %rsi     # 0x2bddb
leaq 0x21955(%rip), %rcx     # 0x2bd17
movb $0x0, %al
callq 0x52c0
leaq 0x2da98(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0xa40b
leaq 0x2da8b(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x1d8(%rbp)
callq 0x13930
movq -0x1d8(%rbp), %rdi
movq %rax, %rdx
leaq 0x219de(%rip), %rsi     # 0x2bddb
leaq 0x21913(%rip), %rcx     # 0x2bd17
movb $0x0, %al
callq 0x52c0
jmp 0xa40d
jmp 0xa40f
movq 0x2cbca(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x1e0(%rbp)
callq 0x13930
movq -0x1e0(%rbp), %rdi
movq %rax, %rdx
movl -0x70(%rbp), %ecx
movswl -0x72(%rbp), %r8d
leaq 0x20fd0(%rip), %rsi     # 0x2b40e
movb $0x0, %al
callq 0x52c0
leaq 0x2da1c(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0xa488
leaq 0x2da0f(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x1e8(%rbp)
callq 0x13930
movq -0x1e8(%rbp), %rdi
movq %rax, %rdx
movl -0x70(%rbp), %ecx
movswl -0x72(%rbp), %r8d
leaq 0x20f8d(%rip), %rsi     # 0x2b40e
movb $0x0, %al
callq 0x52c0
jmp 0xa48a
movl $0x1000, %edi           # imm = 0x1000
callq 0x9a50
movswl -0x72(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0xa4a5
jmp 0xad65
jmp 0xa4a7
movswl -0x72(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0xa4b8
jmp 0xad52
movl -0x70(%rbp), %eax
cmpl 0x2d4b3(%rip), %eax     # 0x37974
jne 0xaade
movl -0x70(%rbp), %edi
leaq -0x18(%rbp), %rsi
movl $0x4, %edx
callq 0x5250
cmpq $0x4, %rax
jne 0xaadc
xorl %edi, %edi
callq 0x5220
movl -0x18(%rbp), %eax
movl %eax, -0x1ec(%rbp)
testl %eax, %eax
je 0xa51d
jmp 0xa4f8
movl -0x1ec(%rbp), %eax
subl $0x1, %eax
je 0xa853
jmp 0xa509
movl -0x1ec(%rbp), %eax
subl $0x2, %eax
je 0xaa27
jmp 0xaad8
movzbl -0x1d(%rbp), %eax
cmpl $0x1, %eax
je 0xa53b
movq -0x10(%rbp), %rax
movzbl 0x215(%rax), %eax
cmpl $0x0, %eax
jne 0xa53b
jmp 0xaada
movq -0x30(%rbp), %rax
movq %rax, -0x1f8(%rbp)
callq 0x13e90
movq %rax, %rcx
movq -0x1f8(%rbp), %rax
cmpq %rcx, %rax
jbe 0xa593
movq -0x30(%rbp), %rax
movq %rax, -0x200(%rbp)
callq 0x13e90
movq %rax, %rcx
movq -0x200(%rbp), %rax
subq %rcx, %rax
addq $0x3e7, %rax            # imm = 0x3E7
movl $0x3e8, %ecx            # imm = 0x3E8
xorl %edx, %edx
divq %rcx
movl %eax, %edi
callq 0x5220
jmp 0xaada
movq -0x10(%rbp), %rax
movzbl 0x50(%rax), %eax
cmpl $0x0, %eax
je 0xa681
movzbl -0x1e(%rbp), %eax
cmpl $0x2, %eax
je 0xa681
movq -0x40(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rdi
movl $0x4, %esi
callq *%rax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jle 0xa657
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xa657
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0xa657
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0xa657
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0xa657
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x78(%rbp)
movq -0x10(%rbp), %rax
movl 0x18(%rax), %edx
movl $0x1, %ecx
movl $0x2, %eax
cmpl $0x1, %edx
cmovel %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x40(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rdi
movl $0x4, %esi
callq *%rax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0xa655
movl -0x78(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x18(%rax)
jmp 0xa657
cmpl $0x0, -0x34(%rbp)
jne 0xa67f
movq -0x40(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x10(%rbp), %rdi
movl $0x4, %esi
callq *%rax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0xa67d
movb $0x2, -0x1e(%rbp)
jmp 0xa67f
jmp 0xa681
movq -0x10(%rbp), %rax
movzbl 0x51(%rax), %eax
cmpl $0x0, %eax
je 0xa702
movzbl -0x1f(%rbp), %eax
cmpl $0x2, %eax
je 0xa702
movq -0x10(%rbp), %rax
movzbl 0x50(%rax), %eax
cmpl $0x0, %eax
je 0xa6c0
movq -0x10(%rbp), %rax
leaq 0x2bcf1(%rip), %rcx     # 0x363a0
cmpq %rcx, 0x326(%rax)
je 0xa6c0
movb -0x1e(%rbp), %al
movb %al, -0x1f(%rbp)
jmp 0xa700
movq -0x40(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rdi
movl $0x6, %esi
callq *%rax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0xa6fe
movq -0x40(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x10(%rbp), %rdi
movl $0x6, %esi
callq *%rax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0xa6fc
movb $0x2, -0x1f(%rbp)
jmp 0xa6fe
jmp 0xa700
jmp 0xa702
movq -0x10(%rbp), %rax
movzbl 0x50(%rax), %eax
cmpl $0x0, %eax
je 0xa718
movzbl -0x1e(%rbp), %eax
cmpl $0x1, %eax
je 0xa736
movq -0x10(%rbp), %rax
movzbl 0x51(%rax), %eax
cmpl $0x0, %eax
je 0xa82a
movzbl -0x1f(%rbp), %eax
cmpl $0x1, %eax
jne 0xa82a
movq 0x20e83(%rip), %rax     # 0x2b5c0
movq %rax, -0x90(%rbp)
movq 0x20e7d(%rip), %rax     # 0x2b5c8
movq %rax, -0x88(%rbp)
movl 0x20e78(%rip), %eax     # 0x2b5d0
movl %eax, -0x80(%rbp)
movl -0x24(%rbp), %eax
cmpq $0x5, %rax
jae 0xa774
movl -0x24(%rbp), %eax
movl -0x90(%rbp,%rax,4), %eax
movq %rax, -0x30(%rbp)
jmp 0xa77c
movq $0x3c, -0x30(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq 0x2c854(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x208(%rbp)
callq 0x13930
movq -0x208(%rbp), %rdi
movq %rax, %rdx
movq -0x30(%rbp), %rcx
leaq 0x21641(%rip), %rsi     # 0x2bdf1
movb $0x0, %al
callq 0x52c0
leaq 0x2d6aa(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0xa7f6
leaq 0x2d69d(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x210(%rbp)
callq 0x13930
movq -0x210(%rbp), %rdi
movq %rax, %rdx
movq -0x30(%rbp), %rcx
leaq 0x21602(%rip), %rsi     # 0x2bdf1
movb $0x0, %al
callq 0x52c0
jmp 0xa7f8
movq -0x30(%rbp), %rax
movl %eax, %edi
callq 0x5220
imulq $0x3e8, -0x30(%rbp), %rax # imm = 0x3E8
movq %rax, -0x218(%rbp)
callq 0x13e90
movq %rax, %rcx
movq -0x218(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x30(%rbp)
jmp 0xa84e
movzbl -0x1e(%rbp), %eax
cmpl $0x2, %eax
je 0xa83c
movzbl -0x1f(%rbp), %eax
cmpl $0x2, %eax
jne 0xa84c
movl $0x0, -0x24(%rbp)
callq 0x13e90
movq %rax, -0x30(%rbp)
jmp 0xa84e
jmp 0xaada
movq -0x40(%rbp), %rax
cmpq $0x0, 0x60(%rax)
je 0xa865
movq -0x40(%rbp), %rax
callq *0x60(%rax)
movq -0x40(%rbp), %rax
cmpq $0x0, 0x68(%rax)
je 0xa877
movq -0x40(%rbp), %rax
callq *0x68(%rax)
movq -0x10(%rbp), %rax
movzbl 0x50(%rax), %eax
cmpl $0x0, %eax
je 0xa91a
movzbl -0x1e(%rbp), %eax
cmpl $0x1, %eax
je 0xa91a
movq -0x40(%rbp), %rax
leaq -0x1e(%rbp), %rdi
movl $0x4, %esi
callq *0x48(%rax)
cmpl $0x0, %eax
jne 0xa91a
movzbl -0x1e(%rbp), %ecx
movl $0x2, %eax
cmpl %ecx, %eax
jne 0xa8e6
movq -0x10(%rbp), %rax
cmpl $0x0, 0x126(%rax)
jne 0xa8e6
movq -0x40(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x10(%rbp), %rdi
movl $0x4, %esi
callq *%rax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0xa8e4
movb $0x1, -0x1e(%rbp)
jmp 0xa8e6
movzbl -0x1e(%rbp), %ecx
movl $0x2, %eax
cmpl %ecx, %eax
jne 0xa918
movq -0x10(%rbp), %rdi
callq 0xafb0
cmpl $0x0, %eax
jne 0xa918
movq -0x40(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x10(%rbp), %rdi
movl $0x4, %esi
callq *%rax
movb $0x1, -0x1e(%rbp)
jmp 0xa91e
movb $0x1, -0x1e(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x51(%rax), %eax
cmpl $0x0, %eax
je 0xa96f
movzbl -0x1f(%rbp), %eax
cmpl $0x1, %eax
je 0xa96f
movq -0x10(%rbp), %rax
movzbl 0x50(%rax), %eax
cmpl $0x0, %eax
je 0xa95d
movq -0x10(%rbp), %rax
leaq 0x2ba54(%rip), %rcx     # 0x363a0
cmpq %rcx, 0x326(%rax)
je 0xa95d
movb -0x1e(%rbp), %al
movb %al, -0x1f(%rbp)
jmp 0xa96d
movq -0x40(%rbp), %rax
leaq -0x1f(%rbp), %rdi
movl $0x6, %esi
callq *0x48(%rax)
jmp 0xa973
movb $0x1, -0x1f(%rbp)
movzbl -0x1e(%rbp), %eax
cmpl $0x1, %eax
jne 0xa992
movzbl -0x1f(%rbp), %eax
cmpl $0x1, %eax
jne 0xa992
movq -0x10(%rbp), %rsi
xorl %edi, %edi
callq 0xb1b0
jmp 0xa9ef
movzbl -0x1e(%rbp), %eax
cmpl $0x2, %eax
je 0xa9a4
movzbl -0x1f(%rbp), %eax
cmpl $0x2, %eax
jne 0xa9ed
movl $0x0, -0x94(%rbp)
movzbl -0x1e(%rbp), %eax
cmpl $0x2, %eax
jne 0xa9c6
movl -0x94(%rbp), %eax
orl $0x10, %eax
movl %eax, -0x94(%rbp)
movzbl -0x1f(%rbp), %eax
cmpl $0x2, %eax
jne 0xa9de
movl -0x94(%rbp), %eax
orl $0x40, %eax
movl %eax, -0x94(%rbp)
movl -0x94(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0xb1b0
jmp 0xa9ef
movq -0x10(%rbp), %rax
movzbl 0x50(%rax), %eax
cmpl $0x0, %eax
je 0xaa05
movzbl -0x1e(%rbp), %eax
cmpl $0x1, %eax
je 0xaa1b
movq -0x10(%rbp), %rax
movzbl 0x51(%rax), %eax
cmpl $0x0, %eax
je 0xaa22
movzbl -0x1f(%rbp), %eax
cmpl $0x1, %eax
jne 0xaa22
xorl %edi, %edi
callq 0x9a20
jmp 0xaada
movq -0x10(%rbp), %rax
movzbl 0x50(%rax), %eax
cmpl $0x0, %eax
je 0xaa50
movzbl -0x1e(%rbp), %eax
cmpl $0x2, %eax
jne 0xaa50
movq -0x40(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x10(%rbp), %rdi
movl $0x4, %esi
callq *%rax
movq -0x10(%rbp), %rax
movzbl 0x51(%rax), %eax
cmpl $0x0, %eax
je 0xaa9e
movzbl -0x1f(%rbp), %eax
cmpl $0x2, %eax
jne 0xaa9e
movq -0x10(%rbp), %rax
movzbl 0x50(%rax), %eax
cmpl $0x0, %eax
je 0xaa89
movq -0x10(%rbp), %rax
leaq 0x2b922(%rip), %rcx     # 0x363a0
cmpq %rcx, 0x326(%rax)
je 0xaa89
jmp 0xaa9c
movq -0x40(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x10(%rbp), %rdi
movl $0x6, %esi
callq *%rax
jmp 0xaa9e
movq -0x10(%rbp), %rsi
xorl %edi, %edi
callq 0xb1b0
movq -0x10(%rbp), %rax
movq 0x31e(%rax), %rax
cmpq $0x0, 0x8(%rax)
je 0xaac9
movq -0x10(%rbp), %rax
movq 0x31e(%rax), %rax
callq *0x8(%rax)
movl $0x1000, %edi           # imm = 0x1000
callq 0x9a50
jmp 0xad65
jmp 0xaada
jmp 0xaadc
jmp 0xaade
movl -0x70(%rbp), %eax
cmpl 0x2caad(%rip), %eax     # 0x37594
jne 0xad50
movl -0x70(%rbp), %edi
leaq -0x14(%rbp), %rsi
movl $0x4, %edx
callq 0x5250
cmpq $0x4, %rax
jne 0xad4e
movl -0x14(%rbp), %eax
addl $0xffffeffd, %eax       # imm = 0xFFFFEFFD
movl %eax, %ecx
movq %rcx, -0x220(%rbp)
subl $0x4, %eax
ja 0xad4a
movq -0x220(%rbp), %rax
leaq 0x20a7c(%rip), %rcx     # 0x2b5ac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rsi
xorl %edi, %edi
callq 0xb1b0
jmp 0xad65
movq -0x40(%rbp), %rax
leaq -0x1d(%rbp), %rdi
callq *0x38(%rax)
movzbl -0x1d(%rbp), %eax
cmpl $0x1, %eax
jne 0xab92
movq -0x10(%rbp), %rax
movzbl 0x50(%rax), %eax
cmpl $0x0, %eax
je 0xab73
movzbl -0x1e(%rbp), %eax
cmpl $0x1, %eax
je 0xab89
movq -0x10(%rbp), %rax
movzbl 0x51(%rax), %eax
cmpl $0x0, %eax
je 0xab90
movzbl -0x1f(%rbp), %eax
cmpl $0x1, %eax
jne 0xab90
xorl %edi, %edi
callq 0x9a20
jmp 0xab9b
callq 0x13e90
movq %rax, -0x30(%rbp)
jmp 0xad4c
movzbl -0x1e(%rbp), %eax
cmpl $0x2, %eax
je 0xabb2
movzbl -0x1f(%rbp), %eax
cmpl $0x2, %eax
jne 0xabc1
callq 0x13e90
addq $0x3e8, %rax            # imm = 0x3E8
movq %rax, -0x30(%rbp)
movl $0x1, %edi
callq 0x9a20
jmp 0xad4c
jmp 0xabd2
movq 0x2c407(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x228(%rbp)
callq 0x13930
movq -0x228(%rbp), %rdi
movq %rax, %rdx
leaq 0x2122b(%rip), %rsi     # 0x2be24
movb $0x0, %al
callq 0x52c0
leaq 0x2d261(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0xac3b
leaq 0x2d254(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x230(%rbp)
callq 0x13930
movq -0x230(%rbp), %rdi
movq %rax, %rdx
leaq 0x211f0(%rip), %rsi     # 0x2be24
movb $0x0, %al
callq 0x52c0
jmp 0xac3d
movl $0x1000, %edi           # imm = 0x1000
callq 0x9a50
movl $0x1, 0x2c93f(%rip)     # 0x37590
jmp 0xad65
movl -0x70(%rbp), %edi
leaq -0xa3(%rbp), %rsi
movl $0xf, %edx
callq 0x5250
cmpq $0xf, %rax
jne 0xad48
movb -0x9c(%rbp), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x215(%rax)
movl -0x98(%rbp), %edi
callq 0x13f20
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x86(%rax)
movq 0x2c33e(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x238(%rbp)
callq 0x13930
movq -0x238(%rbp), %rdi
movq %rax, %rdx
movq -0x10(%rbp), %rax
movzbl 0x215(%rax), %ecx
movq -0x10(%rbp), %rax
movl 0x86(%rax), %r8d
leaq 0x2116f(%rip), %rsi     # 0x2be47
movb $0x0, %al
callq 0x52c0
leaq 0x2d182(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0xad30
leaq 0x2d175(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x240(%rbp)
callq 0x13930
movq -0x240(%rbp), %rdi
movq %rax, %rdx
movq -0x10(%rbp), %rax
movzbl 0x215(%rax), %ecx
movq -0x10(%rbp), %rax
movl 0x86(%rax), %r8d
leaq 0x2111e(%rip), %rsi     # 0x2be47
movb $0x0, %al
callq 0x52c0
jmp 0xad32
movq -0x10(%rbp), %rax
cmpb $0x0, 0x215(%rax)
je 0xad46
xorl %edi, %edi
callq 0x9a20
jmp 0xad48
jmp 0xad4c
jmp 0xad4c
jmp 0xad4e
jmp 0xad50
jmp 0xad52
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0xa35e
jmp 0xa1cb
movq -0x10(%rbp), %rsi
xorl %edi, %edi
callq 0xb1b0
cmpq $0x0, -0x48(%rbp)
je 0xae42
movq -0x48(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x5520
cmpl $0x0, %eax
je 0xae42
jmp 0xad93
movq 0x2c246(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x250(%rbp)
callq 0x13930
movq %rax, -0x248(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x250(%rbp), %rdi
movq -0x248(%rbp), %rdx
movq %rax, %r8
leaq 0x210b2(%rip), %rsi     # 0x2be86
leaq 0x20f3c(%rip), %rcx     # 0x2bd17
movb $0x0, %al
callq 0x52c0
leaq 0x2d07f(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0xae3e
leaq 0x2d072(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x260(%rbp)
callq 0x13930
movq %rax, -0x258(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x260(%rbp), %rdi
movq -0x258(%rbp), %rdx
movq %rax, %r8
leaq 0x21056(%rip), %rsi     # 0x2be86
leaq 0x20ee0(%rip), %rcx     # 0x2bd17
movb $0x0, %al
callq 0x52c0
jmp 0xae40
jmp 0xae42
movl 0x2cb28(%rip), %edi     # 0x37970
callq 0x5230
movl 0x2cb21(%rip), %edi     # 0x37974
callq 0x5230
movl 0x2c736(%rip), %edi     # 0x37594
callq 0x5230
movl 0x2c72f(%rip), %edi     # 0x37598
callq 0x5230
movq 0x2c16b(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x268(%rbp)
callq 0x13930
movq -0x268(%rbp), %rdi
movq %rax, %rdx
leaq 0x203cf(%rip), %rsi     # 0x2b264
leaq 0x20e7b(%rip), %rcx     # 0x2bd17
movb $0x0, %al
callq 0x52c0
leaq 0x2cfbe(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0xaee5
leaq 0x2cfb1(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x270(%rbp)
callq 0x13930
movq -0x270(%rbp), %rdi
movq %rax, %rdx
leaq 0x2038d(%rip), %rsi     # 0x2b264
leaq 0x20e39(%rip), %rcx     # 0x2bd17
movb $0x0, %al
callq 0x52c0
jmp 0xaee7
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
nopw (%rax,%rax)