// File: /workspace/github_cpp_makefile_star2_O1/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 $0x3a8, %rsp            # imm = 0x3A8
orq $-0x1, 0x90(%rsp)
orq $-0x1, 0x88(%rsp)
movq %rsi, %rbx
andq $0x0, 0xc5dc(%rip)      # 0xeac0
movl %edi, %ebp
movb $0x0, 0xa683(%rip)      # 0xcb70
movq 0x9aec(%rip), %r15      # 0xbfe0
movq (%r15), %rdi
leaq 0x4e3d(%rip), %rsi      # 0x733b
leaq 0x4e5a(%rip), %rdx      # 0x735f
xorl %eax, %eax
callq 0x22c0
cmpl $0x2, %ebp
jl 0x2517
movq 0x8(%rbx), %rsi
jmp 0x251e
leaq 0x9cb2(%rip), %rsi      # 0xc1d0
leaq 0x210(%rsp), %rbx
movl $0xfa, %edx
movq %rbx, %rdi
callq 0x5844
movq %rbx, %rdi
callq 0x6410
testb %al, %al
jne 0x2558
leaq 0x4e1e(%rip), %rsi      # 0x7364
pushq $0x1
popq %rdi
leaq 0x210(%rsp), %rdx
xorl %eax, %eax
callq 0x355c
leaq 0x9c91(%rip), %rax      # 0xc1f0
movl (%rax), %edx
leaq 0x5196(%rip), %rsi      # 0x76fe
pushq $0x2
popq %rbp
movl %ebp, %edi
xorl %eax, %eax
callq 0x355c
leaq 0x9c79(%rip), %rax      # 0xc1f4
movl (%rax), %edx
leaq 0x51a7(%rip), %rsi      # 0x772b
movl %ebp, %edi
xorl %eax, %eax
callq 0x355c
leaq 0xa4ac(%rip), %r12      # 0xca40
movl (%r12), %edx
leaq 0x51b9(%rip), %rsi      # 0x7758
movl %ebp, %edi
xorl %eax, %eax
callq 0x355c
leaq 0xa495(%rip), %rax      # 0xca44
movl (%rax), %edx
leaq 0x51cd(%rip), %rsi      # 0x7785
movl %ebp, %edi
xorl %eax, %eax
callq 0x355c
leaq 0x51eb(%rip), %rsi      # 0x77b3
leaq 0x9d31(%rip), %rdx      # 0xc300
movl %ebp, %edi
xorl %eax, %eax
callq 0x355c
leaq 0x5225(%rip), %rsi      # 0x7804
leaq 0x9c1a(%rip), %rdx      # 0xc200
movl %ebp, %edi
xorl %eax, %eax
callq 0x355c
leaq 0x9c02(%rip), %r14      # 0xc1f8
testb $0x1, (%r14)
leaq 0x5285(%rip), %rbx      # 0x7886
leaq 0x527a(%rip), %r13      # 0x7882
movq %r13, %rdx
cmoveq %rbx, %rdx
leaq 0x522f(%rip), %rsi      # 0x7845
movl %ebp, %edi
xorl %eax, %eax
callq 0x355c
testb $0x2, (%r14)
movq %r13, %rdx
cmoveq %rbx, %rdx
leaq 0x5258(%rip), %rsi      # 0x7889
movl %ebp, %edi
xorl %eax, %eax
callq 0x355c
leaq 0x12adf(%rip), %rax     # 0x15120
movl (%rax), %edx
leaq 0x527c(%rip), %rsi      # 0x78c6
movl %ebp, %edi
xorl %eax, %eax
callq 0x355c
leaq 0x12c66(%rip), %r14     # 0x152c0
cmpl $0x1, (%r14)
movq %rbx, %rdx
cmoveq %r13, %rdx
leaq 0x529f(%rip), %rsi      # 0x790b
movl %ebp, %edi
xorl %eax, %eax
callq 0x355c
cmpl $0x1, (%r14)
jne 0x2759
leaq 0xa3be(%rip), %rax      # 0xca44
cmpl $0x2, (%rax)
jl 0x26ec
leaq 0x52bc(%rip), %rsi      # 0x794e
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x355c
pushq $0xc
popq %rbp
leaq 0x9d5a(%rip), %r12      # 0xc400
leaq 0x52f0(%rip), %r14      # 0x799d
movq (%r15), %rdi
movl -0xc(%r12,%rbp), %edx
movl -0x8(%r12,%rbp), %ecx
movl -0x4(%r12,%rbp), %r8d
movl (%r12,%rbp), %r9d
movq %r14, %rsi
xorl %eax, %eax
callq 0x22c0
addq $0x10, %rbp
cmpq $0x32c, %rbp            # imm = 0x32C
jne 0x26ad
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x2270
leaq 0xa354(%rip), %r12      # 0xca40
leaq 0xa351(%rip), %rax      # 0xca44
cmpl $0x2, (%rax)
jl 0x2759
pushq $0xc
popq %rbp
leaq 0x52a8(%rip), %rsi      # 0x79aa
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x355c
leaq 0xa00d(%rip), %r12      # 0xc720
leaq 0x5283(%rip), %r14      # 0x799d
movq (%r15), %rdi
movl -0xc(%r12,%rbp), %edx
movl -0x8(%r12,%rbp), %ecx
movl -0x4(%r12,%rbp), %r8d
movl (%r12,%rbp), %r9d
movq %r14, %rsi
xorl %eax, %eax
callq 0x22c0
addq $0x10, %rbp
cmpq $0x32c, %rbp            # imm = 0x32C
jne 0x271a
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x2270
leaq 0xa2e7(%rip), %r12      # 0xca40
leaq 0x129c4(%rip), %r14     # 0x15124
cmpl $0x1, (%r14)
cmoveq %r13, %rbx
leaq 0x5288(%rip), %rsi      # 0x79f7
pushq $0x2
popq %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x355c
cmpl $0x1, (%r14)
jne 0x27dc
leaq 0xa2bb(%rip), %rax      # 0xca44
cmpl $0x2, (%rax)
jl 0x27dc
leaq 0x52a6(%rip), %rsi      # 0x7a3b
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x355c
leaq 0x1298a(%rip), %r14     # 0x15130
leaq 0x52d2(%rip), %rbx      # 0x7a7f
xorl %r12d, %r12d
movq (%r15), %rdi
movl (%r14,%r12,4), %edx
movq %rbx, %rsi
xorl %eax, %eax
callq 0x22c0
incq %r12
cmpq $0x64, %r12
jne 0x27b0
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x2270
leaq 0xa264(%rip), %r12      # 0xca40
leaq 0x12ae1(%rip), %r15     # 0x152c4
leaq 0x52cc(%rip), %r14      # 0x7ab6
cmpb $0x0, (%r15)
leaq 0x52c6(%rip), %rbx      # 0x7abb
movq %rbx, %rdx
cmovneq %r14, %rdx
leaq 0x5280(%rip), %rsi      # 0x7a83
pushq $0x2
popq %rbp
movl %ebp, %edi
xorl %eax, %eax
callq 0x355c
leaq 0x52ab(%rip), %rsi      # 0x7ac1
leaq 0xa233(%rip), %rdx      # 0xca50
movl %ebp, %edi
xorl %eax, %eax
callq 0x355c
leaq 0xa323(%rip), %rax      # 0xcb50
movl (%rax), %edx
leaq 0x52bf(%rip), %rsi      # 0x7af5
movl %ebp, %edi
xorl %eax, %eax
callq 0x355c
leaq 0x12a7f(%rip), %rax     # 0x152c5
cmpb $0x0, (%rax)
cmovneq %r14, %rbx
leaq 0x52d5(%rip), %rsi      # 0x7b29
movl %ebp, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x355c
callq 0x6819
cmpb $0x1, (%r15)
jne 0x28b0
movl $0x6, 0xc253(%rip)      # 0xeac8
leaq 0xc24c(%rip), %rbx      # 0xeac8
xorl %edi, %edi
callq 0x21c0
movq %rax, 0xc246(%rip)      # 0xead0
callq 0x22e0
movl %eax, 0xc243(%rip)      # 0xead8
movl (%r12), %eax
movl %eax, 0xc23d(%rip)      # 0xeadc
pushq $0xf
popq %rcx
movq %rsp, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x6849
movslq (%r12), %r14
leaq 0xa2c5(%rip), %rdi      # 0xcb80
movl $0x1f40, %edx           # imm = 0x1F40
xorl %esi, %esi
callq 0x2110
leaq 0xc272(%rip), %rdi      # 0xeb40
movl $0x1f40, %edx           # imm = 0x1F40
xorl %esi, %esi
callq 0x2110
leaq 0xe19f(%rip), %rdi      # 0x10a80
movl $0x1f40, %edx           # imm = 0x1F40
xorl %esi, %esi
callq 0x2110
leaq 0x100cc(%rip), %rdi     # 0x129c0
movl $0x1f40, %edx           # imm = 0x1F40
xorl %esi, %esi
callq 0x2110
testq %r14, %r14
setle %bpl
jle 0x29d5
pushq $0x1
popq %rdi
pushq $0x68
popq %rsi
callq 0x2150
movq %rax, 0xa261(%rip)      # 0xcb80
testq %rax, %rax
je 0x29d3
pushq $0x1
popq %r12
pushq $0x10
popq %rsi
movq %r12, %rdi
callq 0x2150
movq %rax, 0xc202(%rip)      # 0xeb40
testq %rax, %rax
je 0x29d3
xorl %r13d, %r13d
pushq $0x30
popq %r15
movq %r12, %rbx
xorl %ebp, %ebp
movq %r12, %rdi
movq %r15, %rsi
callq 0x2150
leaq 0xe11b(%rip), %rcx      # 0x10a80
movq %rax, (%r13,%rcx)
testq %rax, %rax
je 0x29d5
movq %r12, %rdi
movq %r15, %rsi
callq 0x2150
leaq 0x1003f(%rip), %rcx     # 0x129c0
movq %rax, (%r13,%rcx)
testq %rax, %rax
je 0x29d5
cmpq %r14, %rbx
setae %bpl
je 0x29d5
movq %r12, %rdi
pushq $0x68
popq %rsi
callq 0x2150
leaq 0xa1da(%rip), %rcx      # 0xcb80
movq %rax, (%rcx,%rbx,8)
testq %rax, %rax
je 0x29d5
movq %r12, %rdi
pushq $0x10
popq %rsi
callq 0x2150
leaq 0xc17f(%rip), %rcx      # 0xeb40
movq %rax, (%rcx,%rbx,8)
incq %rbx
addq $0x8, %r13
testq %rax, %rax
jne 0x2953
jmp 0x29d5
xorl %ebp, %ebp
testb $0x1, %bpl
je 0x2a69
testl %r14d, %r14d
leaq 0xa057(%rip), %r12      # 0xca40
leaq 0xa190(%rip), %r14      # 0xcb80
leaq 0xe089(%rip), %r15      # 0x10a80
leaq 0xffc2(%rip), %r13      # 0x129c0
jle 0x2a95
xorl %eax, %eax
xorps %xmm0, %xmm0
leaq 0xc130(%rip), %rcx      # 0xeb40
xorl %edx, %edx
movq (%rax,%r14), %rsi
movups %xmm0, 0x50(%rsi)
movups %xmm0, 0x40(%rsi)
movups %xmm0, 0x30(%rsi)
movups %xmm0, 0x20(%rsi)
andq $0x0, 0x60(%rsi)
movups %xmm0, 0x10(%rsi)
movups %xmm0, (%rsi)
movq (%rax,%rcx), %rsi
movups %xmm0, (%rsi)
movq (%rax,%r15), %rsi
movups %xmm0, 0x20(%rsi)
movups %xmm0, 0x10(%rsi)
movups %xmm0, (%rsi)
movq (%rax,%r13), %rsi
movups %xmm0, 0x20(%rsi)
movups %xmm0, 0x10(%rsi)
movups %xmm0, (%rsi)
incq %rdx
movslq (%r12), %rsi
addq $0x8, %rax
cmpq %rsi, %rdx
jl 0x2a12
jmp 0x2a95
leaq 0x4926(%rip), %rsi      # 0x7396
xorl %edi, %edi
xorl %eax, %eax
callq 0x355c
leaq 0x9fc0(%rip), %r12      # 0xca40
leaq 0xa0f9(%rip), %r14      # 0xcb80
leaq 0xdff2(%rip), %r15      # 0x10a80
leaq 0xff2b(%rip), %r13      # 0x129c0
testb $0x1, %bpl
leaq 0xc0a0(%rip), %rbp      # 0xeb40
je 0x2c2f
leaq 0x310(%rsp), %rbx
movl $0x98, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2110
movl $0x10000000, 0x88(%rbx) # imm = 0x10000000
leaq 0x1320(%rip), %rax      # 0x3dee
movq %rax, (%rbx)
pushq $0x2
popq %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x2280
leaq 0x9713(%rip), %rbx      # 0xc1f8
testb $0x3, (%rbx)
je 0x2b03
leaq 0x96ff(%rip), %rax      # 0xc1f0
movl (%rax), %eax
leaq 0x90(%rsp), %rdi
movl %eax, 0x4(%rdi)
callq 0x3df6
testb $0x2, (%rbx)
je 0x2b21
leaq 0x96e5(%rip), %rax      # 0xc1f4
movl (%rax), %eax
leaq 0x88(%rsp), %rdi
movl %eax, 0x4(%rdi)
callq 0x3df6
callq 0x2130
testl %eax, %eax
jne 0x2bd3
leaq 0x96cb(%rip), %r15      # 0xc200
movq %r15, %rdi
callq 0x2190
movq %rax, %rbx
leaq 0x51dc(%rip), %rsi      # 0x7d23
pushq $0x1
popq %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x355c
testq %rbx, %rbx
je 0x3367
movl 0x14(%rbx), %edi
callq 0x2320
testl %eax, %eax
jne 0x3388
movl 0x10(%rbx), %edi
callq 0x2350
testl %eax, %eax
leaq 0xdf02(%rip), %r15      # 0x10a80
jne 0x339b
callq 0x2130
testl %eax, %eax
je 0x2ba7
leaq 0x527b(%rip), %rsi      # 0x7e0f
leaq 0x9665(%rip), %rdx      # 0xc200
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x355c
jmp 0x2bd3
leaq 0x51d4(%rip), %rdi      # 0x7d82
leaq 0x964b(%rip), %rsi      # 0xc200
callq 0x22a0
testl %eax, %eax
jne 0x33ae
leaq 0x51be(%rip), %rsi      # 0x7d87
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x355c
cmpb $0x0, 0x9f96(%rip)      # 0xcb70
jne 0x2c17
movl 0x90(%rsp), %ebx
movl 0x88(%rsp), %eax
cmpl %eax, %ebx
movl %eax, 0x78(%rsp)
cmovgl %ebx, %eax
movl %eax, 0x84(%rsp)
leaq 0x52c1(%rip), %rsi      # 0x7ec2
xorl %edi, %edi
xorl %eax, %eax
callq 0x355c
cmpb $0x0, 0x9f5f(%rip)      # 0xcb70
je 0x2d19
movl 0x90(%rsp), %edi
callq 0x2360
movl 0x88(%rsp), %edi
callq 0x2360
xorl %ebx, %ebx
movq (%rbx,%r14), %rdi
testq %rdi, %rdi
je 0x2c44
callq 0x2240
andq $0x0, (%rbx,%r14)
movq (%rbx,%rbp), %rdi
testq %rdi, %rdi
je 0x2c57
callq 0x2240
andq $0x0, (%rbx,%rbp)
movq (%rbx,%r15), %rdi
testq %rdi, %rdi
je 0x2c6a
callq 0x2240
andq $0x0, (%rbx,%r15)
movq (%rbx,%r13), %rdi
testq %rdi, %rdi
je 0x2c7d
callq 0x2240
andq $0x0, (%rbx,%r13)
addq $0x8, %rbx
cmpq $0x1f40, %rbx           # imm = 0x1F40
jne 0x2c31
leaq 0x12633(%rip), %rax     # 0x152c4
cmpb $0x1, (%rax)
jne 0x2cf5
movl $0x7, 0xbe28(%rip)      # 0xeac8
leaq 0xbe21(%rip), %rbx      # 0xeac8
xorl %edi, %edi
callq 0x21c0
movq %rax, 0xbe1b(%rip)      # 0xead0
callq 0x22e0
movl %eax, 0xbe18(%rip)      # 0xead8
movl (%r12), %eax
movl %eax, 0xbe12(%rip)      # 0xeadc
pushq $0xf
popq %rcx
movq %rsp, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x6849
testb %al, %al
jne 0x2cf0
leaq 0x46f6(%rip), %rsi      # 0x73dc
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x355c
callq 0x68b5
leaq 0x4705(%rip), %rsi      # 0x7401
xorl %edi, %edi
xorl %eax, %eax
callq 0x355c
xorl %eax, %eax
addq $0x3a8, %rsp            # imm = 0x3A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %rdi
pushq $0x40
popq %rsi
movl %ebx, %eax
cltd
idivl %esi
movslq %eax, %rcx
movq %rcx, 0xb8(%rsp)
shll $0x6, %eax
movl %ebx, %ecx
subl %eax, %ecx
movq %rdi, %rax
shlq %cl, %rax
movq %rax, 0xb0(%rsp)
movl 0x78(%rsp), %ecx
movl %ecx, %eax
cltd
idivl %esi
movslq %eax, %rdx
movq %rdx, 0xa8(%rsp)
shll $0x6, %eax
subl %eax, %ecx
shlq %cl, %rdi
movq %rdi, 0xc0(%rsp)
incl 0x84(%rsp)
movl $0x0, 0x80(%rsp)
movq $0x0, 0xa0(%rsp)
movl %ebx, 0x7c(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x170(%rsp)
movaps %xmm0, 0x160(%rsp)
movaps %xmm0, 0x150(%rsp)
movaps %xmm0, 0x140(%rsp)
movaps %xmm0, 0x130(%rsp)
movaps %xmm0, 0x120(%rsp)
movaps %xmm0, 0x110(%rsp)
movaps %xmm0, 0x100(%rsp)
cmpl $-0x1, %ebx
je 0x2dea
movq 0xb8(%rsp), %rax
movq 0xb0(%rsp), %rcx
orq %rcx, 0x100(%rsp,%rax,8)
cmpl $-0x1, 0x78(%rsp)
je 0x2e09
movq 0xc0(%rsp), %rax
movq 0xa8(%rsp), %rcx
orq %rax, 0x100(%rsp,%rcx,8)
movq $0x1, 0xe0(%rsp)
andq $0x0, 0xe8(%rsp)
movl 0x84(%rsp), %edi
leaq 0x100(%rsp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
leaq 0xe0(%rsp), %r8
callq 0x21d0
movb 0x9d2c(%rip), %cl       # 0xcb70
cmpl $-0x1, %eax
je 0x2ee1
testb $0x1, %cl
jne 0x32d1
cmpl $-0x1, %ebx
pushq $0x1
popq %r14
je 0x2e94
movq 0xb8(%rsp), %rax
movq 0xb0(%rsp), %rcx
testq %rcx, 0x100(%rsp,%rax,8)
je 0x2e94
pushq $0x3
popq %rdi
leaq 0x50b6(%rip), %rsi      # 0x7f39
xorl %eax, %eax
callq 0x355c
movl %ebx, %edi
movl %r14d, %esi
callq 0x3f15
cmpl $-0x1, 0x78(%rsp)
je 0x2ed1
movq 0xc0(%rsp), %rax
movq 0xa8(%rsp), %rcx
testq %rax, 0x100(%rsp,%rcx,8)
je 0x2ed1
pushq $0x3
popq %rdi
leaq 0x50b3(%rip), %rsi      # 0x7f72
xorl %eax, %eax
callq 0x355c
movl 0x78(%rsp), %edi
xorl %esi, %esi
callq 0x3f15
movl 0x80(%rsp), %ebp
cmpl $0x4, %ebp
jge 0x2f17
incl %ebp
jmp 0x2f5b
testb $0x1, %cl
jne 0x32d1
callq 0x2030
movl (%rax), %ebx
movl %ebx, %edi
callq 0x20a0
pushq $0x2
popq %rdi
leaq 0x5003(%rip), %rsi      # 0x7f05
movl %ebx, %edx
movl 0x7c(%rsp), %ebx
movq %rax, %rcx
xorl %eax, %eax
callq 0x355c
jmp 0x32d1
cmpl $0x0, (%r12)
jle 0x2f59
xorl %r14d, %r14d
xorl %ebx, %ebx
leaq 0x9b16(%rip), %r12      # 0xca40
movq (%r14,%r13), %rsi
pushq $0x1
popq %rdi
movl %ebx, %edx
callq 0x5168
movq (%r14,%r15), %rsi
xorl %ebp, %ebp
xorl %edi, %edi
movl %ebx, %edx
callq 0x5168
incq %rbx
movslq (%r12), %rax
addq $0x8, %r14
cmpq %rax, %rbx
jl 0x2f2a
jmp 0x2f5b
xorl %ebp, %ebp
movl %ebp, 0x80(%rsp)
movq 0xa0(%rsp), %rbx
cmpl $0x59, %ebx
jge 0x32e3
incl %ebx
leaq 0x9ac4(%rip), %r12      # 0xca40
leaq 0xbbbd(%rip), %rbp      # 0xeb40
movq %rbx, 0xa0(%rsp)
cmpl $0x0, (%r12)
jle 0x32c1
xorl %r14d, %r14d
movq (%rbp,%r14,8), %rax
cmpq $0x0, (%rax)
je 0x3104
movl 0x8(%rax), %edi
leaq 0x9c(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x2180
testl %eax, %eax
jle 0x3104
movl %eax, %ebx
movzbl 0x9d(%rsp), %r13d
pushq $0x3
popq %rdi
leaq 0x5e9a(%rip), %rsi      # 0x8e72
movl %r13d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0x355c
movslq (%r12), %rax
testq %rax, %rax
jle 0x3007
movq %rbp, %rcx
xorl %r15d, %r15d
movq (%rcx), %rdx
cmpl %ebx, 0x8(%rdx)
je 0x3022
incq %r15
addq $0x8, %rcx
cmpq %r15, %rax
jne 0x2ff3
pushq $0x2
popq %rdi
leaq 0x6021(%rip), %rsi      # 0x9032
movl %ebx, %edx
xorl %eax, %eax
callq 0x355c
movl $0xf423f, %r15d         # imm = 0xF423F
jmp 0x303b
movq (%rdx), %r8
pushq $0x3
popq %rdi
leaq 0x5fbf(%rip), %rsi      # 0x8fee
movl %r15d, %edx
movl %ebx, %ecx
xorl %eax, %eax
callq 0x355c
cmpl $0xf423f, %r15d         # imm = 0xF423F
jne 0x305a
pushq $0x2
popq %rdi
leaq 0x5f70(%rip), %rsi      # 0x8fbe
xorl %eax, %eax
callq 0x355c
jmp 0x30f6
movl %r13d, 0x98(%rsp)
movslq %r15d, %rax
movq (%rbp,%rax,8), %rax
movq (%rax), %r13
movq %r13, %rdi
callq 0x509a
movl %eax, %r15d
movq %r13, %rdi
callq 0x5101
movl %eax, %r12d
movl $0xf423f, %ecx          # imm = 0xF423F
cmpl %ecx, %r15d
sete %al
cmpl %ecx, %r12d
sete %cl
orb %al, %cl
jne 0x30d8
leaq 0x99a1(%rip), %rax      # 0xca40
movslq (%rax), %rax
testq %rax, %rax
jle 0x30c5
leaq 0xba92(%rip), %rbp      # 0xeb40
xorl %edx, %edx
movq (%rbp), %rcx
cmpl %ebx, 0x8(%rcx)
je 0x3119
incq %rdx
addq $0x8, %rbp
cmpq %rdx, %rax
jne 0x30b0
pushq $0x2
popq %rdi
leaq 0x5fe3(%rip), %rsi      # 0x90b2
xorl %eax, %eax
callq 0x355c
jmp 0x3138
pushq $0x2
popq %rdi
leaq 0x5e93(%rip), %rsi      # 0x8f75
movl %r12d, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x355c
leaq 0x994a(%rip), %r12      # 0xca40
leaq 0xd983(%rip), %r15      # 0x10a80
leaq 0xf8bc(%rip), %r13      # 0x129c0
incq %r14
movslq (%r12), %rax
cmpq %rax, %r14
jl 0x2f99
jmp 0x32c1
pushq $0x3
popq %rdi
leaq 0x5f50(%rip), %rsi      # 0x9073
movl %ebx, %ecx
xorl %eax, %eax
callq 0x355c
movq (%rbp), %rax
andq $0x0, (%rax)
andl $0x0, 0x8(%rax)
pushq $0x3
popq %rdi
leaq 0x5d65(%rip), %rsi      # 0x8ea7
movq %r13, %rdx
movl %r15d, %ecx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x355c
leaq 0x1216b(%rip), %rax     # 0x152c4
cmpb $0x1, (%rax)
movslq %r15d, %rbx
movslq %r12d, %rcx
leaq 0xb9d7(%rip), %rbp      # 0xeb40
jne 0x3268
xorl %edi, %edi
movq %rcx, 0xc8(%rsp)
callq 0x21c0
movq %rax, 0xd0(%rsp)
callq 0x22e0
movq %r13, %rcx
shrq $0x3f, %rcx
pushq $0x2
popq %rdx
subl %ecx, %edx
leaq 0xd8e2(%rip), %rcx      # 0x10a80
movq %rbx, 0xd8(%rsp)
movq (%rcx,%rbx,8), %rcx
movups 0x18(%rcx), %xmm0
movaps %xmm0, 0x200(%rsp)
leaq 0xf803(%rip), %rcx      # 0x129c0
movq 0xc8(%rsp), %rsi
movq (%rcx,%rsi,8), %rcx
movups 0x18(%rcx), %xmm1
movaps %xmm1, 0xf0(%rsp)
movl $0x5, 0x188(%rsp)
movq 0xd0(%rsp), %rcx
movq %rcx, 0x190(%rsp)
movl %eax, 0x198(%rsp)
movl %r15d, 0x19c(%rsp)
movl %r12d, 0x1a0(%rsp)
movq %r13, 0x1a4(%rsp)
movl %edx, 0x1ac(%rsp)
leaq 0x1b0(%rsp), %rax
movups %xmm0, (%rax)
movaps 0xf0(%rsp), %xmm0
movups %xmm0, 0x10(%rax)
pushq $0xf
popq %rcx
movq %rsp, %rdi
leaq 0x188(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x6849
testb %al, %al
jne 0x3258
pushq $0x1
popq %rdi
leaq 0x5c9c(%rip), %rsi      # 0x8eed
xorl %eax, %eax
callq 0x355c
movq 0xc8(%rsp), %rcx
movq 0xd8(%rsp), %rbx
movl 0x98(%rsp), %eax
decl %eax
cmpl $0x4, %eax
leaq 0x97c5(%rip), %r12      # 0xca40
leaq 0xd7fe(%rip), %r15      # 0x10a80
ja 0x30fd
movq (%r15,%rbx,8), %rax
movl (%rax), %edx
leaq 0xf72b(%rip), %rax      # 0x129c0
movq (%rax,%rcx,8), %rax
movl (%rax), %ecx
pushq $0x1
popq %rdi
leaq 0x5c85(%rip), %rsi      # 0x8f2a
xorl %eax, %eax
callq 0x355c
movq %r13, %rdi
callq 0x536a
movq %r13, %rdi
callq 0x5301
jmp 0x30fd
callq 0x68b5
leaq 0x98b3(%rip), %r14      # 0xcb80
movl 0x7c(%rsp), %ebx
cmpb $0x1, 0x9898(%rip)      # 0xcb70
jne 0x2d8a
jmp 0x2c17
xorl %ebx, %ebx
leaq 0x11fd8(%rip), %rax     # 0x152c4
cmpb $0x1, (%rax)
leaq 0x974a(%rip), %r12      # 0xca40
leaq 0xb843(%rip), %rbp      # 0xeb40
jne 0x2f83
movl $0x8, 0xb7bb(%rip)      # 0xeac8
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x21c0
movq %rax, 0xb7b3(%rip)      # 0xead0
callq 0x22e0
movl %eax, 0xb7b0(%rip)      # 0xead8
movl (%r12), %eax
movl %eax, 0xb7aa(%rip)      # 0xeadc
pushq $0xf
popq %rcx
movq %rsp, %rdi
leaq 0xb789(%rip), %rsi      # 0xeac8
rep  movsq (%rsi), %es:(%rdi)
callq 0x6849
testb %al, %al
jne 0x2f83
xorl %ebx, %ebx
pushq $0x1
popq %rdi
leaq 0x4c50(%rip), %rsi      # 0x7fab
xorl %eax, %eax
callq 0x355c
jmp 0x2f83
leaq 0x4af0(%rip), %rdi      # 0x7e5e
leaq 0x8e5b(%rip), %rsi      # 0xc1d0
xorl %eax, %eax
callq 0x2405
leaq 0xd6fd(%rip), %r15      # 0x10a80
jmp 0x2bd3
leaq 0x49a5(%rip), %rdi      # 0x7d34
xorl %eax, %eax
callq 0x2405
jmp 0x2b6d
leaq 0x49b9(%rip), %rdi      # 0x7d5b
xorl %eax, %eax
callq 0x2405
jmp 0x2b84
leaq 0x4a28(%rip), %rdi      # 0x7ddd
xorl %eax, %eax
callq 0x2405
jmp 0x2bd3