// File: /workspace/github_c_makefile_star2_O3/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 $0x78, %rsp
testq %rdi, %rdi
je 0x106cf
movq %r9, %r14
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %rbx
movl 0xc0(%rsp), %edx
cmpq %r8, %r15
leaq 0x318b8(%rip), %r12     # 0x41b82
leaq 0x30e0b(%rip), %rax     # 0x410dc
cmovbeq %rax, %r12
movq %r8, 0x28(%rsp)
testq %r8, %r8
cmoveq %rax, %r12
testq %r9, %r9
je 0x102eb
orb $0x10, 0x18(%r14)
movq %rcx, 0x38(%rsp)
addq %rcx, %r15
movl $0x40000, %edi          # imm = 0x40000
movq %r15, %rsi
movq %r12, %rcx
callq 0x55eb
leaq 0x47e76(%rip), %rax     # 0x58180
xorl %r13d, %r13d
testb $0x4, 0x2(%rax)
je 0x1032b
leaq 0x3486f(%rip), %rdi     # 0x44b89
movl 0xb8(%rsp), %esi
xorl %eax, %eax
callq 0x3120
movl %eax, %r13d
movzwl %bp, %ebp
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x45af
movl %eax, %r15d
movq %rbx, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x10356
movq %rbx, %rdi
callq 0x31a0
testl %eax, %eax
je 0x103d3
xorl %r14d, %r14d
movl 0xc0(%rsp), %eax
movl %eax, %r15d
movq %rbx, %rdi
callq 0x31b0
movq %rbx, %rdi
callq 0x3190
leaq -0x1(%rax), %rsi
leaq 0x30d7b(%rip), %rcx     # 0x410f9
movl $0x40000, %edi          # imm = 0x40000
movl %r15d, %edx
callq 0x55eb
leaq 0x47dee(%rip), %rax     # 0x58180
testb $0x4, 0x2(%rax)
je 0x103b1
leaq 0x31784(%rip), %rdi     # 0x41b23
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movl %r13d, %edi
callq 0x1707a
testq %r14, %r14
je 0x103be
movq %r14, %rdi
callq 0x3050
xorl %r15d, %r15d
movq %r15, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, 0x58(%rsp)
movl %ebp, 0xc(%rsp)
movq 0xb0(%rsp), %rbp
movw %r15w, 0x60(%rsp)
movzwl %r15w, %r15d
movq %rbx, %rdi
callq 0x3190
movq %rax, %r12
leaq 0x47d80(%rip), %rax     # 0x58180
testb $0x4, 0x2(%rax)
movq %r15, 0x70(%rsp)
movq %r12, 0x48(%rsp)
je 0x10453
leaq 0x31788(%rip), %rdi     # 0x41b9f
movl %r15d, %esi
xorl %eax, %eax
callq 0x3120
movq %rbp, %r15
movl %eax, %ebp
leaq 0x3177f(%rip), %rdi     # 0x41bac
movq %r12, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
addl %ebp, %r13d
movq %r15, %rbp
movq 0x70(%rsp), %r15
movl %r13d, %edi
callq 0x1707a
movl %eax, %r13d
movq %r14, 0x30(%rsp)
leaq 0x31538(%rip), %rsi     # 0x41997
leaq 0x33ef5(%rip), %rdx     # 0x4435b
movq %rbp, %rdi
callq 0x17f99
movq %rax, 0x40(%rsp)
movl 0xc0(%rsp), %eax
addl $0x2, %eax
movq %rax, 0x20(%rsp)
testl %r15d, %r15d
je 0x106f3
leal (,%r15,4), %eax
leal (%rax,%rax,2), %eax
movq %rax, 0x50(%rsp)
movl %r15d, %r14d
movl $0x0, 0x10(%rsp)
movq 0x48(%rsp), %rbp
movq $0x0, 0x18(%rsp)
movl 0xc(%rsp), %r12d
movq 0x20(%rsp), %r15
movq %rbx, %rdi
movl %r12d, %esi
movq %rbp, %rdx
callq 0x4bcc
movq %rax, %r12
movzwl 0x2(%rax), %eax
addl $-0xd, %eax
cmpw $-0xc, %ax
jb 0x104f8
movq %rbx, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x104f8
movq %rbx, %rdi
callq 0x31a0
testl %eax, %eax
je 0x105d2
movl $0x4003333, %edi        # imm = 0x4003333
movq %rbp, %rsi
movl %r15d, %edx
movq 0x58(%rsp), %rcx
callq 0x55eb
movq 0x10(%r12), %rsi
leaq 0x34687(%rip), %rdi     # 0x44ba0
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movl %r13d, %edi
callq 0x1707a
movl %eax, %r13d
movq %rbx, %rdi
callq 0x31b0
movq %rbx, %rdi
callq 0x3190
movq %rax, %r12
movq 0x28(%rsp), %rax
movq %rax, %r15
testq %rax, %rax
jne 0x10580
movq %rbx, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x3210
movl $0x0, %r15d
cmpl $-0x1, %eax
je 0x10580
movq %rbx, %rdi
callq 0x3190
movq %rax, %r15
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x3210
movq %rbx, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x106d9
movq %rbx, %rdi
callq 0x31a0
testq %r15, %r15
je 0x106d9
testl %eax, %eax
jne 0x106d9
addq 0x50(%rsp), %rbp
cmpq %r15, %rbp
jae 0x106d9
movq %r12, %rbp
movq 0x20(%rsp), %r15
decl %r14d
movl 0xc(%rsp), %r12d
jne 0x104be
jmp 0x10712
movq %rbx, %rdi
callq 0x3190
movq %rax, 0x68(%rsp)
movzwl (%r12), %eax
cmpl $0xa002, %eax           # imm = 0xA002
jg 0x1060e
cmpl $0x927c, %eax           # imm = 0x927C
je 0x1061c
cmpl $0xa002, %eax           # imm = 0xA002
jne 0x10635
movq 0x30(%rsp), %rcx
testq %rcx, %rcx
je 0x10635
movq 0x10(%r12), %rax
movq %rax, 0x60(%rcx)
jmp 0x10635
cmpl $0xa003, %eax           # imm = 0xA003
je 0x10622
cmpl $0xa005, %eax           # imm = 0xA005
jne 0x10635
incl 0x10(%rsp)
jmp 0x10635
movq 0x30(%rsp), %rcx
testq %rcx, %rcx
je 0x10635
movq 0x10(%r12), %rax
movq %rax, 0x68(%rcx)
movl $0x4003333, %edi        # imm = 0x4003333
movq %rbp, %rsi
movl %r15d, %edx
movq 0x58(%rsp), %rcx
callq 0x55eb
movq %rbx, %rdi
movl 0xc(%rsp), %esi
movq %r12, %rdx
movq 0x38(%rsp), %rcx
movq 0x30(%rsp), %r8
movq 0x40(%rsp), %r9
movl $0x2, %r10d
pushq %r10
pushq $-0x1
movl 0xc8(%rsp), %eax
pushq %rax
pushq %r10
callq 0x5749
addq $0x20, %rsp
testq %rax, %rax
movq 0x68(%rsp), %rbp
cmoveq %rbp, %rax
movq 0x18(%rsp), %rcx
cmpq %rcx, %rax
cmovaq %rax, %rcx
movq %rcx, 0x18(%rsp)
leaq 0x47adc(%rip), %rax     # 0x58180
testb $0x1, 0x3(%rax)
je 0x105bf
movzwl 0x2(%r12), %edi
callq 0x1646c
cltq
imulq 0x8(%r12), %rax
cmpq $0x5, %rax
sbbl $-0x1, 0x10(%rsp)
jmp 0x105bf
callq 0x33d3
jmp 0x103be
movl %r13d, %edi
callq 0x1707a
movl %eax, %r13d
movq 0x40(%rsp), %r14
movq 0x20(%rsp), %r15
jmp 0x10363
movb $0x1, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq 0x48(%rsp), %rbp
movl 0xc(%rsp), %r12d
movq 0x20(%rsp), %r15
jmp 0x1071c
cmpl $0x0, 0x10(%rsp)
sete 0x10(%rsp)
movq %rbx, %rdi
movl %r12d, %esi
movq %rbp, %rdx
callq 0x4707
movq %rax, %rdx
leaq 0x47a4c(%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 0x10763
movq %rdx, %r14
testb %al, %al
je 0x10775
addq 0x38(%rsp), %r14
movq %r14, 0x50(%rsp)
jmp 0x10843
testb %al, %al
je 0x107ce
movq $0x0, 0x50(%rsp)
jmp 0x10808
movl 0xc0(%rsp), %eax
leal 0x4(%rax), %edx
movl $0x40000, %edi          # imm = 0x40000
movq %rbp, %rsi
movq 0x58(%rsp), %rcx
callq 0x55eb
leaq 0x3145b(%rip), %rdi     # 0x41bf3
movq %r14, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %r12d
addl %r13d, %r12d
movq 0x38(%rsp), %r15
addq %r15, %r14
movq %rbx, %rdi
callq 0x3190
cmpq %rax, %r14
jae 0x1080f
leaq 0x36edc(%rip), %rdi     # 0x476a0
callq 0x5c26
xorl %r14d, %r14d
jmp 0x10829
movl $0x40000, %edi          # imm = 0x40000
movq %rbp, %rsi
movl %r15d, %edx
movq 0x58(%rsp), %rcx
callq 0x55eb
leaq 0x31424(%rip), %rdi     # 0x41c0e
movq $0x0, 0x50(%rsp)
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movl %r13d, %edi
callq 0x1707a
movl %eax, %r13d
movq 0x28(%rsp), %r14
jmp 0x10843
leaq 0x34ab2(%rip), %rdi     # 0x452c8
movq %r15, %rsi
movq %r14, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x3120
addl %eax, %r12d
movq 0x20(%rsp), %r15
movl %r12d, %edi
callq 0x1707a
movl %eax, %r13d
movq %r14, 0x50(%rsp)
movl 0xc(%rsp), %r12d
movq %rbx, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x1085f
movq %rbx, %rdi
callq 0x31a0
testl %eax, %eax
je 0x10d16
leaq 0x313bf(%rip), %rdi     # 0x41c25
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movl %r13d, %edi
callq 0x1707a
movl %eax, %r13d
movq 0x47746(%rip), %rax     # 0x57fc8
movq (%rax), %rdi
callq 0x17ef7
movq %rbx, %rdi
callq 0x31b0
cmpb $0x0, 0x10(%rsp)
je 0x108ad
movq 0x18(%rsp), %r15
cmpq %r15, %rbp
cmovaq %rbp, %r15
xorl %r14d, %r14d
jmp 0x10bff
movq %r14, 0x68(%rsp)
leaq 0x478c7(%rip), %rax     # 0x58180
movq (%rax), %rax
testb $0x30, %al
sete %cl
notl %eax
testl $0x1040000, %eax        # imm = 0x1040000
setne %al
orb %cl, %al
jne 0x10900
movl $0x40000, %edi          # imm = 0x40000
movq %rbp, %rsi
movl %r15d, %edx
movq 0x58(%rsp), %rcx
callq 0x55eb
leaq 0x342cf(%rip), %rdi     # 0x44bba
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movl %r13d, %edi
callq 0x1707a
movl %eax, %r13d
movq 0x48(%rsp), %r15
cmpw $0x0, 0x60(%rsp)
je 0x10bf7
leaq 0x342e9(%rip), %r14     # 0x44c01
movq $0x0, 0x10(%rsp)
movq $0x0, 0x60(%rsp)
movq %rbx, %rdi
movl %r12d, %esi
movq %r15, %rdx
callq 0x4bcc
movq %rax, %r12
movzwl 0x2(%rax), %eax
addl $-0xd, %eax
cmpw $-0xc, %ax
jb 0x10960
movq %rbx, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x10960
movq %rbx, %rdi
callq 0x31a0
testl %eax, %eax
je 0x10983
movq %rbx, %rdi
callq 0x3190
movq %rax, %r15
movl 0xc(%rsp), %r12d
movq 0x70(%rsp), %rax
decl %eax
movq %rax, 0x70(%rsp)
jne 0x1092a
jmp 0x10beb
movq %rbx, %rdi
callq 0x3190
movq %rax, %r15
movzwl (%r12), %eax
cmpl $0x927c, %eax           # imm = 0x927C
je 0x109ed
cmpl $0xa005, %eax           # imm = 0xA005
jne 0x10ae0
movq 0x10(%r12), %rdx
subq $0x8, %rsp
movq %rbx, %rdi
movl 0x14(%rsp), %r12d
movl %r12d, %esi
movq 0x40(%rsp), %rcx
movq 0x70(%rsp), %r8
movq 0x38(%rsp), %r9
pushq 0x28(%rsp)
pushq $0x0
movl 0xd0(%rsp), %eax
pushq %rax
pushq $0x3
pushq 0x68(%rsp)
callq 0xcabc
addq $0x30, %rsp
movq %rax, %rbp
jmp 0x10b18
leaq 0x4cc7c(%rip), %rax     # 0x5d670
testb $0x10, (%rax)
movq 0x18(%rsp), %rdx
je 0x10a11
leaq 0x341e1(%rip), %rdi     # 0x44be6
movq 0x28(%rsp), %rsi
xorl %eax, %eax
callq 0x3120
movq 0x10(%r12), %r14
addq 0x38(%rsp), %r14
movq 0x28(%rsp), %rax
testq %rax, %rax
movq 0x10(%rsp), %rbp
je 0x10a39
cmpq %rax, %r14
jbe 0x10a39
cmpq $0x5, 0x8(%r12)
cmovaeq %r14, %rbp
leaq 0x4cc30(%rip), %rax     # 0x5d670
testb $0x10, (%rax)
je 0x10a59
leaq 0x341ac(%rip), %rdi     # 0x44bf8
movq %r14, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x3120
movq %r14, 0x60(%rsp)
movq %rbp, 0x10(%rsp)
movq %rbx, %rdi
movl 0xc(%rsp), %esi
movq %r12, %rdx
movq 0x38(%rsp), %rcx
movq 0x68(%rsp), %r8
movq 0x30(%rsp), %r9
pushq 0x20(%rsp)
pushq 0x48(%rsp)
callq 0x1a0dc
addq $0x10, %rsp
movq %rax, %rbp
leaq 0x4cbd9(%rip), %r14     # 0x5d670
testb $0x10, (%r14)
je 0x10ad2
leaq 0x34142(%rip), %rdi     # 0x44be6
movq 0x28(%rsp), %r12
movq %r12, %rsi
movq 0x18(%rsp), %rdx
xorl %eax, %eax
callq 0x3120
testb $0x10, (%r14)
je 0x10ad2
leaq 0x34145(%rip), %rdi     # 0x44c0a
movq %rbp, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x3120
movl 0xc(%rsp), %r12d
leaq 0x34123(%rip), %r14     # 0x44c01
jmp 0x10b18
leaq 0x47699(%rip), %rax     # 0x58180
movq (%rax), %rax
testb $0x30, %al
sete %cl
btl $0x18, %eax
setae %al
orb %cl, %al
jne 0x10b13
movzwl 0x2(%r12), %edi
callq 0x1646c
cltq
imulq 0x8(%r12), %rax
cmpq $0x5, %rax
jae 0x10b7e
movl 0xc(%rsp), %r12d
movq 0x18(%rsp), %rax
cmpq %rax, %rbp
cmovaq %rbp, %rax
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rax
testq %rax, %rax
je 0x10970
cmpq %rax, %rbp
jbe 0x10970
leaq 0x4cb29(%rip), %rax     # 0x5d670
testb $0x10, (%rax)
jne 0x10b5b
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x10970
movq %r14, %rdi
movq 0x60(%rsp), %r14
movq %r14, %rsi
xorl %eax, %eax
callq 0x3120
movq %r14, 0x10(%rsp)
leaq 0x34088(%rip), %r14     # 0x44c01
jmp 0x10970
movq 0x10(%r12), %rsi
movq 0x38(%rsp), %rbp
addq %rbp, %rsi
movl $0x4003333, %edi        # imm = 0x4003333
movq %r15, 0x48(%rsp)
movq 0x20(%rsp), %r15
movl %r15d, %edx
movq 0x58(%rsp), %rcx
callq 0x55eb
movq %r12, %rdi
movl $0x2, %esi
movl $0x2, %edx
callq 0x684b
movq %rbx, %rdi
movl 0xc(%rsp), %esi
movq %r12, %rdx
movl %esi, %r12d
movq %rbp, %rcx
movq 0x40(%rsp), %r8
movl $0x2, %r9d
pushq $0x1
pushq %r15
movq 0x58(%rsp), %r15
callq 0x5c40
addq $0x10, %rsp
jmp 0x109e5
movq 0x18(%rsp), %r15
movq 0x10(%rsp), %r14
jmp 0x10bff
xorl %r14d, %r14d
movq 0x18(%rsp), %r15
movq 0x30(%rsp), %rbp
movq 0x28(%rsp), %rdx
testq %rdx, %rdx
setne %al
cmpq %rdx, %r15
seta %cl
testb %cl, %al
movq %r15, %rsi
cmovneq %rdx, %rsi
leaq 0x33ff7(%rip), %rax     # 0x44c1c
leaq 0x304cd(%rip), %rcx     # 0x410f9
cmovneq %rax, %rcx
decq %rsi
movl $0x40000, %edi          # imm = 0x40000
movl 0xc0(%rsp), %edx
callq 0x55eb
leaq 0x47535(%rip), %rax     # 0x58180
testb $0x4, 0x2(%rax)
je 0x10c6a
leaq 0x30ecb(%rip), %rdi     # 0x41b23
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movl %r13d, %edi
callq 0x1707a
movq 0x50(%rsp), %r13
testq %r13, %r13
je 0x10cd7
leaq 0x33fa3(%rip), %rdi     # 0x44c1e
callq 0x5c26
movl $0x1, %edi
callq 0x1707a
movl 0xb8(%rsp), %eax
movq %rax, %r10
incl %r10d
subq $0x8, %rsp
movq %rbx, %rdi
movl %r12d, %esi
movq %r13, %rdx
movq 0x40(%rsp), %rcx
movq 0x30(%rsp), %r8
movq %rbp, %r9
movl 0xc8(%rsp), %eax
pushq %rax
pushq $-0x1
pushq %r10
pushq $0x2
movq 0x68(%rsp), %rbx
pushq %rbx
callq 0xcabc
addq $0x30, %rsp
cmpq %r15, %rax
cmovaq %rax, %r15
jmp 0x10cdc
movq 0x40(%rsp), %rbx
testq %rbx, %rbx
je 0x10ce9
movq %rbx, %rdi
callq 0x3050
testq %r14, %r14
cmovneq %r14, %r15
leaq 0x4c979(%rip), %rax     # 0x5d670
testb $0x10, (%rax)
je 0x103c1
leaq 0x33f55(%rip), %rdi     # 0x44c5c
movq %r15, %rsi
xorl %eax, %eax
callq 0x3120
jmp 0x103c1
movq %rbx, %rdi
callq 0x3190
movq %rax, %rbp
jmp 0x10892