// File: /workspace/github_c_makefile_star2_O2/adsr[P]phpspy/top.c
// Function: main_top
int main_top(int argc, char **argv) {
    fd_set readfds;
    int ttyfd, outfd, errfd, maxfd;
    pid_t pid;
    struct timeval timeout;
    struct timespec ts, last_display;
    struct tb_event event;
    int rc, i;
    /* TODO consider doing this by aggregating in-process instead of fork/stdout */

    outfd = errfd = ttyfd = pid = -1;

    if (opt_pid == -1 && opt_pgrep_args == NULL && optind >= argc) {
        /* TODO DRY with main() */
        log_error("Expected pid (-p), pgrep (-P), or command\n\n");
        usage(stderr, 1);
        return 1;
    }

    /* TODO refactor this function */
    filter_child_args(argc, argv);
    snprintf(phpspy_args, BUF_SIZE, "phpspy ");
    for (i = 1; i < argc; i++) {
        snprintf(phpspy_args+strlen(phpspy_args), BUF_SIZE-strlen(phpspy_args), "%s ", argv[i]);
    }

    if ((ttyfd = open("/dev/tty", O_RDONLY)) < 0) {
        perror("open");
        return 1;
    }
    if ((fork_child(argc, argv, &pid, &outfd, &errfd)) < 0) {
        return 1;
    }
    maxfd = PHPSPY_MAX(PHPSPY_MAX(ttyfd, outfd), errfd);

    last_display.tv_sec = 0;
    last_display.tv_nsec = 0;

    tb_init(); /* TODO support for ncurses for portability sake? */
    while (!done) {
        clock_gettime(CLOCK_MONOTONIC, &ts);
        if (last_display.tv_sec == 0 || ts.tv_sec - last_display.tv_sec >= 1) {
            display();
            last_display = ts;
        }
        FD_ZERO(&readfds);
        FD_SET(ttyfd, &readfds);
        FD_SET(outfd, &readfds);
        FD_SET(errfd, &readfds);
        timeout.tv_sec = 1;
        timeout.tv_usec = 0;
        rc = select(maxfd + 1, &readfds, NULL, NULL, &timeout);
        if (rc < 0) {
            if (errno == EINTR) {
                /* Probably due to SIGWINCH (terminal resize) */
                /* Call tb_peek_event to let termbox update dimensions */
                tb_peek_event(&event, 0);
                last_display.tv_sec = 0; /* Immediately re-display */
                continue;
            }
            perror("select");
            break;
        }
        if (FD_ISSET(outfd, &readfds)) {
            read_child_out(outfd);
        }
        if (FD_ISSET(errfd, &readfds)) {
            read_child_err(errfd);
        }
        if (FD_ISSET(ttyfd, &readfds)) {
            event.type = 0;
            tb_peek_event(&event, 0);
            handle_event(&event);
        }
    }
    tb_shutdown();

    close(outfd);
    close(errfd);
    close(ttyfd);
    kill(pid, SIGTERM);
    waitpid(pid, NULL, 0);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x338, %rsp            # imm = 0x338
movq %rsi, %rbx
leaq 0xe66d(%rip), %rax      # 0x25330
cmpl $-0x1, (%rax)
pushq $0x1
popq %r14
jne 0x16d09
leaq 0xf3cd(%rip), %rax      # 0x260a0
cmpq $0x0, (%rax)
jne 0x16d09
movq 0xe2e8(%rip), %rax      # 0x24fc8
cmpl %edi, (%rax)
jl 0x16d09
leaq 0x4cda(%rip), %rdi      # 0x1b9c5
xorl %eax, %eax
callq 0xa442
movq 0xe2f7(%rip), %rax      # 0x24ff0
movq (%rax), %rdi
movl %r14d, %esi
callq 0xa4ea
jmp 0x17cb8
xorl %r15d, %r15d
testl %edi, %edi
movl $0x0, %r12d
movl %edi, 0x8(%rsp)
cmovgl %edi, %r12d
pushq $0x8
popq %r13
cmpq %r15, %r12
je 0x16dc2
movq (%rbx,%r15,8), %r14
movb (%r14), %bpl
cmpb $0x2d, %bpl
jne 0x16d3d
cmpb $0x6f, 0x1(%r14)
je 0x16d53
movq %r14, %rdi
leaq 0x7271(%rip), %rsi      # 0x1dfb8
movq %r13, %rdx
callq 0x6080
testl %eax, %eax
jne 0x16d67
movb $0x23, 0x1(%r14)
movq (%rbx,%r15,8), %rax
movb $0x0, 0x2(%rax)
movq (%rbx,%r15,8), %r14
movb (%r14), %bpl
cmpb $0x2d, %bpl
jne 0x16d74
cmpb $0x31, 0x1(%r14)
je 0x16dad
movq %r14, %rdi
leaq 0x7243(%rip), %rsi      # 0x1dfc1
pushq $0xd
popq %rdx
callq 0x6080
testl %eax, %eax
je 0x16dad
cmpb $0x2d, %bpl
jne 0x16d97
cmpb $0x74, 0x1(%r14)
je 0x16dad
movq %r14, %rdi
leaq 0x722e(%rip), %rsi      # 0x1dfcf
pushq $0x5
popq %rdx
callq 0x6080
testl %eax, %eax
jne 0x16dba
movb $0x40, 0x1(%r14)
movq (%rbx,%r15,8), %rax
movb $0x0, 0x2(%rax)
incq %r15
jmp 0x16d20
movabsq $0x20797073706870, %rax # imm = 0x20797073706870
movq %rax, 0xf45d(%rip)      # 0x26230
movslq 0x8(%rsp), %r12
pushq $0x1
popq %r13
leaq 0xf44d(%rip), %r14      # 0x26230
leaq 0x71be(%rip), %r15      # 0x1dfa8
cmpq %r12, %r13
jge 0x16e16
movq %r14, %rdi
callq 0x6160
leaq (%r14,%rax), %rdi
movl $0x200, %esi            # imm = 0x200
subq %rax, %rsi
movq (%rbx,%r13,8), %rcx
movq %r15, %rdx
xorl %eax, %eax
callq 0x61d0
incq %r13
jmp 0x16dea
leaq 0x4a37(%rip), %rdi      # 0x1b854
xorl %esi, %esi
xorl %eax, %eax
callq 0x64f0
movl %eax, 0x14(%rsp)
testl %eax, %eax
js 0x17c47
leaq 0x130(%rsp), %r12
movq %r12, %rdi
callq 0x6270
testl %eax, %eax
js 0x17c2c
leaq 0xb0(%rsp), %rdi
callq 0x6270
testl %eax, %eax
js 0x17c2c
callq 0x6600
testl %eax, %eax
je 0x17cd5
movl %eax, 0x10(%rsp)
js 0x17c59
movl 0x134(%rsp), %edi
callq 0x6260
movl 0xb4(%rsp), %edi
callq 0x6260
movl 0x130(%rsp), %ebp
movl 0xb0(%rsp), %r14d
movl 0x14(%rsp), %ebx
cmpl %ebp, %ebx
movl %ebp, %r15d
cmovgl %ebx, %r15d
cmpl %r14d, %r15d
cmovlel %r14d, %r15d
callq 0x672c
pushq $0x1
popq %rdi
movq %rdi, %r13
movl %ebx, %ecx
shlq %cl, %r13
movl %ebx, %r8d
pushq $0x40
popq %rsi
movl %ebp, %eax
cltd
idivl %esi
movslq %eax, %rdx
shll $0x6, %eax
movl %ebp, 0x1c(%rsp)
movl %ebp, %ecx
movq %rdx, %rbp
subl %eax, %ecx
movq %rdi, %rbx
shlq %cl, %rbx
movl %r14d, %eax
cltd
idivl %esi
movslq %eax, %rcx
movq %rcx, 0x58(%rsp)
shll $0x6, %eax
movl %r14d, 0x18(%rsp)
subl %eax, %r14d
movl %r14d, %ecx
shlq %cl, %rdi
movq %rdi, 0x50(%rsp)
shrl $0x6, %r8d
movq %r8, 0x60(%rsp)
incl %r15d
movl %r15d, 0x44(%rsp)
pushq $0xa
popq %r14
leaq 0xf51d(%rip), %r15      # 0x26440
movq $0x0, 0x38(%rsp)
movq %rbp, 0x28(%rsp)
movq %rbx, 0x48(%rsp)
movq %r13, 0x70(%rsp)
leaq 0xf1d2(%rip), %rax      # 0x26114
cmpl $0x0, (%rax)
jne 0x17c7c
pushq $0x1
popq %rdi
leaq 0x90(%rsp), %rsi
callq 0x6110
movq 0x38(%rsp), %rax
testq %rax, %rax
je 0x16f73
cmpq %rax, 0x90(%rsp)
jle 0x17153
movq 0xf6ce(%rip), %rsi      # 0x26648
testq %rsi, %rsi
je 0x16faf
movq 0xf6d2(%rip), %rdi      # 0x26658
pushq $0x8
popq %rdx
leaq 0xdb3(%rip), %rcx       # 0x17d43
callq 0x60b0
movq 0xf6c4(%rip), %rax      # 0x26660
testq %rax, %rax
js 0x17a5b
cvtsi2ss %rax, %xmm0
jmp 0x17a72
movq 0xf6aa(%rip), %rax      # 0x26660
addq %rax, 0xf6bb(%rip)      # 0x26678
callq 0x70b7
callq 0x708f
movl %eax, %ebp
callq 0x70a3
movl %eax, %ebx
xorl %edi, %edi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
xorl %ecx, %ecx
leaq 0x7086(%rip), %r8       # 0x1e068
leaq 0xf247(%rip), %r9       # 0x26230
xorl %eax, %eax
callq 0x7dcc
movq 0xf681(%rip), %r9       # 0x26678
xorl %edi, %edi
pushq $0x1
popq %rsi
xorl %edx, %edx
xorl %ecx, %ecx
leaq 0x6fd3(%rip), %r8       # 0x1dfda
xorl %eax, %eax
pushq 0xf639(%rip)            # 0x26648
pushq 0xf653(%rip)            # 0x26668
callq 0x7dcc
addq $0x10, %rsp
xorl %edi, %edi
pushq $0x3
popq %r14
movl %r14d, %esi
movl $0x500, %edx            # imm = 0x500
xorl %ecx, %ecx
leaq 0x6fd6(%rip), %r8       # 0x1e00b
leaq 0x6fed(%rip), %r9       # 0x1e029
xorl %eax, %eax
leaq 0x6ff0(%rip), %r10      # 0x1e035
pushq %r10
leaq 0x6fe2(%rip), %r10      # 0x1e030
pushq %r10
leaq 0x6fd3(%rip), %r10      # 0x1e02a
pushq %r10
leaq 0x6fcf(%rip), %r10      # 0x1e02f
pushq %r10
callq 0x7dcc
addq $0x20, %rsp
addl $-0x34, %ebp
subq $0x8, %rsp
pushq $0x34
popq %rdi
movl %r14d, %esi
movl $0x500, %edx            # imm = 0x500
xorl %ecx, %ecx
leaq 0x6fb5(%rip), %r8       # 0x1e03b
movl %ebp, %r9d
xorl %eax, %eax
leaq 0x6da3(%rip), %r10      # 0x1de35
pushq %r10
callq 0x7dcc
addq $0x10, %rsp
xorl %r14d, %r14d
leaq 0x6f99(%rip), %r15      # 0x1e040
leaq 0x4(%r14), %rsi
movq 0xf596(%rip), %rcx      # 0x26648
movq 0xf59f(%rip), %rax      # 0x26658
cmpl %ebx, %esi
jge 0x17106
cmpq %rcx, %r14
jae 0x17106
movq (%rax,%r14,8), %r10
incq %r14
movq 0x118(%r10), %r9
cvtss2sd 0x120(%r10), %xmm0
xorl %edi, %edi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r15, %r8
movb $0x1, %al
pushq %r10
pushq 0x100(%r10)
pushq 0x108(%r10)
pushq 0x110(%r10)
callq 0x7dcc
addq $0x20, %rsp
jmp 0x170a7
xorl %edx, %edx
movq 0x28(%rsp), %rbp
movq 0x48(%rsp), %rbx
xorps %xmm0, %xmm0
pushq $0xa
popq %r14
leaq 0xf320(%rip), %r15      # 0x26440
cmpq %rdx, %rcx
je 0x17135
movq (%rax,%rdx,8), %rsi
incq %rdx
movups %xmm0, 0x100(%rsi)
jmp 0x17120
andq $0x0, 0xf523(%rip)      # 0x26660
cmpl $0x0, 0xf52c(%rip)      # 0x26670
jne 0x1714b
callq 0x7127
movq 0x90(%rsp), %rax
movq %rax, 0x38(%rsp)
xorl %eax, %eax
cmpq $0x10, %rax
je 0x1716e
andq $0x0, 0xb0(%rsp,%rax,8)
incq %rax
jmp 0x1715a
movq 0x60(%rsp), %rax
orq %r13, 0xb0(%rsp,%rax,8)
orq %rbx, 0xb0(%rsp,%rbp,8)
movq 0x58(%rsp), %rax
movq 0x50(%rsp), %rcx
orq %rcx, 0xb0(%rsp,%rax,8)
movq $0x1, 0xa0(%rsp)
andq $0x0, 0xa8(%rsp)
movl 0x44(%rsp), %edi
leaq 0xb0(%rsp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
leaq 0xa0(%rsp), %r8
callq 0x6390
testl %eax, %eax
js 0x17201
testq %rbx, 0xb0(%rsp,%rbp,8)
je 0x17b06
movq 0xf250(%rip), %rsi      # 0x26430
movq %rsi, %rdx
subq $0x200, %rdx            # imm = 0x200
movl 0x1c(%rsp), %edi
jne 0x17229
andq $0x0, 0xf238(%rip)      # 0x26430
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
jmp 0x1722c
callq 0x6060
cmpl $0x4, (%rax)
jne 0x17c70
leaq 0x78(%rsp), %rdi
xorl %esi, %esi
callq 0x7a5c
movq $0x0, 0x38(%rsp)
jmp 0x16f3b
negq %rdx
addq %r15, %rsi
callq 0x62b0
testq %rax, %rax
js 0x17c0a
je 0x17af9
movq %rax, %rbx
addq 0xf1e3(%rip), %rbx      # 0x26430
movq %rbx, 0xf1dc(%rip)      # 0x26430
movq %r15, %rdi
movl %r14d, %esi
movq %rbx, %rdx
callq 0x62a0
testq %rax, %rax
je 0x17b06
movq %rax, %r13
movq %rax, %rbx
subq %r15, %rbx
cmpl $0x3, %ebx
jl 0x17a2b
cmpb $0x23, 0xf1bc(%rip)     # 0x26440
je 0x17a2b
leaq 0xf1af(%rip), %rdi      # 0x26440
movq %r12, %rsi
movl %r14d, %edx
callq 0x62e0
testq %rax, %rax
jne 0x172ae
cmpb $0x30, 0xf198(%rip)     # 0x26440
jne 0x17a2b
movq 0x130(%rsp), %r10
cmpb $0x20, (%r10)
jne 0x17a2b
leaq 0x1(%r10), %rdx
movl %ebx, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
leaq 0xf16d(%rip), %r15      # 0x26440
movq %rdx, 0x8(%rsp)
subq %rdx, %r15
leaq (%r15,%rcx), %rdx
addq $-0x100, %rdx
cmpq $-0xff, %rdx
jb 0x17a2b
movq %rax, 0x30(%rsp)
addq %rcx, %r15
addq $0xb, %r10
movl $0xfeedbeef, %ecx       # imm = 0xFEEDBEEF
movl $0x9e3779b9, %edx       # imm = 0x9E3779B9
movl %r15d, %edi
movl $0x9e3779b9, %esi       # imm = 0x9E3779B9
cmpl $0xc, %edi
jb 0x173ae
addl -0x6(%r10), %edx
addl -0x2(%r10), %ecx
addl -0xa(%r10), %esi
subl %edx, %esi
subl %ecx, %esi
movl %ecx, %r8d
shrl $0xd, %r8d
xorl %esi, %r8d
subl %ecx, %edx
subl %r8d, %edx
movl %r8d, %esi
shll $0x8, %esi
xorl %edx, %esi
subl %r8d, %ecx
subl %esi, %ecx
movl %esi, %edx
shrl $0xd, %edx
xorl %ecx, %edx
subl %esi, %r8d
subl %edx, %r8d
movl %edx, %ecx
shrl $0xc, %ecx
xorl %r8d, %ecx
subl %edx, %esi
subl %ecx, %esi
movl %ecx, %r8d
shll $0x10, %r8d
xorl %esi, %r8d
subl %ecx, %edx
subl %r8d, %edx
movl %r8d, %r9d
shrl $0x5, %r9d
xorl %edx, %r9d
subl %r8d, %ecx
subl %r9d, %ecx
movl %r9d, %esi
shrl $0x3, %esi
xorl %ecx, %esi
subl %r9d, %r8d
subl %esi, %r8d
movl %esi, %edx
shll $0xa, %edx
xorl %r8d, %edx
subl %esi, %r9d
subl %edx, %r9d
movl %edx, %ecx
shrl $0xf, %ecx
xorl %r9d, %ecx
addl $-0xc, %edi
addq $0xc, %r10
jmp 0x17311
addl %r15d, %ecx
decl %edi
cmpl $0xa, %edi
ja 0x17449
leaq 0x6b8d(%rip), %r8       # 0x1df50
movslq (%r8,%rdi,4), %rdi
addq %r8, %rdi
jmpq *%rdi
movzbl (%r10), %edi
shll $0x18, %edi
addl %ecx, %edi
movl %edi, %ecx
movzbl -0x1(%r10), %edi
shll $0x10, %edi
addl %ecx, %edi
movl %edi, %ecx
movzbl -0x2(%r10), %edi
shll $0x8, %edi
addl %ecx, %edi
movl %edi, %ecx
movzbl -0x3(%r10), %edi
shll $0x18, %edi
addl %edx, %edi
movl %edi, %edx
movzbl -0x4(%r10), %edi
shll $0x10, %edi
addl %edx, %edi
movl %edi, %edx
movzbl -0x5(%r10), %edi
shll $0x8, %edi
addl %edx, %edi
movl %edi, %edx
movzbl -0x6(%r10), %edi
addl %edx, %edi
movl %edi, %edx
movzbl -0x7(%r10), %edi
shll $0x18, %edi
addl %esi, %edi
movl %edi, %esi
movzbl -0x8(%r10), %edi
shll $0x10, %edi
addl %esi, %edi
movl %edi, %esi
movzbl -0x9(%r10), %edi
shll $0x8, %edi
addl %esi, %edi
movl %edi, %esi
movzbl -0xa(%r10), %eax
addl %esi, %eax
movl %eax, %esi
movq 0xf1f0(%rip), %rax      # 0x26640
testq %rax, %rax
je 0x1753e
subl %edx, %esi
subl %ecx, %esi
movl %ecx, %edi
shrl $0xd, %edi
xorl %esi, %edi
subl %ecx, %edx
subl %edi, %edx
movl %edi, %esi
shll $0x8, %esi
xorl %edx, %esi
subl %edi, %ecx
subl %esi, %ecx
movl %esi, %edx
shrl $0xd, %edx
xorl %ecx, %edx
subl %esi, %edi
subl %edx, %edi
movl %edx, %ecx
shrl $0xc, %ecx
xorl %edi, %ecx
subl %edx, %esi
subl %ecx, %esi
movl %ecx, %edi
shll $0x10, %edi
xorl %esi, %edi
subl %ecx, %edx
subl %edi, %edx
movl %edi, %esi
shrl $0x5, %esi
xorl %edx, %esi
subl %edi, %ecx
subl %esi, %ecx
movl %esi, %edx
shrl $0x3, %edx
xorl %ecx, %edx
subl %esi, %edi
subl %edx, %edi
movl %edx, %r14d
shll $0xa, %r14d
xorl %edi, %r14d
addl %r14d, %edx
subl %edx, %esi
shrl $0xf, %r14d
xorl %esi, %r14d
movq 0x128(%rax), %rbp
movl 0x8(%rbp), %eax
decl %eax
andl %r14d, %eax
movq (%rbp), %rcx
shlq $0x4, %rax
movq (%rcx,%rax), %r12
testq %r12, %r12
je 0x174e6
subq 0x20(%rbp), %r12
jmp 0x174e9
xorl %r12d, %r12d
testq %r12, %r12
je 0x1753e
cmpl %r14d, 0x15c(%r12)
jne 0x17522
movl 0x158(%r12), %eax
cmpq %rax, %r15
jne 0x17522
movq 0x150(%r12), %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
callq 0x6410
testl %eax, %eax
je 0x1799b
movq 0x148(%r12), %rax
movl $0x0, %r12d
testq %rax, %rax
je 0x174e9
subq 0x20(%rbp), %rax
movq %rax, %r12
jmp 0x174e9
movl $0x160, %esi            # imm = 0x160
pushq $0x1
popq %rdi
callq 0x62f0
movq %rax, %r14
movq %rax, %r12
movl $0x100, %esi            # imm = 0x100
movq %rax, %rdi
leaq 0x64c5(%rip), %rdx      # 0x1da25
movl %r15d, %ecx
movq 0x8(%rsp), %r8
xorl %eax, %eax
callq 0x61d0
movq %r14, %rdi
callq 0x6160
movq %r14, %r11
leaq 0xa(%r14), %rcx
movl $0x9e3779b9, %edi       # imm = 0x9E3779B9
movl $0xfeedbeef, %edx       # imm = 0xFEEDBEEF
movl $0x9e3779b9, %esi       # imm = 0x9E3779B9
movl %eax, %r8d
cmpl $0xc, %r8d
jb 0x1762c
addl -0x6(%rcx), %esi
addl -0x2(%rcx), %edx
addl -0xa(%rcx), %edi
subl %esi, %edi
subl %edx, %edi
movl %edx, %r9d
shrl $0xd, %r9d
xorl %edi, %r9d
subl %edx, %esi
subl %r9d, %esi
movl %r9d, %edi
shll $0x8, %edi
xorl %esi, %edi
subl %r9d, %edx
subl %edi, %edx
movl %edi, %esi
shrl $0xd, %esi
xorl %edx, %esi
subl %edi, %r9d
subl %esi, %r9d
movl %esi, %edx
shrl $0xc, %edx
xorl %r9d, %edx
subl %esi, %edi
subl %edx, %edi
movl %edx, %r9d
shll $0x10, %r9d
xorl %edi, %r9d
subl %edx, %esi
subl %r9d, %esi
movl %r9d, %r10d
shrl $0x5, %r10d
xorl %esi, %r10d
subl %r9d, %edx
subl %r10d, %edx
movl %r10d, %edi
shrl $0x3, %edi
xorl %edx, %edi
subl %r10d, %r9d
subl %edi, %r9d
movl %edi, %esi
shll $0xa, %esi
xorl %r9d, %esi
subl %edi, %r10d
subl %esi, %r10d
movl %esi, %edx
shrl $0xf, %edx
xorl %r10d, %edx
addl $-0xc, %r8d
addq $0xc, %rcx
jmp 0x17590
addl %eax, %edx
decl %r8d
cmpl $0xa, %r8d
ja 0x17a52
leaq 0x693a(%rip), %r9       # 0x1df7c
movslq (%r9,%r8,4), %r8
addq %r9, %r8
pushq $0x1
popq %r15
jmpq *%r8
movzbl (%rcx), %r8d
shll $0x18, %r8d
addl %edx, %r8d
movl %r8d, %edx
movzbl -0x1(%rcx), %r8d
shll $0x10, %r8d
addl %edx, %r8d
movl %r8d, %edx
movzbl -0x2(%rcx), %r8d
shll $0x8, %r8d
addl %edx, %r8d
movl %r8d, %edx
movzbl -0x3(%rcx), %r8d
shll $0x18, %r8d
addl %esi, %r8d
movl %r8d, %esi
movzbl -0x4(%rcx), %r8d
shll $0x10, %r8d
addl %esi, %r8d
movl %r8d, %esi
movzbl -0x5(%rcx), %r8d
shll $0x8, %r8d
addl %esi, %r8d
movl %r8d, %esi
movzbl -0x6(%rcx), %r8d
addl %esi, %r8d
movl %r8d, %esi
movzbl -0x7(%rcx), %r8d
shll $0x18, %r8d
addl %edi, %r8d
movl %r8d, %edi
movzbl -0x8(%rcx), %r8d
shll $0x10, %r8d
addl %edi, %r8d
movl %r8d, %edi
movzbl -0x9(%rcx), %r8d
shll $0x8, %r8d
addl %edi, %r8d
movl %r8d, %edi
movzbl -0xa(%rcx), %ecx
addl %edi, %ecx
movl %ecx, %edi
subl %edx, %edi
subl %esi, %edi
movl %edx, %ecx
shrl $0xd, %ecx
xorl %edi, %ecx
subl %edx, %esi
subl %ecx, %esi
movl %ecx, %edi
shll $0x8, %edi
xorl %esi, %edi
subl %ecx, %edx
subl %edi, %edx
movl %edi, %esi
shrl $0xd, %esi
xorl %edx, %esi
subl %edi, %ecx
subl %esi, %ecx
movl %esi, %edx
shrl $0xc, %edx
xorl %ecx, %edx
subl %esi, %edi
subl %edx, %edi
movl %edx, %ecx
shll $0x10, %ecx
xorl %edi, %ecx
subl %edx, %esi
subl %ecx, %esi
movl %ecx, %edi
shrl $0x5, %edi
xorl %esi, %edi
subl %ecx, %edx
subl %edi, %edx
movl %edi, %esi
shrl $0x3, %esi
xorl %edx, %esi
subl %edi, %ecx
subl %esi, %ecx
movl %esi, %r14d
shll $0xa, %r14d
xorl %ecx, %r14d
addl %r14d, %esi
subl %esi, %edi
shrl $0xf, %r14d
xorl %edi, %r14d
addq $0x128, %r11            # imm = 0x128
movl %r14d, 0x15c(%r12)
movq %r12, 0x150(%r12)
movl %eax, 0x158(%r12)
movq 0xeeca(%rip), %rax      # 0x26640
testq %rax, %rax
je 0x177ba
movq 0x128(%rax), %r15
movq %r15, 0x128(%r12)
andq $0x0, 0x138(%r12)
movq 0x18(%r15), %rax
movq %rax, %rcx
subq 0x20(%r15), %rcx
movq %rcx, 0x130(%r12)
movq %r12, 0x10(%rax)
movq %r11, 0x18(%r15)
movl 0x8(%r15), %esi
movq (%r15), %rbp
jmp 0x1783e
movq %r11, 0x20(%rsp)
movq %r15, %rdi
pushq $0x40
popq %rsi
callq 0x62f0
xorps %xmm0, %xmm0
movups %xmm0, 0x130(%r12)
movq %rax, 0x128(%r12)
testq %rax, %rax
je 0x17ccd
movq %r15, %rdi
movq %rax, %r15
movq 0x20(%rsp), %rax
movq %rax, 0x18(%r15)
movabsq $0x500000020, %rax      # imm = 0x500000020
movq %rax, 0x8(%r15)
movq $0x128, 0x20(%r15)      # imm = 0x128
movl $0x200, %esi            # imm = 0x200
callq 0x62f0
movq %rax, (%r15)
movl $0xa0111fe1, 0x38(%r15) # imm = 0xA0111FE1
testq %rax, %rax
je 0x17ccd
movq %rax, %rbp
movq %r12, 0xee0c(%rip)      # 0x26640
pushq $0x20
popq %rax
movl %eax, %esi
movq 0x20(%rsp), %r11
movl 0x10(%r15), %edi
incl %edi
movl %edi, 0x10(%r15)
leal -0x1(%rsi), %eax
andl %r14d, %eax
shlq $0x4, %rax
movl 0x8(%rbp,%rax), %ecx
incl %ecx
movl %ecx, 0x8(%rbp,%rax)
movq (%rbp,%rax), %rdx
movq %rdx, 0x148(%r12)
andq $0x0, 0x140(%r12)
testq %rdx, %rdx
je 0x1787b
movq %r11, 0x18(%rdx)
addq %rbp, %rax
movq %r11, (%rax)
imull $0xa, 0xc(%rax), %eax
addl $0xa, %eax
cmpl %eax, %ecx
jb 0x179ab
cmpl $0x0, 0x34(%r15)
jne 0x179ab
movl %edi, 0x40(%rsp)
movq %r11, 0x20(%rsp)
movq %rsi, 0x68(%rsp)
movl %esi, %esi
movq %rsi, 0x8(%rsp)
shlq $0x5, %rsi
pushq $0x1
popq %rdi
callq 0x62f0
testq %rax, %rax
je 0x17ccd
movq %rax, %r14
movb 0xc(%r15), %cl
incb %cl
movl 0x40(%rsp), %eax
movl %eax, %esi
shrl %cl, %esi
movq 0x68(%rsp), %rcx
leal -0x1(,%rcx,2), %ecx
andl %ecx, %eax
cmpl $0x1, %eax
sbbl $-0x1, %esi
movl %esi, 0x28(%r15)
andl $0x0, 0x2c(%r15)
xorl %edi, %edi
xorl %r8d, %r8d
cmpq 0x8(%rsp), %r8
je 0x17962
movq %r8, %rax
shlq $0x4, %rax
movq (%rbp,%rax), %r9
testq %r9, %r9
je 0x1795d
movq 0x20(%r9), %r10
movl 0x34(%r9), %edx
andl %ecx, %edx
shlq $0x4, %rdx
leaq (%r14,%rdx), %r11
movl 0x8(%r14,%rdx), %eax
incl %eax
movl %eax, 0x8(%r14,%rdx)
cmpl %esi, %eax
jbe 0x17940
incl %edi
movl %edi, 0x2c(%r15)
xorl %edx, %edx
divl %esi
movl %eax, 0xc(%r11)
andq $0x0, 0x18(%r9)
movq (%r11), %rax
movq %rax, 0x20(%r9)
testq %rax, %rax
je 0x17955
movq %r9, 0x18(%rax)
movq %r9, (%r11)
movq %r10, %r9
jmp 0x1790b
incq %r8
jmp 0x178f8
movq %rbp, %rdi
callq 0x6050
movq 0x20(%rsp), %rax
movq (%rax), %rax
shll 0x8(%rax)
incl 0xc(%rax)
movq %r14, (%rax)
movl 0x10(%rax), %ecx
shrl %ecx
cmpl %ecx, 0x2c(%rax)
jbe 0x179a7
movl 0x30(%rax), %ecx
incl %ecx
movl %ecx, 0x30(%rax)
cmpl $0x2, %ecx
jb 0x179ab
movl $0x1, 0x34(%rax)
jmp 0x179ab
movq 0x28(%rsp), %rbp
movq 0x30(%rsp), %rcx
jmp 0x17a03
andl $0x0, 0x30(%rax)
movq 0xec96(%rip), %r14      # 0x26648
leaq 0x1(%r14), %rcx
movq %rcx, 0xec8b(%rip)      # 0x26648
movq 0xec8c(%rip), %r15      # 0x26650
movq 0xec8d(%rip), %rax      # 0x26658
cmpq %r15, %rcx
jbe 0x179f5
leaq 0x2000(,%r15,8), %rsi
movq %rax, %rdi
callq 0x6430
movq %rax, 0xec71(%rip)      # 0x26658
addq $0x400, %r15            # imm = 0x400
movq %r15, 0xec5b(%rip)      # 0x26650
movq 0x28(%rsp), %rbp
movq 0x30(%rsp), %rcx
movq %r12, (%rax,%r14,8)
testq %rcx, %rcx
pushq $0xa
popq %r14
jne 0x17a1b
incq 0xec4d(%rip)            # 0x26660
incq 0x100(%r12)
incq 0x108(%r12)
leaq 0x130(%rsp), %r12
incq %r13
notq %rbx
addq 0xe9f8(%rip), %rbx      # 0x26430
leaq 0xea01(%rip), %r15      # 0x26440
movq %r15, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x6490
jmp 0x1724d
pushq $0x1
popq %r15
jmp 0x176e9
movq %rax, %rcx
shrq %rcx
movl %eax, %edx
andl $0x1, %edx
orq %rcx, %rdx
cvtsi2ss %rdx, %xmm0
addss %xmm0, %xmm0
movq 0xebcf(%rip), %rcx      # 0x26648
movq 0xebd8(%rip), %rdx      # 0x26658
xorl %esi, %esi
cmpq %rsi, %rcx
je 0x16fb6
movq (%rdx,%rsi,8), %rdi
movq 0x100(%rdi), %r8
testq %r8, %r8
js 0x17aa2
cvtsi2ss %r8, %xmm1
jmp 0x17ab8
movq %r8, %r9
shrq %r9
andl $0x1, %r8d
orq %r9, %r8
cvtsi2ss %r8, %xmm1
addss %xmm1, %xmm1
movdqu 0x100(%rdi), %xmm2
movdqu 0x110(%rdi), %xmm3
paddq %xmm2, %xmm3
movdqu %xmm3, 0x110(%rdi)
mulss 0x6470(%rip), %xmm1     # 0x1df4c
pxor %xmm2, %xmm2
testq %rax, %rax
je 0x17aec
divss %xmm0, %xmm1
movaps %xmm1, %xmm2
movd %xmm2, 0x120(%rdi)
incq %rsi
jmp 0x17a82
leaq 0xe614(%rip), %rax      # 0x26114
movl $0x1, (%rax)
movq 0x58(%rsp), %rax
movq 0x50(%rsp), %rcx
testq %rcx, 0xb0(%rsp,%rax,8)
movq 0x70(%rsp), %r13
je 0x17b9e
movl $0x200, %edx            # imm = 0x200
movl 0x18(%rsp), %edi
movq %r12, %rsi
callq 0x62b0
testq %rax, %rax
js 0x17c1b
je 0x17b86
movq %rax, %rbx
movq 0xeb23(%rip), %r14      # 0x26668
incq %r14
xorl %r15d, %r15d
testq %rbx, %rbx
jle 0x17b93
leaq (%rsp,%r15), %rdi
addq $0x130, %rdi            # imm = 0x130
pushq $0xa
popq %rsi
movq %rbx, %rdx
callq 0x62a0
testq %rax, %rax
je 0x17b93
movq %r14, 0xeaf6(%rip)      # 0x26668
subq %r12, %rax
addq %rax, %r15
incq %r15
incq %rax
subq %rax, %rbx
incq %r14
jmp 0x17b4b
leaq 0xe587(%rip), %rax      # 0x26114
movl $0x1, (%rax)
pushq $0xa
popq %r14
leaq 0xe8a2(%rip), %r15      # 0x26440
movq 0x60(%rsp), %rax
testq %r13, 0xb0(%rsp,%rax,8)
movq 0x48(%rsp), %rbx
je 0x16f3b
movb $0x0, 0x78(%rsp)
leaq 0x78(%rsp), %rdi
xorl %esi, %esi
callq 0x7a5c
cmpb $0x1, 0x78(%rsp)
jne 0x16f3b
movl 0x7c(%rsp), %eax
cmpl $0x70, %eax
je 0x17bf6
cmpl $0x71, %eax
jne 0x16f3b
leaq 0xe529(%rip), %rax      # 0x26114
movl $0x1, (%rax)
jmp 0x16f3b
pushq $0x1
popq %rax
subl 0xea71(%rip), %eax      # 0x26670
movl %eax, 0xea6b(%rip)      # 0x26670
jmp 0x16f3b
leaq 0x63c4(%rip), %rdi      # 0x1dfd5
callq 0x6530
jmp 0x17b06
leaq 0x63b3(%rip), %rdi      # 0x1dfd5
callq 0x6530
jmp 0x17b93
leaq 0x6380(%rip), %rdi      # 0x1dfb3
callq 0x6530
pushq $-0x1
popq %rbp
movl %ebp, %r14d
movl %ebp, 0x10(%rsp)
jmp 0x16e9d
leaq 0x6868(%rip), %rdi      # 0x1e4b6
callq 0x6530
pushq $0x1
popq %r14
jmp 0x17cb8
pushq $-0x1
popq %rbp
leaq 0x5e62(%rip), %rdi      # 0x1dac5
callq 0x6530
movl %ebp, %r14d
jmp 0x16e9d
leaq 0x6335(%rip), %rdi      # 0x1dfac
callq 0x6530
callq 0x7075
movl 0x1c(%rsp), %edi
callq 0x6260
movl 0x18(%rsp), %edi
callq 0x6260
movl 0x14(%rsp), %edi
callq 0x6260
pushq $0xf
popq %rsi
movl 0x10(%rsp), %ebx
movl %ebx, %edi
callq 0x6370
xorl %r14d, %r14d
movl %ebx, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x64b0
movl %r14d, %eax
addq $0x338, %rsp            # imm = 0x338
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x1
popq %rdi
callq 0x6590
movl 0x130(%rsp), %edi
callq 0x6260
movl 0x134(%rsp), %edi
pushq $0x1
popq %rbp
movl %ebp, %esi
callq 0x6180
movl 0x134(%rsp), %edi
callq 0x6260
movl 0xb0(%rsp), %edi
callq 0x6260
movl 0xb4(%rsp), %edi
pushq $0x2
popq %rsi
callq 0x6180
movl 0xb4(%rsp), %edi
callq 0x6260
movq (%rbx), %rdi
movq %rbx, %rsi
callq 0x6570
leaq 0x5d87(%rip), %rdi      # 0x1dabe
callq 0x6530
movl %ebp, %edi
callq 0x6590