// File: davidcairuz[P]network-internet-relay-chat/server.cpp
// Function: server_thread(void*)
void* server_thread(void* arg) {    
    int failed = 0;
    bool quit = false;
    int new_client = *((int*)arg);
    int pos = active->find(new_client);
    string nome = active->clients[pos].name;
    spread_message("A new client has joined us!", new_client);

    while (!quit) {
        string message = socket_server->Read(new_client);
        cout << message << endl;
        socket_server->Check();

        if (message.empty()) {
            failed++;
            
            if (failed >= Socket::max_retries) message = "/quit";
            else continue;
        } else {
            failed = 0;
        }

        if (message == "/quit") {
            spread_message("Someone left the server", new_client);
            active->remove(new_client);
            quit = true;

        } else if (message == "/ping") {
            send_message("pong!", new_client);

        } else if(message.size() >= 10 && message.substr(0, 9) == "/nickname") {
            string new_nickname = message.substr(10, message.size());
            int pos = active->find(new_client);
            active->clients[pos].name = new_nickname;
        
        } else if (message.size() >= 6 && message.substr(0, 5) == "/join") {
            string channel_name = message.substr(6, message.size());
            
            int pos = active->find(new_client);
            bool is_admin = (channels[channel_name] == 0);
            
            // Checa se cliente tem permissão para entrar no canal
            // isto é, se ele é admin ou foi convidado. O cliente
            // só pode estar em um canal por vez
            if(channel_name[0] == '&' and !is_admin){
                auto permissions = channels_permissions[channel_name];
                auto can_join = find(permissions.begin(), permissions.end(), new_client) != permissions.end();
                if (!can_join) {
                    send_message("You're not welcome here >:(", new_client);
                    continue;
                }
            }

            active->clients[pos].channel_name = channel_name;
            active->clients[pos].is_admin = is_admin;    
            
            send_message("Joined channel " + channel_name, new_client);

            if(is_admin) {
                channels[channel_name] = 1;
                channels_permissions[channel_name] = {};
                channels_permissions[channel_name].push_back(new_client);
                send_message("You own this ****!", new_client);
            }
            
            channels[channel_name]++;

        } else if (message.size() >= 6 && message.substr(0, 5) == "/kick") {
            // O /kick só pode ser utilizado pelo admin e expulsa um client
            // momentaneamente do canal. O client pode voltar ao canal sem problemas.

            int pos_client = active->find(new_client);
            
            if (active->clients[pos_client].is_admin == false) {
                send_message("You can't be that bad!", new_client);
                continue;
            }

            string to_be_kicked = message.substr(6, message.size());
            int pos = active->find(active->clients[pos_client].channel_name, to_be_kicked);

            if (active->clients[pos].channel_name != active->clients[pos_client].channel_name) {
                send_message("This user is not here", new_client);
                continue;
            }

            send_message("Admin hates you", active->clients[pos].conn);
            active->clients[pos].channel_name = "$";
            active->clients[pos].is_admin = false;
            channels[active->clients[pos_client].channel_name]--;
            
        } else if (message.size() >= 6 && message.substr(0, 5) == "/mute") {
            int pos_client = active->find(new_client);
            
            if (active->clients[pos_client].is_admin == false) {
                send_message("The Force is not with you!!", new_client);
                continue;
            } 
            
            string to_be_kicked = message.substr(6, message.size());
            int pos = active->find(active->clients[pos_client].channel_name, to_be_kicked);

            if (pos == -1 or active->clients[pos].channel_name != active->clients[pos_client].channel_name) {
                send_message("This user is not here", new_client);
                continue;
            }

            send_message("Admin can't stand you anymore", active->clients[pos].conn);
            active->clients[pos].is_muted = true;
            
        } else if (message.size() >= 8 && message.substr(0, 7) == "/unmute") {
            int pos_client = active->find(new_client);
            
            if (active->clients[pos_client].is_admin == false) {
                send_message("The Force is not with you!!", new_client);
                continue;
            }

            string to_be_kicked = message.substr(8, message.size());
            int pos = active->find(active->clients[pos_client].channel_name, to_be_kicked);

            if (pos == -1 or active->clients[pos].channel_name != active->clients[pos_client].channel_name) {
                send_message("This user is not here", new_client);
                continue;
            }

            send_message("You have your voice again, use it wisely", active->clients[pos].conn);
            active->clients[pos].is_muted = false;
               
        } else if (message.size() >= 7 && message.substr(0, 6) == "/whois") {
            int pos_client = active->find(new_client);
            
            if (active->clients[pos_client].is_admin == false) {
                send_message("The Force is not with you!!", new_client);
                continue;
            } 
            
            string to_be_found = message.substr(7, message.size());
            int pos = active->find(active->clients[pos_client].channel_name, to_be_found);
            
            if (pos == -1 or active->clients[pos].channel_name != active->clients[pos_client].channel_name) {
                send_message("This user is not here", new_client);
                continue;
            }

            send_message(active->clients[pos].name + " is " + active->clients[pos].ip, new_client);
            
        } else if (message.size() >= 8 && message.substr(0, 7) == "/invite") {
            int pos_client = active->find(new_client);
            
            if (active->clients[pos_client].is_admin == false) {
                send_message("The Force is not with you!!", new_client);
                continue;
            } 
            
            string to_be_found = message.substr(8, message.size());
            int pos = active->find(to_be_found);
            
            if (pos == -1) {
                send_message("This user doesn't exist", new_client);
                continue;
            }

            send_message("Admin wants to have the pleasure of your company at " + active->clients[pos_client].channel_name + ". To join this channel, type /join " + active->clients[pos_client].channel_name, active->clients[pos].conn);
            send_message("Invite sent!", new_client);
            
            // adiciona permissão para o cliente convidado entrar no canal
            // assim, ele pode entrar a qualquer momento após o convite
            channels_permissions[active->clients[pos_client].channel_name].push_back(active->clients[pos].conn);
        
        } else {
            spread_message(message, new_client);
        }

        message = "";
    }

    cout << nome << " has left us :(" << endl;
    pthread_exit(NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x9f0, %rsp            # imm = 0x9F0
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movb $0x0, -0xd(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movq 0x10116(%rip), %rdi     # 0x15350
movl -0x14(%rbp), %esi
callq 0x7a00
movl %eax, -0x18(%rbp)
movq 0x10104(%rip), %rdi     # 0x15350
movslq -0x18(%rbp), %rsi
callq 0x7c20
movq %rax, %rsi
addq $0x28, %rsi
leaq -0x38(%rbp), %rdi
callq 0x3140
leaq -0x59(%rbp), %rdi
movq %rdi, -0x7f0(%rbp)
callq 0x34b0
movq -0x7f0(%rbp), %rdx
leaq 0x8ef8(%rip), %rsi      # 0xe17b
leaq -0x58(%rbp), %rdi
callq 0x3a20
jmp 0x528e
movl -0x14(%rbp), %esi
leaq -0x58(%rbp), %rdi
callq 0x4ad0
jmp 0x529c
leaq -0x58(%rbp), %rdi
callq 0x31c0
leaq -0x59(%rbp), %rdi
callq 0x3330
movb -0xd(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x52bc
jmp 0x74eb
movq 0xfffd(%rip), %rsi      # 0x152c0
movl -0x14(%rbp), %edx
leaq -0x90(%rbp), %rdi
callq 0x43f0
jmp 0x52d4
movq 0xfcfd(%rip), %rdi      # 0x14fd8
leaq -0x90(%rbp), %rsi
callq 0x3290
movq %rax, -0x7f8(%rbp)
jmp 0x52f0
movq -0x7f8(%rbp), %rdi
movq 0xfcca(%rip), %rsi      # 0x14fc8
callq 0x3310
jmp 0x5305
movq 0xffb4(%rip), %rdi      # 0x152c0
callq 0x4770
jmp 0x5313
leaq -0x90(%rbp), %rdi
callq 0x3460
testb $0x1, %al
jne 0x5328
jmp 0x53b2
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
cmpl $0x5, -0xc(%rbp)
jl 0x53a1
leaq 0x8e59(%rip), %rsi      # 0xe197
leaq -0x90(%rbp), %rdi
callq 0x33c0
jmp 0x534c
jmp 0x53b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x5371
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x31c0
leaq -0x59(%rbp), %rdi
callq 0x3330
jmp 0x7540
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x7540
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x74dd
movl $0x2, -0x94(%rbp)
jmp 0x74bb
jmp 0x53b9
movl $0x0, -0xc(%rbp)
leaq 0x8dd7(%rip), %rsi      # 0xe197
leaq -0x90(%rbp), %rdi
callq 0x7d60
movb %al, -0x7f9(%rbp)
jmp 0x53d4
movb -0x7f9(%rbp), %al
testb $0x1, %al
jne 0x53e3
jmp 0x548c
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x808(%rbp)
callq 0x34b0
movq -0x808(%rbp), %rdx
leaq 0x8d99(%rip), %rsi      # 0xe19d
leaq -0xb8(%rbp), %rdi
callq 0x3a20
jmp 0x5412
movl -0x14(%rbp), %esi
leaq -0xb8(%rbp), %rdi
callq 0x4ad0
jmp 0x5423
leaq -0xb8(%rbp), %rdi
callq 0x31c0
leaq -0xb9(%rbp), %rdi
callq 0x3330
movq 0xff0e(%rip), %rdi      # 0x15350
movl -0x14(%rbp), %esi
callq 0x7980
jmp 0x544c
movb $0x1, -0xd(%rbp)
jmp 0x749c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x547b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x31c0
leaq -0xb9(%rbp), %rdi
callq 0x3330
jmp 0x74dd
leaq 0x8d22(%rip), %rsi      # 0xe1b5
leaq -0x90(%rbp), %rdi
callq 0x7d60
movb %al, -0x809(%rbp)
jmp 0x54a7
movb -0x809(%rbp), %al
testb $0x1, %al
jne 0x54b6
jmp 0x554a
leaq -0xe1(%rbp), %rdi
movq %rdi, -0x818(%rbp)
callq 0x34b0
movq -0x818(%rbp), %rdx
leaq 0x8ce4(%rip), %rsi      # 0xe1bb
leaq -0xe0(%rbp), %rdi
callq 0x3a20
jmp 0x54e5
movl -0x14(%rbp), %esi
leaq -0xe0(%rbp), %rdi
callq 0x4990
jmp 0x54f6
leaq -0xe0(%rbp), %rdi
callq 0x31c0
leaq -0xe1(%rbp), %rdi
callq 0x3330
jmp 0x749a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x5539
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x31c0
leaq -0xe1(%rbp), %rdi
callq 0x3330
jmp 0x74dd
leaq -0x90(%rbp), %rdi
callq 0x31f0
movq %rax, %rcx
movb $0x0, -0x109(%rbp)
xorl %eax, %eax
cmpq $0xa, %rcx
movb %al, -0x819(%rbp)
jb 0x55bc
xorl %eax, %eax
movl %eax, %edx
leaq -0x108(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movl $0x9, %ecx
callq 0x32f0
jmp 0x558c
movb $0x1, -0x109(%rbp)
leaq 0x8c27(%rip), %rsi      # 0xe1c1
leaq -0x108(%rbp), %rdi
callq 0x7d60
movb %al, -0x81a(%rbp)
jmp 0x55ae
movb -0x81a(%rbp), %al
movb %al, -0x819(%rbp)
jmp 0x55bc
movb -0x819(%rbp), %al
movb %al, -0x81b(%rbp)
testb $0x1, -0x109(%rbp)
jne 0x55d3
jmp 0x55df
leaq -0x108(%rbp), %rdi
callq 0x31c0
movb -0x81b(%rbp), %al
testb $0x1, %al
jne 0x55ee
jmp 0x56bf
leaq -0x90(%rbp), %rdi
movq %rdi, -0x828(%rbp)
callq 0x31f0
movq -0x828(%rbp), %rsi
movq %rax, %rcx
leaq -0x130(%rbp), %rdi
movl $0xa, %edx
callq 0x32f0
jmp 0x561e
movq 0xfd2b(%rip), %rdi      # 0x15350
movl -0x14(%rbp), %esi
callq 0x7a00
movl %eax, -0x82c(%rbp)
jmp 0x5635
movl -0x82c(%rbp), %eax
movl %eax, -0x134(%rbp)
movq 0xfd08(%rip), %rdi      # 0x15350
movslq -0x134(%rbp), %rsi
callq 0x7c20
movq %rax, %rdi
addq $0x28, %rdi
leaq -0x130(%rbp), %rsi
callq 0x3050
jmp 0x5669
leaq -0x130(%rbp), %rdi
callq 0x31c0
jmp 0x7498
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
testb $0x1, -0x109(%rbp)
jne 0x5691
jmp 0x569d
leaq -0x108(%rbp), %rdi
callq 0x31c0
jmp 0x74dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x31c0
jmp 0x74dd
leaq -0x90(%rbp), %rdi
callq 0x31f0
movq %rax, %rcx
movb $0x0, -0x159(%rbp)
xorl %eax, %eax
cmpq $0x6, %rcx
movb %al, -0x82d(%rbp)
jb 0x5731
xorl %eax, %eax
movl %eax, %edx
leaq -0x158(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movl $0x5, %ecx
callq 0x32f0
jmp 0x5701
movb $0x1, -0x159(%rbp)
leaq 0x8abc(%rip), %rsi      # 0xe1cb
leaq -0x158(%rbp), %rdi
callq 0x7d60
movb %al, -0x82e(%rbp)
jmp 0x5723
movb -0x82e(%rbp), %al
movb %al, -0x82d(%rbp)
jmp 0x5731
movb -0x82d(%rbp), %al
movb %al, -0x82f(%rbp)
testb $0x1, -0x159(%rbp)
jne 0x5748
jmp 0x5754
leaq -0x158(%rbp), %rdi
callq 0x31c0
movb -0x82f(%rbp), %al
testb $0x1, %al
jne 0x5763
jmp 0x5c44
leaq -0x90(%rbp), %rdi
movq %rdi, -0x838(%rbp)
callq 0x31f0
movq -0x838(%rbp), %rsi
movq %rax, %rcx
leaq -0x180(%rbp), %rdi
movl $0x6, %edx
callq 0x32f0
jmp 0x5793
movq 0xfbb6(%rip), %rdi      # 0x15350
movl -0x14(%rbp), %esi
callq 0x7a00
movl %eax, -0x83c(%rbp)
jmp 0x57aa
movl -0x83c(%rbp), %eax
movl %eax, -0x184(%rbp)
leaq 0xfb33(%rip), %rdi      # 0x152f0
leaq -0x180(%rbp), %rsi
callq 0x81c0
movq %rax, -0x848(%rbp)
jmp 0x57d2
movq -0x848(%rbp), %rax
movl (%rax), %eax
testl %eax, %eax
sete -0x185(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x180(%rbp), %rdi
callq 0x3520
movq %rax, -0x850(%rbp)
jmp 0x57fd
movq -0x850(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x26, %eax
jne 0x59ff
testb $0x1, -0x185(%rbp)
jne 0x59ff
leaq 0xfafc(%rip), %rdi      # 0x15320
leaq -0x180(%rbp), %rsi
callq 0x82a0
movq %rax, -0x858(%rbp)
jmp 0x5839
movq -0x858(%rbp), %rsi
leaq -0x1a0(%rbp), %rdi
callq 0x8380
jmp 0x584e
leaq -0x1a0(%rbp), %rdi
movq %rdi, -0x868(%rbp)
callq 0x8080
movq -0x868(%rbp), %rdi
movq %rax, -0x1b8(%rbp)
callq 0x80b0
movq %rax, -0x1c0(%rbp)
movq -0x1b8(%rbp), %rdi
movq -0x1c0(%rbp), %rsi
leaq -0x14(%rbp), %rdx
callq 0x8470
movq %rax, -0x860(%rbp)
jmp 0x589b
movq -0x860(%rbp), %rax
movq %rax, -0x1b0(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x80b0
movq %rax, -0x1c8(%rbp)
leaq -0x1b0(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x80e0
andb $0x1, %al
movb %al, -0x1a1(%rbp)
testb $0x1, -0x1a1(%rbp)
jne 0x59c6
leaq -0x1e9(%rbp), %rdi
movq %rdi, -0x870(%rbp)
callq 0x34b0
movq -0x870(%rbp), %rdx
leaq 0x88cc(%rip), %rsi      # 0xe1d1
leaq -0x1e8(%rbp), %rdi
callq 0x3a20
jmp 0x5913
movl -0x14(%rbp), %esi
leaq -0x1e8(%rbp), %rdi
callq 0x4990
jmp 0x5924
leaq -0x1e8(%rbp), %rdi
callq 0x31c0
leaq -0x1e9(%rbp), %rdi
callq 0x3330
movl $0x2, -0x94(%rbp)
jmp 0x59d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
testb $0x1, -0x159(%rbp)
jne 0x5962
jmp 0x596e
leaq -0x158(%rbp), %rdi
callq 0x31c0
jmp 0x74dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x5c33
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x59ee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x59b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0x31c0
leaq -0x1e9(%rbp), %rdi
callq 0x3330
jmp 0x59ee
movl $0x0, -0x94(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x8160
movl -0x94(%rbp), %eax
testl %eax, %eax
jne 0x5c12
jmp 0x59ec
jmp 0x59ff
leaq -0x1a0(%rbp), %rdi
callq 0x8160
jmp 0x5c33
movq 0xf94a(%rip), %rdi      # 0x15350
movslq -0x184(%rbp), %rsi
callq 0x7c20
movq %rax, %rdi
addq $0x50, %rdi
leaq -0x180(%rbp), %rsi
callq 0x3050
jmp 0x5a27
movb -0x185(%rbp), %al
movb %al, -0x871(%rbp)
movq 0xf916(%rip), %rdi      # 0x15350
movslq -0x184(%rbp), %rsi
callq 0x7c20
movb -0x871(%rbp), %cl
andb $0x1, %cl
movb %cl, 0x70(%rax)
leaq 0x8794(%rip), %rsi      # 0xe1ed
leaq -0x210(%rbp), %rdi
leaq -0x180(%rbp), %rdx
callq 0x84c0
jmp 0x5a6e
movl -0x14(%rbp), %esi
leaq -0x210(%rbp), %rdi
callq 0x4990
jmp 0x5a7f
leaq -0x210(%rbp), %rdi
callq 0x31c0
testb $0x1, -0x185(%rbp)
je 0x5bde
leaq 0xf851(%rip), %rdi      # 0x152f0
leaq -0x180(%rbp), %rsi
callq 0x81c0
movq %rax, -0x880(%rbp)
jmp 0x5ab4
movq -0x880(%rbp), %rax
movl $0x1, (%rax)
leaq -0x220(%rbp), %rdi
callq 0x85d0
leaq 0xf84c(%rip), %rdi      # 0x15320
leaq -0x180(%rbp), %rsi
callq 0x82a0
movq %rax, -0x888(%rbp)
jmp 0x5ae9
movq -0x888(%rbp), %rdi
movq -0x220(%rbp), %rsi
movq -0x218(%rbp), %rdx
callq 0x85f0
jmp 0x5b05
leaq 0xf814(%rip), %rdi      # 0x15320
leaq -0x180(%rbp), %rsi
callq 0x82a0
movq %rax, -0x890(%rbp)
jmp 0x5b21
movq -0x890(%rbp), %rdi
leaq -0x14(%rbp), %rsi
callq 0x7fb0
jmp 0x5b33
leaq -0x241(%rbp), %rdi
movq %rdi, -0x898(%rbp)
callq 0x34b0
movq -0x898(%rbp), %rdx
leaq 0x86a9(%rip), %rsi      # 0xe1fd
leaq -0x240(%rbp), %rdi
callq 0x3a20
jmp 0x5b62
movl -0x14(%rbp), %esi
leaq -0x240(%rbp), %rdi
callq 0x4990
jmp 0x5b73
leaq -0x240(%rbp), %rdi
callq 0x31c0
leaq -0x241(%rbp), %rdi
callq 0x3330
jmp 0x5bde
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x210(%rbp), %rdi
callq 0x31c0
jmp 0x5c33
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x5bd0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x31c0
leaq -0x241(%rbp), %rdi
callq 0x3330
jmp 0x5c33
leaq 0xf70b(%rip), %rdi      # 0x152f0
leaq -0x180(%rbp), %rsi
callq 0x81c0
movq %rax, -0x8a0(%rbp)
jmp 0x5bfa
movq -0x8a0(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl $0x0, -0x94(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x31c0
movl -0x94(%rbp), %eax
testl %eax, %eax
jne 0x74bb
jmp 0x5c2e
jmp 0x7496
leaq -0x180(%rbp), %rdi
callq 0x31c0
jmp 0x74dd
leaq -0x90(%rbp), %rdi
callq 0x31f0
movq %rax, %rcx
movb $0x0, -0x269(%rbp)
xorl %eax, %eax
cmpq $0x6, %rcx
movb %al, -0x8a1(%rbp)
jb 0x5cb6
xorl %eax, %eax
movl %eax, %edx
leaq -0x268(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movl $0x5, %ecx
callq 0x32f0
jmp 0x5c86
movb $0x1, -0x269(%rbp)
leaq 0x857c(%rip), %rsi      # 0xe210
leaq -0x268(%rbp), %rdi
callq 0x7d60
movb %al, -0x8a2(%rbp)
jmp 0x5ca8
movb -0x8a2(%rbp), %al
movb %al, -0x8a1(%rbp)
jmp 0x5cb6
movb -0x8a1(%rbp), %al
movb %al, -0x8a3(%rbp)
testb $0x1, -0x269(%rbp)
jne 0x5ccd
jmp 0x5cd9
leaq -0x268(%rbp), %rdi
callq 0x31c0
movb -0x8a3(%rbp), %al
testb $0x1, %al
jne 0x5ce8
jmp 0x6137
movq 0xf661(%rip), %rdi      # 0x15350
movl -0x14(%rbp), %esi
callq 0x7a00
movl %eax, -0x8a8(%rbp)
jmp 0x5cff
movl -0x8a8(%rbp), %eax
movl %eax, -0x270(%rbp)
movq 0xf63e(%rip), %rdi      # 0x15350
movslq -0x270(%rbp), %rsi
callq 0x7c20
movb 0x70(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x5df5
leaq -0x291(%rbp), %rdi
movq %rdi, -0x8b0(%rbp)
callq 0x34b0
movq -0x8b0(%rbp), %rdx
leaq 0x84c6(%rip), %rsi      # 0xe216
leaq -0x290(%rbp), %rdi
callq 0x3a20
jmp 0x5d5e
movl -0x14(%rbp), %esi
leaq -0x290(%rbp), %rdi
callq 0x4990
jmp 0x5d6f
leaq -0x290(%rbp), %rdi
callq 0x31c0
leaq -0x291(%rbp), %rdi
callq 0x3330
movl $0x2, -0x94(%rbp)
jmp 0x74bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
testb $0x1, -0x269(%rbp)
jne 0x5dad
jmp 0x5db9
leaq -0x268(%rbp), %rdi
callq 0x31c0
jmp 0x74dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x5de4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x290(%rbp), %rdi
callq 0x31c0
leaq -0x291(%rbp), %rdi
callq 0x3330
jmp 0x74dd
leaq -0x90(%rbp), %rdi
movq %rdi, -0x8b8(%rbp)
callq 0x31f0
movq -0x8b8(%rbp), %rsi
movq %rax, %rcx
leaq -0x2b8(%rbp), %rdi
movl $0x6, %edx
callq 0x32f0
jmp 0x5e25
movq 0xf524(%rip), %rdi      # 0x15350
movq %rdi, -0x8c0(%rbp)
movslq -0x270(%rbp), %rsi
callq 0x7c20
movq %rax, %rsi
addq $0x50, %rsi
leaq -0x2e0(%rbp), %rdi
callq 0x3140
jmp 0x5e54
leaq -0x300(%rbp), %rdi
leaq -0x2b8(%rbp), %rsi
callq 0x3140
jmp 0x5e69
movq -0x8c0(%rbp), %rdi
leaq -0x2e0(%rbp), %rsi
leaq -0x300(%rbp), %rdx
callq 0x8640
movl %eax, -0x8c4(%rbp)
jmp 0x5e8b
leaq -0x300(%rbp), %rdi
callq 0x31c0
leaq -0x2e0(%rbp), %rdi
callq 0x31c0
movl -0x8c4(%rbp), %eax
movl %eax, -0x2bc(%rbp)
movq 0xf49a(%rip), %rdi      # 0x15350
movslq -0x2bc(%rbp), %rsi
callq 0x7c20
addq $0x50, %rax
movq %rax, -0x8d0(%rbp)
movq 0xf47c(%rip), %rdi      # 0x15350
movslq -0x270(%rbp), %rsi
callq 0x7c20
movq -0x8d0(%rbp), %rdi
movq %rax, %rsi
addq $0x50, %rsi
callq 0x7f30
testb $0x1, %al
jne 0x5efc
jmp 0x5fe2
leaq -0x321(%rbp), %rdi
movq %rdi, -0x8d8(%rbp)
callq 0x34b0
movq -0x8d8(%rbp), %rdx
leaq 0x8310(%rip), %rsi      # 0xe22d
leaq -0x320(%rbp), %rdi
callq 0x3a20
jmp 0x5f2b
movl -0x14(%rbp), %esi
leaq -0x320(%rbp), %rdi
callq 0x4990
jmp 0x5f3c
leaq -0x320(%rbp), %rdi
callq 0x31c0
leaq -0x321(%rbp), %rdi
callq 0x3330
movl $0x2, -0x94(%rbp)
jmp 0x60d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x6126
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x5f9a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x300(%rbp), %rdi
callq 0x31c0
leaq -0x2e0(%rbp), %rdi
callq 0x31c0
jmp 0x6126
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x5fd1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x320(%rbp), %rdi
callq 0x31c0
leaq -0x321(%rbp), %rdi
callq 0x3330
jmp 0x6126
leaq -0x349(%rbp), %rdi
movq %rdi, -0x8e0(%rbp)
callq 0x34b0
movq -0x8e0(%rbp), %rdx
leaq 0x8240(%rip), %rsi      # 0xe243
leaq -0x348(%rbp), %rdi
callq 0x3a20
jmp 0x6011
movq 0xf338(%rip), %rdi      # 0x15350
movslq -0x2bc(%rbp), %rsi
callq 0x7c20
movl 0x4(%rax), %esi
leaq -0x348(%rbp), %rdi
callq 0x4990
jmp 0x6035
leaq -0x348(%rbp), %rdi
callq 0x31c0
leaq -0x349(%rbp), %rdi
callq 0x3330
movq 0xf2fc(%rip), %rdi      # 0x15350
movslq -0x2bc(%rbp), %rsi
callq 0x7c20
movq %rax, %rdi
addq $0x50, %rdi
leaq 0x80cf(%rip), %rsi      # 0xe13d
callq 0x33c0
jmp 0x6075
movq 0xf2d4(%rip), %rdi      # 0x15350
movslq -0x2bc(%rbp), %rsi
callq 0x7c20
movb $0x0, 0x70(%rax)
movq 0xf2bd(%rip), %rdi      # 0x15350
movslq -0x270(%rbp), %rsi
callq 0x7c20
movq %rax, %rsi
addq $0x50, %rsi
leaq 0xf243(%rip), %rdi      # 0x152f0
callq 0x81c0
movq %rax, -0x8e8(%rbp)
jmp 0x60bb
movq -0x8e8(%rbp), %rax
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
movl $0x0, -0x94(%rbp)
leaq -0x2b8(%rbp), %rdi
callq 0x31c0
movl -0x94(%rbp), %eax
testl %eax, %eax
jne 0x74bb
jmp 0x60ef
jmp 0x7494
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x611a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x348(%rbp), %rdi
callq 0x31c0
leaq -0x349(%rbp), %rdi
callq 0x3330
leaq -0x2b8(%rbp), %rdi
callq 0x31c0
jmp 0x74dd
leaq -0x90(%rbp), %rdi
callq 0x31f0
movq %rax, %rcx
movb $0x0, -0x371(%rbp)
xorl %eax, %eax
cmpq $0x6, %rcx
movb %al, -0x8e9(%rbp)
jb 0x61a9
xorl %eax, %eax
movl %eax, %edx
leaq -0x370(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movl $0x5, %ecx
callq 0x32f0
jmp 0x6179
movb $0x1, -0x371(%rbp)
leaq 0x80cc(%rip), %rsi      # 0xe253
leaq -0x370(%rbp), %rdi
callq 0x7d60
movb %al, -0x8ea(%rbp)
jmp 0x619b
movb -0x8ea(%rbp), %al
movb %al, -0x8e9(%rbp)
jmp 0x61a9
movb -0x8e9(%rbp), %al
movb %al, -0x8eb(%rbp)
testb $0x1, -0x371(%rbp)
jne 0x61c0
jmp 0x61cc
leaq -0x370(%rbp), %rdi
callq 0x31c0
movb -0x8eb(%rbp), %al
testb $0x1, %al
jne 0x61db
jmp 0x65ce
movq 0xf16e(%rip), %rdi      # 0x15350
movl -0x14(%rbp), %esi
callq 0x7a00
movl %eax, -0x8f0(%rbp)
jmp 0x61f2
movl -0x8f0(%rbp), %eax
movl %eax, -0x378(%rbp)
movq 0xf14b(%rip), %rdi      # 0x15350
movslq -0x378(%rbp), %rsi
callq 0x7c20
movb 0x70(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x62e8
leaq -0x399(%rbp), %rdi
movq %rdi, -0x8f8(%rbp)
callq 0x34b0
movq -0x8f8(%rbp), %rdx
leaq 0x8016(%rip), %rsi      # 0xe259
leaq -0x398(%rbp), %rdi
callq 0x3a20
jmp 0x6251
movl -0x14(%rbp), %esi
leaq -0x398(%rbp), %rdi
callq 0x4990
jmp 0x6262
leaq -0x398(%rbp), %rdi
callq 0x31c0
leaq -0x399(%rbp), %rdi
callq 0x3330
movl $0x2, -0x94(%rbp)
jmp 0x74bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
testb $0x1, -0x371(%rbp)
jne 0x62a0
jmp 0x62ac
leaq -0x370(%rbp), %rdi
callq 0x31c0
jmp 0x74dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x62d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x398(%rbp), %rdi
callq 0x31c0
leaq -0x399(%rbp), %rdi
callq 0x3330
jmp 0x74dd
leaq -0x90(%rbp), %rdi
movq %rdi, -0x900(%rbp)
callq 0x31f0
movq -0x900(%rbp), %rsi
movq %rax, %rcx
leaq -0x3c0(%rbp), %rdi
movl $0x6, %edx
callq 0x32f0
jmp 0x6318
movq 0xf031(%rip), %rdi      # 0x15350
movq %rdi, -0x908(%rbp)
movslq -0x378(%rbp), %rsi
callq 0x7c20
movq %rax, %rsi
addq $0x50, %rsi
leaq -0x3e8(%rbp), %rdi
callq 0x3140
jmp 0x6347
leaq -0x408(%rbp), %rdi
leaq -0x3c0(%rbp), %rsi
callq 0x3140
jmp 0x635c
movq -0x908(%rbp), %rdi
leaq -0x3e8(%rbp), %rsi
leaq -0x408(%rbp), %rdx
callq 0x8640
movl %eax, -0x90c(%rbp)
jmp 0x637e
leaq -0x408(%rbp), %rdi
callq 0x31c0
leaq -0x3e8(%rbp), %rdi
callq 0x31c0
movl -0x90c(%rbp), %eax
movl %eax, -0x3c4(%rbp)
cmpl $-0x1, -0x3c4(%rbp)
je 0x63f8
movq 0xef9e(%rip), %rdi      # 0x15350
movslq -0x3c4(%rbp), %rsi
callq 0x7c20
addq $0x50, %rax
movq %rax, -0x918(%rbp)
movq 0xef80(%rip), %rdi      # 0x15350
movslq -0x378(%rbp), %rsi
callq 0x7c20
movq -0x918(%rbp), %rdi
movq %rax, %rsi
addq $0x50, %rsi
callq 0x7f30
testb $0x1, %al
jne 0x63f8
jmp 0x64de
leaq -0x429(%rbp), %rdi
movq %rdi, -0x920(%rbp)
callq 0x34b0
movq -0x920(%rbp), %rdx
leaq 0x7e14(%rip), %rsi      # 0xe22d
leaq -0x428(%rbp), %rdi
callq 0x3a20
jmp 0x6427
movl -0x14(%rbp), %esi
leaq -0x428(%rbp), %rdi
callq 0x4990
jmp 0x6438
leaq -0x428(%rbp), %rdi
callq 0x31c0
leaq -0x429(%rbp), %rdi
callq 0x3330
movl $0x2, -0x94(%rbp)
jmp 0x656a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x65bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x6496
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x408(%rbp), %rdi
callq 0x31c0
leaq -0x3e8(%rbp), %rdi
callq 0x31c0
jmp 0x65bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x64cd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x428(%rbp), %rdi
callq 0x31c0
leaq -0x429(%rbp), %rdi
callq 0x3330
jmp 0x65bd
leaq -0x451(%rbp), %rdi
movq %rdi, -0x928(%rbp)
callq 0x34b0
movq -0x928(%rbp), %rdx
leaq 0x7d76(%rip), %rsi      # 0xe275
leaq -0x450(%rbp), %rdi
callq 0x3a20
jmp 0x650d
movq 0xee3c(%rip), %rdi      # 0x15350
movslq -0x3c4(%rbp), %rsi
callq 0x7c20
movl 0x4(%rax), %esi
leaq -0x450(%rbp), %rdi
callq 0x4990
jmp 0x6531
leaq -0x450(%rbp), %rdi
callq 0x31c0
leaq -0x451(%rbp), %rdi
callq 0x3330
movq 0xee00(%rip), %rdi      # 0x15350
movslq -0x3c4(%rbp), %rsi
callq 0x7c20
movb $0x1, 0x71(%rax)
movl $0x0, -0x94(%rbp)
leaq -0x3c0(%rbp), %rdi
callq 0x31c0
movl -0x94(%rbp), %eax
testl %eax, %eax
jne 0x74bb
jmp 0x6586
jmp 0x7492
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x65b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x450(%rbp), %rdi
callq 0x31c0
leaq -0x451(%rbp), %rdi
callq 0x3330
leaq -0x3c0(%rbp), %rdi
callq 0x31c0
jmp 0x74dd
leaq -0x90(%rbp), %rdi
callq 0x31f0
movq %rax, %rcx
movb $0x0, -0x479(%rbp)
xorl %eax, %eax
cmpq $0x8, %rcx
movb %al, -0x929(%rbp)
jb 0x6640
xorl %eax, %eax
movl %eax, %edx
leaq -0x478(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movl $0x7, %ecx
callq 0x32f0
jmp 0x6610
movb $0x1, -0x479(%rbp)
leaq 0x7c75(%rip), %rsi      # 0xe293
leaq -0x478(%rbp), %rdi
callq 0x7d60
movb %al, -0x92a(%rbp)
jmp 0x6632
movb -0x92a(%rbp), %al
movb %al, -0x929(%rbp)
jmp 0x6640
movb -0x929(%rbp), %al
movb %al, -0x92b(%rbp)
testb $0x1, -0x479(%rbp)
jne 0x6657
jmp 0x6663
leaq -0x478(%rbp), %rdi
callq 0x31c0
movb -0x92b(%rbp), %al
testb $0x1, %al
jne 0x6672
jmp 0x6a65
movq 0xecd7(%rip), %rdi      # 0x15350
movl -0x14(%rbp), %esi
callq 0x7a00
movl %eax, -0x930(%rbp)
jmp 0x6689
movl -0x930(%rbp), %eax
movl %eax, -0x480(%rbp)
movq 0xecb4(%rip), %rdi      # 0x15350
movslq -0x480(%rbp), %rsi
callq 0x7c20
movb 0x70(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x677f
leaq -0x4a1(%rbp), %rdi
movq %rdi, -0x938(%rbp)
callq 0x34b0
movq -0x938(%rbp), %rdx
leaq 0x7b7f(%rip), %rsi      # 0xe259
leaq -0x4a0(%rbp), %rdi
callq 0x3a20
jmp 0x66e8
movl -0x14(%rbp), %esi
leaq -0x4a0(%rbp), %rdi
callq 0x4990
jmp 0x66f9
leaq -0x4a0(%rbp), %rdi
callq 0x31c0
leaq -0x4a1(%rbp), %rdi
callq 0x3330
movl $0x2, -0x94(%rbp)
jmp 0x74bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
testb $0x1, -0x479(%rbp)
jne 0x6737
jmp 0x6743
leaq -0x478(%rbp), %rdi
callq 0x31c0
jmp 0x74dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x676e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x4a0(%rbp), %rdi
callq 0x31c0
leaq -0x4a1(%rbp), %rdi
callq 0x3330
jmp 0x74dd
leaq -0x90(%rbp), %rdi
movq %rdi, -0x940(%rbp)
callq 0x31f0
movq -0x940(%rbp), %rsi
movq %rax, %rcx
leaq -0x4c8(%rbp), %rdi
movl $0x8, %edx
callq 0x32f0
jmp 0x67af
movq 0xeb9a(%rip), %rdi      # 0x15350
movq %rdi, -0x948(%rbp)
movslq -0x480(%rbp), %rsi
callq 0x7c20
movq %rax, %rsi
addq $0x50, %rsi
leaq -0x4f0(%rbp), %rdi
callq 0x3140
jmp 0x67de
leaq -0x510(%rbp), %rdi
leaq -0x4c8(%rbp), %rsi
callq 0x3140
jmp 0x67f3
movq -0x948(%rbp), %rdi
leaq -0x4f0(%rbp), %rsi
leaq -0x510(%rbp), %rdx
callq 0x8640
movl %eax, -0x94c(%rbp)
jmp 0x6815
leaq -0x510(%rbp), %rdi
callq 0x31c0
leaq -0x4f0(%rbp), %rdi
callq 0x31c0
movl -0x94c(%rbp), %eax
movl %eax, -0x4cc(%rbp)
cmpl $-0x1, -0x4cc(%rbp)
je 0x688f
movq 0xeb07(%rip), %rdi      # 0x15350
movslq -0x4cc(%rbp), %rsi
callq 0x7c20
addq $0x50, %rax
movq %rax, -0x958(%rbp)
movq 0xeae9(%rip), %rdi      # 0x15350
movslq -0x480(%rbp), %rsi
callq 0x7c20
movq -0x958(%rbp), %rdi
movq %rax, %rsi
addq $0x50, %rsi
callq 0x7f30
testb $0x1, %al
jne 0x688f
jmp 0x6975
leaq -0x531(%rbp), %rdi
movq %rdi, -0x960(%rbp)
callq 0x34b0
movq -0x960(%rbp), %rdx
leaq 0x797d(%rip), %rsi      # 0xe22d
leaq -0x530(%rbp), %rdi
callq 0x3a20
jmp 0x68be
movl -0x14(%rbp), %esi
leaq -0x530(%rbp), %rdi
callq 0x4990
jmp 0x68cf
leaq -0x530(%rbp), %rdi
callq 0x31c0
leaq -0x531(%rbp), %rdi
callq 0x3330
movl $0x2, -0x94(%rbp)
jmp 0x6a01
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x6a54
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x692d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x510(%rbp), %rdi
callq 0x31c0
leaq -0x4f0(%rbp), %rdi
callq 0x31c0
jmp 0x6a54
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x6964
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x530(%rbp), %rdi
callq 0x31c0
leaq -0x531(%rbp), %rdi
callq 0x3330
jmp 0x6a54
leaq -0x559(%rbp), %rdi
movq %rdi, -0x968(%rbp)
callq 0x34b0
movq -0x968(%rbp), %rdx
leaq 0x7905(%rip), %rsi      # 0xe29b
leaq -0x558(%rbp), %rdi
callq 0x3a20
jmp 0x69a4
movq 0xe9a5(%rip), %rdi      # 0x15350
movslq -0x4cc(%rbp), %rsi
callq 0x7c20
movl 0x4(%rax), %esi
leaq -0x558(%rbp), %rdi
callq 0x4990
jmp 0x69c8
leaq -0x558(%rbp), %rdi
callq 0x31c0
leaq -0x559(%rbp), %rdi
callq 0x3330
movq 0xe969(%rip), %rdi      # 0x15350
movslq -0x4cc(%rbp), %rsi
callq 0x7c20
movb $0x0, 0x71(%rax)
movl $0x0, -0x94(%rbp)
leaq -0x4c8(%rbp), %rdi
callq 0x31c0
movl -0x94(%rbp), %eax
testl %eax, %eax
jne 0x74bb
jmp 0x6a1d
jmp 0x7490
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x6a48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x558(%rbp), %rdi
callq 0x31c0
leaq -0x559(%rbp), %rdi
callq 0x3330
leaq -0x4c8(%rbp), %rdi
callq 0x31c0
jmp 0x74dd
leaq -0x90(%rbp), %rdi
callq 0x31f0
movq %rax, %rcx
movb $0x0, -0x581(%rbp)
xorl %eax, %eax
cmpq $0x7, %rcx
movb %al, -0x969(%rbp)
jb 0x6ad7
xorl %eax, %eax
movl %eax, %edx
leaq -0x580(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movl $0x6, %ecx
callq 0x32f0
jmp 0x6aa7
movb $0x1, -0x581(%rbp)
leaq 0x780f(%rip), %rsi      # 0xe2c4
leaq -0x580(%rbp), %rdi
callq 0x7d60
movb %al, -0x96a(%rbp)
jmp 0x6ac9
movb -0x96a(%rbp), %al
movb %al, -0x969(%rbp)
jmp 0x6ad7
movb -0x969(%rbp), %al
movb %al, -0x96b(%rbp)
testb $0x1, -0x581(%rbp)
jne 0x6aee
jmp 0x6afa
leaq -0x580(%rbp), %rdi
callq 0x31c0
movb -0x96b(%rbp), %al
testb $0x1, %al
jne 0x6b09
jmp 0x6f01
movq 0xe840(%rip), %rdi      # 0x15350
movl -0x14(%rbp), %esi
callq 0x7a00
movl %eax, -0x970(%rbp)
jmp 0x6b20
movl -0x970(%rbp), %eax
movl %eax, -0x588(%rbp)
movq 0xe81d(%rip), %rdi      # 0x15350
movslq -0x588(%rbp), %rsi
callq 0x7c20
movb 0x70(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x6c16
leaq -0x5a9(%rbp), %rdi
movq %rdi, -0x978(%rbp)
callq 0x34b0
movq -0x978(%rbp), %rdx
leaq 0x76e8(%rip), %rsi      # 0xe259
leaq -0x5a8(%rbp), %rdi
callq 0x3a20
jmp 0x6b7f
movl -0x14(%rbp), %esi
leaq -0x5a8(%rbp), %rdi
callq 0x4990
jmp 0x6b90
leaq -0x5a8(%rbp), %rdi
callq 0x31c0
leaq -0x5a9(%rbp), %rdi
callq 0x3330
movl $0x2, -0x94(%rbp)
jmp 0x74bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
testb $0x1, -0x581(%rbp)
jne 0x6bce
jmp 0x6bda
leaq -0x580(%rbp), %rdi
callq 0x31c0
jmp 0x74dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x6c05
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x5a8(%rbp), %rdi
callq 0x31c0
leaq -0x5a9(%rbp), %rdi
callq 0x3330
jmp 0x74dd
leaq -0x90(%rbp), %rdi
movq %rdi, -0x980(%rbp)
callq 0x31f0
movq -0x980(%rbp), %rsi
movq %rax, %rcx
leaq -0x5d0(%rbp), %rdi
movl $0x7, %edx
callq 0x32f0
jmp 0x6c46
movq 0xe703(%rip), %rdi      # 0x15350
movq %rdi, -0x988(%rbp)
movslq -0x588(%rbp), %rsi
callq 0x7c20
movq %rax, %rsi
addq $0x50, %rsi
leaq -0x5f8(%rbp), %rdi
callq 0x3140
jmp 0x6c75
leaq -0x618(%rbp), %rdi
leaq -0x5d0(%rbp), %rsi
callq 0x3140
jmp 0x6c8a
movq -0x988(%rbp), %rdi
leaq -0x5f8(%rbp), %rsi
leaq -0x618(%rbp), %rdx
callq 0x8640
movl %eax, -0x98c(%rbp)
jmp 0x6cac
leaq -0x618(%rbp), %rdi
callq 0x31c0
leaq -0x5f8(%rbp), %rdi
callq 0x31c0
movl -0x98c(%rbp), %eax
movl %eax, -0x5d4(%rbp)
cmpl $-0x1, -0x5d4(%rbp)
je 0x6d26
movq 0xe670(%rip), %rdi      # 0x15350
movslq -0x5d4(%rbp), %rsi
callq 0x7c20
addq $0x50, %rax
movq %rax, -0x998(%rbp)
movq 0xe652(%rip), %rdi      # 0x15350
movslq -0x588(%rbp), %rsi
callq 0x7c20
movq -0x998(%rbp), %rdi
movq %rax, %rsi
addq $0x50, %rsi
callq 0x7f30
testb $0x1, %al
jne 0x6d26
jmp 0x6e0c
leaq -0x639(%rbp), %rdi
movq %rdi, -0x9a0(%rbp)
callq 0x34b0
movq -0x9a0(%rbp), %rdx
leaq 0x74e6(%rip), %rsi      # 0xe22d
leaq -0x638(%rbp), %rdi
callq 0x3a20
jmp 0x6d55
movl -0x14(%rbp), %esi
leaq -0x638(%rbp), %rdi
callq 0x4990
jmp 0x6d66
leaq -0x638(%rbp), %rdi
callq 0x31c0
leaq -0x639(%rbp), %rdi
callq 0x3330
movl $0x2, -0x94(%rbp)
jmp 0x6e9d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x6ef0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x6dc4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x618(%rbp), %rdi
callq 0x31c0
leaq -0x5f8(%rbp), %rdi
callq 0x31c0
jmp 0x6ef0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x6dfb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x638(%rbp), %rdi
callq 0x31c0
leaq -0x639(%rbp), %rdi
callq 0x3330
jmp 0x6ef0
movq 0xe53d(%rip), %rdi      # 0x15350
movslq -0x5d4(%rbp), %rsi
callq 0x7c20
movq %rax, %rsi
addq $0x28, %rsi
leaq 0x749e(%rip), %rdx      # 0xe2cb
leaq -0x680(%rbp), %rdi
callq 0x7ba0
jmp 0x6e3b
movq 0xe50e(%rip), %rdi      # 0x15350
movslq -0x5d4(%rbp), %rsi
callq 0x7c20
movq %rax, %rdx
addq $0x8, %rdx
leaq -0x660(%rbp), %rdi
leaq -0x680(%rbp), %rsi
callq 0x8700
jmp 0x6e6a
movl -0x14(%rbp), %esi
leaq -0x660(%rbp), %rdi
callq 0x4990
jmp 0x6e7b
leaq -0x660(%rbp), %rdi
callq 0x31c0
leaq -0x680(%rbp), %rdi
callq 0x31c0
movl $0x0, -0x94(%rbp)
leaq -0x5d0(%rbp), %rdi
callq 0x31c0
movl -0x94(%rbp), %eax
testl %eax, %eax
jne 0x74bb
jmp 0x6eb9
jmp 0x748e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x6ee4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x660(%rbp), %rdi
callq 0x31c0
leaq -0x680(%rbp), %rdi
callq 0x31c0
leaq -0x5d0(%rbp), %rdi
callq 0x31c0
jmp 0x74dd
leaq -0x90(%rbp), %rdi
callq 0x31f0
movq %rax, %rcx
movb $0x0, -0x6a1(%rbp)
xorl %eax, %eax
cmpq $0x8, %rcx
movb %al, -0x9a1(%rbp)
jb 0x6f73
xorl %eax, %eax
movl %eax, %edx
leaq -0x6a0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movl $0x7, %ecx
callq 0x32f0
jmp 0x6f43
movb $0x1, -0x6a1(%rbp)
leaq 0x737f(%rip), %rsi      # 0xe2d0
leaq -0x6a0(%rbp), %rdi
callq 0x7d60
movb %al, -0x9a2(%rbp)
jmp 0x6f65
movb -0x9a2(%rbp), %al
movb %al, -0x9a1(%rbp)
jmp 0x6f73
movb -0x9a1(%rbp), %al
movb %al, -0x9a3(%rbp)
testb $0x1, -0x6a1(%rbp)
jne 0x6f8a
jmp 0x6f96
leaq -0x6a0(%rbp), %rdi
callq 0x31c0
movb -0x9a3(%rbp), %al
testb $0x1, %al
jne 0x6fa5
jmp 0x743e
movq 0xe3a4(%rip), %rdi      # 0x15350
movl -0x14(%rbp), %esi
callq 0x7a00
movl %eax, -0x9a8(%rbp)
jmp 0x6fbc
movl -0x9a8(%rbp), %eax
movl %eax, -0x6a8(%rbp)
movq 0xe381(%rip), %rdi      # 0x15350
movslq -0x6a8(%rbp), %rsi
callq 0x7c20
movb 0x70(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x70b2
leaq -0x6c9(%rbp), %rdi
movq %rdi, -0x9b0(%rbp)
callq 0x34b0
movq -0x9b0(%rbp), %rdx
leaq 0x724c(%rip), %rsi      # 0xe259
leaq -0x6c8(%rbp), %rdi
callq 0x3a20
jmp 0x701b
movl -0x14(%rbp), %esi
leaq -0x6c8(%rbp), %rdi
callq 0x4990
jmp 0x702c
leaq -0x6c8(%rbp), %rdi
callq 0x31c0
leaq -0x6c9(%rbp), %rdi
callq 0x3330
movl $0x2, -0x94(%rbp)
jmp 0x74bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
testb $0x1, -0x6a1(%rbp)
jne 0x706a
jmp 0x7076
leaq -0x6a0(%rbp), %rdi
callq 0x31c0
jmp 0x74dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x70a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x6c8(%rbp), %rdi
callq 0x31c0
leaq -0x6c9(%rbp), %rdi
callq 0x3330
jmp 0x74dd
leaq -0x90(%rbp), %rdi
movq %rdi, -0x9b8(%rbp)
callq 0x31f0
movq -0x9b8(%rbp), %rsi
movq %rax, %rcx
leaq -0x6f0(%rbp), %rdi
movl $0x8, %edx
callq 0x32f0
jmp 0x70e2
movq 0xe267(%rip), %rax      # 0x15350
movq %rax, -0x9c0(%rbp)
leaq -0x718(%rbp), %rdi
leaq -0x6f0(%rbp), %rsi
callq 0x3140
jmp 0x7105
movq -0x9c0(%rbp), %rdi
leaq -0x718(%rbp), %rsi
callq 0x8750
movl %eax, -0x9c4(%rbp)
jmp 0x7120
leaq -0x718(%rbp), %rdi
callq 0x31c0
movl -0x9c4(%rbp), %eax
movl %eax, -0x6f4(%rbp)
cmpl $-0x1, -0x6f4(%rbp)
jne 0x7211
leaq -0x739(%rbp), %rdi
movq %rdi, -0x9d0(%rbp)
callq 0x34b0
movq -0x9d0(%rbp), %rdx
leaq 0x7172(%rip), %rsi      # 0xe2d8
leaq -0x738(%rbp), %rdi
callq 0x3a20
jmp 0x7174
movl -0x14(%rbp), %esi
leaq -0x738(%rbp), %rdi
callq 0x4990
jmp 0x7185
leaq -0x738(%rbp), %rdi
callq 0x31c0
leaq -0x739(%rbp), %rdi
callq 0x3330
movl $0x2, -0x94(%rbp)
jmp 0x738c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x742d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x718(%rbp), %rdi
callq 0x31c0
jmp 0x742d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x7200
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x738(%rbp), %rdi
callq 0x31c0
leaq -0x739(%rbp), %rdi
callq 0x3330
jmp 0x742d
movq 0xe138(%rip), %rdi      # 0x15350
movslq -0x6a8(%rbp), %rsi
callq 0x7c20
movq %rax, %rdx
addq $0x50, %rdx
leaq 0x70be(%rip), %rsi      # 0xe2f0
leaq -0x7a0(%rbp), %rdi
callq 0x84c0
jmp 0x7240
leaq 0x70de(%rip), %rdx      # 0xe325
leaq -0x780(%rbp), %rdi
leaq -0x7a0(%rbp), %rsi
callq 0x7a80
jmp 0x725c
movq 0xe0ed(%rip), %rdi      # 0x15350
movslq -0x6a8(%rbp), %rsi
callq 0x7c20
movq %rax, %rdx
addq $0x50, %rdx
leaq -0x760(%rbp), %rdi
leaq -0x780(%rbp), %rsi
callq 0x8700
jmp 0x728b
movq 0xe0be(%rip), %rdi      # 0x15350
movslq -0x6f4(%rbp), %rsi
callq 0x7c20
movl 0x4(%rax), %esi
leaq -0x760(%rbp), %rdi
callq 0x4990
jmp 0x72af
leaq -0x760(%rbp), %rdi
callq 0x31c0
leaq -0x780(%rbp), %rdi
callq 0x31c0
leaq -0x7a0(%rbp), %rdi
callq 0x31c0
leaq -0x7c1(%rbp), %rdi
movq %rdi, -0x9d8(%rbp)
callq 0x34b0
movq -0x9d8(%rbp), %rdx
leaq 0x7055(%rip), %rsi      # 0xe349
leaq -0x7c0(%rbp), %rdi
callq 0x3a20
jmp 0x7302
movl -0x14(%rbp), %esi
leaq -0x7c0(%rbp), %rdi
callq 0x4990
jmp 0x7313
leaq -0x7c0(%rbp), %rdi
callq 0x31c0
leaq -0x7c1(%rbp), %rdi
callq 0x3330
movq 0xe01e(%rip), %rdi      # 0x15350
movslq -0x6a8(%rbp), %rsi
callq 0x7c20
movq %rax, %rsi
addq $0x50, %rsi
leaq 0xdfd4(%rip), %rdi      # 0x15320
callq 0x82a0
movq %rax, -0x9e0(%rbp)
jmp 0x735a
movq 0xdfef(%rip), %rdi      # 0x15350
movslq -0x6f4(%rbp), %rsi
callq 0x7c20
movq -0x9e0(%rbp), %rdi
movq %rax, %rsi
addq $0x4, %rsi
callq 0x7fb0
jmp 0x7382
movl $0x0, -0x94(%rbp)
leaq -0x6f0(%rbp), %rdi
callq 0x31c0
movl -0x94(%rbp), %eax
testl %eax, %eax
jne 0x74bb
jmp 0x73a8
jmp 0x748c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x73ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x73e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x760(%rbp), %rdi
callq 0x31c0
leaq -0x780(%rbp), %rdi
callq 0x31c0
leaq -0x7a0(%rbp), %rdi
callq 0x31c0
jmp 0x742d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x7421
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x7c0(%rbp), %rdi
callq 0x31c0
leaq -0x7c1(%rbp), %rdi
callq 0x3330
leaq -0x6f0(%rbp), %rdi
callq 0x31c0
jmp 0x74dd
leaq -0x7e8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x3140
jmp 0x7453
movl -0x14(%rbp), %esi
leaq -0x7e8(%rbp), %rdi
callq 0x4ad0
jmp 0x7464
leaq -0x7e8(%rbp), %rdi
callq 0x31c0
jmp 0x748c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x7e8(%rbp), %rdi
callq 0x31c0
jmp 0x74dd
jmp 0x748e
jmp 0x7490
jmp 0x7492
jmp 0x7494
jmp 0x7496
jmp 0x7498
jmp 0x749a
jmp 0x749c
leaq 0x6c5c(%rip), %rsi      # 0xe0ff
leaq -0x90(%rbp), %rdi
callq 0x33c0
jmp 0x74b1
movl $0x0, -0x94(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x31c0
movl -0x94(%rbp), %eax
testl %eax, %eax
je 0x74d8
jmp 0x74d3
jmp 0x52ae
jmp 0x52ae
leaq -0x90(%rbp), %rdi
callq 0x31c0
jmp 0x7540
movq 0xdae6(%rip), %rdi      # 0x14fd8
leaq -0x38(%rbp), %rsi
callq 0x3290
movq %rax, -0x9e8(%rbp)
jmp 0x7504
movq -0x9e8(%rbp), %rdi
leaq 0x6e44(%rip), %rsi      # 0xe356
callq 0x32b0
movq %rax, -0x9f0(%rbp)
jmp 0x7520
movq -0x9f0(%rbp), %rdi
movq 0xda9a(%rip), %rsi      # 0x14fc8
callq 0x3310
jmp 0x7535
xorl %eax, %eax
movl %eax, %edi
callq 0x34a0
jmp 0x7540
leaq -0x38(%rbp), %rdi
callq 0x31c0
movq -0x68(%rbp), %rdi
callq 0x3490
nopw %cs:(%rax,%rax)