// File: /workspace/github_cpp_makefile_star2_O2/qian-jiahong[P]uvncrep017-ws/repeater.cpp
// Function: main
int main(int argc, char **argv)
{
    //Viewer port listener variable
    listenPortInfo viewerListener = {-1, -1};

    //Server port listener variable
    listenPortInfo serverListener = {-1, -1};

    //ctrl+c signal handler
    struct sigaction saInt;

    //ini file default
    char defaultIniFilePathAndName[] = "/etc/uvnc/uvncrepeater.ini";
    char tmpBuf[MAX_PATH];
    bool memoryOk;

    //Startup event
    startEndEvent seEv;
    
    stopped = false;
    mode1ConnCode = 0;
    
    fprintf(stderr, "UltraVnc Linux Repeater version %s\n", REPEATER_VERSION);
    
    //Read parameters from ini file
    // strlcpy(tmpBuf, (argc >= 2) ? argv[1] : defaultIniFilePathAndName, MAX_PATH);
    strlcpy(tmpBuf, (argc >= 2) ? argv[1] : DEFAULT_INI_FILE_PATH_AND_NAME, MAX_PATH);
    if (false == readIniFile(tmpBuf)) {
        debug(LEVEL_1, "main(): ini file (%s) read error, using defaults\n", tmpBuf);
    }
    listInitializationValues();

    //Send startup event to event interface 
    initRepeaterEventInterface();
    if (useEventInterface) {
        event.eventNum = REPEATER_STARTUP;
        event.timeStamp = time(NULL);
        event.repeaterProcessId = getpid();
        
        seEv.maxSessions = maxSessions;
        memcpy(event.extraInfo, &seEv, sizeof(startEndEvent));
        
        //Event fifo can not be full here ;-)
        sendRepeaterEvent(event);
    }

    //Allocate and clean various repeater lists
    if (false == allocateMemoryForRepeaterLists(maxSessions)) {
        debug(LEVEL_0, "main(): memory allocation for repeater lists failed, exiting program\n");
        memoryOk = false;
    }
    else {
        memoryOk = true;
        cleanLists();
    }

    //If we got lists allocated, we can run
    if (memoryOk) {
        //Initialize ctrl+c signal handler
        memset(&saInt, 0, sizeof(saInt));
    
        //Restart interrupted system calls after handler returns    
        saInt.sa_flags = SA_RESTART;    
        saInt.sa_handler = &handleSigInt;
        sigaction(SIGINT, &saInt, NULL);

        //Initialize and start listening on viewer port
        if (((allowedModes & CONN_MODE1) > 0) || ((allowedModes & CONN_MODE2) > 0)) {
            viewerListener.port = viewerPort;
            startListeningOnPort(&viewerListener);
        }

        //Initialize and start listening on server port
        if ((allowedModes & CONN_MODE2) > 0) {
            serverListener.port = serverPort;
            startListeningOnPort(&serverListener);
        }

        //Drop root privileges (if we are running as root) after all listen ports have been bound
        if (geteuid() == 0) {
            dropRootPrivileges(); 
        }

        //Accept & Route new connections
        if (stopped == false) {
            routeConnections(viewerListener.socket, serverListener.socket);
        }

        close(viewerListener.socket);
        close(serverListener.socket);
    }

    //Free allocated memory of repeater lists
    freeMemoryOfRepeaterLists();

    //Send shutdown event to event interface
    if (useEventInterface) {
        event.eventNum = REPEATER_SHUTDOWN;
        event.timeStamp = time(NULL);
        event.repeaterProcessId = getpid();
        
        seEv.maxSessions = maxSessions;
        memcpy(event.extraInfo, &seEv, sizeof(startEndEvent));
        if (false == sendRepeaterEvent(event)) {
            debug(LEVEL_1, "main(): Warning, event fifo is full\n");
        }
        handleRepeaterEvents();
    }

    debug(LEVEL_0, "main(): relaying done.\n");

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3c8, %rsp            # imm = 0x3C8
orq $-0x1, 0xe0(%rsp)
orq $-0x1, 0xd8(%rsp)
movq %rsi, %rbx
andq $0x0, 0xbcfa(%rip)      # 0xeac0
movl %edi, %ebp
movb $0x0, 0x9da1(%rip)      # 0xcb70
movq 0x920a(%rip), %rax      # 0xbfe0
movq (%rax), %rdi
leaq 0x455b(%rip), %rsi      # 0x733b
leaq 0x4578(%rip), %rdx      # 0x735f
xorl %eax, %eax
callq 0x22d0
cmpl $0x2, %ebp
jl 0x2df9
movq 0x8(%rbx), %rsi
jmp 0x2e00
leaq 0x93d0(%rip), %rsi      # 0xc1d0
leaq 0x2c0(%rsp), %rbx
movl $0xfa, %edx
movq %rbx, %rdi
callq 0x553a
movq %rbx, %rdi
callq 0x603c
testb %al, %al
jne 0x2e3a
leaq 0x453c(%rip), %rsi      # 0x7364
pushq $0x1
popq %rdi
leaq 0x2c0(%rsp), %rdx
xorl %eax, %eax
callq 0x247c
leaq 0x93af(%rip), %rax      # 0xc1f0
movl (%rax), %edx
leaq 0x48b4(%rip), %rsi      # 0x76fe
pushq $0x2
popq %rbp
movl %ebp, %edi
xorl %eax, %eax
callq 0x247c
leaq 0x9397(%rip), %rax      # 0xc1f4
movl (%rax), %edx
leaq 0x48c5(%rip), %rsi      # 0x772b
movl %ebp, %edi
xorl %eax, %eax
callq 0x247c
leaq 0x9bca(%rip), %rax      # 0xca40
movl (%rax), %edx
leaq 0x48d9(%rip), %rsi      # 0x7758
movl %ebp, %edi
xorl %eax, %eax
callq 0x247c
leaq 0x9bb5(%rip), %r12      # 0xca44
movl (%r12), %edx
leaq 0x48eb(%rip), %rsi      # 0x7785
movl %ebp, %edi
xorl %eax, %eax
callq 0x247c
leaq 0x4909(%rip), %rsi      # 0x77b3
leaq 0x944f(%rip), %rdx      # 0xc300
movl %ebp, %edi
xorl %eax, %eax
callq 0x247c
leaq 0x4943(%rip), %rsi      # 0x7804
leaq 0x9338(%rip), %rdx      # 0xc200
movl %ebp, %edi
xorl %eax, %eax
callq 0x247c
leaq 0x9320(%rip), %r14      # 0xc1f8
testb $0x1, (%r14)
leaq 0x49a3(%rip), %rbx      # 0x7886
leaq 0x4998(%rip), %r13      # 0x7882
movq %r13, %rdx
cmoveq %rbx, %rdx
leaq 0x494d(%rip), %rsi      # 0x7845
movl %ebp, %edi
xorl %eax, %eax
callq 0x247c
testb $0x2, (%r14)
movq %r13, %rdx
cmoveq %rbx, %rdx
leaq 0x4976(%rip), %rsi      # 0x7889
movl %ebp, %edi
xorl %eax, %eax
callq 0x247c
leaq 0x121fd(%rip), %rax     # 0x15120
movl (%rax), %edx
leaq 0x499a(%rip), %rsi      # 0x78c6
movl %ebp, %edi
xorl %eax, %eax
callq 0x247c
leaq 0x12384(%rip), %r14     # 0x152c0
cmpl $0x1, (%r14)
movq %rbx, %rdx
cmoveq %r13, %rdx
leaq 0x49bd(%rip), %rsi      # 0x790b
movl %ebp, %edi
xorl %eax, %eax
callq 0x247c
cmpl $0x1, (%r14)
jne 0x3039
cmpl $0x2, (%r12)
jl 0x3039
leaq 0x49db(%rip), %rsi      # 0x794e
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x247c
pushq $0xc
popq %rbp
leaq 0x9479(%rip), %r15      # 0xc400
leaq 0x4a0f(%rip), %r14      # 0x799d
movq 0x904b(%rip), %rax      # 0xbfe0
movq (%rax), %rsi
cmpq $0x32c, %rbp            # imm = 0x32C
je 0x2fc7
movl -0xc(%r15,%rbp), %edx
movl -0x8(%r15,%rbp), %ecx
movl -0x4(%r15,%rbp), %r8d
movl (%r15,%rbp), %r9d
movq %rsi, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x22d0
addq $0x10, %rbp
jmp 0x2f8e
pushq $0xa
popq %rdi
callq 0x2280
cmpl $0x2, (%r12)
jl 0x3039
leaq 0x49cd(%rip), %rsi      # 0x79aa
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x247c
pushq $0xc
popq %rbp
leaq 0x972f(%rip), %r15      # 0xc720
leaq 0x49a5(%rip), %r14      # 0x799d
movq 0x8fe1(%rip), %rax      # 0xbfe0
movq (%rax), %rsi
cmpq $0x32c, %rbp            # imm = 0x32C
je 0x3031
movl -0xc(%r15,%rbp), %edx
movl -0x8(%r15,%rbp), %ecx
movl -0x4(%r15,%rbp), %r8d
movl (%r15,%rbp), %r9d
movq %rsi, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x22d0
addq $0x10, %rbp
jmp 0x2ff8
pushq $0xa
popq %rdi
callq 0x2280
leaq 0x120e4(%rip), %r14     # 0x15124
cmpl $0x1, (%r14)
cmoveq %r13, %rbx
leaq 0x49a8(%rip), %rsi      # 0x79f7
pushq $0x2
popq %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x247c
cmpl $0x1, (%r14)
leaq 0x99d9(%rip), %r13      # 0xca40
jne 0x30c0
cmpl $0x2, (%r12)
jl 0x30c0
leaq 0x49c4(%rip), %rsi      # 0x7a3b
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x247c
leaq 0x120a8(%rip), %r14     # 0x15130
leaq 0x49f0(%rip), %rbx      # 0x7a7f
xorl %r15d, %r15d
movq 0x8f47(%rip), %rax      # 0xbfe0
movq (%rax), %rsi
cmpq $0x64, %r15
je 0x30b8
movl (%r14,%r15,4), %edx
movq %rsi, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x22d0
incq %r15
jmp 0x3092
pushq $0xa
popq %rdi
callq 0x2280
leaq 0x121fd(%rip), %r15     # 0x152c4
leaq 0x49e8(%rip), %r14      # 0x7ab6
cmpb $0x0, (%r15)
leaq 0x49e2(%rip), %rbx      # 0x7abb
movq %rbx, %rdx
cmovneq %r14, %rdx
leaq 0x499c(%rip), %rsi      # 0x7a83
pushq $0x2
popq %rbp
movl %ebp, %edi
xorl %eax, %eax
callq 0x247c
leaq 0x49c7(%rip), %rsi      # 0x7ac1
leaq 0x994f(%rip), %rdx      # 0xca50
movl %ebp, %edi
xorl %eax, %eax
callq 0x247c
leaq 0x9a3f(%rip), %rax      # 0xcb50
movl (%rax), %edx
leaq 0x49db(%rip), %rsi      # 0x7af5
movl %ebp, %edi
xorl %eax, %eax
callq 0x247c
leaq 0x1219b(%rip), %rax     # 0x152c5
cmpb $0x0, (%rax)
cmovneq %r14, %rbx
leaq 0x49f1(%rip), %rsi      # 0x7b29
movl %ebp, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x247c
callq 0x6446
cmpb $0x1, (%r15)
jne 0x3194
movl $0x6, 0xb96f(%rip)      # 0xeac8
leaq 0xb968(%rip), %rbx      # 0xeac8
xorl %edi, %edi
callq 0x21c0
movq %rax, 0xb962(%rip)      # 0xead0
callq 0x22f0
movl %eax, 0xb95f(%rip)      # 0xead8
movl (%r13), %eax
movl %eax, 0xb959(%rip)      # 0xeadc
pushq $0xf
popq %rcx
movq %rsp, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x6478
movl (%r13), %eax
movl %eax, 0x90(%rsp)
cltq
movq %rax, 0xa8(%rsp)
xorl %eax, %eax
leaq 0x99ce(%rip), %r13      # 0xcb80
leaq 0xb987(%rip), %rbx      # 0xeb40
leaq 0xd8c0(%rip), %r15      # 0x10a80
leaq 0xf7f9(%rip), %r14      # 0x129c0
cmpq $0x1f40, %rax           # imm = 0x1F40
je 0x31e9
andq $0x0, (%rax,%r13)
andq $0x0, (%rax,%rbx)
andq $0x0, (%rax,%r15)
andq $0x0, (%rax,%r14)
addq $0x8, %rax
jmp 0x31c7
xorl %ecx, %ecx
movl 0x90(%rsp), %eax
testl %eax, %eax
movl $0x0, %edx
cmovgl %eax, %edx
movq %rdx, 0x98(%rsp)
pushq $0x30
popq %r12
pushq $0x1
popq %rbp
cmpq %rcx, 0x98(%rsp)
je 0x3292
movq %rcx, 0x88(%rsp)
movq %rbp, %rdi
pushq $0x68
popq %rsi
callq 0x2150
movq %rax, (%r13)
testq %rax, %rax
je 0x3288
movq %rbp, %rdi
pushq $0x10
popq %rsi
callq 0x2150
movq %rax, (%rbx)
testq %rax, %rax
je 0x3288
movq %rbp, %rdi
movq %r12, %rsi
callq 0x2150
movq %rax, (%r15)
testq %rax, %rax
je 0x3288
movq %rbp, %rdi
movq %r12, %rsi
callq 0x2150
movq %rax, (%r14)
movq 0x88(%rsp), %rdx
leaq 0x1(%rdx), %rcx
addq $0x8, %r14
addq $0x8, %r15
addq $0x8, %rbx
addq $0x8, %r13
testq %rax, %rax
jne 0x320b
jmp 0x329a
movq 0x88(%rsp), %rdx
jmp 0x329a
movq 0x98(%rsp), %rdx
cmpq 0xa8(%rsp), %rdx
jge 0x32b9
leaq 0x40eb(%rip), %rsi      # 0x7396
xorl %edi, %edi
xorl %eax, %eax
callq 0x247c
jmp 0x3404
xorl %eax, %eax
leaq 0x98be(%rip), %rcx      # 0xcb80
xorps %xmm0, %xmm0
leaq 0xb874(%rip), %r12      # 0xeb40
leaq 0xd7ad(%rip), %rdi      # 0x10a80
leaq 0xf6e6(%rip), %r8       # 0x129c0
xorl %edx, %edx
leaq 0x975d(%rip), %r13      # 0xca40
leaq 0x8f0e(%rip), %rbx      # 0xc1f8
movl 0x90(%rsp), %esi
movslq %esi, %rsi
cmpq %rsi, %rdx
jge 0x334b
movq (%rax,%rcx), %rsi
movups %xmm0, 0x50(%rsi)
movups %xmm0, 0x40(%rsi)
movups %xmm0, 0x30(%rsi)
movups %xmm0, 0x20(%rsi)
movups %xmm0, 0x10(%rsi)
movups %xmm0, (%rsi)
andq $0x0, 0x60(%rsi)
movq (%rax,%r12), %rsi
movups %xmm0, (%rsi)
movq (%rax,%rdi), %rsi
movups %xmm0, 0x20(%rsi)
movups %xmm0, 0x10(%rsi)
movups %xmm0, (%rsi)
movq (%rax,%r8), %rsi
movups %xmm0, 0x20(%rsi)
movups %xmm0, 0x10(%rsi)
movups %xmm0, (%rsi)
incq %rdx
movl (%r13), %esi
addq $0x8, %rax
jmp 0x32f1
leaq 0x230(%rsp), %r14
movl $0x90, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x2110
movl $0x10000000, 0x80(%r14) # imm = 0x10000000
leaq 0x8b3(%rip), %rax       # 0x3c27
movq %rax, -0x8(%r14)
pushq $0x2
popq %rdi
leaq 0x228(%rsp), %rsi
xorl %edx, %edx
callq 0x2290
movl (%rbx), %eax
testb $0x3, %al
je 0x33ab
leaq 0x8e59(%rip), %rax      # 0xc1f0
movl (%rax), %eax
leaq 0xe0(%rsp), %rdi
movl %eax, 0x4(%rdi)
callq 0x3c2f
movl (%rbx), %eax
testb $0x2, %al
pushq $0x1
popq %r14
je 0x33cc
leaq 0x8e3a(%rip), %rax      # 0xc1f4
movl (%rax), %eax
leaq 0xd8(%rsp), %rdi
movl %eax, 0x4(%rdi)
callq 0x3c2f
callq 0x2130
testl %eax, %eax
je 0x3b3e
movl 0xe0(%rsp), %r15d
movl 0xd8(%rsp), %ebx
cmpb $0x0, 0x9781(%rip)      # 0xcb70
je 0x3511
movl %r15d, %edi
callq 0x2370
movl %ebx, %edi
callq 0x2370
xorl %ebx, %ebx
leaq 0x9773(%rip), %r14      # 0xcb80
leaq 0xb72c(%rip), %r15      # 0xeb40
leaq 0xd665(%rip), %r12      # 0x10a80
leaq 0xf59e(%rip), %r13      # 0x129c0
cmpq $0x1f40, %rbx           # imm = 0x1F40
je 0x347d
movq (%rbx,%r14), %rdi
testq %rdi, %rdi
je 0x343e
callq 0x2250
andq $0x0, (%rbx,%r14)
movq (%rbx,%r15), %rdi
testq %rdi, %rdi
je 0x3451
callq 0x2250
andq $0x0, (%rbx,%r15)
movq (%rbx,%r12), %rdi
testq %rdi, %rdi
je 0x3464
callq 0x2250
andq $0x0, (%rbx,%r12)
movq (%rbx,%r13), %rdi
testq %rdi, %rdi
je 0x3477
callq 0x2250
andq $0x0, (%rbx,%r13)
addq $0x8, %rbx
jmp 0x3422
leaq 0x11e40(%rip), %rax     # 0x152c4
cmpb $0x1, (%rax)
jne 0x34ed
movl $0x7, 0xb635(%rip)      # 0xeac8
leaq 0xb62e(%rip), %rbx      # 0xeac8
xorl %edi, %edi
callq 0x21c0
movq %rax, 0xb628(%rip)      # 0xead0
callq 0x22f0
movl %eax, 0xb625(%rip)      # 0xead8
leaq 0x9586(%rip), %rax      # 0xca40
movl (%rax), %eax
movl %eax, 0xb61a(%rip)      # 0xeadc
pushq $0xf
popq %rcx
movq %rsp, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x6478
testb %al, %al
jne 0x34e8
leaq 0x3efe(%rip), %rsi      # 0x73dc
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x247c
callq 0x64e2
leaq 0x3f0d(%rip), %rsi      # 0x7401
xorl %edi, %edi
xorl %eax, %eax
callq 0x247c
xorl %eax, %eax
addq $0x3c8, %rsp            # imm = 0x3C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl %ebx, %r15d
movl %ebx, %eax
cmovgl %r15d, %eax
incl %eax
movl %eax, 0x88(%rsp)
leaq 0x4998(%rip), %rsi      # 0x7ec2
xorl %edi, %edi
xorl %eax, %eax
callq 0x247c
pushq $0x40
popq %rsi
movl %r15d, %eax
cltd
idivl %esi
movslq %eax, %rcx
movq %rcx, 0x98(%rsp)
shll $0x6, %eax
movl %r15d, %ecx
subl %eax, %ecx
movq %r14, %rax
shlq %cl, %rax
movq %rax, 0x90(%rsp)
movl %ebx, %eax
cltd
idivl %esi
movslq %eax, %rcx
movq %rcx, 0xa8(%rsp)
shll $0x6, %eax
movl %ebx, %ecx
subl %eax, %ecx
shlq %cl, %r14
pushq $0x3
popq %rbp
movq $0x0, 0xd0(%rsp)
movl $0x0, 0x84(%rsp)
movl %ebx, 0xa4(%rsp)
cmpb $0x0, 0x95d1(%rip)      # 0xcb70
jne 0x33f5
xorl %eax, %eax
cmpq $0x10, %rax
je 0x35bb
andq $0x0, 0x1a8(%rsp,%rax,8)
incq %rax
jmp 0x35a7
cmpl $-0x1, %r15d
je 0x35d9
movq 0x98(%rsp), %rax
movq 0x90(%rsp), %rcx
orq %rcx, 0x1a8(%rsp,%rax,8)
cmpl $-0x1, %ebx
je 0x35ee
movq 0xa8(%rsp), %rax
orq %r14, 0x1a8(%rsp,%rax,8)
movq $0x1, 0xf0(%rsp)
andq $0x0, 0xf8(%rsp)
movl 0x88(%rsp), %edi
leaq 0x1a8(%rsp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
leaq 0xf0(%rsp), %r8
callq 0x21d0
movb 0x9547(%rip), %cl       # 0xcb70
cmpl $-0x1, %eax
je 0x36fa
testb $0x1, %cl
jne 0x3598
cmpl $-0x1, %r15d
je 0x3676
movq 0x98(%rsp), %rax
movq 0x90(%rsp), %rcx
testq %rcx, 0x1a8(%rsp,%rax,8)
je 0x3676
movl %ebp, %edi
leaq 0x48d5(%rip), %rsi      # 0x7f39
xorl %eax, %eax
callq 0x247c
movl %r15d, %edi
pushq $0x1
popq %rsi
callq 0x3da8
cmpl $-0x1, %ebx
je 0x36a6
movq 0xa8(%rsp), %rax
testq %r14, 0x1a8(%rsp,%rax,8)
je 0x36a6
movl %ebp, %edi
leaq 0x48dc(%rip), %rsi      # 0x7f72
xorl %eax, %eax
callq 0x247c
movl %ebx, %edi
xorl %esi, %esi
callq 0x3da8
movl 0x84(%rsp), %eax
cmpl $0x4, %eax
jl 0x372f
movl %r15d, %ebp
movq %r12, %r15
xorl %ebx, %ebx
xorl %r12d, %r12d
movslq (%r13), %rax
cmpq %rax, %r12
jge 0x373a
leaq 0xf2f3(%rip), %rax      # 0x129c0
movq (%rbx,%rax), %rsi
pushq $0x1
popq %rdi
movl %r12d, %edx
callq 0x4f04
leaq 0xd39d(%rip), %rax      # 0x10a80
movq (%rbx,%rax), %rsi
xorl %edi, %edi
movl %r12d, %edx
callq 0x4f04
incq %r12
addq $0x8, %rbx
jmp 0x36bd
testb $0x1, %cl
jne 0x3598
callq 0x2030
movl (%rax), %ebp
movl %ebp, %edi
callq 0x20a0
pushq $0x2
popq %rdi
leaq 0x47ea(%rip), %rsi      # 0x7f05
movl %ebp, %edx
pushq $0x3
popq %rbp
movq %rax, %rcx
xorl %eax, %eax
callq 0x247c
jmp 0x3598
incl %eax
movl %eax, 0x84(%rsp)
jmp 0x3752
movl $0x0, 0x84(%rsp)
movq %r15, %r12
movl 0xa4(%rsp), %ebx
movl %ebp, %r15d
movq 0xd0(%rsp), %rbp
cmpl $0x59, %ebp
movq %r14, 0xe8(%rsp)
jge 0x3ac8
incl %ebp
movq %rbp, 0xd0(%rsp)
xorl %r14d, %r14d
movl %r15d, 0xc0(%rsp)
movslq (%r13), %rax
cmpq %rax, %r14
jge 0x3ab3
movq (%r12,%r14,8), %rax
cmpq $0x0, (%rax)
je 0x3866
movl 0x8(%rax), %edi
leaq 0xc4(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x2180
testl %eax, %eax
jle 0x3866
movl %eax, %ebp
movq %r13, %rbx
movzbl 0xc5(%rsp), %r13d
pushq $0x3
popq %rdi
leaq 0x56a4(%rip), %rsi      # 0x8e72
movl %r13d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0x247c
movl (%rbx), %eax
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
movq %r12, %r15
movq %r12, %rbx
xorl %r12d, %r12d
cmpq %r12, %rax
je 0x3805
movq (%rbx), %rcx
cmpl %ebp, 0x8(%rcx)
je 0x381a
incq %r12
addq $0x8, %rbx
jmp 0x37ef
pushq $0x2
popq %rdi
leaq 0x5823(%rip), %rsi      # 0x9032
movl %ebp, %edx
xorl %eax, %eax
callq 0x247c
jmp 0x383c
movq (%rcx), %r8
pushq $0x3
popq %rdi
leaq 0x57c7(%rip), %rsi      # 0x8fee
movl %r12d, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x247c
cmpq $0xf423f, %r12          # imm = 0xF423F
jne 0x386e
pushq $0x2
popq %rdi
leaq 0x5778(%rip), %rsi      # 0x8fbe
xorl %eax, %eax
callq 0x247c
movq %r15, %r12
leaq 0x91e9(%rip), %r13      # 0xca40
movl 0xa4(%rsp), %ebx
movl 0xc0(%rsp), %r15d
incq %r14
jmp 0x3780
movq (%rbx), %rax
movq (%rax), %rbx
movq %rbx, %rdi
callq 0x4e3c
movq %rbx, 0xb0(%rsp)
movq %rbx, %rdi
movl %eax, %ebx
callq 0x4ea0
movl %eax, %edx
movl $0xf423f, %ecx          # imm = 0xF423F
cmpl %ecx, %ebx
sete %al
cmpl %ecx, %edx
sete %cl
orb %al, %cl
movq %r15, %r12
jne 0x38e2
movl %edx, 0xa0(%rsp)
movl %ebx, 0xbc(%rsp)
leaq 0x9185(%rip), %rax      # 0xca40
movl (%rax), %eax
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
movq %r12, %rbx
xorl %edx, %edx
cmpq %rdx, %rax
je 0x38fa
movq (%rbx), %rcx
cmpl %ebp, 0x8(%rcx)
je 0x3910
incq %rdx
addq $0x8, %rbx
jmp 0x38cc
pushq $0x2
popq %rdi
leaq 0x5689(%rip), %rsi      # 0x8f75
movl %ebx, %ecx
xorl %eax, %eax
callq 0x247c
jmp 0x3850
pushq $0x2
popq %rdi
leaq 0x57ae(%rip), %rsi      # 0x90b2
xorl %eax, %eax
callq 0x247c
pushq $0x3
popq %rdi
jmp 0x3931
pushq $0x3
popq %rdi
leaq 0x5759(%rip), %rsi      # 0x9073
movl %ebp, %ecx
xorl %eax, %eax
callq 0x247c
pushq $0x3
popq %rdi
movq (%rbx), %rax
andq $0x0, (%rax)
andl $0x0, 0x8(%rax)
leaq 0x556f(%rip), %rsi      # 0x8ea7
movq 0xb0(%rsp), %rdx
movl 0xbc(%rsp), %ebx
movl %ebx, %ecx
movl 0xa0(%rsp), %ebp
movl %ebp, %r8d
xorl %eax, %eax
callq 0x247c
movl %ebp, %ecx
leaq 0x11961(%rip), %rax     # 0x152c4
cmpb $0x1, (%rax)
movslq %ebx, %rbp
movslq %ecx, %rax
movq %rax, 0xc8(%rsp)
jne 0x3a56
xorl %edi, %edi
callq 0x21c0
movq %rax, %r12
callq 0x22f0
movq 0xb0(%rsp), %rsi
movq %rsi, %rcx
shrq $0x3f, %rcx
pushq $0x2
popq %rdx
subl %ecx, %edx
leaq 0xd0dc(%rip), %rcx      # 0x10a80
movq (%rcx,%rbp,8), %rcx
movups 0x18(%rcx), %xmm0
movaps %xmm0, 0x190(%rsp)
leaq 0xf005(%rip), %rcx      # 0x129c0
movq 0xc8(%rsp), %rdi
movq (%rcx,%rdi,8), %rcx
movups 0x18(%rcx), %xmm1
movaps %xmm1, 0x100(%rsp)
movl $0x5, 0x118(%rsp)
movq %r12, 0x120(%rsp)
movl %eax, 0x128(%rsp)
movl %ebx, 0x12c(%rsp)
movl 0xa0(%rsp), %eax
movl %eax, 0x130(%rsp)
movq %rsi, 0x134(%rsp)
movl %edx, 0x13c(%rsp)
leaq 0x140(%rsp), %rax
movups %xmm0, (%rax)
movaps 0x100(%rsp), %xmm0
movups %xmm0, 0x10(%rax)
pushq $0xf
popq %rcx
movq %rsp, %rdi
leaq 0x118(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x6478
testb %al, %al
jne 0x3a53
pushq $0x1
popq %rdi
leaq 0x54a1(%rip), %rsi      # 0x8eed
xorl %eax, %eax
callq 0x247c
movq %r15, %r12
decl %r13d
cmpl $0x4, %r13d
ja 0x3850
leaq 0xd016(%rip), %rax      # 0x10a80
movq (%rax,%rbp,8), %rax
movl (%rax), %edx
leaq 0xef49(%rip), %rax      # 0x129c0
movq 0xc8(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl (%rax), %ecx
pushq $0x1
popq %rdi
leaq 0x549b(%rip), %rsi      # 0x8f2a
xorl %eax, %eax
callq 0x247c
movq 0xb0(%rsp), %rbx
movq %rbx, %rdi
callq 0x50ef
movq %rbx, %rdi
callq 0x508c
jmp 0x3850
callq 0x64e2
movq 0xe8(%rsp), %r14
pushq $0x3
popq %rbp
jmp 0x3598
xorl %ebp, %ebp
leaq 0x117f3(%rip), %rax     # 0x152c4
cmpb $0x1, (%rax)
jne 0x376d
movl $0x8, 0xafe4(%rip)      # 0xeac8
xorl %ebp, %ebp
xorl %edi, %edi
callq 0x21c0
movq %rax, 0xafdc(%rip)      # 0xead0
callq 0x22f0
movl %eax, 0xafd9(%rip)      # 0xead8
movl (%r13), %eax
movl %eax, 0xafd3(%rip)      # 0xeadc
pushq $0xf
popq %rcx
movq %rsp, %rdi
leaq 0xafb2(%rip), %rsi      # 0xeac8
rep  movsq (%rsi), %es:(%rdi)
callq 0x6478
testb %al, %al
jne 0x376d
xorl %ebp, %ebp
pushq $0x1
popq %rdi
leaq 0x4479(%rip), %rsi      # 0x7fab
xorl %eax, %eax
callq 0x247c
jmp 0x376d
leaq 0x86bb(%rip), %r15      # 0xc200
movq %r15, %rdi
callq 0x2190
movq %rax, %r14
leaq 0x41cc(%rip), %rsi      # 0x7d23
pushq $0x1
popq %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x247c
testq %r14, %r14
je 0x3bc9
movl 0x14(%r14), %edi
callq 0x2330
testl %eax, %eax
je 0x3b84
leaq 0x41b7(%rip), %rdi      # 0x7d34
xorl %eax, %eax
callq 0x25b4
movl 0x10(%r14), %edi
callq 0x2360
testl %eax, %eax
je 0x3b9f
leaq 0x41c3(%rip), %rdi      # 0x7d5b
xorl %eax, %eax
callq 0x25b4
callq 0x2130
testl %eax, %eax
pushq $0x1
popq %r14
je 0x3be7
leaq 0x425c(%rip), %rsi      # 0x7e0f
leaq 0x8646(%rip), %rdx      # 0xc200
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x247c
jmp 0x33d9
leaq 0x428e(%rip), %rdi      # 0x7e5e
leaq 0x85f9(%rip), %rsi      # 0xc1d0
xorl %eax, %eax
callq 0x25b4
pushq $0x1
popq %r14
jmp 0x33d9
leaq 0x4194(%rip), %rdi      # 0x7d82
leaq 0x860b(%rip), %rsi      # 0xc200
callq 0x22b0
testl %eax, %eax
je 0x3c11
leaq 0x41d8(%rip), %rdi      # 0x7ddd
xorl %eax, %eax
callq 0x25b4
jmp 0x33d9
leaq 0x416f(%rip), %rsi      # 0x7d87
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x247c
jmp 0x33d9