// File: /workspace/github_c_makefile_star2_O2/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 $0x58, %rsp
movq %rsi, %rbx
movl %edi, %ebp
movq (%rsi), %rax
movq %rax, 0x5506f(%rip)     # 0x58468
xorl %eax, %eax
callq 0x1b8da
movl %ebp, %edi
movq %rbx, %rsi
callq 0x1b418
cltq
leaq (%rbx,%rax,8), %rbx
pushq $-0x1
popq %rax
movq %rax, 0x40(%rsp)
movq $0x0, 0x48(%rsp)
xorl %r15d, %r15d
addq $0x8, %rbx
leaq 0x3bbd5(%rip), %r12     # 0x3f004
movq -0x8(%rbx), %rbp
testq %rbp, %rbp
je 0x3d73
movq %rbp, %rdi
movq %r12, %rsi
callq 0x3220
testq %rax, %rax
je 0x377c
movq %rax, %r14
movq %rbp, %rdi
callq 0x16f75
movq %r14, %rdi
callq 0x4c6d
movq %rax, %r13
movq 0x54fbb(%rip), %rsi     # 0x58428
cmpq %rax, %rsi
ja 0x35f6
testq %rsi, %rsi
je 0x34e1
movq %r14, %rdi
xorl %edx, %edx
callq 0x3210
cmpl $-0x1, %eax
jne 0x34c8
movq 0x53b67(%rip), %rax     # 0x56ff8
movq (%rax), %rdi
movq 0x54fcd(%rip), %rdx     # 0x58468
movq 0x54f86(%rip), %rcx     # 0x58428
leaq 0x3bb9c(%rip), %rsi     # 0x3f045
xorl %eax, %eax
callq 0x3180
movq 0x53b11(%rip), %rax     # 0x56fc8
movq (%rax), %rdi
callq 0x16e8c
addq $0x8, %rbx
jmp 0x342f
movq %r14, %rdi
callq 0x3190
leaq 0x3bb96(%rip), %rdi     # 0x3f06d
movq %rax, %rsi
xorl %eax, %eax
callq 0x3120
xorl %eax, %eax
callq 0x16f7d
testl $0x1040000, 0x53c8e(%rip) # imm = 0x1040000
leaq 0x3bb92(%rip), %rdi     # 0x3f08b
leaq 0x3bb7d(%rip), %rax     # 0x3f07d
cmoveq %rax, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r15d
movl %r15d, %edi
callq 0x160f7
movl %eax, %r15d
movq 0x54f05(%rip), %rsi     # 0x58428
movq %r14, %rdi
callq 0x3d98
movq %rax, %r12
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x3424
xorl %eax, %eax
callq 0x16f7d
testl $0x1040000, 0x53c31(%rip) # imm = 0x1040000
leaq 0x3bb50(%rip), %rdi     # 0x3f0a6
leaq 0x3bb3d(%rip), %rax     # 0x3f09a
cmoveq %rax, %rdi
xorl %eax, %eax
callq 0x3120
addl %eax, %r15d
movq 0x8(%r12), %rdi
movzwl (%r12), %esi
callq 0x4fdd
movq %rax, 0x40(%rsp)
movl %r15d, %edi
callq 0x160f7
movl %eax, %r15d
xorl %eax, %eax
callq 0x16f7d
testl $0x1040000, 0x53be5(%rip) # imm = 0x1040000
leaq 0x3bb20(%rip), %rdi     # 0x3f0c2
leaq 0x3bb0a(%rip), %rax     # 0x3f0b3
cmoveq %rax, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r15d
movl %r15d, %edi
callq 0x160f7
movl %eax, %edx
cmpl $0x0, 0x40(%rsp)
je 0x361d
movq 0x54e36(%rip), %rcx     # 0x58408
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %rcx
movq 0x48(%rsp), %r15
je 0x373b
testq %rcx, %rcx
jne 0x374b
pushq $0x40
popq %rcx
jmp 0x374b
xorl %eax, %eax
callq 0x16f7d
movq 0x54e24(%rip), %rsi     # 0x58428
leaq 0x3ba18(%rip), %rdi     # 0x3f023
movq %r13, %rdx
xorl %eax, %eax
callq 0x3120
addl %eax, %r15d
jmp 0x3424
movl %edx, 0x34(%rsp)
movq 0x8(%r12), %rax
cmpq $0x1a, %rax
je 0x3a1c
cmpq $0x2a, %rax
je 0x368c
cmpq $0x55, %rax
je 0x368c
cmpq $0x4655, %rax           # imm = 0x4655
je 0x3948
cmpq $0x4f52, %rax           # imm = 0x4F52
je 0x368c
cmpq $0x62564f46, %rax       # imm = 0x62564F46
je 0x39b7
cmpq $0xffd8, %rax           # imm = 0xFFD8
je 0x37da
cmpq $0x4d524d, %rax         # imm = 0x4D524D
je 0x38bc
cmpq $0xd0a870a, %rax        # imm = 0xD0A870A
je 0x383c
cmpq $0x5352, %rax           # imm = 0x5352
jne 0x39a9
movzwl (%r12), %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r14, %rdi
callq 0x42ba
cmpq %r13, %rax
jbe 0x378c
movq 0x54d7a(%rip), %rsi     # 0x58428
andl $0x0, (%rsp)
movq %r14, %rdi
pushq $0xa
popq %rcx
movq %rcx, %rdx
pushq $0xc
popq %r15
movl %r15d, %r8d
xorl %r9d, %r9d
callq 0x6e93
movl 0x34(%rsp), %edi
callq 0x160f7
movl %eax, %edx
movq 0x54d2c(%rip), %rax     # 0x58408
leaq -0xa(%rax), %rcx
testq %rax, %rax
pushq $0x3c
popq %rax
cmoveq %rax, %rcx
testq %rcx, %rcx
je 0x3abe
movq 0x54d2e(%rip), %rsi     # 0x58428
movq %r13, %rdx
subq %rsi, %rdx
addq $0xa, %rsi
addq $-0xa, %rdx
andl $0x0, (%rsp)
movq $0x0, 0x38(%rsp)
movq %r14, %rdi
movl %r15d, %r8d
xorl %r9d, %r9d
callq 0x6e93
pushq $0x1
popq %r12
movl %r12d, %edi
callq 0x160f7
movl %eax, 0x34(%rsp)
pushq $-0x1
popq %rax
jmp 0x3c9a
movq %r13, %rcx
testq %r13, %r13
pushq $0x1
popq %r12
je 0x3d09
movq 0x54cd6(%rip), %rsi     # 0x58428
andl $0x0, (%rsp)
movl %edx, %r12d
movq %r14, %rdi
movq %r13, %rdx
pushq $0x10
popq %r8
xorl %r9d, %r9d
callq 0x6e93
movl %r12d, %edi
pushq $0x1
popq %r12
callq 0x160f7
jmp 0x3d09
leaq 0x3b884(%rip), %rsi     # 0x3f007
pushq $0x1
popq %r12
jmp 0x3d39
movq %rax, %r15
movl 0x8(%r12), %esi
xorl %edi, %edi
xorl %edx, %edx
callq 0xef13
movq %rax, %r9
movq 0x8(%r12), %rax
cmpq $0x55, %rax
je 0x3b5c
cmpq $0x5352, %rax           # imm = 0x5352
je 0x3b53
leaq 0x3fb1d(%rip), %rdx     # 0x432df
cmpq $0x4f52, %rax           # imm = 0x4F52
jne 0x3b63
leaq 0x3b8fd(%rip), %rdx     # 0x3f0d2
jmp 0x3b63
xorl %edi, %edi
movl $0xffd8, %esi           # imm = 0xFFD8
movl $0xffd8, %edx           # imm = 0xFFD8
callq 0xef13
movq %rax, %r8
testq %rax, %rax
je 0x37fe
movl $0x1, 0xc4(%r8)
movq 0x54c23(%rip), %rsi     # 0x58428
andl $0x0, 0x8(%rsp)
leaq 0x3b8cb(%rip), %rax     # 0x3f0dc
movq %rax, (%rsp)
movq %r14, %rdi
movl $0xffd8, %edx           # imm = 0xFFD8
xorl %ecx, %ecx
movq %r8, 0x48(%rsp)
leaq 0x401f6(%rip), %r9      # 0x43a21
callq 0x105af
xorl %edi, %edi
callq 0x1259b
jmp 0x39a0
movq $0x0, 0x40(%rsp)
xorl %edi, %edi
movl $0xd0a870a, %esi        # imm = 0xD0A870A
movl $0xd0a870a, %edx        # imm = 0xD0A870A
callq 0xef13
movq %rax, %r15
testb $0x4, 0x53922(%rip)     # 0x57182
movl $0x0, %eax
je 0x388e
movq 0x54bba(%rip), %rsi     # 0x58428
movl $0x40000, %edi          # imm = 0x40000
xorl %edx, %edx
leaq 0x3b860(%rip), %rcx     # 0x3f0dc
callq 0x5100
movl $0x40000, %esi          # imm = 0x40000
movq %r12, %rdi
callq 0x4cd0
movl %eax, 0x30(%rsp)
movq 0x54b8f(%rip), %rsi     # 0x58428
addq $0xc, %rsi
movq %r14, %rdi
movq %r15, 0x48(%rsp)
movq %r15, %rdx
leaq 0x3b846(%rip), %rcx     # 0x3f0f5
xorl %r8d, %r8d
callq 0x1f8e1
jmp 0x3c4a
movq $0x0, 0x40(%rsp)
xorl %edi, %edi
movl $0x4d524d, %esi         # imm = 0x4D524D
movl $0x4d524d, %edx         # imm = 0x4D524D
callq 0xef13
movq %rax, %r15
testb $0x4, 0x538a2(%rip)     # 0x57182
movl $0x0, %eax
je 0x390e
movq 0x54b3a(%rip), %rsi     # 0x58428
movl $0x40000, %edi          # imm = 0x40000
xorl %edx, %edx
leaq 0x3b7e0(%rip), %rcx     # 0x3f0dc
callq 0x5100
movl $0x40000, %esi          # imm = 0x40000
movq %r12, %rdi
callq 0x4cd0
movl %eax, 0x30(%rsp)
movq 0x54b0f(%rip), %rsi     # 0x58428
addq $0x8, %rsi
movq 0x38(%r12), %rdx
movq %r13, %rcx
subq %rdx, %rcx
andl $0x0, (%rsp)
movq %r14, %rdi
movq %r15, 0x48(%rsp)
movq %r15, %r8
leaq 0x4006a(%rip), %r9      # 0x439a8
callq 0x2437c
jmp 0x3c4a
xorl %edi, %edi
movl $0x4655, %esi           # imm = 0x4655
movl $0x4655, %edx           # imm = 0x4655
callq 0xef13
movq %rax, %r15
testb $0x4, 0x5381f(%rip)     # 0x57182
movq %rax, 0x48(%rsp)
je 0x3ad5
movq 0x54ab3(%rip), %rsi     # 0x58428
movl $0x40000, %edi          # imm = 0x40000
xorl %edx, %edx
leaq 0x3b759(%rip), %rcx     # 0x3f0dc
callq 0x5100
movl $0x40000, %edx          # imm = 0x40000
movq %r14, %rdi
movq %r12, %rsi
callq 0x26430
testl %eax, %eax
je 0x3ad5
movl %eax, 0x30(%rsp)
jmp 0x3afd
movq $0x0, 0x38(%rsp)
jmp 0x3acb
xorl %edi, %edi
movl $0x62564f46, %esi       # imm = 0x62564F46
movl $0x62564f46, %edx       # imm = 0x62564F46
callq 0xef13
movq %rax, %r15
testb $0x4, 0x537b0(%rip)     # 0x57182
movq %rax, 0x48(%rsp)
je 0x3b15
movq 0x54a44(%rip), %rsi     # 0x58428
movl $0x40000, %edi          # imm = 0x40000
xorl %edx, %edx
leaq 0x3b6ea(%rip), %rcx     # 0x3f0dc
callq 0x5100
movl $0x40000, %edx          # imm = 0x40000
movq %r14, %rdi
movq %r12, %rsi
callq 0x277c4
testl %eax, %eax
je 0x3b15
movl %eax, 0x30(%rsp)
pushq $0x1
popq %r12
jmp 0x3c6f
movq $0x0, 0x38(%rsp)
xorl %edi, %edi
pushq $0x1a
popq %rdx
movl %edx, %esi
callq 0xef13
movq %rax, %r15
testb $0x4, 0x53747(%rip)     # 0x57182
je 0x3a69
movq 0x549e4(%rip), %rsi     # 0x58428
movl $0x40000, %edi          # imm = 0x40000
xorl %edx, %edx
leaq 0x3b68a(%rip), %rcx     # 0x3f0dc
callq 0x5100
movl $0x40000, %esi          # imm = 0x40000
movq %r12, %rdi
callq 0x4cd0
movq %rax, 0x38(%rsp)
movq 0x549b8(%rip), %rdx     # 0x58428
andl $0x0, 0x8(%rsp)
andl $0x0, (%rsp)
movq $0x0, 0x40(%rsp)
movq %r14, %rdi
movq %r12, %rsi
xorl %ecx, %ecx
movq %r15, 0x48(%rsp)
movq %r15, %r8
leaq 0x3fe54(%rip), %r9      # 0x438ed
callq 0x1bc44
movq %rax, %r15
movq 0x53520(%rip), %rax     # 0x56fc8
movq (%rax), %rdi
callq 0x3200
movq 0x38(%rsp), %rax
movl %eax, 0x30(%rsp)
jmp 0x3c5c
movq $0x0, 0x38(%rsp)
movl %edx, 0x34(%rsp)
pushq $-0x1
popq %rax
movq %rax, 0x40(%rsp)
jmp 0x3b4a
movq 0x5494c(%rip), %rsi     # 0x58428
addq $0x3c, %rsi
movl $0x0, 0x30(%rsp)
movq %r14, %rdi
movq %r15, %rdx
leaq 0x3febf(%rip), %rcx     # 0x439b4
xorl %r8d, %r8d
callq 0x264b0
pushq $0x1
popq %r12
movq 0x534c0(%rip), %rax     # 0x56fc8
movq (%rax), %rdi
callq 0x3200
jmp 0x3c6f
movq 0x5490c(%rip), %rdx     # 0x58428
andl $0x0, (%rsp)
movq $0x0, 0x38(%rsp)
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rcx
leaq 0x3fe80(%rip), %r8      # 0x439b9
xorl %r9d, %r9d
callq 0x27d34
movq $0x0, 0x40(%rsp)
pushq $0x1
popq %r12
jmp 0x3c9f
leaq 0x3b57d(%rip), %rdx     # 0x3f0d7
jmp 0x3b63
leaq 0x3fe31(%rip), %rdx     # 0x43994
movq $0x0, 0x40(%rsp)
testb $0x4, 0x5360f(%rip)     # 0x57182
movl $0x0, 0x30(%rsp)
movq %r9, 0x48(%rsp)
je 0x3c18
movq %rdx, 0x50(%rsp)
movq 0x54896(%rip), %rsi     # 0x58428
movl $0x40000, %edi          # imm = 0x40000
xorl %edx, %edx
leaq 0x3b53c(%rip), %rcx     # 0x3f0dc
callq 0x5100
movl $0x40000, %esi          # imm = 0x40000
movq %r12, %rdi
callq 0x4cd0
movl %eax, 0x30(%rsp)
leaq 0x3b521(%rip), %rdi     # 0x3f0de
movq %r15, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3120
movq %r15, %rcx
movl %eax, %r15d
addl 0x34(%rsp), %r15d
movq 0x5484c(%rip), %rsi     # 0x58428
testq %rsi, %rsi
movq %rcx, 0x38(%rsp)
je 0x3bfd
addq %rsi, %rcx
leaq 0x3f693(%rip), %rdi     # 0x43283
movq %rcx, %rdx
xorl %eax, %eax
callq 0x3120
addl %eax, %r15d
movl %r15d, %edi
callq 0x160f7
movl %eax, 0x34(%rsp)
movq 0x48(%rsp), %r9
movq 0x38(%rsp), %r15
movq 0x50(%rsp), %rdx
movzwl (%r12), %esi
movq 0x54804(%rip), %rcx     # 0x58428
andl $0x0, 0x20(%rsp)
orl $-0x1, 0x18(%rsp)
andl $0x0, 0x10(%rsp)
andl $0x0, 0x8(%rsp)
movq %rdx, (%rsp)
movq %r14, %rdi
movq %r15, %rdx
xorl %r8d, %r8d
callq 0xc004
movq %rax, %r15
movq 0x53374(%rip), %rax     # 0x56fc8
movq (%rax), %rdi
callq 0x3200
movl $0x0, %eax
movq %rax, 0x38(%rsp)
testq %r15, %r15
pushq $0x1
popq %r12
jne 0x3c9f
movl 0x30(%rsp), %eax
cmpl $0x1, %eax
jne 0x3c91
movl 0x34(%rsp), %edi
callq 0x160f7
movl %eax, 0x34(%rsp)
movb $0x1, %al
movq %rax, 0x38(%rsp)
movl %r12d, %eax
jmp 0x3c9a
movq $0x0, 0x38(%rsp)
movq %rax, 0x40(%rsp)
decq %r13
movl $0x40000, %edi          # imm = 0x40000
movq %r13, %rsi
xorl %edx, %edx
leaq 0x3b446(%rip), %rcx     # 0x3f0f9
callq 0x5100
testb $0x4, 0x534c3(%rip)     # 0x57182
jne 0x3cc8
movl 0x34(%rsp), %r15d
jmp 0x3cf4
leaq 0x3b42c(%rip), %rdi     # 0x3f0fb
xorl %eax, %eax
callq 0x3120
movl %eax, %r15d
addl 0x34(%rsp), %r15d
cmpb $0x0, 0x38(%rsp)
je 0x3cf4
movl %r12d, %edi
callq 0x1259b
xorl %eax, %eax
callq 0x8fb2
movl %r15d, %edi
callq 0x160f7
movq 0x48(%rsp), %r15
movq %r15, %rdi
callq 0x1566d
movq %r15, %rdi
callq 0x165b1
movq %r15, %rdi
callq 0x12d29
movq %rax, 0x48(%rsp)
movl %r12d, %edi
callq 0x160f7
movq %r14, %rdi
callq 0x30f0
leaq 0x3b3d2(%rip), %rsi     # 0x3f107
testl %eax, %eax
je 0x3d5c
movq 0x532b8(%rip), %r14     # 0x56ff8
movq (%r14), %rdi
movq 0x5471e(%rip), %rdx     # 0x58468
movq %rbp, %rcx
xorl %eax, %eax
callq 0x3180
movq (%r14), %rdi
callq 0x16e8c
xorl %eax, %eax
callq 0x16ed9
movl %r12d, %edi
callq 0x160f7
movl %eax, %r15d
jmp 0x3424
testb $0x4, 0x53407(%rip)     # 0x57181
je 0x3d83
xorl %eax, %eax
callq 0x18d41
movq 0x40(%rsp), %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop