// File: /workspace/github_c_makefile_star2_O1/hfiguiere[P]exifprobe/process.c
// Function: process_exif_ifd
unsigned long
process_exif_ifd(FILE *inptr,unsigned short byteorder,
                    unsigned long exif_offset,unsigned long fileoffset_base,
                    unsigned long max_offset,struct image_summary *summary_entry,
                    char *parent_name,int ifdnum,int indent)
{
    struct ifd_entry *entry_ptr;
    unsigned long max_value_offset = 0L;
    unsigned long next_ifd_offset,current_offset,max_exif_offset;
    unsigned long start_entry_offset,entry_offset,value_offset;
    unsigned long value_start_offset = 0UL;
    unsigned long next_max_offset = 0UL;
    int entry_num,num_entries,value_is_offset,use_second_pass;
    int chpr = 0;
    char *prefix;
    char *fulldirname = CNULL;

    if(inptr == (FILE *)0)
    {
        fprintf(stderr,"%s: no open file pointer to read EXIF IFD\n",
                Progname);
        return(0L);
    }

    PUSHCOLOR(EXIF_COLOR);
    /* If the exif segment appears to be beyond the end of the parent */
    /* ifd, mark the start address to call attention.                 */
    if(max_offset && (exif_offset > max_offset))
        prefix = "+";
    else
        prefix = "@";
    if(summary_entry)
        summary_entry->filesubformat |= FILESUBFMT_EXIF;
    max_exif_offset = max_offset;
    print_tag_address(SECTION,exif_offset + fileoffset_base,indent,prefix);
    if(PRINT_SECTION)
        chpr += printf("<EXIF IFD> (in IFD %d)",ifdnum);

    num_entries = read_ushort(inptr,byteorder,exif_offset + fileoffset_base);
    if(ferror(inptr) || feof(inptr))
        goto blewit;
    current_offset = entry_offset = start_entry_offset = ftell(inptr);
    if(PRINT_SECTION)
    {
        chpr += printf(" %d entries ",num_entries);
        chpr += printf("starting at file offset %#lx=%lu",
                                            current_offset,current_offset);
            chpr = newline(chpr);
    }
    use_second_pass = value_is_offset = 0;
    fulldirname = splice(parent_name,".","Exif");

    indent += SMALLINDENT;
    /* The direct entries                                             */
    for(entry_num = 0; entry_num < num_entries; ++entry_num)
    {
        entry_ptr = read_ifd_entry(inptr,byteorder,entry_offset);
        if((entry_ptr->value_type == 0) || (entry_ptr->value_type > DOUBLE) ||
            ferror(inptr) || feof(inptr))
        {
            int invalid_entry = 0;
            unsigned long limit_offset = 0L;

            print_tag_address(ENTRY,entry_offset,indent,prefix);
            chpr += printf(" INVALID EXIF ENTRY (%lu)",entry_ptr->value);
            chpr = newline(chpr);
            clearerr(inptr);
            current_offset = ftell(inptr);
            if(max_offset > 0)
                limit_offset = max_offset;
            else
            {
                if(fseek(inptr,0L,SEEK_END) != -1)
                {
                    limit_offset = ftell(inptr);
                    fseek(inptr,current_offset,SEEK_SET);
                }
            }
            /* If there's an error on input, or we can't check    */
            /* for absurd num_entries, give up.                   */
            if(!ferror(inptr) && !feof(inptr) && (limit_offset > 0))
            {
                /* If the number of entries would read past the   */
                /* size of the IFD, or past EOF, give up          */
                if((entry_offset + (12 * num_entries)) < limit_offset)
                {
                    /* Limit the number of consecutive failures.  */
                    /* An apparently valid entry resets the count */
                    /* to 0.                                      */
                    if(invalid_entry++ < MAX_INVALID_ENTRIES)
                    {
                        entry_offset = current_offset;
                        continue;
                    }
                }
            }
            chpr = newline(chpr);
            goto blewit;
        }
        current_offset = ftell(inptr);
        switch(entry_ptr->tag)
        {
            case EXIFTAG_PixelXDimension:
                if(summary_entry)
                    summary_entry->primary_width = entry_ptr->value;
                break;
            case EXIFTAG_PixelYDimension:
                if(summary_entry)
                    summary_entry->primary_height = entry_ptr->value;
                break;
            case EXIFTAG_Interoperability: 
            case EXIFTAG_MakerNote: 
                use_second_pass++;
                break;
            default:
                break;
        }
     
        print_tag_address(ENTRY,entry_offset,indent,prefix);
        value_offset = print_entry(inptr,byteorder,entry_ptr,fileoffset_base,
                                        summary_entry,fulldirname,EXIF_IFD,
                                        ifdnum,-1,SMALLINDENT);
        if(value_offset == 0UL)
            value_offset = current_offset;
        if(value_offset > max_value_offset)
            max_value_offset = value_offset;
        if((PRINT_VALUE_AT_OFFSET) && (is_offset(entry_ptr)))
            ++use_second_pass;
        entry_offset = current_offset;
    }

    next_ifd_offset = read_ulong(inptr,byteorder,current_offset);

    /* There should be no next_ifd_offset for the Exif Ifd.           */
    /* I am not confident, however, that someone won't eventually     */
    /* chain Exif ifds, so just handle them, and let the error        */
    /* messages fly.                                                  */
    if(next_ifd_offset > 0L)
    {
        if((PRINT_VALUE) && (PRINT_SECTION) && (PRINT_VALUE_AT_OFFSET))
        {
            print_tag_address(SECTION,current_offset,indent + SMALLINDENT,prefix);
            chpr += printf("**** next IFD offset %lu  ",next_ifd_offset);
            next_ifd_offset += fileoffset_base;
            if(next_ifd_offset < ftell(inptr))
            {
                printred("BAD NEXT IFD OFFSET");
                next_ifd_offset = 0L;
            }
            else
                chpr += printf("(+ %lu = %#lx/%lu)",fileoffset_base,
                                        next_ifd_offset,next_ifd_offset);
            chpr = newline(chpr);
        }
        else
            next_ifd_offset += fileoffset_base;
        /* This should never happen                                   */
        max_exif_offset = next_ifd_offset;
    }
    else
    {
        if((PRINT_VALUE) && (PRINT_SECTION) && (PRINT_VALUE_AT_OFFSET))
        {
            print_tag_address(SECTION,current_offset,indent,prefix);
            chpr += printf("**** next IFD offset 0");
            chpr = newline(chpr);
        }
    }

    if(ferror(inptr) || feof(inptr))
    {
        chpr += printf(" READ NEXT IFD OFFSET FAILED ");
        chpr = newline(chpr);
        why(stdout);
        clearerr(inptr);    /* keep going...                          */
    }
    else
        current_offset = ftell(inptr);

    value_offset = current_offset;

    /* Second pass, to evaluate entries which are stored indirectly.  */
    /* This occurs when the value requires more than 4 bytes, AND for */
    /* certain LONG values which are intended to be used as offsets   */
    /* (and should have their own type defined in the spec),          */
    if(use_second_pass)
    {
        if((PRINT_VALUE) && (PRINT_SECTION) && (PRINT_VALUE_AT_OFFSET))
        {
            print_tag_address(SECTION,value_offset,indent,prefix);
            chpr += printf("============= VALUES, EXIF IFD ============");
            chpr = newline(chpr);
        }

        entry_offset = start_entry_offset;
        for(entry_num = 0; entry_num < num_entries; ++entry_num)
        {
            entry_ptr = read_ifd_entry(inptr,byteorder,entry_offset);
            if((entry_ptr->value_type == 0) || (entry_ptr->value_type > DOUBLE) ||
                ferror(inptr) || feof(inptr))
            {
                /* If the first pass made it through invalid entries, */
                /* this pass should just ignore them and quietly      */
                /* continue.                                          */
                entry_offset = current_offset = ftell(inptr);
                continue;
            }
            current_offset = entry_offset = ftell(inptr);
            switch(entry_ptr->tag)
            {
                case EXIFTAG_Interoperability: 
                    PUSHCOLOR(INTEROP_COLOR);
                    value_offset = process_tiff_ifd(inptr,byteorder,
                                            entry_ptr->value,fileoffset_base,
                                            max_exif_offset,summary_entry,
                                            fulldirname,INTEROP_IFD,ifdnum,0,
                                            indent);
                    POPCOLOR();
                    break;
                case EXIFTAG_MakerNote: 
        /* ###%%% temporary debug                                     */
                    if(Debug & END_OF_SECTION_DEBUG)
                        printf("mo=%lu, mvo=%lu, ",
                                max_offset,max_value_offset);
                    value_start_offset = entry_ptr->value + fileoffset_base;
                    if(max_offset && (value_start_offset > max_offset) &&
                            (entry_ptr->count > 4))
                    {
                        next_max_offset = value_start_offset;
                    }
                    if(Debug & END_OF_SECTION_DEBUG)
                        printf("vso=%lu, nmo=%lu\n",value_start_offset,next_max_offset);
                    value_offset = process_makernote(inptr,byteorder,
                                            entry_ptr,fileoffset_base,max_exif_offset,
                                                    summary_entry,fulldirname,indent);
                    if(Debug & END_OF_SECTION_DEBUG)
                        printf("mo=%lu, mvo=%lu, ",max_offset,max_value_offset);
                    if(Debug & END_OF_SECTION_DEBUG)
                        printf("MNvo=%lu, mo=%lu\n",value_offset,max_offset);
                    break;
                default:
                    if((PRINT_VALUE) && ((PRINT_VALUE_AT_OFFSET) && is_offset(entry_ptr)))
                    {
                        print_tag_address(ENTRY,fileoffset_base + entry_ptr->value,
                                            indent,prefix);
                        print_tagid(entry_ptr,SMALLINDENT,EXIF_IFD);
                        value_offset =
                                    print_offset_value(inptr,byteorder,entry_ptr,
                                                    fileoffset_base,fulldirname,
                                                    EXIF_IFD,indent,1);
                    }
                    break;
            }
            if(value_offset > max_value_offset)
                max_value_offset = value_offset;
            if(max_offset && (value_offset > max_offset))
            {
                next_max_offset = value_start_offset;
                if(Debug & END_OF_SECTION_DEBUG)
                    printf("nmo=%lu\n",next_max_offset);
            }
        }
    }
    else if(current_offset > max_value_offset)
        max_value_offset = current_offset;

    indent -= SMALLINDENT;
    if(max_offset && (max_value_offset > max_offset))
        print_tag_address(SECTION,max_offset - 1,indent,"<");
    else
        print_tag_address(SECTION,max_value_offset - 1,indent,"-");
    if(PRINT_SECTION)
    {
        chpr += printf("</EXIF IFD>");
        chpr = newline(chpr);
    }
    POPCOLOR();

    /* This shouldn't happen.                                         */
    if(next_ifd_offset)
    {
        printred("#========= WARNING! CHAINING NEXT IFD FROM EXIF IFD =========");
        chpr = newline(1);
        value_offset = process_tiff_ifd(inptr,byteorder,next_ifd_offset,
                                fileoffset_base,max_offset,summary_entry,fulldirname,
                                EXIF_IFD,++ifdnum,-1,indent);
        if(value_offset > max_value_offset)
            max_value_offset = value_offset;
    }
    if(fulldirname)
        free(fulldirname);
    if(next_max_offset)
        max_value_offset = next_max_offset;
    if(Debug & END_OF_SECTION_DEBUG)
        printf("exmvo=%lu\n",max_value_offset);
    return(max_value_offset);
blewit:
    clearerr(inptr);
    current_offset = ftell(inptr);
    print_tag_address(SECTION,current_offset - 1,indent,"-");
    if(PRINT_SECTION)
    {
        chpr += printf("</EXIF IFD>");
        chpr = newline(chpr);
    }
    if(fulldirname)
        free(fulldirname);
    POPCOLOR();
    return(0L);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
testq %rdi, %rdi
je 0x105a9
movq %rdx, %r15
movl %esi, %r12d
movq %rdi, %r14
movl 0xb0(%rsp), %r13d
cmpq %r8, %rdx
leaq 0x319c4(%rip), %rbx     # 0x41b82
leaq 0x30f17(%rip), %rax     # 0x410dc
cmovbeq %rax, %rbx
movq %r8, 0x28(%rsp)
testq %r8, %r8
cmoveq %rax, %rbx
testq %r9, %r9
je 0x101df
orb $0x10, 0x18(%r9)
movq %r9, 0x50(%rsp)
movq %rcx, 0x48(%rsp)
addq %rcx, %r15
movl $0x40000, %edi          # imm = 0x40000
movq %r15, %rsi
movl %r13d, %edx
movq %rbx, %rcx
callq 0x5605
leaq 0x47f7a(%rip), %rax     # 0x58180
xorl %ebp, %ebp
testb $0x4, 0x2(%rax)
je 0x10225
leaq 0x34930(%rip), %rdi     # 0x44b45
movl 0xa8(%rsp), %esi
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
movzwl %r12w, %r12d
movq %r14, %rdi
movl %r12d, %esi
movq %r15, %rdx
callq 0x4574
movl %eax, %r15d
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x10257
movl %r12d, 0x4(%rsp)
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
je 0x102c7
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x31b0
movq %r14, %rdi
callq 0x3190
leaq -0x1(%rax), %rsi
leaq 0x30e85(%rip), %rcx     # 0x410f9
movl $0x40000, %edi          # imm = 0x40000
movl %r13d, %edx
callq 0x5605
leaq 0x47ef8(%rip), %rax     # 0x58180
testb $0x4, 0x2(%rax)
je 0x102a5
leaq 0x3188e(%rip), %rdi     # 0x41b23
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl %ebp, %edi
callq 0x16b56
testq %rbx, %rbx
je 0x102b2
movq %rbx, %rdi
callq 0x3050
xorl %r15d, %r15d
movq %r15, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzwl %r15w, %r15d
movq %r14, %rdi
callq 0x3190
movq %rax, %r12
leaq 0x47ea3(%rip), %rax     # 0x58180
testb $0x4, 0x2(%rax)
movq %r15, 0x58(%rsp)
movq %r12, 0x18(%rsp)
je 0x1032e
leaq 0x318ab(%rip), %rdi     # 0x41b9f
movl %r15d, %esi
xorl %eax, %eax
callq 0x3120
movq %r13, %r15
movl %eax, %r13d
leaq 0x318a1(%rip), %rdi     # 0x41bac
movq %r12, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
addl %r13d, %ebp
movq %r15, %r13
movq 0x58(%rsp), %r15
movl %ebp, %edi
callq 0x16b56
movl %eax, %ebp
leaq 0x31662(%rip), %rsi     # 0x41997
leaq 0x33fdb(%rip), %rdx     # 0x44317
movq 0xa0(%rsp), %rdi
callq 0x17a47
movq %rax, 0x40(%rsp)
leal 0x2(%r13), %eax
movq %rax, 0x30(%rsp)
testl %r15d, %r15d
je 0x105cb
leal (,%r15,4), %eax
leal (%rax,%rax,2), %eax
movq %rax, 0x10(%rsp)
movl $0x0, 0x38(%rsp)
movq 0x18(%rsp), %r13
movq $0x0, 0x20(%rsp)
movq %r14, %rdi
movl 0x4(%rsp), %esi
movq %r13, %rdx
callq 0x4b9b
movq %rax, %r12
movzwl 0x2(%rax), %eax
addl $-0xd, %eax
cmpw $-0xc, %ax
jb 0x103c1
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x103c1
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
je 0x104ab
movl $0x4003333, %edi        # imm = 0x4003333
movq %r13, %rsi
movq 0x30(%rsp), %rdx
movq %rbx, %rcx
callq 0x5605
movq 0x10(%r12), %rsi
leaq 0x3477a(%rip), %rdi     # 0x44b5c
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl %ebp, %edi
callq 0x16b56
movl %eax, %ebp
movq %r14, %rdi
callq 0x31b0
movq %r14, %rdi
callq 0x3190
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rax
movq %rax, %r12
testq %rax, %rax
jne 0x1044a
movq %r14, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x3210
movl $0x0, %r12d
cmpl $-0x1, %eax
je 0x1044a
movq %r14, %rdi
callq 0x3190
movq %rax, %r12
movq %r14, %rdi
movq 0x8(%rsp), %rsi
xorl %edx, %edx
callq 0x3210
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x10480
movl %ebp, %edi
callq 0x16b56
movl %eax, %ebp
movl $0x2, %eax
cmpl $0x5, %eax
movq 0x18(%rsp), %r12
jne 0x105b3
decl %r15d
jne 0x10386
jmp 0x105e3
movq %r14, %rdi
callq 0x31a0
testq %r12, %r12
je 0x10456
testl %eax, %eax
jne 0x10456
movq 0x10(%rsp), %rax
leaq (%rax,%r13), %rcx
movl $0x5, %eax
cmpq %r12, %rcx
jae 0x10456
movq 0x8(%rsp), %r13
jmp 0x10464
movq %r14, %rdi
callq 0x3190
movq %rax, 0x8(%rsp)
movzwl (%r12), %eax
cmpl $0xa002, %eax           # imm = 0xA002
jg 0x104e7
cmpl $0x927c, %eax           # imm = 0x927C
je 0x104f5
cmpl $0xa002, %eax           # imm = 0xA002
jne 0x1050e
movq 0x50(%rsp), %rcx
testq %rcx, %rcx
je 0x1050e
movq 0x10(%r12), %rax
movq %rax, 0x60(%rcx)
jmp 0x1050e
cmpl $0xa003, %eax           # imm = 0xA003
je 0x104fb
cmpl $0xa005, %eax           # imm = 0xA005
jne 0x1050e
incl 0x38(%rsp)
jmp 0x1050e
movq 0x50(%rsp), %rcx
testq %rcx, %rcx
je 0x1050e
movq 0x10(%r12), %rax
movq %rax, 0x68(%rcx)
movl $0x4003333, %edi        # imm = 0x4003333
movq %r13, %rsi
movq 0x30(%rsp), %rdx
movq %rbx, %rcx
callq 0x5605
movq %r14, %rdi
movl 0x4(%rsp), %esi
movq %r12, %rdx
movq 0x48(%rsp), %rcx
movq 0x50(%rsp), %r8
movq 0x40(%rsp), %r9
movl $0x2, %r10d
pushq %r10
pushq $-0x1
movl 0xb8(%rsp), %eax
pushq %rax
pushq %r10
callq 0x5763
addq $0x20, %rsp
testq %rax, %rax
movq 0x8(%rsp), %r13
cmoveq %r13, %rax
movq 0x20(%rsp), %rcx
cmpq %rcx, %rax
cmovaq %rax, %rcx
movq %rcx, 0x20(%rsp)
leaq 0x47c03(%rip), %rax     # 0x58180
testb $0x1, 0x3(%rax)
je 0x1059f
movzwl 0x2(%r12), %edi
callq 0x15f20
cltq
imulq 0x8(%r12), %rax
cmpq $0x5, %rax
sbbl $-0x1, 0x38(%rsp)
movq 0x18(%rsp), %r12
jmp 0x10472
callq 0x33d3
jmp 0x102b2
cmpl $0x2, %eax
jne 0x10656
movq 0x30(%rsp), %r13
movq 0x40(%rsp), %rbx
jmp 0x10259
movb $0x1, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x18(%rsp), %r12
movq %r12, %rdx
jmp 0x105fa
cmpl $0x0, 0x38(%rsp)
sete 0x10(%rsp)
movl 0xb0(%rsp), %r13d
movq 0x8(%rsp), %rdx
movq %r14, %rdi
movl 0x4(%rsp), %esi
movq %rdx, 0x8(%rsp)
callq 0x46cc
movq %rax, %rdx
leaq 0x47b6b(%rip), %rax     # 0x58180
movq (%rax), %rax
testb $0x30, %al
sete %cl
notl %eax
testl $0x1040000, %eax        # imm = 0x1040000
setne %al
orb %cl, %al
testq %rdx, %rdx
je 0x10644
movq %rdx, %r15
testb %al, %al
je 0x1065b
addq 0x48(%rsp), %r15
movq %r15, 0x38(%rsp)
jmp 0x1071c
testb %al, %al
je 0x106ae
movq $0x0, 0x38(%rsp)
jmp 0x106e7
jmp 0x102b5
leal 0x4(%r13), %edx
movl $0x40000, %edi          # imm = 0x40000
movq 0x8(%rsp), %rsi
movq %rbx, %rcx
callq 0x5605
leaq 0x3157b(%rip), %rdi     # 0x41bf3
movq %r15, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %r12d
addl %ebp, %r12d
movq 0x48(%rsp), %rbp
addq %rbp, %r15
movq %r14, %rdi
callq 0x3190
cmpq %rax, %r15
jae 0x106ee
leaq 0x36fbc(%rip), %rdi     # 0x47660
callq 0x5c33
xorl %r15d, %r15d
jmp 0x10708
movl $0x40000, %edi          # imm = 0x40000
movq 0x8(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %rbx, %rcx
callq 0x5605
leaq 0x31542(%rip), %rdi     # 0x41c0e
movq $0x0, 0x38(%rsp)
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl %ebp, %edi
callq 0x16b56
movl %eax, %ebp
movq 0x28(%rsp), %r15
jmp 0x1071c
leaq 0x34b8f(%rip), %rdi     # 0x45284
movq %rbp, %rsi
movq %r15, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x3120
addl %eax, %r12d
movl %r12d, %edi
callq 0x16b56
movl %eax, %ebp
movq %r15, 0x38(%rsp)
movq 0x18(%rsp), %r12
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x10738
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
je 0x10bbc
leaq 0x314e6(%rip), %rdi     # 0x41c25
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl %ebp, %edi
callq 0x16b56
movl %eax, %ebp
movq 0x47870(%rip), %rax     # 0x57fc8
movq (%rax), %rdi
callq 0x179a5
movq %r14, %rdi
callq 0x31b0
cmpb $0x0, 0x10(%rsp)
je 0x10793
movq 0x20(%rsp), %r15
movq 0x8(%rsp), %rax
cmpq %r15, %rax
cmovaq %rax, %r15
movq $0x0, 0x10(%rsp)
movq 0x40(%rsp), %rbx
jmp 0x10abf
leaq 0x479e6(%rip), %rax     # 0x58180
movq (%rax), %rax
testb $0x30, %al
sete %cl
notl %eax
testl $0x1040000, %eax        # imm = 0x1040000
setne %al
orb %cl, %al
movq %r15, 0x60(%rsp)
jne 0x107e5
movl $0x40000, %edi          # imm = 0x40000
movq 0x8(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %rbx, %rcx
callq 0x5605
leaq 0x343a3(%rip), %rdi     # 0x44b76
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl %ebp, %edi
callq 0x16b56
movl %eax, %ebp
cmpl $0x0, 0x58(%rsp)
movl 0x4(%rsp), %r15d
je 0x10aa4
movq $0x0, 0x10(%rsp)
xorl %r13d, %r13d
movq %r14, %rdi
movl %r15d, %esi
movq %r12, %rdx
callq 0x4b9b
movq %rax, %r12
movzwl 0x2(%rax), %eax
addl $-0xd, %eax
cmpw $-0xc, %ax
jb 0x10837
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x10837
movq %r14, %rdi
callq 0x31a0
testl %eax, %eax
je 0x10855
movq %r14, %rdi
callq 0x3190
movq %rax, %r12
movq 0x58(%rsp), %rax
decl %eax
movq %rax, 0x58(%rsp)
jne 0x10801
jmp 0x10aad
movq %r14, %rdi
callq 0x3190
movq %rax, 0x18(%rsp)
movzwl (%r12), %eax
cmpl $0x927c, %eax           # imm = 0x927C
je 0x108c1
cmpl $0xa005, %eax           # imm = 0xA005
jne 0x109b9
movq 0x10(%r12), %rdx
subq $0x8, %rsp
movq %r14, %rdi
movl %r15d, %esi
movq 0x50(%rsp), %rcx
movq 0x68(%rsp), %r8
movq 0x58(%rsp), %r9
pushq 0x38(%rsp)
pushq $0x0
movl 0xc0(%rsp), %eax
pushq %rax
pushq $0x3
pushq 0x68(%rsp)
callq 0xc93c
addq $0x30, %rsp
movq %rax, %r15
movq 0x18(%rsp), %r12
jmp 0x109f6
leaq 0x4cda8(%rip), %rax     # 0x5d670
testb $0x10, (%rax)
je 0x108e5
leaq 0x342ce(%rip), %rdi     # 0x44ba2
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdx
xorl %eax, %eax
callq 0x3120
movq 0x10(%r12), %rcx
addq 0x48(%rsp), %rcx
movq 0x28(%rsp), %rax
testq %rax, %rax
je 0x10912
cmpq %rax, %rcx
jbe 0x10912
cmpq $0x5, 0x8(%r12)
movq 0x10(%rsp), %rax
cmovaeq %rcx, %rax
movq %rax, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
leaq 0x4cd52(%rip), %rax     # 0x5d670
testb $0x10, (%rax)
je 0x1093b
leaq 0x3428a(%rip), %rdi     # 0x44bb4
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x3120
movq %r14, %rdi
movl %r15d, %esi
movq %r12, %rdx
movq 0x48(%rsp), %rcx
movq 0x60(%rsp), %r8
movq 0x50(%rsp), %r9
pushq 0x30(%rsp)
pushq 0x48(%rsp)
callq 0x19b94
addq $0x10, %rsp
movq %rax, %r15
leaq 0x4cd02(%rip), %rax     # 0x5d670
testb $0x10, (%rax)
je 0x1098b
leaq 0x34228(%rip), %rdi     # 0x44ba2
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdx
xorl %eax, %eax
callq 0x3120
leaq 0x4ccde(%rip), %rax     # 0x5d670
testb $0x10, (%rax)
movq 0x18(%rsp), %r12
je 0x109b2
leaq 0x34223(%rip), %rdi     # 0x44bc6
movq %r15, %rsi
movq 0x28(%rsp), %rdx
xorl %eax, %eax
callq 0x3120
movq 0x8(%rsp), %r13
jmp 0x109f6
leaq 0x477c0(%rip), %rax     # 0x58180
movq (%rax), %rax
testb $0x30, %al
sete %cl
btl $0x18, %eax
setae %al
orb %cl, %al
jne 0x109ec
movzwl 0x2(%r12), %edi
callq 0x15f20
cltq
imulq 0x8(%r12), %rax
cmpq $0x5, %rax
jae 0x10a47
movq 0x18(%rsp), %r12
movq 0x8(%rsp), %r15
movq 0x20(%rsp), %rax
cmpq %rax, %r15
cmovaq %r15, %rax
movq %rax, 0x20(%rsp)
movq 0x28(%rsp), %rax
testq %rax, %rax
movq %r15, 0x8(%rsp)
je 0x10a3d
cmpq %rax, %r15
jbe 0x10a3d
leaq 0x4cc4e(%rip), %rax     # 0x5d670
testb $0x10, (%rax)
je 0x10a38
leaq 0x3418f(%rip), %rdi     # 0x44bbd
movq %r13, %rsi
xorl %eax, %eax
callq 0x3120
movq %r13, 0x10(%rsp)
movl 0x4(%rsp), %r15d
jmp 0x10842
movq 0x10(%r12), %rsi
movq 0x48(%rsp), %r15
addq %r15, %rsi
movl $0x4003333, %edi        # imm = 0x4003333
movq 0x30(%rsp), %rdx
movq %rbx, %rcx
callq 0x5605
movq %r12, %rdi
movl $0x2, %esi
movl $0x2, %edx
callq 0x67d3
movq %r14, %rdi
movl 0x4(%rsp), %esi
movq %r12, %rdx
movq %r15, %rcx
movq 0x40(%rsp), %r8
movl $0x2, %r9d
pushq $0x1
pushq 0x38(%rsp)
callq 0x5c4d
addq $0x10, %rsp
jmp 0x108b4
movq $0x0, 0x10(%rsp)
movl 0xb0(%rsp), %r13d
movq 0x40(%rsp), %rbx
movq 0x20(%rsp), %r15
movq 0x28(%rsp), %rdx
testq %rdx, %rdx
setne %al
cmpq %rdx, %r15
seta %cl
testb %cl, %al
movq %r15, %rsi
cmovneq %rdx, %rsi
leaq 0x340f8(%rip), %rax     # 0x44bd8
leaq 0x30612(%rip), %rcx     # 0x410f9
cmovneq %rax, %rcx
decq %rsi
movl $0x40000, %edi          # imm = 0x40000
movl %r13d, %edx
callq 0x5605
leaq 0x4767e(%rip), %rax     # 0x58180
testb $0x4, 0x2(%rax)
je 0x10b1f
leaq 0x31014(%rip), %rdi     # 0x41b23
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl %ebp, %edi
callq 0x16b56
movq 0x38(%rsp), %r12
testq %r12, %r12
je 0x10b7d
leaq 0x340aa(%rip), %rdi     # 0x44bda
callq 0x5c33
movl $0x1, %edi
callq 0x16b56
movl 0xa8(%rsp), %eax
incl %eax
subq $0x8, %rsp
movq %r14, %rdi
movl 0xc(%rsp), %esi
movq %r12, %rdx
movq 0x50(%rsp), %rcx
movq 0x30(%rsp), %r8
movq 0x58(%rsp), %r9
pushq %r13
pushq $-0x1
pushq %rax
pushq $0x2
pushq %rbx
callq 0xc93c
addq $0x30, %rsp
cmpq %r15, %rax
cmovaq %rax, %r15
testq %rbx, %rbx
je 0x10b8a
movq %rbx, %rdi
callq 0x3050
movq 0x10(%rsp), %rax
testq %rax, %rax
cmovneq %rax, %r15
leaq 0x4cad3(%rip), %rax     # 0x5d670
testb $0x10, (%rax)
je 0x102b5
leaq 0x3406b(%rip), %rdi     # 0x44c18
movq %r15, %rsi
xorl %eax, %eax
callq 0x3120
jmp 0x102b5
movq %r14, %rdi
callq 0x3190
movq %rax, 0x8(%rsp)
jmp 0x10768