// File: /workspace/github_c_makefile_star2_O2/Matthias-Wandel[P]imgcomp/src/exif.c
// Function: ProcessExifDir
static void ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBase, 
        unsigned ExifLength, int NestingLevel)
{
    int de;
    int a;
    int NumDirEntries;
    char IndentString[25];

    if (NestingLevel > 4){
        ErrNonfatal("Maximum Exif directory nesting exceeded (corrupt Exif header)", 0,0);
        return;
    }

    memset(IndentString, ' ', 25);
    IndentString[NestingLevel * 4] = '\0';


    NumDirEntries = Get16u(DirStart);
    #define DIR_ENTRY_ADDR(Start, Entry) (Start+2+12*(Entry))

    {
        unsigned char * DirEnd;
        DirEnd = DIR_ENTRY_ADDR(DirStart, NumDirEntries);
        if (DirEnd+4 > (OffsetBase+ExifLength)){
            if (DirEnd+2 == OffsetBase+ExifLength || DirEnd == OffsetBase+ExifLength){
                // Version 1.3 of jhead would truncate a bit too much.
                // This also caught later on as well.
            }else{
                ErrNonfatal("Illegally sized Exif subdirectory (%d entries)",NumDirEntries,0);
                return;
            }
        }
    }

    if (ShowTags){
        printf("(dir has %d entries)\n",NumDirEntries);
    }

    for (de=0;de<NumDirEntries;de++){
        int Tag, Format, Components;
        unsigned char * ValuePtr;
        int ByteCount;
        unsigned char * DirEntry;
        DirEntry = DIR_ENTRY_ADDR(DirStart, de);

        Tag = Get16u(DirEntry);
        Format = Get16u(DirEntry+2);
        Components = Get32u(DirEntry+4);

        if ((Format-1) >= NUM_FORMATS) {
            // (-1) catches illegal zero case as unsigned underflows to positive large.
            ErrNonfatal("Illegal number format %d for tag %04x in Exif", Format, Tag);
            continue;
        }

        if ((unsigned)Components > 0x10000){
            ErrNonfatal("Too many components %d for tag %04x in Exif", Components, Tag);
            continue;
        }

        ByteCount = Components * BytesPerFormat[Format];

        if (ByteCount > 4){
            unsigned OffsetVal;
            OffsetVal = Get32u(DirEntry+8);
            // If its bigger than 4 bytes, the dir entry contains an offset.
            if (OffsetVal+ByteCount > ExifLength){
                // Bogus pointer offset and / or bytecount value
                ErrNonfatal("Illegal value pointer for tag %04x in Exif", Tag,0);
                continue;
            }
            ValuePtr = OffsetBase+OffsetVal;
        }else{
            // 4 bytes or less and value is in the dir entry itself
            ValuePtr = DirEntry+8;
        }

        if (ShowTags){
            // Show tag name
            for (a=0;;a++){
                if (a >= TAG_TABLE_SIZE){
                    printf("%s    Unknown Tag %04x Value = ", IndentString, Tag);
                    break;
                }
                if (TagTable[a].Tag == Tag){
                    printf("%s    %s = ",IndentString, TagTable[a].Desc);
                    break;
                }
            }

            // Show tag value.
            switch(Format){
                case FMT_BYTE:
                    if(ByteCount>1){
                        printf("%.*ls\n", ByteCount/2, (wchar_t *)ValuePtr);
                    }else{
                        PrintFormatNumber(ValuePtr, Format, ByteCount);
                        printf("\n");
                    }
                    break;

                case FMT_UNDEFINED:
                    // Undefined is typically an ascii string.

                case FMT_STRING:
                    // String arrays printed without function call (different from int arrays)
                    {
                        int NoPrint = 0;
                        printf("\"");
                        for (a=0;a<ByteCount;a++){
                            if (ValuePtr[a] >= 32){
                                putchar(ValuePtr[a]);
                                NoPrint = 0;
                            }else{
                                // Avoiding indicating too many unprintable characters of proprietary
                                // bits of binary information this program may not know how to parse.
                                if (!NoPrint && a != ByteCount-1){
                                    putchar('?');
                                    NoPrint = 1;
                                }
                            }
                        }
                        printf("\"\n");
                    }
                    break;

                default:
                    // Handle arrays of numbers later (will there ever be?)
                    PrintFormatNumber(ValuePtr, Format, ByteCount);
                    printf("\n");
            }
        }

        // Extract useful components of tag
        switch(Tag){

            case TAG_MAKE:
                strncpy(ImageInfo.CameraMake, (char *)ValuePtr, ByteCount < 31 ? ByteCount : 31);
                break;

            case TAG_MODEL:
                strncpy(ImageInfo.CameraModel, (char *)ValuePtr, ByteCount < 39 ? ByteCount : 39);
                break;

            case TAG_DATETIME_ORIGINAL:
                // If we get a DATETIME_ORIGINAL, we use that one.
                strncpy(ImageInfo.DateTime, (char *)ValuePtr, 19);
                // Fallthru...

            case TAG_DATETIME_DIGITIZED:
            case TAG_DATETIME:
                if (!isdigit(ImageInfo.DateTime[0])){
                    // If we don't already have a DATETIME_ORIGINAL, use whatever
                    // time fields we may have.
                    strncpy(ImageInfo.DateTime, (char *)ValuePtr, 19);
                }
                break;

            case TAG_FNUMBER:
                // Simplest way of expressing aperture, so I trust it the most.
                // (overwrite previously computd value if there is one)
                ImageInfo.ApertureFNumber = (float)ConvertAnyFormat(ValuePtr, Format);
                break;

#if 0 // don't pull in extra math stuff.
            case TAG_APERTURE:
            case TAG_MAXAPERTURE:
                // More relevant info always comes earlier, so only use this field if we don't 
                // have appropriate aperture information yet.
                if (ImageInfo.ApertureFNumber == 0){
                    ImageInfo.ApertureFNumber 
                        = (float)exp(ConvertAnyFormat(ValuePtr, Format)*log(2)*0.5);
                }
                break;

            case TAG_SHUTTERSPEED:
                // More complicated way of expressing exposure time, so only use
                // this value if we don't already have it from somewhere else.
                if (ImageInfo.ExposureTime == 0){
                    ImageInfo.ExposureTime 
                        = (float)(1/exp(ConvertAnyFormat(ValuePtr, Format)*log(2)));
                }
                break;
#endif
            case TAG_FOCALLENGTH:
                // Nice digital cameras actually save the focal length as a function
                // of how farthey are zoomed in.
                ImageInfo.FocalLength = (float)ConvertAnyFormat(ValuePtr, Format);
                break;

            case TAG_SUBJECT_DISTANCE:
                // Inidcates the distacne the autofocus camera is focused to.
                // Tends to be less accurate as distance increases.
                ImageInfo.Distance = (float)ConvertAnyFormat(ValuePtr, Format);
                break;

            case TAG_EXPOSURETIME:
                // Simplest way of expressing exposure time, so I trust it most.
                // (overwrite previously computd value if there is one)
                ImageInfo.ExposureTime = (float)ConvertAnyFormat(ValuePtr, Format);
                break;



            case TAG_FLASH:
                ImageInfo.FlashUsed=(int)ConvertAnyFormat(ValuePtr, Format);
                break;

            case TAG_ORIENTATION:
                ImageInfo.Orientation = (int)ConvertAnyFormat(ValuePtr, Format);
                break;

            case TAG_PIXEL_Y_DIMENSION:
            case TAG_PIXEL_X_DIMENSION:
                // Use largest of height and width to deal with images that have been
                // rotated to portrait format.
                a = (int)ConvertAnyFormat(ValuePtr, Format);
                if (ExifImageWidth < a) ExifImageWidth = a;
                break;

            case TAG_FOCAL_PLANE_XRES:
                FocalplaneXRes = ConvertAnyFormat(ValuePtr, Format);
                break;

            case TAG_FOCAL_PLANE_UNITS:
                switch((int)ConvertAnyFormat(ValuePtr, Format)){
                    case 1: FocalplaneUnits = 25.4; break; // inch
                    case 2: 
                        // According to the information I was using, 2 means meters.
                        // But looking at the Cannon powershot's files, inches is the only
                        // sensible value.
                        FocalplaneUnits = 25.4;
                        break;

                    case 3: FocalplaneUnits = 10;   break;  // centimeter
                    case 4: FocalplaneUnits = 1;    break;  // millimeter
                    case 5: FocalplaneUnits = .001; break;  // micrometer
                }
                break;

            case TAG_EXPOSURE_BIAS:
                ImageInfo.ExposureBias = (float)ConvertAnyFormat(ValuePtr, Format);
                break;

            case TAG_WHITEBALANCE:
                ImageInfo.Whitebalance = (int)ConvertAnyFormat(ValuePtr, Format);
                break;

            case TAG_LIGHT_SOURCE:
                ImageInfo.LightSource = (int)ConvertAnyFormat(ValuePtr, Format);
                break;

            case TAG_METERING_MODE:
                ImageInfo.MeteringMode = (int)ConvertAnyFormat(ValuePtr, Format);
                break;

            case TAG_EXPOSURE_PROGRAM:
                ImageInfo.ExposureProgram = (int)ConvertAnyFormat(ValuePtr, Format);
                break;

            case TAG_EXPOSURE_INDEX:
                if (ImageInfo.ISOequivalent == 0){
                    // Exposure index and ISO equivalent are often used interchangeably,
                    // so we will do the same in jhead.
                    // http://photography.about.com/library/glossary/bldef_ei.htm
                    ImageInfo.ISOequivalent = (int)ConvertAnyFormat(ValuePtr, Format);
                }
                break;

            case TAG_EXPOSURE_MODE:
                ImageInfo.ExposureMode = (int)ConvertAnyFormat(ValuePtr, Format);
                break;

            case TAG_ISO_EQUIVALENT:
                ImageInfo.ISOequivalent = (int)ConvertAnyFormat(ValuePtr, Format);
                break;

            case TAG_DIGITALZOOMRATIO:
                ImageInfo.DigitalZoomRatio = (float)ConvertAnyFormat(ValuePtr, Format);
                break;

            case TAG_EXIF_OFFSET:
                if (ShowTags) printf("%s    Exif Dir:",IndentString);

            case TAG_INTEROP_OFFSET:
                if (Tag == TAG_INTEROP_OFFSET && ShowTags) printf("%s    Interop Dir:",IndentString);
                {
                    unsigned char * SubdirStart;
                    SubdirStart = OffsetBase + Get32u(ValuePtr);
                    if (SubdirStart < OffsetBase || SubdirStart > OffsetBase+ExifLength){
                        ErrNonfatal("Illegal Exif or interop ofset directory link",0,0);
                    }else{
                        ProcessExifDir(SubdirStart, OffsetBase, ExifLength, NestingLevel+1);
                    }
                    continue;
                }
                break;

            case TAG_FOCALLENGTH_35MM:
                // The focal length equivalent 35 mm is a 2.2 tag (defined as of April 2002)
                // if its present, use it to compute equivalent focal length instead of 
                // computing it from sensor geometry and actual focal length.
                ImageInfo.FocalLength35mmEquiv = (unsigned)ConvertAnyFormat(ValuePtr, Format);
                break;

            case TAG_DISTANCE_RANGE:
                // Three possible standard values:
                //   1 = macro, 2 = close, 3 = distant
                ImageInfo.DistanceRange = (int)ConvertAnyFormat(ValuePtr, Format);
                break;



            case TAG_X_RESOLUTION:
                if (NestingLevel==0) {// Only use the values from the top level directory
                    ImageInfo.xResolution = (float)ConvertAnyFormat(ValuePtr,Format);
                    // if yResolution has not been set, use the value of xResolution
                    if (ImageInfo.yResolution == 0.0) ImageInfo.yResolution = ImageInfo.xResolution;
                }
                break;

            case TAG_Y_RESOLUTION:
                if (NestingLevel==0) {// Only use the values from the top level directory
                    ImageInfo.yResolution = (float)ConvertAnyFormat(ValuePtr,Format);
                    // if xResolution has not been set, use the value of yResolution
                    if (ImageInfo.xResolution == 0.0) ImageInfo.xResolution = ImageInfo.yResolution;
                }
                break;

            case TAG_RESOLUTION_UNIT:
                if (NestingLevel==0) {// Only use the values from the top level directory
                    ImageInfo.ResolutionUnit = (int) ConvertAnyFormat(ValuePtr,Format);
                }
                break;

        }
    }


    {
        // In addition to linking to subdirectories via exif tags, 
        // there's also a potential link to another directory at the end of each
        // directory.  this has got to be the result of a committee!
        unsigned char * SubdirStart;
        unsigned Offset;

        if (DIR_ENTRY_ADDR(DirStart, NumDirEntries) + 4 <= OffsetBase+ExifLength){
            Offset = Get32u(DirStart+2+12*NumDirEntries);
            if (Offset){
                SubdirStart = OffsetBase + Offset;
                if (SubdirStart > OffsetBase+ExifLength || SubdirStart < OffsetBase){
                    if (SubdirStart > OffsetBase && SubdirStart < OffsetBase+ExifLength+20){
                        // Jhead 1.3 or earlier would crop the whole directory!
                        // As Jhead produces this form of format incorrectness, 
                        // I'll just let it pass silently
                        if (ShowTags) printf("Thumbnail removed with Jhead 1.3 or earlier\n");
                    }else{
                        ErrNonfatal("Illegal subdirectory link in Exif header",0,0);
                    }
                }else{
                    if (SubdirStart <= OffsetBase+ExifLength){
                        if (ShowTags) printf("%s    Continued directory ",IndentString);
                        ProcessExifDir(SubdirStart, OffsetBase, ExifLength, NestingLevel+1);
                    }
                }
            }
        }else{
            // The exif header ends before the last next directory pointer.
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
cmpl $0x5, %ecx
jl 0x7776
leaq 0x5c5b(%rip), %rdi      # 0xd3cd
xorl %esi, %esi
jmp 0x77f0
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %r13
movaps 0x568a(%rip), %xmm0     # 0xce10
movups %xmm0, 0x39(%rsp)
movaps %xmm0, 0x30(%rsp)
movq %rcx, 0x18(%rsp)
movl %ecx, %eax
movb $0x0, 0x30(%rsp,%rax,4)
cmpl $0x0, 0xcd89(%rip)      # 0x1452c
je 0x77b3
movzwl (%r13), %eax
rolw $0x8, %ax
movzwl %ax, %ebx
jmp 0x77b8
movzwl (%r13), %ebx
imull $0xc, %ebx, %eax
leaq (%rax,%r13), %rdx
addq $0x2, %rdx
leaq (%rax,%r13), %rsi
addq $0x6, %rsi
movl %r15d, %ecx
addq %r12, %rcx
cmpq %rcx, %rdx
je 0x7808
cmpq %rcx, %rsi
jbe 0x7808
addq %r13, %rax
addq $0x4, %rax
cmpq %rcx, %rax
je 0x7808
leaq 0x5c1d(%rip), %rdi      # 0xd40b
movl %ebx, %esi
xorl %edx, %edx
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6fc0
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movq %rcx, 0x70(%rsp)
leaq 0xbc42(%rip), %rax      # 0x13460
cmpl $0x0, (%rax)
je 0x7833
leaq 0x5c10(%rip), %rdi      # 0xd43a
movl %ebx, %esi
xorl %eax, %eax
callq 0x3170
addq $0x2, %r13
movq 0x18(%rsp), %rax
incl %eax
movl %eax, 0x14(%rsp)
movl %ebx, %eax
movq %rax, 0x90(%rsp)
movl $0x1028, %eax           # imm = 0x1028
addq 0xa780(%rip), %rax      # 0x11fd8
movq %rax, 0x58(%rsp)
movl $0x1050, %eax           # imm = 0x1050
addq 0xa76f(%rip), %rax      # 0x11fd8
movq %rax, 0x28(%rsp)
movl $0x1008, %eax           # imm = 0x1008
addq 0xa75e(%rip), %rax      # 0x11fd8
movq %rax, 0x50(%rsp)
xorl %ebx, %ebx
movl %r15d, 0x24(%rsp)
movq %r12, 0x78(%rsp)
movq %r13, 0x88(%rsp)
cmpq 0x90(%rsp), %rbx
je 0x8041
movq %rbx, (%rsp)
imulq $0xc, %rbx, %r14
addq %r13, %r14
cmpl $0x0, 0xcc79(%rip)      # 0x1452c
je 0x78ce
movzwl (%r14), %eax
movzwl 0x2(%r14), %ecx
rolw $0x8, %ax
movzwl %ax, %ebx
rolw $0x8, %cx
movzwl %cx, %ebp
jmp 0x78d7
movzwl (%r14), %ebx
movzwl 0x2(%r14), %ebp
leaq 0x4(%r14), %rdi
callq 0x7318
cmpl $0xd, %ebp
jb 0x78f0
leaq 0x5b64(%rip), %rdi      # 0xd450
movl %ebp, %esi
jmp 0x7900
cmpl $0x10001, %eax          # imm = 0x10001
jb 0x791b
leaq 0x5b80(%rip), %rdi      # 0xd47e
movl %eax, %esi
movl %ebx, %edx
callq 0x6fc0
movq (%rsp), %rbx
incq %rbx
movq 0x88(%rsp), %r13
jmp 0x7893
movl %ebp, %ecx
leaq 0x543c(%rip), %rdx      # 0xcd60
movl (%rdx,%rcx,4), %r13d
imull %eax, %r13d
addq $0x8, %r14
cmpl $0x5, %r13d
movq %r13, 0x8(%rsp)
jl 0x795f
movq %r14, %rdi
callq 0x7318
leal (%rax,%r13), %ecx
cmpl %r15d, %ecx
jbe 0x7959
leaq 0x5b57(%rip), %rdi      # 0xd4aa
movl %ebx, %esi
xorl %edx, %edx
jmp 0x7902
movl %eax, %r14d
addq %r12, %r14
leaq 0xbafa(%rip), %rax      # 0x13460
cmpl $0x0, (%rax)
je 0x7a9d
xorl %ecx, %ecx
leaq 0x10(%rcx), %rax
cmpq $0x6b0, %rax            # imm = 0x6B0
je 0x79b0
leaq 0x9d9c(%rip), %rdx      # 0x11720
movzwl (%rcx,%rdx), %edx
movq %rax, %rcx
cmpl %edx, %ebx
jne 0x7971
leaq 0x9d8a(%rip), %rcx      # 0x11720
movq -0x8(%rax,%rcx), %rdx
leaq 0x5b53(%rip), %rdi      # 0xd4f5
leaq 0x30(%rsp), %rsi
xorl %eax, %eax
callq 0x3170
jmp 0x79c5
leaq 0x5b1e(%rip), %rdi      # 0xd4d5
leaq 0x30(%rsp), %rsi
movl %ebx, %edx
xorl %eax, %eax
callq 0x3170
cmpl $0x7, %ebp
je 0x7a00
cmpl $0x2, %ebp
je 0x7a00
cmpl $0x1, %ebp
jne 0x7a7e
movq 0x8(%rsp), %rdx
cmpl $0x2, %edx
jl 0x7a8a
movl %edx, %esi
shrl %esi
leaq 0x5b10(%rip), %rdi      # 0xd501
movq %r14, %rdx
xorl %eax, %eax
callq 0x3170
jmp 0x7a9d
pushq $0x22
popq %rdi
callq 0x3050
movq 0x8(%rsp), %rax
leal -0x1(%rax), %ecx
movq %rcx, 0x80(%rsp)
xorl %r12d, %r12d
testl %eax, %eax
movl $0x0, %r15d
cmovgl %eax, %r15d
xorl %eax, %eax
cmpq %r12, %r15
je 0x7a66
movzbl (%r14,%r12), %edi
cmpl $0x20, %edi
jb 0x7a45
xorl %r13d, %r13d
callq 0x3050
movl %r13d, %eax
jmp 0x7a4c
testl %eax, %eax
pushq $0x1
popq %rax
je 0x7a51
incq %r12
jmp 0x7a29
xorl %eax, %eax
pushq $0x3f
popq %rdi
pushq $0x1
popq %r13
cmpq %r12, 0x80(%rsp)
jne 0x7a3b
jmp 0x7a4c
leaq 0x3741(%rip), %rdi      # 0xb1ae
callq 0x30c0
movl 0x24(%rsp), %r15d
movq 0x78(%rsp), %r12
jmp 0x7a9d
movq %r14, %rdi
movl %ebp, %esi
movq 0x8(%rsp), %rdx
jmp 0x7a90
movq %r14, %rdi
pushq $0x1
popq %rsi
callq 0x7396
pushq $0xa
popq %rdi
callq 0x3050
leal -0x9204(%rbx), %eax
cmpl $0x6, %eax
jbe 0x7bc4
leal -0xa402(%rbx), %eax
cmpl $0xa, %eax
jbe 0x7bfa
leal -0xa002(%rbx), %eax
cmpl $0x2, %eax
jb 0x7c3d
cmpl $0xa215, %ebx           # imm = 0xA215
je 0x7fc7
cmpl $0x110, %ebx            # imm = 0x110
je 0x7f2a
cmpl $0x112, %ebx            # imm = 0x112
je 0x7d8d
cmpl $0x11a, %ebx            # imm = 0x11A
je 0x7eaf
cmpl $0x11b, %ebx            # imm = 0x11B
je 0x7dad
cmpl $0x128, %ebx            # imm = 0x128
je 0x7f4d
cmpl $0x132, %ebx            # imm = 0x132
je 0x7f8c
cmpl $0x829a, %ebx           # imm = 0x829A
je 0x7e08
cmpl $0x829d, %ebx           # imm = 0x829D
je 0x7fff
cmpl $0x8769, %ebx           # imm = 0x8769
je 0x7e2a
cmpl $0x8822, %ebx           # imm = 0x8822
je 0x8021
cmpl $0x8827, %ebx           # imm = 0x8827
je 0x7f0a
cmpl $0x9003, %ebx           # imm = 0x9003
je 0x7f7c
cmpl $0x9004, %ebx           # imm = 0x9004
je 0x7f8c
cmpl $0xa005, %ebx           # imm = 0xA005
je 0x7e49
cmpl $0xa20e, %ebx           # imm = 0xA20E
je 0x7c2e
cmpl $0xa210, %ebx           # imm = 0xA210
je 0x7c2e
cmpl $0x10f, %ebx            # imm = 0x10F
movq (%rsp), %rbx
jne 0x790b
movq 0x8(%rsp), %rcx
cmpl $0x1f, %ecx
pushq $0x1f
popq %rax
cmovgel %eax, %ecx
movslq %ecx, %rdx
movq 0x50(%rsp), %rdi
movq %r14, %rsi
jmp 0x7fbd
leaq 0x50c5(%rip), %rcx      # 0xcc90
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
movq (%rsp), %rbx
jmpq *%rax
movq %r14, %rdi
movl %ebp, %esi
callq 0x752f
cvtsd2ss %xmm0, %xmm0
leaq 0xb87b(%rip), %rax      # 0x13468
movss %xmm0, 0x108c(%rax)
jmp 0x790b
leaq 0x50ab(%rip), %rcx      # 0xccac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
movq (%rsp), %rbx
jmpq *%rax
movq %r14, %rdi
movl %ebp, %esi
callq 0x752f
cvttsd2si %xmm0, %eax
leaq 0xb845(%rip), %rcx      # 0x13468
movl %eax, 0x10a4(%rcx)
jmp 0x790b
movq %r14, %rdi
movl %ebp, %esi
callq 0x752f
jmp 0x7907
movq %r14, %rdi
movl %ebp, %esi
callq 0x752f
cvttsd2si %xmm0, %eax
cmpl %eax, 0xc8df(%rip)      # 0x14530
movq (%rsp), %rbx
jge 0x790b
movl %eax, 0xc8cf(%rip)      # 0x14530
jmp 0x790b
movq %r14, %rdi
movl %ebp, %esi
callq 0x752f
cvtsd2ss %xmm0, %xmm0
leaq 0xb7ed(%rip), %rax      # 0x13468
movss %xmm0, 0x107c(%rax)
jmp 0x790b
movq %r14, %rdi
movl %ebp, %esi
callq 0x752f
cvtsd2ss %xmm0, %xmm0
leaq 0xb7cb(%rip), %rax      # 0x13468
movss %xmm0, 0x1088(%rax)
jmp 0x790b
movq %r14, %rdi
movl %ebp, %esi
callq 0x752f
cvttsd2si %xmm0, %eax
leaq 0xb7a9(%rip), %rcx      # 0x13468
movl %eax, 0x1078(%rcx)
jmp 0x790b
movq %r14, %rdi
movl %ebp, %esi
callq 0x752f
cvttsd2si %xmm0, %eax
leaq 0xb789(%rip), %rcx      # 0x13468
movl %eax, 0x10ac(%rcx)
jmp 0x790b
movq %r14, %rdi
movl %ebp, %esi
callq 0x752f
cvttsd2si %xmm0, %eax
leaq 0xb769(%rip), %rcx      # 0x13468
movl %eax, 0x109c(%rcx)
jmp 0x790b
movq %r14, %rdi
movl %ebp, %esi
callq 0x752f
cvtsd2ss %xmm0, %xmm0
leaq 0xb749(%rip), %rax      # 0x13468
movss %xmm0, 0x1090(%rax)
jmp 0x790b
movq %r14, %rdi
movl %ebp, %esi
callq 0x752f
cvttsd2si %xmm0, %eax
leaq 0xb727(%rip), %rcx      # 0x13468
movl %eax, 0x10b0(%rcx)
jmp 0x790b
movq %r14, %rdi
movl %ebp, %esi
callq 0x752f
cvttsd2si %xmm0, %eax
leaq 0xb707(%rip), %rcx      # 0x13468
movl %eax, 0x1098(%rcx)
jmp 0x790b
movq %r14, %rdi
movl %ebp, %esi
callq 0x752f
cvttsd2si %xmm0, %rax
leaq 0xb6e6(%rip), %rcx      # 0x13468
movl %eax, 0x1094(%rcx)
jmp 0x790b
movq %r14, %rdi
movl %ebp, %esi
callq 0x752f
cvttsd2si %xmm0, %eax
leaq 0xb6c6(%rip), %rcx      # 0x13468
movl %eax, 0x106c(%rcx)
jmp 0x7907
cmpl $0x0, 0x18(%rsp)
movq (%rsp), %rbx
jne 0x790b
movq %r14, %rdi
movl %ebp, %esi
callq 0x752f
cvtsd2ss %xmm0, %xmm0
leaq 0xb697(%rip), %rax      # 0x13468
movss %xmm0, 0x10b8(%rax)
movss 0x10b4(%rax), %xmm1
ucomiss 0x5038(%rip), %xmm1     # 0xce20
jne 0x790b
jp 0x790b
leaq 0xb66d(%rip), %rax      # 0x13468
movss %xmm0, 0x10b4(%rax)
jmp 0x790b
movq %r14, %rdi
movl %ebp, %esi
callq 0x752f
cvtsd2ss %xmm0, %xmm0
leaq 0xb64b(%rip), %rax      # 0x13468
movss %xmm0, 0x1080(%rax)
jmp 0x7907
leaq 0xb62f(%rip), %rax      # 0x13460
cmpl $0x0, (%rax)
je 0x7e49
leaq 0x56cb(%rip), %rdi      # 0xd508
leaq 0x30(%rsp), %rsi
xorl %eax, %eax
callq 0x3170
cmpl $0xa005, %ebx           # imm = 0xA005
jne 0x7e70
leaq 0xb608(%rip), %rax      # 0x13460
cmpl $0x0, (%rax)
je 0x7e70
leaq 0x56b4(%rip), %rdi      # 0xd518
leaq 0x30(%rsp), %rsi
xorl %eax, %eax
callq 0x3170
movq %r14, %rdi
callq 0x7318
cmpl %r15d, %eax
movq (%rsp), %rbx
jbe 0x7e96
leaq 0x56a3(%rip), %rdi      # 0xd52b
xorl %esi, %esi
xorl %edx, %edx
callq 0x6fc0
jmp 0x790b
movl %eax, %edi
addq %r12, %rdi
movq %r12, %rsi
movl %r15d, %edx
movl 0x14(%rsp), %ecx
callq 0x7755
jmp 0x790b
cmpl $0x0, 0x18(%rsp)
movq (%rsp), %rbx
jne 0x790b
movq %r14, %rdi
movl %ebp, %esi
callq 0x752f
cvtsd2ss %xmm0, %xmm0
leaq 0xb595(%rip), %rax      # 0x13468
movss %xmm0, 0x10b4(%rax)
movss 0x10b8(%rax), %xmm1
ucomiss 0x4f36(%rip), %xmm1     # 0xce20
jne 0x790b
jp 0x790b
leaq 0xb56b(%rip), %rax      # 0x13468
movss %xmm0, 0x10b8(%rax)
jmp 0x790b
movq %r14, %rdi
movl %ebp, %esi
callq 0x752f
cvttsd2si %xmm0, %eax
leaq 0xb549(%rip), %rcx      # 0x13468
movl %eax, 0x10a8(%rcx)
jmp 0x7907
movq 0x8(%rsp), %rcx
cmpl $0x27, %ecx
pushq $0x27
popq %rax
cmovgel %eax, %ecx
movslq %ecx, %rdx
movq 0x58(%rsp), %rdi
movq %r14, %rsi
callq 0x3090
jmp 0x7907
cmpl $0x0, 0x18(%rsp)
movq (%rsp), %rbx
jne 0x790b
movq %r14, %rdi
movl %ebp, %esi
callq 0x752f
cvttsd2si %xmm0, %eax
leaq 0xb4f7(%rip), %rcx      # 0x13468
movl %eax, 0x10bc(%rcx)
jmp 0x790b
movq 0x28(%rsp), %rdi
movq %r14, %rsi
pushq $0x13
popq %rdx
callq 0x3090
callq 0x3520
movq (%rax), %rax
leaq 0xb4cd(%rip), %rcx      # 0x13468
movsbq 0x1050(%rcx), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
movq (%rsp), %rbx
jne 0x790b
movq 0x28(%rsp), %rdi
movq %r14, %rsi
pushq $0x13
popq %rdx
callq 0x3090
jmp 0x790b
leaq 0xb49a(%rip), %rax      # 0x13468
cmpl $0x0, 0x10a8(%rax)
movq (%rsp), %rbx
jne 0x790b
movq %r14, %rdi
movl %ebp, %esi
callq 0x752f
cvttsd2si %xmm0, %eax
leaq 0xb474(%rip), %rcx      # 0x13468
movl %eax, 0x10a8(%rcx)
jmp 0x790b
movq %r14, %rdi
movl %ebp, %esi
callq 0x752f
cvtsd2ss %xmm0, %xmm0
leaq 0xb454(%rip), %rax      # 0x13468
movss %xmm0, 0x1084(%rax)
jmp 0x7907
movq %r14, %rdi
movl %ebp, %esi
callq 0x752f
cvttsd2si %xmm0, %eax
leaq 0xb432(%rip), %rcx      # 0x13468
movl %eax, 0x10a0(%rcx)
jmp 0x7907
movq 0x70(%rsp), %r14
cmpq %r14, 0x68(%rsp)
ja 0x80cb
movq 0x60(%rsp), %rdi
callq 0x7318
testl %eax, %eax
je 0x80cb
movl %eax, %ebx
addq %r12, %rbx
cmpl %r15d, %eax
jbe 0x8088
addq $0x14, %r14
cmpq %r14, %rbx
jae 0x80bb
leaq 0xb3eb(%rip), %rax      # 0x13460
cmpl $0x0, (%rax)
je 0x80cb
leaq 0x5b8f(%rip), %rdi      # 0xdc10
callq 0x30c0
jmp 0x80cb
leaq 0xb3d1(%rip), %rax      # 0x13460
cmpl $0x0, (%rax)
je 0x80a7
leaq 0x54e6(%rip), %rdi      # 0xd581
leaq 0x30(%rsp), %rsi
xorl %eax, %eax
callq 0x3170
movq %rbx, %rdi
movq %r12, %rsi
movl %r15d, %edx
movl 0x14(%rsp), %ecx
callq 0x7755
jmp 0x80cb
leaq 0x5496(%rip), %rdi      # 0xd558
xorl %esi, %esi
xorl %edx, %edx
callq 0x6fc0
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq