// File: /workspace/github_c_makefile_star2_O3/Matthias-Wandel[P]imgcomp/src/exif.c
// Function: ShowImageInfo
void ShowImageInfo(int ShowFileInfo)
{
    if (ShowFileInfo){
        printf("File name    : %s\n",ImageInfo.FileName);
        printf("File size    : %d bytes\n",ImageInfo.FileSize);
    }

    if (ImageInfo.CameraMake[0]){
        printf("Camera make  : %s\n",ImageInfo.CameraMake);
        printf("Camera model : %s\n",ImageInfo.CameraModel);
    }
    if (ImageInfo.DateTime[0]){
        printf("Date/Time    : %s\n",ImageInfo.DateTime);
    }
    printf("Resolution   : %d x %d\n",ImageInfo.Width, ImageInfo.Height);

    if (ImageInfo.Orientation > 1 && ImageInfo.Orientation <=8){
        // Only print orientation if one was supplied, and if its not 1 (normal orientation)
        printf("Orientation  : %s\n", OrientTab[ImageInfo.Orientation]);
    }

    if (ImageInfo.FlashUsed >= 0){
        if (ImageInfo.FlashUsed & 1){    
            printf("Flash used   : Yes");
            switch (ImageInfo.FlashUsed){
	            case 0x5: printf(" (Strobe light not detected)"); break;
	            case 0x7: printf(" (Strobe light detected) "); break;
	            case 0x9: printf(" (manual)"); break;
	            case 0xd: printf(" (manual, return light not detected)"); break;
	            case 0xf: printf(" (manual, return light  detected)"); break;
	            case 0x19:printf(" (auto)"); break;
	            case 0x1d:printf(" (auto, return light not detected)"); break;
	            case 0x1f:printf(" (auto, return light detected)"); break;
	            case 0x41:printf(" (red eye reduction mode)"); break;
	            case 0x45:printf(" (red eye reduction mode return light not detected)"); break;
	            case 0x47:printf(" (red eye reduction mode return light  detected)"); break;
	            case 0x49:printf(" (manual, red eye reduction mode)"); break;
	            case 0x4d:printf(" (manual, red eye reduction mode, return light not detected)"); break;
	            case 0x4f:printf(" (red eye reduction mode, return light detected)"); break;
	            case 0x59:printf(" (auto, red eye reduction mode)"); break;
	            case 0x5d:printf(" (auto, red eye reduction mode, return light not detected)"); break;
	            case 0x5f:printf(" (auto, red eye reduction mode, return light detected)"); break;
            }
        }else{
            printf("Flash used   : No");
            switch (ImageInfo.FlashUsed){
	            case 0x18:printf(" (auto)"); break;
            }
        }
        printf("\n");
    }


    if (ImageInfo.FocalLength){
        printf("Focal length : %4.1fmm",(double)ImageInfo.FocalLength);
        if (ImageInfo.FocalLength35mmEquiv){
            printf("  (35mm equivalent: %dmm)", ImageInfo.FocalLength35mmEquiv);
        }
        printf("\n");
    }

    if (ImageInfo.DigitalZoomRatio > 1){
        // Digital zoom used.  Shame on you!
        printf("Digital Zoom : %1.3fx\n", (double)ImageInfo.DigitalZoomRatio);
    }

    if (ImageInfo.ExposureTime){
        if (ImageInfo.ExposureTime < 0.010){
            printf("Exposure time: %6.4f s ",(double)ImageInfo.ExposureTime);
        }else{
            printf("Exposure time: %5.3f s ",(double)ImageInfo.ExposureTime);
        }
        if (ImageInfo.ExposureTime <= 0.5){
            printf(" (1/%d)",(int)(0.5 + 1/ImageInfo.ExposureTime));
        }
        printf("\n");
    }
    if (ImageInfo.ApertureFNumber){
        printf("Aperture     : f/%3.1f\n",(double)ImageInfo.ApertureFNumber);
    }
    if (ImageInfo.Distance){
        if (ImageInfo.Distance < 0){
            printf("Focus dist.  : Infinite\n");
        }else{
            printf("Focus dist.  : %4.2fm\n",(double)ImageInfo.Distance);
        }
    }

    if (ImageInfo.ISOequivalent){
        printf("ISO equiv.   : %2d\n",(int)ImageInfo.ISOequivalent);
    }

    if (ImageInfo.ExposureBias){
        // If exposure bias was specified, but set to zero, presumably its no bias at all,
        // so only show it if its nonzero.
        printf("Exposure bias: %4.2f\n",(double)ImageInfo.ExposureBias);
    }
        
    switch(ImageInfo.Whitebalance) {
        case 1:
            printf("Whitebalance : Manual\n");
            break;
        case 0:
            printf("Whitebalance : Auto\n");
            break;
    }

    //Quercus: 17-1-2004 Added LightSource, some cams return this, whitebalance or both
    switch(ImageInfo.LightSource) {
        case 1:
            printf("Light Source : Daylight\n");
            break;
        case 2:
            printf("Light Source : Fluorescent\n");
            break;
        case 3:
            printf("Light Source : Incandescent\n");
            break;
        case 4:
            printf("Light Source : Flash\n");
            break;
        case 9:
            printf("Light Source : Fine weather\n");
            break;
        case 11:
            printf("Light Source : Shade\n");
            break;
        default:; //Quercus: 17-1-2004 There are many more modes for this, check Exif2.2 specs
            // If it just says 'unknown' or we don't know it, then
            // don't bother showing it - it doesn't add any useful information.
    }

    if (ImageInfo.MeteringMode > 0){ // 05-jan-2001 vcs
        printf("Metering Mode: ");
        switch(ImageInfo.MeteringMode) {
        case 1: printf("average\n"); break;
        case 2: printf("center weight\n"); break;
        case 3: printf("spot\n"); break;
        case 4: printf("multi spot\n");  break;
        case 5: printf("pattern\n"); break;
        case 6: printf("partial\n");  break;
        case 255: printf("other\n");  break;
        default: printf("unknown (%d)\n",ImageInfo.MeteringMode); break;
        }
    }

    if (ImageInfo.ExposureProgram){ // 05-jan-2001 vcs
        switch(ImageInfo.ExposureProgram) {
        case 1:
            printf("Exposure     : Manual\n");
            break;
        case 2:
            printf("Exposure     : program (auto)\n");
            break;
        case 3:
            printf("Exposure     : aperture priority (semi-auto)\n");
            break;
        case 4:
            printf("Exposure     : shutter priority (semi-auto)\n");
            break;
        case 5:
            printf("Exposure     : Creative Program (based towards depth of field)\n"); 
            break;
        case 6:
            printf("Exposure     : Action program (based towards fast shutter speed)\n");
            break;
        case 7:
            printf("Exposure     : Portrait Mode\n");
            break;
        case 8:
            printf("Exposure     : LandscapeMode \n");
            break;
        default:
            break;
        }
    }
    switch(ImageInfo.ExposureMode){
        case 0: // Automatic (not worth cluttering up output for)
            break;
        case 1: printf("Exposure Mode: Manual\n");
            break;
        case 2: printf("Exposure Mode: Auto bracketing\n");
            break;
    }

    if (ImageInfo.DistanceRange) {
        printf("Focus range  : ");
        switch(ImageInfo.DistanceRange) {
            case 1:
                printf("macro");
                break;
            case 2:
                printf("close");
                break;
            case 3:
                printf("distant");
                break;
        }
        printf("\n");
    }
}

// Assembly:
pushq %rbx
testl %edi, %edi
je 0x8a9b
leaq 0x451e(%rip), %rdi      # 0xcf94
leaq 0xa9db(%rip), %rbx      # 0x13458
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3170
movl 0x1004(%rbx), %esi
leaq 0x4513(%rip), %rdi      # 0xcfa7
xorl %eax, %eax
callq 0x3170
leaq 0xa9b6(%rip), %rbx      # 0x13458
cmpb $0x0, 0x1008(%rbx)
je 0x8ad5
leaq 0x1008(%rbx), %rsi
leaq 0x4507(%rip), %rdi      # 0xcfc0
xorl %eax, %eax
callq 0x3170
leaq 0x1028(%rbx), %rsi
leaq 0x4505(%rip), %rdi      # 0xcfd3
xorl %eax, %eax
callq 0x3170
cmpb $0x0, 0x1050(%rbx)
je 0x8af8
movl $0x1050, %esi           # imm = 0x1050
addq 0x94ee(%rip), %rsi      # 0x11fd8
leaq 0x44f5(%rip), %rdi      # 0xcfe6
xorl %eax, %eax
callq 0x3170
movl 0x1064(%rbx), %edx
movl 0x1068(%rbx), %esi
leaq 0x44ee(%rip), %rdi      # 0xcff9
xorl %eax, %eax
callq 0x3170
movl 0x106c(%rbx), %eax
leal -0x2(%rax), %ecx
cmpl $0x6, %ecx
ja 0x8b3c
leaq 0x429d(%rip), %rcx      # 0xcdc4
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
leaq 0x44dc(%rip), %rdi      # 0xd011
xorl %eax, %eax
callq 0x3170
movl 0x1078(%rbx), %eax
testl %eax, %eax
js 0x8b7d
testb $0x1, %al
jne 0x8cb6
leaq 0x474d(%rip), %rdi      # 0xd2a2
xorl %eax, %eax
callq 0x3170
cmpl $0x18, 0x1078(%rbx)
jne 0x8b73
leaq 0x5338(%rip), %rdi      # 0xdea4
xorl %eax, %eax
callq 0x3170
movl $0xa, %edi
callq 0x3050
movss 0x107c(%rbx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x8b8f
jnp 0x8bc3
cvtss2sd %xmm0, %xmm0
leaq 0x471a(%rip), %rdi      # 0xd2b4
movb $0x1, %al
callq 0x3170
movl 0x1094(%rbx), %esi
testl %esi, %esi
je 0x8bb9
leaq 0x4719(%rip), %rdi      # 0xd2cb
xorl %eax, %eax
callq 0x3170
movl $0xa, %edi
callq 0x3050
movss 0x1090(%rbx), %xmm0
ucomiss 0x4282(%rip), %xmm0     # 0xce54
jbe 0x8be6
cvtss2sd %xmm0, %xmm0
leaq 0x4706(%rip), %rdi      # 0xd2e5
movb $0x1, %al
callq 0x3170
movss 0x1080(%rbx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x8bf8
jnp 0x8c70
cvtss2sd %xmm0, %xmm0
movsd 0x425c(%rip), %xmm1     # 0xce60
ucomisd %xmm0, %xmm1
leaq 0x46ed(%rip), %rax      # 0xd2fc
leaq 0x46fe(%rip), %rdi      # 0xd314
cmovaq %rax, %rdi
movb $0x1, %al
callq 0x3170
movss 0x1080(%rbx), %xmm0
movss 0x4227(%rip), %xmm1     # 0xce58
ucomiss %xmm0, %xmm1
jb 0x8c63
movss 0x4216(%rip), %xmm1     # 0xce54
divss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
addsd 0x3aa7(%rip), %xmm0     # 0xc6f8
cvttsd2si %xmm0, %esi
leaq 0x46d0(%rip), %rdi      # 0xd32c
xorl %eax, %eax
callq 0x3170
movl $0xa, %edi
callq 0x3050
xorps %xmm1, %xmm1
movss 0x1084(%rbx), %xmm0
ucomiss %xmm1, %xmm0
jne 0x8c7f
jnp 0x8c91
cvtss2sd %xmm0, %xmm0
leaq 0x46aa(%rip), %rdi      # 0xd334
movb $0x1, %al
callq 0x3170
movss 0x1088(%rbx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x8ca3
jnp 0x8d16
ucomiss %xmm0, %xmm1
jbe 0x8d04
leaq 0x4fbd(%rip), %rdi      # 0xdc6c
callq 0x30c0
jmp 0x8d16
leaq 0x4367(%rip), %rdi      # 0xd024
xorl %eax, %eax
callq 0x3170
movl 0x1078(%rbx), %eax
cmpl $0x40, %eax
jle 0x8df5
cmpl $0x58, %eax
jg 0x8ef5
addl $-0x41, %eax
cmpl $0xe, %eax
ja 0x8b73
leaq 0x4041(%rip), %rcx      # 0xcd30
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x4402(%rip), %rdi      # 0xd101
jmp 0x8b6c
cvtss2sd %xmm0, %xmm0
leaq 0x463d(%rip), %rdi      # 0xd34c
movb $0x1, %al
callq 0x3170
movl 0x10a8(%rbx), %esi
testl %esi, %esi
je 0x8d2e
leaq 0x463c(%rip), %rdi      # 0xd363
xorl %eax, %eax
callq 0x3170
movss 0x108c(%rbx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x8d40
jnp 0x8d52
cvtss2sd %xmm0, %xmm0
leaq 0x462c(%rip), %rdi      # 0xd377
movb $0x1, %al
callq 0x3170
movl 0x1098(%rbx), %eax
cmpl $0x1, %eax
je 0x8d6a
testl %eax, %eax
jne 0x8d76
leaq 0x4f1c(%rip), %rdi      # 0xdc84
jmp 0x8d71
leaq 0x4f27(%rip), %rdi      # 0xdc98
callq 0x30c0
movl 0x10ac(%rbx), %eax
decl %eax
cmpl $0xa, %eax
ja 0x8da2
movl $0x50f, %ecx            # imm = 0x50F
btl %eax, %ecx
jae 0x8da2
movl %eax, %eax
leaq 0x4052(%rip), %rcx      # 0xcde8
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
callq 0x30c0
cmpl $0x0, 0x109c(%rbx)
jle 0x8e66
leaq 0x45d7(%rip), %rdi      # 0xd38d
xorl %eax, %eax
callq 0x3170
movl 0x109c(%rbx), %esi
leal -0x1(%rsi), %eax
cmpl $0x5, %eax
ja 0x8de4
leaq 0x3f9a(%rip), %rcx      # 0xcd6c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x4f90(%rip), %rdi      # 0xdd72
jmp 0x8e61
cmpl $0xff, %esi
jne 0x8e38
leaq 0x4f50(%rip), %rdi      # 0xdd43
jmp 0x8e61
cmpl $0x18, %eax
jg 0x8f1c
addl $-0x5, %eax
cmpl $0xa, %eax
ja 0x8b73
leaq 0x3ef3(%rip), %rcx      # 0xcd04
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x4216(%rip), %rdi      # 0xd037
jmp 0x8b6c
leaq 0x4f24(%rip), %rdi      # 0xdd51
jmp 0x8e61
leaq 0x4f29(%rip), %rdi      # 0xdd5f
jmp 0x8e61
leaq 0x455e(%rip), %rdi      # 0xd39d
xorl %eax, %eax
callq 0x3170
jmp 0x8e66
leaq 0x4f0a(%rip), %rdi      # 0xdd59
jmp 0x8e61
leaq 0x4f0c(%rip), %rdi      # 0xdd64
jmp 0x8e61
leaq 0x4ee8(%rip), %rdi      # 0xdd49
callq 0x30c0
movl 0x10a0(%rbx), %eax
decl %eax
cmpl $0x7, %eax
ja 0x8e88
movl %eax, %eax
leaq 0x3f98(%rip), %rcx      # 0xce14
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
callq 0x30c0
movl 0x10a4(%rbx), %eax
cmpl $0x1, %eax
je 0x8ea1
cmpl $0x2, %eax
jne 0x8ead
leaq 0x5039(%rip), %rdi      # 0xded8
jmp 0x8ea8
leaq 0x501a(%rip), %rdi      # 0xdec2
callq 0x30c0
cmpl $0x0, 0x10b0(%rbx)
je 0x8ef3
leaq 0x44ee(%rip), %rdi      # 0xd3ab
xorl %eax, %eax
callq 0x3170
movl 0x10b0(%rbx), %eax
decl %eax
cmpl $0x2, %eax
ja 0x8ee8
movl %eax, %eax
leaq 0x3f5a(%rip), %rcx      # 0xce34
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
xorl %eax, %eax
callq 0x3170
movl $0xa, %edi
popq %rbx
jmp 0x3050
popq %rbx
retq
cmpl $0x59, %eax
je 0x8faf
cmpl $0x5d, %eax
je 0x8fbb
cmpl $0x5f, %eax
jne 0x8b73
leaq 0x4354(%rip), %rdi      # 0xd26b
jmp 0x8b6c
cmpl $0x19, %eax
je 0x8b65
cmpl $0x1d, %eax
je 0x8fc7
cmpl $0x1f, %eax
jne 0x8b73
leaq 0x41a4(%rip), %rdi      # 0xd0e2
jmp 0x8b6c
leaq 0x412e(%rip), %rdi      # 0xd078
jmp 0x8b6c
leaq 0x4118(%rip), %rdi      # 0xd06e
jmp 0x8b6c
leaq 0x413b(%rip), %rdi      # 0xd09d
jmp 0x8b6c
leaq 0x40e6(%rip), %rdi      # 0xd054
jmp 0x8b6c
leaq 0x41d5(%rip), %rdi      # 0xd14f
jmp 0x8b6c
leaq 0x41fa(%rip), %rdi      # 0xd180
jmp 0x8b6c
leaq 0x4210(%rip), %rdi      # 0xd1a2
jmp 0x8b6c
leaq 0x417d(%rip), %rdi      # 0xd11b
jmp 0x8b6c
leaq 0x4235(%rip), %rdi      # 0xd1df
jmp 0x8b6c
leaq 0x425a(%rip), %rdi      # 0xd210
jmp 0x8b6c
leaq 0x426e(%rip), %rdi      # 0xd230
jmp 0x8b6c
leaq 0x40f1(%rip), %rdi      # 0xd0bf
jmp 0x8b6c