// File: /workspace/github_c_makefile_star2_O0/Jesskas[P]decompisas/source/fileformat/elf.c
// Function: parseElf32
void parseElf32(FILE* fp, long fileSize)
{
    const int sizeOfElfHeader = 0x34;
    struct ELF_Header_32      elfHeader32 = {{ 0 }};

    unsigned char* buffer = (unsigned char*)malloc(sizeOfElfHeader);
    fread(buffer, sizeof(unsigned char), sizeOfElfHeader, fp);
    char mag_str[4] = { buffer[0], buffer[1], buffer[2], buffer[3] };

    // 32-bit ELF Header
    memcpy(elfHeader32.ei_mag, mag_str, 4);
    elfHeader32.ei_class =      buffer[0x04];
    elfHeader32.ei_data =       buffer[0x05];
    elfHeader32.ei_version =    buffer[0x06];
    elfHeader32.ei_osabi =      buffer[0x07];
    elfHeader32.ei_abiversion = buffer[0x08];
    elfHeader32.e_type =    MAKE_SHORT(buffer[0x11], buffer[0x10]);
    elfHeader32.e_machine = MAKE_SHORT(buffer[0x13], buffer[0x12]);
    elfHeader32.e_version =
      MAKE_LONG(buffer[0x17], buffer[0x16], buffer[0x15], buffer[0x14]);
    elfHeader32.e_entry =
      MAKE_LONG(buffer[0x1B], buffer[0x1A], buffer[0x19], buffer[0x18]);
    elfHeader32.e_phoff =
      MAKE_LONG(buffer[0x1F], buffer[0x1E], buffer[0x1D], buffer[0x1C]);
    elfHeader32.e_shoff =
      MAKE_LONG(buffer[0x23], buffer[0x22], buffer[0x21], buffer[0x20]);
    elfHeader32.e_flags =
      MAKE_LONG(buffer[0x27], buffer[0x26], buffer[0x25], buffer[0x24]);
    elfHeader32.e_ehsize =    MAKE_SHORT(buffer[0x29], buffer[0x28]);
    elfHeader32.e_phentsize = MAKE_SHORT(buffer[0x2B], buffer[0x2A]);
    elfHeader32.e_phnum =     MAKE_SHORT(buffer[0x2D], buffer[0x2C]);
    elfHeader32.e_shentsize = MAKE_SHORT(buffer[0x2F], buffer[0x2E]);
    elfHeader32.e_shnum =     MAKE_SHORT(buffer[0x31], buffer[0x30]);
    elfHeader32.e_shstrndx =  MAKE_SHORT(buffer[0x33], buffer[0x32]);
    free(buffer);


    // 32-bit Program Headers
    // if not there already, seek to program header offset found in elfHeader
    if (sizeOfElfHeader != elfHeader32.e_phoff) {
        if (fseek(fp, elfHeader32.e_phoff, SEEK_SET) != 0) {
            printf("[ELF] Error seeking to elfHeader32.e_phoff (parse).\n");
            // TODO: Clean exit in cases like this.
            exit(-1);
        }
    }
    if (elfHeader32.e_phentsize !=
            (unsigned short)sizeof(struct Program_Header_32)) {
        printf("[ELF Fatal Error] elfHeader32.e_phentsize == ");
        printf("sizeof(Program_Header_32)\n[Is file corrupt?]\n");
        // TODO: Clean exit in cases like this.
        exit(-1);
    }

    int i = 0;
    int sizeOfProgramHeaders = elfHeader32.e_phnum * elfHeader32.e_phentsize;
    buffer = (unsigned char*)malloc(sizeOfProgramHeaders);
    fread(buffer, sizeof(unsigned char), sizeOfProgramHeaders, fp);
    struct Program_Header_32* programHeaders =
        (struct Program_Header_32*)malloc(sizeOfProgramHeaders);

    for (i = 0; i < elfHeader32.e_phnum; i++) {
        int cur_phoff = (i * elfHeader32.e_phentsize);
        struct Program_Header_32 cur_programHeader = { 0 };

        cur_programHeader.p_type =
            MAKE_LONG(buffer[cur_phoff+0x03], buffer[cur_phoff+0x02],
                buffer[cur_phoff+0x01], buffer[cur_phoff+0x00]);
        cur_programHeader.p_offset =
            MAKE_LONG(buffer[cur_phoff+0x07], buffer[cur_phoff+0x06],
              buffer[cur_phoff+0x05], buffer[cur_phoff+0x04]);
        cur_programHeader.p_vaddr =
            MAKE_LONG(buffer[cur_phoff+0x0B], buffer[cur_phoff+0x0A],
                buffer[cur_phoff+0x09], buffer[cur_phoff+0x08]);
        cur_programHeader.p_paddr =
            MAKE_LONG(buffer[cur_phoff+0x0F], buffer[cur_phoff+0x0E],
              buffer[cur_phoff+0x0D], buffer[cur_phoff+0x0C]);
        cur_programHeader.p_filesz =
            MAKE_LONG(buffer[cur_phoff+0x13], buffer[cur_phoff+0x12],
                buffer[cur_phoff+0x11], buffer[cur_phoff+0x10]);
        cur_programHeader.p_memsz =
            MAKE_LONG(buffer[cur_phoff+0x17], buffer[cur_phoff+0x16],
                buffer[cur_phoff+0x15], buffer[cur_phoff+0x14]);
        cur_programHeader.p_flags =
            MAKE_LONG(buffer[cur_phoff+0x1B], buffer[cur_phoff+0x1A],
                buffer[cur_phoff+0x19], buffer[cur_phoff+0x18]);
        cur_programHeader.p_align =
            MAKE_LONG(buffer[cur_phoff+0x1F], buffer[cur_phoff+0x1E],
                buffer[cur_phoff+0x1D], buffer[cur_phoff+0x1C]);

        memcpy(&programHeaders[i], &cur_programHeader,
            elfHeader32.e_phentsize);
    }
    free(buffer);


    // 32-bit Section Headers
    if (fseek(fp, elfHeader32.e_shoff, SEEK_SET) != 0) {
        printf("[ELF] Error seeking to elfHeader32.e_shoff (parse).\n");
        // TODO: Clean exit in cases like this.
        free(programHeaders);
        exit(-1);
    }
    if (elfHeader32.e_shentsize !=
      (unsigned short)sizeof(struct Section_Header_32)) {
      printf("[ELF Fatal Error] elfHeader32.e_shentsize == ");
        printf("sizeof(Section_Header_32)\n[Is file corrupt?]\n");
        // TODO: Clean exit in cases like this.
        free(programHeaders);
        exit(-1);
    }

    int sizeOfSectionHeaders = elfHeader32.e_shnum * elfHeader32.e_shentsize;
    buffer = (unsigned char*)malloc(sizeOfSectionHeaders);
    fread(buffer, sizeof(unsigned char), sizeOfSectionHeaders, fp);
    struct Section_Header_32* sectionHeaders =
        (struct Section_Header_32*)malloc(sizeOfSectionHeaders);

    for (i = 0; i < elfHeader32.e_shnum; i++) {
        int cur_shoff = (i * elfHeader32.e_shentsize);
        struct Section_Header_32 cur_sectionHeader = { 0 };

        cur_sectionHeader.sh_name =
            MAKE_LONG(buffer[cur_shoff+0x03], buffer[cur_shoff+0x02],
                buffer[cur_shoff+0x01], buffer[cur_shoff+0x00]);
        cur_sectionHeader.sh_type =
            MAKE_LONG(buffer[cur_shoff+0x07], buffer[cur_shoff+0x06],
              buffer[cur_shoff+0x05], buffer[cur_shoff+0x04]);
        cur_sectionHeader.sh_flags =
            MAKE_LONG(buffer[cur_shoff+0x0B], buffer[cur_shoff+0x0A],
                buffer[cur_shoff+0x09], buffer[cur_shoff+0x08]);
        cur_sectionHeader.sh_address =
            MAKE_LONG(buffer[cur_shoff+0x0F], buffer[cur_shoff+0x0E],
              buffer[cur_shoff+0x0D], buffer[cur_shoff+0x0C]);
        cur_sectionHeader.sh_offset =
            MAKE_LONG(buffer[cur_shoff+0x13], buffer[cur_shoff+0x12],
                buffer[cur_shoff+0x11], buffer[cur_shoff+0x10]);
        cur_sectionHeader.sh_size =
            MAKE_LONG(buffer[cur_shoff+0x17], buffer[cur_shoff+0x16],
                buffer[cur_shoff+0x15], buffer[cur_shoff+0x14]);
        cur_sectionHeader.sh_link =
            MAKE_LONG(buffer[cur_shoff+0x1B], buffer[cur_shoff+0x1A],
                buffer[cur_shoff+0x19], buffer[cur_shoff+0x18]);
        cur_sectionHeader.sh_info =
            MAKE_LONG(buffer[cur_shoff+0x1F], buffer[cur_shoff+0x1E],
                buffer[cur_shoff+0x1D], buffer[cur_shoff+0x1C]);
        cur_sectionHeader.sh_addralign =
            MAKE_LONG(buffer[cur_shoff+0x23], buffer[cur_shoff+0x22],
                buffer[cur_shoff+0x21], buffer[cur_shoff+0x20]);
        cur_sectionHeader.sh_entsize =
            MAKE_LONG(buffer[cur_shoff+0x27], buffer[cur_shoff+0x26],
                buffer[cur_shoff+0x25], buffer[cur_shoff+0x24]);

        memcpy(&sectionHeaders[i], &cur_sectionHeader,
            elfHeader32.e_shentsize);
    }
    free(buffer);

    // Now, store the shstrtab
    int shstrtab_addr =
        sectionHeaders[elfHeader32.e_shstrndx].sh_offset;
    if (!shstrtab_addr || fseek(fp, shstrtab_addr, SEEK_SET) != 0) {
        printf("[ELF] Error seeking to shstrtab_addr (parse).\n");
        // TODO: Clean exit in cases like this.
        free(programHeaders);
        free(sectionHeaders);
        exit(-1);
    }
    int shstrtab_size = sectionHeaders[elfHeader32.e_shstrndx].sh_size;
    char* shstrtab = (char*)malloc(
      sizeof(char)*shstrtab_size);
    fread(shstrtab, sizeof(char), shstrtab_size, fp);

    // Printing!
    unsigned char* codeSection = malloc(sectionHeaders[1].sh_size);
    fseek(fp, sectionHeaders[1].sh_offset, SEEK_SET); // TODO: Error checking
    fread(codeSection, sizeof(unsigned char), sectionHeaders[1].sh_size, fp);
    disassemble_x86(&shstrtab[sectionHeaders[1].sh_name],
        sectionHeaders[1].sh_address,
        codeSection,
        sectionHeaders[1].sh_size);
    free(codeSection);
    /* arbitrary separator here */
    codeSection = malloc(sectionHeaders[2].sh_size);
    fseek(fp, sectionHeaders[2].sh_offset, SEEK_SET); // TODO: Error checking
    fread(codeSection, sizeof(unsigned char), sectionHeaders[2].sh_size, fp);
    disassemble_x86(&shstrtab[sectionHeaders[2].sh_name],
        sectionHeaders[2].sh_address,
        codeSection,
        sectionHeaders[2].sh_size);
    free(codeSection);
    /* arbitrary separator here */
    printSectionHeader32(sectionHeaders[3], shstrtab);
    codeSection = malloc(sectionHeaders[3].sh_size);
    fseek(fp, sectionHeaders[3].sh_offset, SEEK_SET); // TODO: Error checking
    fread(codeSection, sizeof(unsigned char), sectionHeaders[3].sh_size, fp);
    disassemble_x86(&shstrtab[sectionHeaders[3].sh_name],
        sectionHeaders[3].sh_address,
        codeSection,
        sectionHeaders[3].sh_size);
    free(codeSection);


    // cleanup
    free(programHeaders);
    free(sectionHeaders);
    free(shstrtab);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x34, -0x14(%rbp)
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
movl $0x34, %edx
callq 0x1060
movl $0x34, %edi
callq 0x10b0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movq -0x8(%rbp), %rcx
movl $0x1, %esi
movl $0x34, %edx
callq 0x1040
movq -0x50(%rbp), %rax
movb (%rax), %al
movb %al, -0x54(%rbp)
movq -0x50(%rbp), %rax
movb 0x1(%rax), %al
movb %al, -0x53(%rbp)
movq -0x50(%rbp), %rax
movb 0x2(%rax), %al
movb %al, -0x52(%rbp)
movq -0x50(%rbp), %rax
movb 0x3(%rax), %al
movb %al, -0x51(%rbp)
movl -0x54(%rbp), %eax
movl %eax, -0x48(%rbp)
movq -0x50(%rbp), %rax
movb 0x4(%rax), %al
movb %al, -0x44(%rbp)
movq -0x50(%rbp), %rax
movb 0x5(%rax), %al
movb %al, -0x43(%rbp)
movq -0x50(%rbp), %rax
movb 0x6(%rax), %al
movb %al, -0x42(%rbp)
movq -0x50(%rbp), %rax
movb 0x7(%rax), %al
movb %al, -0x41(%rbp)
movq -0x50(%rbp), %rax
movb 0x8(%rax), %al
movb %al, -0x40(%rbp)
movq -0x50(%rbp), %rax
movzbl 0x11(%rax), %eax
shll $0x8, %eax
movq -0x50(%rbp), %rcx
movzbl 0x10(%rcx), %ecx
orl %ecx, %eax
movw %ax, -0x38(%rbp)
movq -0x50(%rbp), %rax
movzbl 0x13(%rax), %eax
shll $0x8, %eax
movq -0x50(%rbp), %rcx
movzbl 0x12(%rcx), %ecx
orl %ecx, %eax
movw %ax, -0x36(%rbp)
movq -0x50(%rbp), %rax
movzbl 0x17(%rax), %eax
shll $0x18, %eax
movq -0x50(%rbp), %rcx
movzbl 0x16(%rcx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movzbl 0x15(%rcx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movzbl 0x14(%rcx), %ecx
orl %ecx, %eax
movl %eax, -0x34(%rbp)
movq -0x50(%rbp), %rax
movzbl 0x1b(%rax), %eax
shll $0x18, %eax
movq -0x50(%rbp), %rcx
movzbl 0x1a(%rcx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movzbl 0x19(%rcx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movzbl 0x18(%rcx), %ecx
orl %ecx, %eax
movl %eax, -0x30(%rbp)
movq -0x50(%rbp), %rax
movzbl 0x1f(%rax), %eax
shll $0x18, %eax
movq -0x50(%rbp), %rcx
movzbl 0x1e(%rcx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movzbl 0x1d(%rcx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movzbl 0x1c(%rcx), %ecx
orl %ecx, %eax
movl %eax, -0x2c(%rbp)
movq -0x50(%rbp), %rax
movzbl 0x23(%rax), %eax
shll $0x18, %eax
movq -0x50(%rbp), %rcx
movzbl 0x22(%rcx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movzbl 0x21(%rcx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movzbl 0x20(%rcx), %ecx
orl %ecx, %eax
movl %eax, -0x28(%rbp)
movq -0x50(%rbp), %rax
movzbl 0x27(%rax), %eax
shll $0x18, %eax
movq -0x50(%rbp), %rcx
movzbl 0x26(%rcx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movzbl 0x25(%rcx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movzbl 0x24(%rcx), %ecx
orl %ecx, %eax
movl %eax, -0x24(%rbp)
movq -0x50(%rbp), %rax
movzbl 0x29(%rax), %eax
shll $0x8, %eax
movq -0x50(%rbp), %rcx
movzbl 0x28(%rcx), %ecx
orl %ecx, %eax
movw %ax, -0x20(%rbp)
movq -0x50(%rbp), %rax
movzbl 0x2b(%rax), %eax
shll $0x8, %eax
movq -0x50(%rbp), %rcx
movzbl 0x2a(%rcx), %ecx
orl %ecx, %eax
movw %ax, -0x1e(%rbp)
movq -0x50(%rbp), %rax
movzbl 0x2d(%rax), %eax
shll $0x8, %eax
movq -0x50(%rbp), %rcx
movzbl 0x2c(%rcx), %ecx
orl %ecx, %eax
movw %ax, -0x1c(%rbp)
movq -0x50(%rbp), %rax
movzbl 0x2f(%rax), %eax
shll $0x8, %eax
movq -0x50(%rbp), %rcx
movzbl 0x2e(%rcx), %ecx
orl %ecx, %eax
movw %ax, -0x1a(%rbp)
movq -0x50(%rbp), %rax
movzbl 0x31(%rax), %eax
shll $0x8, %eax
movq -0x50(%rbp), %rcx
movzbl 0x30(%rcx), %ecx
orl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x50(%rbp), %rax
movzbl 0x33(%rax), %eax
shll $0x8, %eax
movq -0x50(%rbp), %rcx
movzbl 0x32(%rcx), %ecx
orl %ecx, %eax
movw %ax, -0x16(%rbp)
movq -0x50(%rbp), %rdi
callq 0x1030
movl $0x34, %eax
cmpl -0x2c(%rbp), %eax
je 0x15a2
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x10c0
cmpl $0x0, %eax
je 0x15a0
leaq 0xbaf0(%rip), %rdi      # 0xd07f
movb $0x0, %al
callq 0x1050
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x10e0
jmp 0x15a2
movzwl -0x1e(%rbp), %eax
cmpl $0x20, %eax
je 0x15d1
leaq 0xbb02(%rip), %rdi      # 0xd0b4
movb $0x0, %al
callq 0x1050
leaq 0xbb22(%rip), %rdi      # 0xd0e2
movb $0x0, %al
callq 0x1050
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x10e0
movl $0x0, -0x58(%rbp)
movzwl -0x1c(%rbp), %eax
movzwl -0x1e(%rbp), %ecx
imull %ecx, %eax
movl %eax, -0x5c(%rbp)
movslq -0x5c(%rbp), %rdi
callq 0x10b0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movslq -0x5c(%rbp), %rdx
movq -0x8(%rbp), %rcx
movl $0x1, %esi
callq 0x1040
movslq -0x5c(%rbp), %rdi
callq 0x10b0
movq %rax, -0x68(%rbp)
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
movzwl -0x1c(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1934
movl -0x58(%rbp), %eax
movzwl -0x1e(%rbp), %ecx
imull %ecx, %eax
movl %eax, -0x6c(%rbp)
leaq -0x8c(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x1060
movq -0x50(%rbp), %rax
movl -0x6c(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
shll $0x18, %eax
movq -0x50(%rbp), %rcx
movl -0x6c(%rbp), %edx
addl $0x2, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x6c(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x6c(%rbp), %edx
addl $0x0, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
movl %eax, -0x8c(%rbp)
movq -0x50(%rbp), %rax
movl -0x6c(%rbp), %ecx
addl $0x7, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
shll $0x18, %eax
movq -0x50(%rbp), %rcx
movl -0x6c(%rbp), %edx
addl $0x6, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x6c(%rbp), %edx
addl $0x5, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x6c(%rbp), %edx
addl $0x4, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
movl %eax, -0x88(%rbp)
movq -0x50(%rbp), %rax
movl -0x6c(%rbp), %ecx
addl $0xb, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
shll $0x18, %eax
movq -0x50(%rbp), %rcx
movl -0x6c(%rbp), %edx
addl $0xa, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x6c(%rbp), %edx
addl $0x9, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x6c(%rbp), %edx
addl $0x8, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
movl %eax, -0x84(%rbp)
movq -0x50(%rbp), %rax
movl -0x6c(%rbp), %ecx
addl $0xf, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
shll $0x18, %eax
movq -0x50(%rbp), %rcx
movl -0x6c(%rbp), %edx
addl $0xe, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x6c(%rbp), %edx
addl $0xd, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x6c(%rbp), %edx
addl $0xc, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
movl %eax, -0x80(%rbp)
movq -0x50(%rbp), %rax
movl -0x6c(%rbp), %ecx
addl $0x13, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
shll $0x18, %eax
movq -0x50(%rbp), %rcx
movl -0x6c(%rbp), %edx
addl $0x12, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x6c(%rbp), %edx
addl $0x11, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x6c(%rbp), %edx
addl $0x10, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
movl %eax, -0x7c(%rbp)
movq -0x50(%rbp), %rax
movl -0x6c(%rbp), %ecx
addl $0x17, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
shll $0x18, %eax
movq -0x50(%rbp), %rcx
movl -0x6c(%rbp), %edx
addl $0x16, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x6c(%rbp), %edx
addl $0x15, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x6c(%rbp), %edx
addl $0x14, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
movl %eax, -0x78(%rbp)
movq -0x50(%rbp), %rax
movl -0x6c(%rbp), %ecx
addl $0x1b, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
shll $0x18, %eax
movq -0x50(%rbp), %rcx
movl -0x6c(%rbp), %edx
addl $0x1a, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x6c(%rbp), %edx
addl $0x19, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x6c(%rbp), %edx
addl $0x18, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
movl %eax, -0x74(%rbp)
movq -0x50(%rbp), %rax
movl -0x6c(%rbp), %ecx
addl $0x1f, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
shll $0x18, %eax
movq -0x50(%rbp), %rcx
movl -0x6c(%rbp), %edx
addl $0x1e, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x6c(%rbp), %edx
addl $0x1d, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x6c(%rbp), %edx
addl $0x1c, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
movl %eax, -0x70(%rbp)
movq -0x68(%rbp), %rdi
movslq -0x58(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
movzwl -0x1e(%rbp), %eax
movl %eax, %edx
leaq -0x8c(%rbp), %rsi
callq 0x10a0
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x161d
movq -0x50(%rbp), %rdi
callq 0x1030
movq -0x8(%rbp), %rdi
movl -0x28(%rbp), %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x10c0
cmpl $0x0, %eax
je 0x1973
leaq 0xb7b7(%rip), %rdi      # 0xd110
movb $0x0, %al
callq 0x1050
movq -0x68(%rbp), %rdi
callq 0x1030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x10e0
movzwl -0x1a(%rbp), %eax
cmpl $0x28, %eax
je 0x19ab
leaq 0xb7c2(%rip), %rdi      # 0xd145
movb $0x0, %al
callq 0x1050
leaq 0xb7e2(%rip), %rdi      # 0xd173
movb $0x0, %al
callq 0x1050
movq -0x68(%rbp), %rdi
callq 0x1030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x10e0
movzwl -0x18(%rbp), %eax
movzwl -0x1a(%rbp), %ecx
imull %ecx, %eax
movl %eax, -0x90(%rbp)
movslq -0x90(%rbp), %rdi
callq 0x10b0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movslq -0x90(%rbp), %rdx
movq -0x8(%rbp), %rcx
movl $0x1, %esi
callq 0x1040
movslq -0x90(%rbp), %rdi
callq 0x10b0
movq %rax, -0x98(%rbp)
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
movzwl -0x18(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1e55
movl -0x58(%rbp), %eax
movzwl -0x1a(%rbp), %ecx
imull %ecx, %eax
movl %eax, -0x9c(%rbp)
leaq -0xc4(%rbp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x1060
movq -0x50(%rbp), %rax
movl -0x9c(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
shll $0x18, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x2, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x0, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
movl %eax, -0xc4(%rbp)
movq -0x50(%rbp), %rax
movl -0x9c(%rbp), %ecx
addl $0x7, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
shll $0x18, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x6, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x5, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x4, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
movl %eax, -0xc0(%rbp)
movq -0x50(%rbp), %rax
movl -0x9c(%rbp), %ecx
addl $0xb, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
shll $0x18, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0xa, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x9, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x8, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
movl %eax, -0xbc(%rbp)
movq -0x50(%rbp), %rax
movl -0x9c(%rbp), %ecx
addl $0xf, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
shll $0x18, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0xe, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0xd, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0xc, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
movl %eax, -0xb8(%rbp)
movq -0x50(%rbp), %rax
movl -0x9c(%rbp), %ecx
addl $0x13, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
shll $0x18, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x12, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x11, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x10, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
movl %eax, -0xb4(%rbp)
movq -0x50(%rbp), %rax
movl -0x9c(%rbp), %ecx
addl $0x17, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
shll $0x18, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x16, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x15, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x14, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
movl %eax, -0xb0(%rbp)
movq -0x50(%rbp), %rax
movl -0x9c(%rbp), %ecx
addl $0x1b, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
shll $0x18, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x1a, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x19, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x18, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
movl %eax, -0xac(%rbp)
movq -0x50(%rbp), %rax
movl -0x9c(%rbp), %ecx
addl $0x1f, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
shll $0x18, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x1e, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x1d, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x1c, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
movl %eax, -0xa8(%rbp)
movq -0x50(%rbp), %rax
movl -0x9c(%rbp), %ecx
addl $0x23, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
shll $0x18, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x22, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x21, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x20, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
movl %eax, -0xa4(%rbp)
movq -0x50(%rbp), %rax
movl -0x9c(%rbp), %ecx
addl $0x27, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
shll $0x18, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x26, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x25, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x50(%rbp), %rcx
movl -0x9c(%rbp), %edx
addl $0x24, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
movl %eax, -0xa0(%rbp)
movq -0x98(%rbp), %rdi
movslq -0x58(%rbp), %rax
imulq $0x28, %rax, %rax
addq %rax, %rdi
movzwl -0x1a(%rbp), %eax
movl %eax, %edx
leaq -0xc4(%rbp), %rsi
callq 0x10a0
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x19ff
movq -0x50(%rbp), %rdi
callq 0x1030
movq -0x98(%rbp), %rax
movzwl -0x16(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0xc8(%rbp)
cmpl $0x0, -0xc8(%rbp)
je 0x1e99
movq -0x8(%rbp), %rdi
movslq -0xc8(%rbp), %rsi
xorl %edx, %edx
callq 0x10c0
cmpl $0x0, %eax
je 0x1ec6
leaq 0xb301(%rip), %rdi      # 0xd1a1
movb $0x0, %al
callq 0x1050
movq -0x68(%rbp), %rdi
callq 0x1030
movq -0x98(%rbp), %rdi
callq 0x1030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x10e0
movq -0x98(%rbp), %rax
movzwl -0x16(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movl %eax, -0xcc(%rbp)
movslq -0xcc(%rbp), %rdi
shlq $0x0, %rdi
callq 0x10b0
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rdi
movslq -0xcc(%rbp), %rdx
movq -0x8(%rbp), %rcx
movl $0x1, %esi
callq 0x1040
movq -0x98(%rbp), %rax
movl 0x3c(%rax), %eax
movl %eax, %edi
callq 0x10b0
movq %rax, -0xe0(%rbp)
movq -0x8(%rbp), %rdi
movq -0x98(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x10c0
movq -0xe0(%rbp), %rdi
movq -0x98(%rbp), %rax
movl 0x3c(%rax), %eax
movl %eax, %edx
movq -0x8(%rbp), %rcx
movl $0x1, %esi
callq 0x1040
movq -0xd8(%rbp), %rdi
movq -0x98(%rbp), %rax
movl 0x28(%rax), %eax
addq %rax, %rdi
movq -0x98(%rbp), %rax
movl 0x34(%rax), %esi
movq -0xe0(%rbp), %rdx
movq -0x98(%rbp), %rax
movl 0x3c(%rax), %ecx
callq 0x5310
movq -0xe0(%rbp), %rdi
callq 0x1030
movq -0x98(%rbp), %rax
movl 0x64(%rax), %eax
movl %eax, %edi
callq 0x10b0
movq %rax, -0xe0(%rbp)
movq -0x8(%rbp), %rdi
movq -0x98(%rbp), %rax
movl 0x60(%rax), %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x10c0
movq -0xe0(%rbp), %rdi
movq -0x98(%rbp), %rax
movl 0x64(%rax), %eax
movl %eax, %edx
movq -0x8(%rbp), %rcx
movl $0x1, %esi
callq 0x1040
movq -0xd8(%rbp), %rdi
movq -0x98(%rbp), %rax
movl 0x50(%rax), %eax
addq %rax, %rdi
movq -0x98(%rbp), %rax
movl 0x5c(%rax), %esi
movq -0xe0(%rbp), %rdx
movq -0x98(%rbp), %rax
movl 0x64(%rax), %ecx
callq 0x5310
movq -0xe0(%rbp), %rdi
callq 0x1030
movq -0x98(%rbp), %rsi
addq $0x78, %rsi
movq -0xd8(%rbp), %rax
movq %rax, -0x110(%rbp)
leaq -0x108(%rbp), %rdi
movl $0x28, %edx
callq 0x10a0
movq -0x110(%rbp), %rdi
movq -0xe8(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x20(%rax)
movups -0x108(%rbp), %xmm0
movups -0xf8(%rbp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x3680
movq -0x98(%rbp), %rax
movl 0x8c(%rax), %eax
movl %eax, %edi
callq 0x10b0
movq %rax, -0xe0(%rbp)
movq -0x8(%rbp), %rdi
movq -0x98(%rbp), %rax
movl 0x88(%rax), %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x10c0
movq -0xe0(%rbp), %rdi
movq -0x98(%rbp), %rax
movl 0x8c(%rax), %eax
movl %eax, %edx
movq -0x8(%rbp), %rcx
movl $0x1, %esi
callq 0x1040
movq -0xd8(%rbp), %rdi
movq -0x98(%rbp), %rax
movl 0x78(%rax), %eax
addq %rax, %rdi
movq -0x98(%rbp), %rax
movl 0x84(%rax), %esi
movq -0xe0(%rbp), %rdx
movq -0x98(%rbp), %rax
movl 0x8c(%rax), %ecx
callq 0x5310
movq -0xe0(%rbp), %rdi
callq 0x1030
movq -0x68(%rbp), %rdi
callq 0x1030
movq -0x98(%rbp), %rdi
callq 0x1030
movq -0xd8(%rbp), %rdi
callq 0x1030
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
nopw %cs:(%rax,%rax)