// File: /workspace/github_c_makefile_star2_O1/hfiguiere[P]exifprobe/main.c
// Function: main
int
main(int argc,char **argv)
{
    char *file;
    char *name = CNULL;
    FILE *inptr;
    int status = -1;
    unsigned long max_offset = 0UL;
    unsigned long ifd_offset = 0UL;
    unsigned long dumplength = 0UL;
    struct fileheader *header = NULL;
    struct image_summary *summary_entry = NULL;
    unsigned long filesize = 0UL;
    int chpr = 0;


    Progname = *argv;

    /* Gather options from EXIFPROBE_OPTIONS first                    */
    env_options();

    /* Now the command line                                           */
    argv += process_options(argc,argv);

    while((file = *argv++))
    {
        inptr = fopen(file,"rb");
        if(inptr == FNULL)
        {
            fprintf(stderr,"%s: failed to open file %s\n",Progname,file);
            why(stderr);
            max_offset = 0L;
        }
        else
        {
            PUSHCOLOR(BLACK);
            setfilename(file);  /* for '-n' option                    */
            filesize = get_filesize(inptr);

            if(Start_offset > filesize)
            {
                PUSHCOLOR(RED);
                print_filename();
                chpr += printf(" start offset %lu > filesize %lu\n",
                                            Start_offset,filesize);
                POPCOLOR();
                continue;
            }
            else if(Start_offset)
            {
                if(fseek(inptr,Start_offset,SEEK_SET) == -1)
                {
                    fprintf(stderr,"%s: FAILED to seek to start offset %lu\n",
                                                        Progname,Start_offset);
                    why(stdout);
                    continue;
                }
                printf("# Start at %ld\n",ftell(inptr));
            }

            print_filename();   /* for '-n' option                    */
            if((LIST_MODE))
                chpr += printf("FileName = %s",file);
            else
                chpr += printf("File Name = %s",file);
            chpr = newline(chpr);

            header = read_imageheader(inptr,Start_offset);
            if(ferror(inptr))
                continue;
            print_filename();
            if((LIST_MODE))
                chpr += printf("FileType = ");
            else
                chpr += printf("File Type = ");
            status = print_filetype(header->probe_magic,header->file_marker);
            chpr = newline(chpr);

            print_filename();
            if((LIST_MODE))
                chpr += printf("FileSize = %lu",filesize);
            else
                chpr += printf("File Size = %lu",filesize);
            chpr = newline(chpr);

            if(status == 0)
            {
                switch(header->probe_magic)
                {
                    case ORF1_MAGIC:
                    case ORF2_MAGIC:
                    case RW2_MAGIC:
                    case TIFF_MAGIC:
                        ifd_offset = read_ulong(inptr,header->file_marker,HERE); 
                        if(ifd_offset > filesize)
                        {
                            hexdump(inptr,Start_offset,10,10,12,0,0);
                            chpr = newline(chpr);
                            if(Max_undefined > 0L)
                                dumplength = Max_undefined - 10;
                            else
                                dumplength = 60;
                            if(dumplength)
                            {
                                hexdump(inptr,Start_offset +  10,
                                            filesize - 10 - Start_offset,
                                                            dumplength,12,0,0);
                                chpr = newline(1);
                            }
                            status = -1;
                            break;
                        }
                        summary_entry = new_summary_entry(NULL,header->probe_magic,TIFF_IFD);
                        name = "TIFF";
                        switch(header->probe_magic)
                        {
                            case ORF1_MAGIC:
                                name = "ORF1";
                                break;
                            case ORF2_MAGIC:
                                name = "ORF2";
                                break;
                            case RW2_MAGIC:
                                name = "RW2";
                                break;
                            case TIFF_MAGIC:
                            default:
                                break;
                        }

                        if(PRINT_SECTION)
                        {
                            print_tag_address(SECTION,Start_offset,0,"@");
                            status = print_header(header,SECTION);
                            chpr += printf(" ifd offset = %#lx/%lu",ifd_offset,ifd_offset);
                            if(Start_offset)
                            {
                                chpr += printf(" (+ %lu = %#lx/%lu)",Start_offset,
                                                                Start_offset + ifd_offset,
                                                                Start_offset + ifd_offset);
                            }
                            chpr = newline(chpr);
                        }
                        max_offset = process_tiff_ifd(inptr,header->file_marker,
                                            ifd_offset,Start_offset,0L,summary_entry,name,
                                            TIFF_IFD,0,-1,0);
                        if(max_offset > 0L)
                            status = 0;
                        fflush(stdout);
                        break;
                    case JPEG_SOI:
                        summary_entry = new_summary_entry(NULL,FILEFMT_JPEG,IMGFMT_JPEG);
                        if(summary_entry)
                            summary_entry->subfiletype = PRIMARY_TYPE;
                        max_offset = process_jpeg_segments(inptr,Start_offset,JPEG_SOI,0L,summary_entry,
                                                                            "JPEG","@",0);
                        status = jpeg_status(0);
                        fflush(stdout);
                        break;
                    case PROBE_CIFFMAGIC:
                        summary_entry = new_summary_entry(NULL,FILEFMT_CIFF,IMGFMT_CRW);
                        if(PRINT_SECTION)
                        {
                            print_tag_address(SECTION,Start_offset,0,"@");
                            status = print_header(header,SECTION);
                        }
                        max_offset = process_ciff(inptr,header,Start_offset,0L,summary_entry,"CIFF",0,0);
                        if(max_offset > 0L)
                            status = 0;
                        fflush(stdout);
                        break;
                    case PROBE_JP2MAGIC:
                        summary_entry = new_summary_entry(NULL,FILEFMT_JP2,IMGFMT_JPEG2000);
                        if(PRINT_SECTION)
                        {
                            print_tag_address(SECTION,Start_offset,0,"@");
                            status = print_header(header,SECTION);
                        }
                        max_offset = process_jp2(inptr,Start_offset + 12L,summary_entry,"JP2",0L);
                        if(max_offset > 0L)
                            status = 0;
                        fflush(stdout);
                        break;
                    case PROBE_MRWMAGIC:
                        summary_entry = new_summary_entry(NULL,FILEFMT_MRW,IMGFMT_MRW);
                        if(PRINT_SECTION)
                        {
                            print_tag_address(SECTION,Start_offset,0,"@");
                            status = print_header(header,SECTION);
                        }
                        max_offset =
                            process_mrw(inptr,Start_offset + 8L,
                                    header->mrw_header.mrw_dataoffset,
                                    filesize - header->mrw_header.mrw_dataoffset,
                                    summary_entry,"MRW",0L);
                        if(max_offset > 0L)
                            status = 0;
                        fflush(stdout);
                        break;
                    case PROBE_RAFMAGIC:
                        summary_entry = new_summary_entry(NULL,FILEFMT_RAF,IMGFMT_RAF);
                        if(PRINT_SECTION)
                        {
                            print_tag_address(SECTION,Start_offset,0,"@");
                            status = print_raf_header(inptr,header,SECTION);
                        }
                        if(status == 0)
                        {
                            max_offset = process_raf(inptr,Start_offset + 60,summary_entry,"RAF",0L);
                            if(max_offset > 0L)
                                status = 0;
                        }
                        fflush(stdout);
                        break;
                    case PROBE_X3FMAGIC:
                        summary_entry = new_summary_entry(NULL,FILEFMT_X3F,IMGFMT_X3F);
                        if(PRINT_SECTION)
                        {
                            print_tag_address(SECTION,Start_offset,0,"@");
                            status = print_x3f_header(inptr,header,SECTION);
                        }
                        if(status == 0)
                        {
                            max_offset = process_x3f(inptr,header,Start_offset,summary_entry,
                                                                                "X3F",0,0);
                            if(max_offset > 0L)
                                status = 0;
                        }
                        break;
                    default:
                        status = -1;
                        break;
                }
                if(status == JPEG_EARLY_EOI)
                    chpr = newline(chpr);
                print_tag_address(SECTION,filesize - 1,0,"-");
                if(PRINT_SECTION)
                {
                    chpr += printf("END OF FILE");
                    if(status == JPEG_EARLY_EOI)
                    {
                        jpeg_status(status);
                        print_jpeg_status();
                    }
                }
                chpr = newline(chpr);
                /* Print a summary of image sections found            */
                print_summary(summary_entry);
            }
            else
            {
                /* Allow hex/ascii dump of unregcognized file         */
                /* formats. In fact, always dump a little bit.        */
                if(Max_undefined == DUMPALL)
                    dumplength = filesize;
                else if(Max_undefined > 0L)
                    dumplength = Max_undefined;
                else
                    dumplength = DEF_DUMPLENGTH;
                if(dumplength)
                {
                    hexdump(inptr,Start_offset,filesize,dumplength,16,0,0);
                    chpr = newline(chpr);
                }
            }
            print_fileformat(summary_entry);
            summary_entry = destroy_summary(summary_entry);
            chpr = newline(1);
            if(inptr && fclose(inptr))
            {
                fprintf(stderr,"%s: FAILED to close stream for file \"%s\"\n",Progname,file);
                why(stderr);
            }
        }
        clear_memory();     /* Make, Model, Software...               */
        chpr = newline(1);
    }
    if(PRINT_CAMERA_NAMES)
        print_camera_makes();
    return(status);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movl %edi, %ebp
movq (%rsi), %rax
movq %rax, 0x55c7f(%rip)     # 0x59468
xorl %eax, %eax
callq 0x1c619
movl %ebp, %edi
movq %rbx, %rsi
callq 0x1c16c
cltq
movq (%rbx,%rax,8), %rbp
testq %rbp, %rbp
je 0x4161
leaq (%rbx,%rax,8), %rbx
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
leaq 0x3d7ea(%rip), %r13     # 0x41004
xorl %r14d, %r14d
movq $0x0, 0x18(%rsp)
movq %r15, 0x10(%rsp)
addq $0x8, %rbx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x3220
testq %rax, %rax
je 0x3b49
movq %rax, %r15
movq %rbp, %rdi
callq 0x17a9f
movq %r15, %rdi
callq 0x5131
movq %rax, %r12
movq 0x55bc8(%rip), %rsi     # 0x59428
cmpq %rax, %rsi
ja 0x3926
testq %rsi, %rsi
je 0x38b5
movq %r15, %rdi
xorl %edx, %edx
callq 0x3210
cmpl $-0x1, %eax
jne 0x389c
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0x32f0
movq 0x30(%rsp), %rbp
addq $0x8, %rbx
testb $0x1, %al
je 0x382f
jmp 0x415a
movq %r15, %rdi
callq 0x3190
leaq 0x3d7c2(%rip), %rdi     # 0x4106d
movq %rax, %rsi
xorl %eax, %eax
callq 0x3120
xorl %eax, %eax
callq 0x17aa7
testl $0x1040000, 0x548ba(%rip) # imm = 0x1040000
leaq 0x3d7be(%rip), %rdi     # 0x4108b
leaq 0x3d7a9(%rip), %rax     # 0x4107d
cmoveq %rax, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r14d
movl %r14d, %edi
callq 0x16b56
movl %eax, %r14d
movq 0x55b31(%rip), %rsi     # 0x59428
movq %r15, %rdi
callq 0x418c
movq %rax, %r13
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
je 0x394a
movq (%rbx), %rbp
testq %rbp, %rbp
leaq 0x3d6e9(%rip), %r13     # 0x41004
jne 0x382b
jmp 0x415a
xorl %eax, %eax
callq 0x17aa7
movq 0x55af4(%rip), %rsi     # 0x59428
leaq 0x3d6e8(%rip), %rdi     # 0x41023
movq %r12, %rdx
xorl %eax, %eax
callq 0x3120
addl %eax, %r14d
jmp 0x390e
xorl %eax, %eax
callq 0x17aa7
testl $0x1040000, 0x54825(%rip) # imm = 0x1040000
leaq 0x3d744(%rip), %rdi     # 0x410a6
leaq 0x3d731(%rip), %rax     # 0x4109a
cmoveq %rax, %rdi
xorl %eax, %eax
callq 0x3120
addl %eax, %r14d
movq 0x8(%r13), %rdi
movzwl (%r13), %esi
callq 0x54af
movq %rax, 0x10(%rsp)
movl %r14d, %edi
callq 0x16b56
movl %eax, %r14d
xorl %eax, %eax
callq 0x17aa7
testl $0x1040000, 0x547da(%rip) # imm = 0x1040000
leaq 0x3d715(%rip), %rdi     # 0x410c2
leaq 0x3d6ff(%rip), %rax     # 0x410b3
cmoveq %rax, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r14d
movl %r14d, %edi
callq 0x16b56
cmpl $0x0, 0x10(%rsp)
movl %eax, 0xc(%rsp)
je 0x3a02
movq 0x55a29(%rip), %rax     # 0x59408
testq %rax, %rax
movq 0x18(%rsp), %r14
je 0x3a42
movq %r12, %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpq %rdx, %rax
leaq 0x3d609(%rip), %r13     # 0x41004
je 0x3a4e
movq %rax, %rcx
jmp 0x3a4e
movl %eax, %r14d
movq 0x8(%r13), %rax
cmpq $0x5351, %rax           # imm = 0x5351
jg 0x3a8a
cmpq $0x54, %rax
jle 0x3b5a
cmpq $0x55, %rax
je 0x3c03
cmpq $0x4655, %rax           # imm = 0x4655
je 0x3e13
cmpq $0x4f52, %rax           # imm = 0x4F52
je 0x3c03
jmp 0x3f3d
movl $0x40, %ecx
leaq 0x3d5b6(%rip), %r13     # 0x41004
testq %rcx, %rcx
je 0x40de
movq 0x559ca(%rip), %rsi     # 0x59428
subq $0x8, %rsp
movq %r15, %rdi
movq %r12, %rdx
movl $0x10, %r8d
xorl %r9d, %r9d
pushq $0x0
callq 0x7446
addq $0x10, %rsp
movl 0xc(%rsp), %edi
callq 0x16b56
jmp 0x40de
cmpq $0x4d524c, %rax         # imm = 0x4D524C
jle 0x3b73
cmpq $0x4d524d, %rax         # imm = 0x4D524D
je 0x3d88
cmpq $0xd0a870a, %rax        # imm = 0xD0A870A
je 0x3eba
cmpq $0x62564f46, %rax       # imm = 0x62564F46
jne 0x3f3d
xorl %r14d, %r14d
xorl %edi, %edi
movl $0x62564f46, %esi       # imm = 0x62564F46
movl $0x62564f46, %edx       # imm = 0x62564F46
callq 0xfb61
movq %rax, %rcx
testb $0x4, 0x546aa(%rip)     # 0x58182
je 0x3b0d
movq 0x55947(%rip), %rsi     # 0x59428
movl $0x40000, %edi          # imm = 0x40000
xorl %edx, %edx
movq %rcx, %r14
leaq 0x3d5ea(%rip), %rcx     # 0x410dc
callq 0x5605
movl $0x40000, %edx          # imm = 0x40000
movq %r15, %rdi
movq %r13, %rsi
callq 0x28636
movq %r14, %rcx
movl %eax, %r14d
testl %r14d, %r14d
movq %rcx, 0x18(%rsp)
jne 0x4053
movq 0x55906(%rip), %rdx     # 0x59428
subq $0x8, %rsp
xorl %r14d, %r14d
movq %r15, %rdi
movq %r13, %rsi
leaq 0x41e83(%rip), %r8      # 0x459b9
xorl %r9d, %r9d
pushq $0x0
callq 0x28ba1
addq $0x10, %rsp
jmp 0x4053
leaq 0x3d4b7(%rip), %rsi     # 0x41007
movq 0x10(%rsp), %r15
jmp 0x4115
cmpq $0x1a, %rax
je 0x3d0c
cmpq $0x2a, %rax
je 0x3c03
jmp 0x3f3d
cmpq $0x5352, %rax           # imm = 0x5352
je 0x3c03
cmpq $0xffd8, %rax           # imm = 0xFFD8
jne 0x3f3d
xorl %edi, %edi
movl $0xffd8, %esi           # imm = 0xFFD8
movl $0xffd8, %edx           # imm = 0xFFD8
callq 0xfb61
testq %rax, %rax
leaq 0x3d45e(%rip), %r13     # 0x41004
je 0x3bb2
movl $0x1, 0xc4(%rax)
movq 0x5586f(%rip), %rsi     # 0x59428
movq %r15, %rdi
movl $0xffd8, %edx           # imm = 0xFFD8
xorl %ecx, %ecx
movq %rax, %r8
movq %rax, 0x18(%rsp)
leaq 0x41e4f(%rip), %r9      # 0x45a21
pushq $0x0
leaq 0x3d501(%rip), %rax     # 0x410dc
pushq %rax
callq 0x112cd
addq $0x10, %rsp
xorl %edi, %edi
callq 0x12f15
movl %eax, %r14d
movq 0x543d2(%rip), %rax     # 0x57fc8
movq (%rax), %rdi
callq 0x3200
jmp 0x405a
movzwl (%r13), %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r15, %rdi
callq 0x46cc
cmpq %r12, %rax
jbe 0x3cbe
movq 0x55803(%rip), %rsi     # 0x59428
subq $0x8, %rsp
movl $0xa, %edx
movl $0xa, %ecx
movq %r15, %rdi
movl $0xc, %r8d
xorl %r9d, %r9d
pushq $0x0
callq 0x7446
addq $0x10, %rsp
movl %r14d, %edi
callq 0x16b56
movl %eax, %edx
movq 0x557ad(%rip), %rax     # 0x59408
leaq -0xa(%rax), %rcx
testq %rax, %rax
movl $0x3c, %eax
cmoveq %rax, %rcx
testq %rcx, %rcx
leaq 0x3d38f(%rip), %r13     # 0x41004
je 0x3f46
movq 0x557a6(%rip), %rsi     # 0x59428
movq %r12, %rdx
subq %rsi, %rdx
addq $0xa, %rsi
addq $-0xa, %rdx
subq $0x8, %rsp
movq %r15, %rdi
movl $0xc, %r8d
xorl %r9d, %r9d
pushq $0x0
callq 0x7446
addq $0x10, %rsp
movl $0x1, %edi
callq 0x16b56
movl %eax, 0xc(%rsp)
jmp 0x3f4a
movq %rax, 0x20(%rsp)
movl 0x8(%r13), %esi
xorl %edi, %edi
xorl %edx, %edx
callq 0xfb61
movq %rax, %r9
movq 0x8(%r13), %rax
cmpq $0x55, %rax
je 0x3f5e
cmpq $0x5352, %rax           # imm = 0x5352
je 0x3f55
leaq 0x415eb(%rip), %r10     # 0x452df
cmpq $0x4f52, %rax           # imm = 0x4F52
jne 0x3f65
leaq 0x3d3cb(%rip), %r10     # 0x410d2
jmp 0x3f65
xorl %r14d, %r14d
xorl %edi, %edi
movl $0x1a, %esi
movl $0x1a, %edx
callq 0xfb61
movq %rax, %r8
testb $0x4, 0x54458(%rip)     # 0x58182
je 0x3d5c
movq 0x556f5(%rip), %rsi     # 0x59428
movl $0x40000, %edi          # imm = 0x40000
xorl %edx, %edx
leaq 0x3d39b(%rip), %rcx     # 0x410dc
movq %r8, %r14
callq 0x5605
movl $0x40000, %esi          # imm = 0x40000
movq %r13, %rdi
callq 0x5198
movq %r14, %r8
movl %eax, %r14d
movq 0x556c5(%rip), %rdx     # 0x59428
movq %r15, %rdi
movq %r13, %rsi
xorl %ecx, %ecx
movq %r8, 0x18(%rsp)
leaq 0x41b76(%rip), %r9      # 0x458ed
xorl %r13d, %r13d
pushq %r13
pushq %r13
callq 0x1c99c
jmp 0x3e0a
xorl %r14d, %r14d
xorl %edi, %edi
movl $0x4d524d, %esi         # imm = 0x4D524D
movl $0x4d524d, %edx         # imm = 0x4D524D
callq 0xfb61
movq %rax, %r8
testb $0x4, 0x543dc(%rip)     # 0x58182
je 0x3dd8
movq 0x55679(%rip), %rsi     # 0x59428
movl $0x40000, %edi          # imm = 0x40000
xorl %edx, %edx
leaq 0x3d31f(%rip), %rcx     # 0x410dc
movq %r8, %r14
callq 0x5605
movl $0x40000, %esi          # imm = 0x40000
movq %r13, %rdi
callq 0x5198
movq %r14, %r8
movl %eax, %r14d
movq 0x55649(%rip), %rsi     # 0x59428
addq $0x8, %rsi
movq 0x38(%r13), %rdx
movq %r12, %rcx
subq %rdx, %rcx
subq $0x8, %rsp
movq %r15, %rdi
movq %r8, 0x20(%rsp)
leaq 0x41ba8(%rip), %r9      # 0x459a8
xorl %r13d, %r13d
pushq %r13
callq 0x25114
addq $0x10, %rsp
jmp 0x403d
xorl %r14d, %r14d
xorl %edi, %edi
movl $0x4655, %esi           # imm = 0x4655
movl $0x4655, %edx           # imm = 0x4655
callq 0xfb61
testb $0x4, 0x54354(%rip)     # 0x58182
movq %rax, 0x18(%rsp)
je 0x3e67
movq 0x555ec(%rip), %rsi     # 0x59428
movl $0x40000, %edi          # imm = 0x40000
xorl %edx, %edx
leaq 0x3d292(%rip), %rcx     # 0x410dc
callq 0x5605
movl $0x40000, %edx          # imm = 0x40000
movq %r15, %rdi
movq %r13, %rsi
callq 0x2726c
movl %eax, %r14d
movq 0x18(%rsp), %rax
movq %r14, 0x10(%rsp)
testl %r14d, %r14d
jne 0x3e9a
movq 0x555b0(%rip), %rsi     # 0x59428
addq $0x3c, %rsi
movq $0x0, 0x10(%rsp)
movq %r15, %rdi
movq %rax, %rdx
leaq 0x41b22(%rip), %rcx     # 0x459b4
xorl %r8d, %r8d
callq 0x272e7
movq 0x54127(%rip), %rax     # 0x57fc8
movq (%rax), %rdi
callq 0x3200
leaq 0x3d154(%rip), %r13     # 0x41004
movq 0x10(%rsp), %r14
jmp 0x405a
xorl %r14d, %r14d
xorl %edi, %edi
movl $0xd0a870a, %esi        # imm = 0xD0A870A
movl $0xd0a870a, %edx        # imm = 0xD0A870A
callq 0xfb61
movq %rax, %rdx
testb $0x4, 0x542aa(%rip)     # 0x58182
je 0x3f0a
movq 0x55547(%rip), %rsi     # 0x59428
movl $0x40000, %edi          # imm = 0x40000
movq %rdx, %r14
xorl %edx, %edx
leaq 0x3d1ea(%rip), %rcx     # 0x410dc
callq 0x5605
movl $0x40000, %esi          # imm = 0x40000
movq %r13, %rdi
callq 0x5198
movq %r14, %rdx
movl %eax, %r14d
movq 0x55517(%rip), %rsi     # 0x59428
addq $0xc, %rsi
movq %r15, %rdi
movq %rdx, 0x18(%rsp)
leaq 0x3d1d1(%rip), %rcx     # 0x410f5
xorl %r8d, %r8d
callq 0x205e1
testq %rax, %rax
movl $0x0, %eax
cmovnel %eax, %r14d
jmp 0x4044
leaq 0x3d0c0(%rip), %r13     # 0x41004
jmp 0x3f4a
movl %edx, 0xc(%rsp)
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x405a
leaq 0x3d17b(%rip), %r10     # 0x410d7
jmp 0x3f65
leaq 0x41a2f(%rip), %r10     # 0x45994
xorl %r14d, %r14d
testb $0x4, 0x54213(%rip)     # 0x58182
movq %r9, 0x18(%rsp)
je 0x400c
movq %r10, 0x28(%rsp)
movq 0x554a2(%rip), %rsi     # 0x59428
movl $0x40000, %edi          # imm = 0x40000
xorl %edx, %edx
leaq 0x3d148(%rip), %rcx     # 0x410dc
callq 0x5605
movl $0x40000, %esi          # imm = 0x40000
movq %r13, %rdi
callq 0x5198
movq %rax, 0x10(%rsp)
leaq 0x3d12c(%rip), %rdi     # 0x410de
movq 0x20(%rsp), %rdx
movq %rdx, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %r14d
addl 0xc(%rsp), %r14d
movq 0x55458(%rip), %rsi     # 0x59428
testq %rsi, %rsi
je 0x3ff1
movq 0x20(%rsp), %rcx
addq %rsi, %rcx
leaq 0x4129f(%rip), %rdi     # 0x45283
movq %rcx, %rdx
xorl %eax, %eax
callq 0x3120
addl %eax, %r14d
movl %r14d, %edi
callq 0x16b56
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %r9
movq 0x10(%rsp), %r14
movq 0x28(%rsp), %r10
movzwl (%r13), %esi
movq 0x55410(%rip), %rcx     # 0x59428
subq $0x8, %rsp
movq %r15, %rdi
movq 0x28(%rsp), %rdx
xorl %r8d, %r8d
xorl %r13d, %r13d
pushq %r13
pushq $-0x1
pushq %r13
pushq %r13
pushq %r10
callq 0xc93c
addq $0x30, %rsp
testq %rax, %rax
cmovnel %r13d, %r14d
movq 0x53f7d(%rip), %rax     # 0x57fc8
movq (%rax), %rdi
callq 0x3200
leaq 0x3cfaa(%rip), %r13     # 0x41004
movq %r14, 0x10(%rsp)
cmpl $0x1, %r14d
jne 0x4073
movl 0xc(%rsp), %edi
callq 0x16b56
movl %eax, %r14d
jmp 0x4078
movl 0xc(%rsp), %r14d
decq %r12
movl $0x40000, %edi          # imm = 0x40000
movq %r12, %rsi
xorl %edx, %edx
leaq 0x3d06d(%rip), %rcx     # 0x410f9
callq 0x5605
testb $0x4, 0x540ea(%rip)     # 0x58182
je 0x40c9
leaq 0x3d05a(%rip), %rdi     # 0x410fb
xorl %eax, %eax
callq 0x3120
movl %r14d, %ecx
movl %eax, %r14d
addl %ecx, %r14d
cmpl $0x1, 0x10(%rsp)
jne 0x40c9
movl $0x1, %edi
callq 0x12f15
xorl %eax, %eax
callq 0x9609
movl %r14d, %edi
callq 0x16b56
movq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x15fe4
movq %r14, %rdi
callq 0x17092
movq %r14, %rdi
callq 0x13716
movq %rax, 0x18(%rsp)
movl $0x1, %edi
callq 0x16b56
movq %r15, %rdi
callq 0x30f0
leaq 0x3cffb(%rip), %rsi     # 0x41107
testl %eax, %eax
movq 0x10(%rsp), %r15
je 0x4138
movq 0x53edc(%rip), %r14     # 0x57ff8
movq (%r14), %rdi
movq 0x55342(%rip), %rdx     # 0x59468
movq %rbp, %rcx
xorl %eax, %eax
callq 0x3180
movq (%r14), %rdi
callq 0x179a5
xorl %eax, %eax
callq 0x179f5
movl $0x1, %edi
callq 0x16b56
movl %eax, %r14d
movq (%rbx), %rbp
testq %rbp, %rbp
jne 0x3826
jmp 0x4167
movq 0x10(%rsp), %r15
jmp 0x4167
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testb $0x4, 0x54013(%rip)     # 0x58181
je 0x4177
xorl %eax, %eax
callq 0x1997f
movl %r15d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)