// File: greenpau[P]mnpa/main.cpp
// Function: receiver_thread(MulticastReceiver)
void receiver_thread(struct MulticastReceiver receiver) {

    auto thrid = std::hash<std::thread::id>()(std::this_thread::get_id());

    logit(INFO, "receiver thread #" + std::to_string(thrid) + " / " + \
          ipv4_from_s_addr(receiver.group.imr_multiaddr.s_addr) + ":" + \
          std::to_string(ntohs(receiver.listener.sin_port)) + " / started ...");

    int sockfd = socket(AF_INET, SOCK_DGRAM, 0);

    if (sockfd < 0) {
        logit(ERROR, "receiver thread #" + std::to_string(thrid) + " / " + \
              ipv4_from_s_addr(receiver.group.imr_multiaddr.s_addr) + ":" + \
              std::to_string(ntohs(receiver.listener.sin_port)) + \
              " failed to open a datagram socket");
    }

    int reuse_sock = 1;
    if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (char *)&reuse_sock, sizeof(reuse_sock)) < 0) {
        logit(ERROR, "receiver thread #" + std::to_string(thrid) + " / " + \
              ipv4_from_s_addr(receiver.group.imr_multiaddr.s_addr) + ":" + \
              std::to_string(ntohs(receiver.listener.sin_port)) + \
              " failed to set SO_REUSEADDR");
        close(sockfd);
        return;
    }

    if (bind(sockfd, (struct sockaddr*)&receiver.listener, sizeof(receiver.listener))) {
        logit(ERROR, "receiver thread #" + std::to_string(thrid) + " / " + \
              ipv4_from_s_addr(receiver.group.imr_multiaddr.s_addr) + ":" + \
              std::to_string(ntohs(receiver.listener.sin_port)) + \
              " failed to bind a datagram socket");
        close(sockfd);
        return;
    }

    for (;;) {
        if (setsockopt(sockfd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *)&receiver.group, sizeof(receiver.group)) < 0) {
            logit(ERROR, "receiver thread #" + std::to_string(thrid) + " / " + \
                  ipv4_from_s_addr(receiver.group.imr_multiaddr.s_addr) + ":" + \
                  std::to_string(ntohs(receiver.listener.sin_port)) + \
                  " failed to inform kernel of multicast group");
            close(sockfd);
            mu_thrids.lock();
            thrids[thrid] = 1;
            mu_thrids.unlock();
            return;
        }
        if (IGMP_REPORT_ONLY == false) {
            break;
        }
        auto sleep_timer = std::chrono::high_resolution_clock::now() + std::chrono::seconds(30);
        for (;;) {
            if (stopped == true) break;
            std::this_thread::sleep_for(std::chrono::milliseconds(100));
            if (std::chrono::high_resolution_clock::now() >= sleep_timer) break;
        }
        if (stopped == true) break;
    }

    if (IGMP_REPORT_ONLY == false) {
        auto tp = std::chrono::high_resolution_clock::now() + receiver.duration;
        char rcvbuf[65535];
        while(1) {
            struct sockaddr_storage sender_addr;
            ssize_t read_sz;
            socklen_t sender_addr_len = sizeof(sender_addr);
            memset(&sender_addr, 0, sizeof(struct sockaddr_storage));
            memset(&rcvbuf, 0, 65535);
            read_sz = recvfrom(sockfd, rcvbuf, sizeof(rcvbuf), MSG_DONTWAIT,
                               (struct sockaddr *) &sender_addr, &sender_addr_len);
            /*
            if ( read_sz == -1) {
                logit(ERROR, "receiver thread #" + std::to_string(thrid) + " / " + \
                      ipv4_from_s_addr(receiver.group.imr_multiaddr.s_addr) + ":" + \
                      std::to_string(ntohs(receiver.listener.sin_port)) + \
                      " failed to receive a datagram");
                close(sockfd);
                break;
            }
            */
            if (read_sz > 0) {
                logit(INFO, "receiver thread #" + std::to_string(thrid) + " / " + \
                      ipv4_from_s_addr(receiver.group.imr_multiaddr.s_addr) + ":" + \
                      std::to_string(ntohs(receiver.listener.sin_port)) + \
                      " received: ");
                //printf("received %zd bytes: \"%s\"\n", read_sz, rcvbuf);
            }
            if (stopped == true) break;
            if (std::chrono::high_resolution_clock::now() >= tp) break;
        }
    }
    close(sockfd);
    mu_thrids.lock();
    thrids[thrid] = 1;
    mu_thrids.unlock();
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10810, %rsp          # imm = 0x10810
leaq 0x10(%rbp), %rax
movq %rax, -0x107e8(%rbp)
callq 0x24050
movq %rax, -0x18(%rbp)
leaq -0x9(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x24010
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rsi
leaq -0xf8(%rbp), %rdi
movq %rdi, -0x107e0(%rbp)
callq 0x24150
movq -0x107e0(%rbp), %rdx
leaq 0xe764c(%rip), %rsi     # 0x102e21
leaq -0xd8(%rbp), %rdi
callq 0x23c90
jmp 0x1b7e3
leaq 0xe7649(%rip), %rdx     # 0x102e33
leaq -0xb8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x23940
jmp 0x1b7ff
movq -0x107e8(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %esi
leaq -0x128(%rbp), %rdi
callq 0x19600
jmp 0x1b819
leaq -0x98(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
leaq -0x128(%rbp), %rdx
callq 0x24080
jmp 0x1b835
leaq 0xeccb4(%rip), %rdx     # 0x1084f0
leaq -0x78(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x23940
jmp 0x1b84e
movq -0x107e8(%rbp), %rax
movzwl 0x2(%rax), %edi
callq 0x16430
movzwl %ax, %esi
leaq -0x148(%rbp), %rdi
callq 0x23760
jmp 0x1b86f
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rsi
leaq -0x148(%rbp), %rdx
callq 0x24080
jmp 0x1b885
leaq 0xe75ab(%rip), %rdx     # 0x102e37
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x23940
jmp 0x1b89b
xorl %edi, %edi
leaq -0x38(%rbp), %rsi
callq 0x196f0
jmp 0x1b8a8
leaq -0x38(%rbp), %rdi
callq 0xcf470
leaq -0x58(%rbp), %rdi
callq 0xcf470
leaq -0x148(%rbp), %rdi
callq 0xcf470
leaq -0x78(%rbp), %rdi
callq 0xcf470
leaq -0x98(%rbp), %rdi
callq 0xcf470
leaq -0x128(%rbp), %rdi
callq 0xcf470
leaq -0xb8(%rbp), %rdi
callq 0xcf470
leaq -0xd8(%rbp), %rdi
callq 0xcf470
leaq -0xf8(%rbp), %rdi
callq 0xcf470
movl $0x2, %esi
xorl %edx, %edx
movl %esi, %edi
callq 0x165c0
movl %eax, -0x14c(%rbp)
cmpl $0x0, -0x14c(%rbp)
jge 0x1bcff
movq -0x8(%rbp), %rsi
leaq -0x230(%rbp), %rdi
movq %rdi, -0x107f0(%rbp)
callq 0x24150
movq -0x107f0(%rbp), %rdx
leaq 0xe74d0(%rip), %rsi     # 0x102e21
leaq -0x210(%rbp), %rdi
callq 0x23c90
jmp 0x1b95f
leaq 0xe74cd(%rip), %rdx     # 0x102e33
leaq -0x1f0(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x23940
jmp 0x1b97b
movq -0x107e8(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %esi
leaq -0x250(%rbp), %rdi
callq 0x19600
jmp 0x1b995
leaq -0x1d0(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
leaq -0x250(%rbp), %rdx
callq 0x24080
jmp 0x1b9b1
leaq 0xecb38(%rip), %rdx     # 0x1084f0
leaq -0x1b0(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x23940
jmp 0x1b9cd
movq -0x107e8(%rbp), %rax
movzwl 0x2(%rax), %edi
callq 0x16430
movzwl %ax, %esi
leaq -0x270(%rbp), %rdi
callq 0x23760
jmp 0x1b9ee
leaq -0x190(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
leaq -0x270(%rbp), %rdx
callq 0x24080
jmp 0x1ba0a
leaq 0xe7435(%rip), %rdx     # 0x102e46
leaq -0x170(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x23940
jmp 0x1ba26
movl $0x2, %edi
leaq -0x170(%rbp), %rsi
callq 0x196f0
jmp 0x1ba39
leaq -0x170(%rbp), %rdi
callq 0xcf470
leaq -0x190(%rbp), %rdi
callq 0xcf470
leaq -0x270(%rbp), %rdi
callq 0xcf470
leaq -0x1b0(%rbp), %rdi
callq 0xcf470
leaq -0x1d0(%rbp), %rdi
callq 0xcf470
leaq -0x250(%rbp), %rdi
callq 0xcf470
leaq -0x1f0(%rbp), %rdi
callq 0xcf470
leaq -0x210(%rbp), %rdi
callq 0xcf470
leaq -0x230(%rbp), %rdi
callq 0xcf470
jmp 0x1bcff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1bbbf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1bbb3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1bba7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1bb9b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1bb8f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1bb86
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1bb7a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1bb71
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xcf470
leaq -0x58(%rbp), %rdi
callq 0xcf470
leaq -0x148(%rbp), %rdi
callq 0xcf470
leaq -0x78(%rbp), %rdi
callq 0xcf470
leaq -0x98(%rbp), %rdi
callq 0xcf470
leaq -0x128(%rbp), %rdi
callq 0xcf470
leaq -0xb8(%rbp), %rdi
callq 0xcf470
leaq -0xd8(%rbp), %rdi
callq 0xcf470
leaq -0xf8(%rbp), %rdi
callq 0xcf470
jmp 0x1ca84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1bcee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1bce2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1bcd6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1bcca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1bcbe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1bcb2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1bca6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1bc9a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x170(%rbp), %rdi
callq 0xcf470
leaq -0x190(%rbp), %rdi
callq 0xcf470
leaq -0x270(%rbp), %rdi
callq 0xcf470
leaq -0x1b0(%rbp), %rdi
callq 0xcf470
leaq -0x1d0(%rbp), %rdi
callq 0xcf470
leaq -0x250(%rbp), %rdi
callq 0xcf470
leaq -0x1f0(%rbp), %rdi
callq 0xcf470
leaq -0x210(%rbp), %rdi
callq 0xcf470
leaq -0x230(%rbp), %rdi
callq 0xcf470
jmp 0x1ca84
movl $0x1, -0x274(%rbp)
movl -0x14c(%rbp), %edi
movl $0x1, %esi
movl $0x2, %edx
leaq -0x274(%rbp), %rcx
movl $0x4, %r8d
callq 0x162c0
cmpl $0x0, %eax
jge 0x1bfec
movq -0x8(%rbp), %rsi
leaq -0x358(%rbp), %rdi
movq %rdi, -0x107f8(%rbp)
callq 0x24150
movq -0x107f8(%rbp), %rdx
leaq 0xe70c8(%rip), %rsi     # 0x102e21
leaq -0x338(%rbp), %rdi
callq 0x23c90
jmp 0x1bd67
leaq 0xe70c5(%rip), %rdx     # 0x102e33
leaq -0x318(%rbp), %rdi
leaq -0x338(%rbp), %rsi
callq 0x23940
jmp 0x1bd83
movq -0x107e8(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %esi
leaq -0x378(%rbp), %rdi
callq 0x19600
jmp 0x1bd9d
leaq -0x2f8(%rbp), %rdi
leaq -0x318(%rbp), %rsi
leaq -0x378(%rbp), %rdx
callq 0x24080
jmp 0x1bdb9
leaq 0xec730(%rip), %rdx     # 0x1084f0
leaq -0x2d8(%rbp), %rdi
leaq -0x2f8(%rbp), %rsi
callq 0x23940
jmp 0x1bdd5
movq -0x107e8(%rbp), %rax
movzwl 0x2(%rax), %edi
callq 0x16430
movzwl %ax, %esi
leaq -0x398(%rbp), %rdi
callq 0x23760
jmp 0x1bdf6
leaq -0x2b8(%rbp), %rdi
leaq -0x2d8(%rbp), %rsi
leaq -0x398(%rbp), %rdx
callq 0x24080
jmp 0x1be12
leaq 0xe704f(%rip), %rdx     # 0x102e68
leaq -0x298(%rbp), %rdi
leaq -0x2b8(%rbp), %rsi
callq 0x23940
jmp 0x1be2e
movl $0x2, %edi
leaq -0x298(%rbp), %rsi
callq 0x196f0
jmp 0x1be41
leaq -0x298(%rbp), %rdi
callq 0xcf470
leaq -0x2b8(%rbp), %rdi
callq 0xcf470
leaq -0x398(%rbp), %rdi
callq 0xcf470
leaq -0x2d8(%rbp), %rdi
callq 0xcf470
leaq -0x2f8(%rbp), %rdi
callq 0xcf470
leaq -0x378(%rbp), %rdi
callq 0xcf470
leaq -0x318(%rbp), %rdi
callq 0xcf470
leaq -0x338(%rbp), %rdi
callq 0xcf470
leaq -0x358(%rbp), %rdi
callq 0xcf470
movl -0x14c(%rbp), %edi
callq 0x16140
jmp 0x1ca7b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1bfdb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1bfcf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1bfc3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1bfb7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1bfab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1bf9f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1bf93
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1bf87
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x298(%rbp), %rdi
callq 0xcf470
leaq -0x2b8(%rbp), %rdi
callq 0xcf470
leaq -0x398(%rbp), %rdi
callq 0xcf470
leaq -0x2d8(%rbp), %rdi
callq 0xcf470
leaq -0x2f8(%rbp), %rdi
callq 0xcf470
leaq -0x378(%rbp), %rdi
callq 0xcf470
leaq -0x318(%rbp), %rdi
callq 0xcf470
leaq -0x338(%rbp), %rdi
callq 0xcf470
leaq -0x358(%rbp), %rdi
callq 0xcf470
jmp 0x1ca84
movq -0x107e8(%rbp), %rsi
movl -0x14c(%rbp), %edi
movl $0x10, %edx
callq 0x167c0
cmpl $0x0, %eax
je 0x1c2c4
movq -0x8(%rbp), %rsi
leaq -0x478(%rbp), %rdi
movq %rdi, -0x10800(%rbp)
callq 0x24150
movq -0x10800(%rbp), %rdx
leaq 0xe6df0(%rip), %rsi     # 0x102e21
leaq -0x458(%rbp), %rdi
callq 0x23c90
jmp 0x1c03f
leaq 0xe6ded(%rip), %rdx     # 0x102e33
leaq -0x438(%rbp), %rdi
leaq -0x458(%rbp), %rsi
callq 0x23940
jmp 0x1c05b
movq -0x107e8(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %esi
leaq -0x498(%rbp), %rdi
callq 0x19600
jmp 0x1c075
leaq -0x418(%rbp), %rdi
leaq -0x438(%rbp), %rsi
leaq -0x498(%rbp), %rdx
callq 0x24080
jmp 0x1c091
leaq 0xec458(%rip), %rdx     # 0x1084f0
leaq -0x3f8(%rbp), %rdi
leaq -0x418(%rbp), %rsi
callq 0x23940
jmp 0x1c0ad
movq -0x107e8(%rbp), %rax
movzwl 0x2(%rax), %edi
callq 0x16430
movzwl %ax, %esi
leaq -0x4b8(%rbp), %rdi
callq 0x23760
jmp 0x1c0ce
leaq -0x3d8(%rbp), %rdi
leaq -0x3f8(%rbp), %rsi
leaq -0x4b8(%rbp), %rdx
callq 0x24080
jmp 0x1c0ea
leaq 0xe6d93(%rip), %rdx     # 0x102e84
leaq -0x3b8(%rbp), %rdi
leaq -0x3d8(%rbp), %rsi
callq 0x23940
jmp 0x1c106
movl $0x2, %edi
leaq -0x3b8(%rbp), %rsi
callq 0x196f0
jmp 0x1c119
leaq -0x3b8(%rbp), %rdi
callq 0xcf470
leaq -0x3d8(%rbp), %rdi
callq 0xcf470
leaq -0x4b8(%rbp), %rdi
callq 0xcf470
leaq -0x3f8(%rbp), %rdi
callq 0xcf470
leaq -0x418(%rbp), %rdi
callq 0xcf470
leaq -0x498(%rbp), %rdi
callq 0xcf470
leaq -0x438(%rbp), %rdi
callq 0xcf470
leaq -0x458(%rbp), %rdi
callq 0xcf470
leaq -0x478(%rbp), %rdi
callq 0xcf470
movl -0x14c(%rbp), %edi
callq 0x16140
jmp 0x1ca7b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1c2b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1c2a7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1c29b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1c28f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1c283
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1c277
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1c26b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1c25f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x3b8(%rbp), %rdi
callq 0xcf470
leaq -0x3d8(%rbp), %rdi
callq 0xcf470
leaq -0x4b8(%rbp), %rdi
callq 0xcf470
leaq -0x3f8(%rbp), %rdi
callq 0xcf470
leaq -0x418(%rbp), %rdi
callq 0xcf470
leaq -0x498(%rbp), %rdi
callq 0xcf470
leaq -0x438(%rbp), %rdi
callq 0xcf470
leaq -0x458(%rbp), %rdi
callq 0xcf470
leaq -0x478(%rbp), %rdi
callq 0xcf470
jmp 0x1ca84
jmp 0x1c2c6
movq -0x107e8(%rbp), %rcx
movl -0x14c(%rbp), %edi
addq $0x10, %rcx
xorl %esi, %esi
movl $0x23, %edx
movl $0x8, %r8d
callq 0x162c0
cmpl $0x0, %eax
jge 0x1c5d8
movq -0x8(%rbp), %rsi
leaq -0x598(%rbp), %rdi
movq %rdi, -0x10808(%rbp)
callq 0x24150
movq -0x10808(%rbp), %rdx
leaq 0xe6b0a(%rip), %rsi     # 0x102e21
leaq -0x578(%rbp), %rdi
callq 0x23c90
jmp 0x1c325
leaq 0xe6b07(%rip), %rdx     # 0x102e33
leaq -0x558(%rbp), %rdi
leaq -0x578(%rbp), %rsi
callq 0x23940
jmp 0x1c341
movq -0x107e8(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %esi
leaq -0x5b8(%rbp), %rdi
callq 0x19600
jmp 0x1c35b
leaq -0x538(%rbp), %rdi
leaq -0x558(%rbp), %rsi
leaq -0x5b8(%rbp), %rdx
callq 0x24080
jmp 0x1c377
leaq 0xec172(%rip), %rdx     # 0x1084f0
leaq -0x518(%rbp), %rdi
leaq -0x538(%rbp), %rsi
callq 0x23940
jmp 0x1c393
movq -0x107e8(%rbp), %rax
movzwl 0x2(%rax), %edi
callq 0x16430
movzwl %ax, %esi
leaq -0x5d8(%rbp), %rdi
callq 0x23760
jmp 0x1c3b4
leaq -0x4f8(%rbp), %rdi
leaq -0x518(%rbp), %rsi
leaq -0x5d8(%rbp), %rdx
callq 0x24080
jmp 0x1c3d0
leaq 0xe6acf(%rip), %rdx     # 0x102ea6
leaq -0x4d8(%rbp), %rdi
leaq -0x4f8(%rbp), %rsi
callq 0x23940
jmp 0x1c3ec
movl $0x2, %edi
leaq -0x4d8(%rbp), %rsi
callq 0x196f0
jmp 0x1c3ff
leaq -0x4d8(%rbp), %rdi
callq 0xcf470
leaq -0x4f8(%rbp), %rdi
callq 0xcf470
leaq -0x5d8(%rbp), %rdi
callq 0xcf470
leaq -0x518(%rbp), %rdi
callq 0xcf470
leaq -0x538(%rbp), %rdi
callq 0xcf470
leaq -0x5b8(%rbp), %rdi
callq 0xcf470
leaq -0x558(%rbp), %rdi
callq 0xcf470
leaq -0x578(%rbp), %rdi
callq 0xcf470
leaq -0x598(%rbp), %rdi
callq 0xcf470
movl -0x14c(%rbp), %edi
callq 0x16140
leaq 0x1405c3(%rip), %rdi    # 0x15ca40
callq 0x24230
leaq 0x14060f(%rip), %rdi    # 0x15ca98
leaq -0x8(%rbp), %rsi
callq 0x24260
movl $0x1, (%rax)
leaq 0x1405a1(%rip), %rdi    # 0x15ca40
callq 0x24340
jmp 0x1ca7b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1c5c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1c5bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1c5af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1c5a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1c597
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1c58b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1c57f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1c573
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x4d8(%rbp), %rdi
callq 0xcf470
leaq -0x4f8(%rbp), %rdi
callq 0xcf470
leaq -0x5d8(%rbp), %rdi
callq 0xcf470
leaq -0x518(%rbp), %rdi
callq 0xcf470
leaq -0x538(%rbp), %rdi
callq 0xcf470
leaq -0x5b8(%rbp), %rdi
callq 0xcf470
leaq -0x558(%rbp), %rdi
callq 0xcf470
leaq -0x578(%rbp), %rdi
callq 0xcf470
leaq -0x598(%rbp), %rdi
callq 0xcf470
jmp 0x1ca84
movb 0x1404b4(%rip), %al     # 0x15ca92
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x1c5ed
jmp 0x1c6ab
callq 0x5d160
movq %rax, -0x5e8(%rbp)
movl $0x1e, -0x5f4(%rbp)
leaq -0x5f0(%rbp), %rdi
leaq -0x5f4(%rbp), %rsi
callq 0x243b0
leaq -0x5e8(%rbp), %rdi
leaq -0x5f0(%rbp), %rsi
callq 0x24360
movq %rax, -0x5e0(%rbp)
movb 0x1403db(%rip), %al     # 0x15ca11
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x1c642
jmp 0x1c694
movl $0x64, -0x604(%rbp)
leaq -0x600(%rbp), %rdi
leaq -0x604(%rbp), %rsi
callq 0x24480
leaq -0x600(%rbp), %rdi
callq 0x243d0
callq 0x5d160
movq %rax, -0x610(%rbp)
leaq -0x610(%rbp), %rdi
leaq -0x5e0(%rbp), %rsi
callq 0x244a0
testb $0x1, %al
jne 0x1c690
jmp 0x1c692
jmp 0x1c694
jmp 0x1c630
movb 0x140377(%rip), %al     # 0x15ca11
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x1c6a6
jmp 0x1c6ab
jmp 0x1c2c6
movb 0x1403e1(%rip), %al     # 0x15ca92
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x1ca42
callq 0x5d160
movq -0x107e8(%rbp), %rsi
movq %rax, -0x620(%rbp)
addq $0x18, %rsi
leaq -0x620(%rbp), %rdi
callq 0x24360
movq %rax, -0x618(%rbp)
movl $0x80, -0x106ac(%rbp)
leaq -0x106a0(%rbp), %rdi
xorl %esi, %esi
movl $0x80, %edx
callq 0x16100
leaq -0x10620(%rbp), %rdi
xorl %esi, %esi
movl $0xffff, %edx           # imm = 0xFFFF
callq 0x16100
movl -0x14c(%rbp), %edi
leaq -0x10620(%rbp), %rsi
movl $0xffff, %edx           # imm = 0xFFFF
movl $0x40, %ecx
leaq -0x106a0(%rbp), %r8
leaq -0x106ac(%rbp), %r9
callq 0x16700
movq %rax, -0x106a8(%rbp)
cmpq $0x0, -0x106a8(%rbp)
jle 0x1ca02
movq -0x8(%rbp), %rsi
leaq -0x10790(%rbp), %rdi
movq %rdi, -0x10810(%rbp)
callq 0x24150
movq -0x10810(%rbp), %rdx
leaq 0xe66a4(%rip), %rsi     # 0x102e21
leaq -0x10770(%rbp), %rdi
callq 0x23c90
jmp 0x1c78b
leaq 0xe66a1(%rip), %rdx     # 0x102e33
leaq -0x10750(%rbp), %rdi
leaq -0x10770(%rbp), %rsi
callq 0x23940
jmp 0x1c7a7
movq -0x107e8(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %esi
leaq -0x107b0(%rbp), %rdi
callq 0x19600
jmp 0x1c7c1
leaq -0x10730(%rbp), %rdi
leaq -0x10750(%rbp), %rsi
leaq -0x107b0(%rbp), %rdx
callq 0x24080
jmp 0x1c7dd
leaq 0xebd0c(%rip), %rdx     # 0x1084f0
leaq -0x10710(%rbp), %rdi
leaq -0x10730(%rbp), %rsi
callq 0x23940
jmp 0x1c7f9
movq -0x107e8(%rbp), %rax
movzwl 0x2(%rax), %edi
callq 0x16430
movzwl %ax, %esi
leaq -0x107d0(%rbp), %rdi
callq 0x23760
jmp 0x1c81a
leaq -0x106f0(%rbp), %rdi
leaq -0x10710(%rbp), %rsi
leaq -0x107d0(%rbp), %rdx
callq 0x24080
jmp 0x1c836
leaq 0xe6695(%rip), %rdx     # 0x102ed2
leaq -0x106d0(%rbp), %rdi
leaq -0x106f0(%rbp), %rsi
callq 0x23940
jmp 0x1c852
xorl %edi, %edi
leaq -0x106d0(%rbp), %rsi
callq 0x196f0
jmp 0x1c862
leaq -0x106d0(%rbp), %rdi
callq 0xcf470
leaq -0x106f0(%rbp), %rdi
callq 0xcf470
leaq -0x107d0(%rbp), %rdi
callq 0xcf470
leaq -0x10710(%rbp), %rdi
callq 0xcf470
leaq -0x10730(%rbp), %rdi
callq 0xcf470
leaq -0x107b0(%rbp), %rdi
callq 0xcf470
leaq -0x10750(%rbp), %rdi
callq 0xcf470
leaq -0x10770(%rbp), %rdi
callq 0xcf470
leaq -0x10790(%rbp), %rdi
callq 0xcf470
jmp 0x1ca02
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1c9f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1c9e5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1c9d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1c9cd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1c9c1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1c9b5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1c9a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1c99d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x106d0(%rbp), %rdi
callq 0xcf470
leaq -0x106f0(%rbp), %rdi
callq 0xcf470
leaq -0x107d0(%rbp), %rdi
callq 0xcf470
leaq -0x10710(%rbp), %rdi
callq 0xcf470
leaq -0x10730(%rbp), %rdi
callq 0xcf470
leaq -0x107b0(%rbp), %rdi
callq 0xcf470
leaq -0x10750(%rbp), %rdi
callq 0xcf470
leaq -0x10770(%rbp), %rdi
callq 0xcf470
leaq -0x10790(%rbp), %rdi
callq 0xcf470
jmp 0x1ca84
movb 0x140009(%rip), %al     # 0x15ca11
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x1ca14
jmp 0x1ca40
callq 0x5d160
movq %rax, -0x107d8(%rbp)
leaq -0x107d8(%rbp), %rdi
leaq -0x618(%rbp), %rsi
callq 0x244a0
testb $0x1, %al
jne 0x1ca39
jmp 0x1ca3b
jmp 0x1ca40
jmp 0x1c6e9
jmp 0x1ca42
movl -0x14c(%rbp), %edi
callq 0x16140
leaq 0x13ffec(%rip), %rdi    # 0x15ca40
callq 0x24230
leaq 0x140038(%rip), %rdi    # 0x15ca98
leaq -0x8(%rbp), %rsi
callq 0x24260
movl $0x1, (%rax)
leaq 0x13ffca(%rip), %rdi    # 0x15ca40
callq 0x24340
addq $0x10810, %rsp          # imm = 0x10810
popq %rbp
retq
movq -0x100(%rbp), %rdi
callq 0xfeff0