// File: /workspace/github_c_makefile_star2_O2/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 0x81ae
leaq 0x4ddb(%rip), %rdi      # 0xcf64
leaq 0xb2d8(%rip), %rbx      # 0x13468
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3170
movl 0x1004(%rbx), %esi
leaq 0x4dd0(%rip), %rdi      # 0xcf77
xorl %eax, %eax
callq 0x3170
leaq 0xb2b3(%rip), %rbx      # 0x13468
cmpb $0x0, 0x1008(%rbx)
je 0x81e8
leaq 0x1008(%rbx), %rsi
leaq 0x4dc4(%rip), %rdi      # 0xcf90
xorl %eax, %eax
callq 0x3170
leaq 0x1028(%rbx), %rsi
leaq 0x4dc2(%rip), %rdi      # 0xcfa3
xorl %eax, %eax
callq 0x3170
cmpb $0x0, 0x1050(%rbx)
je 0x820b
movl $0x1050, %esi           # imm = 0x1050
addq 0x9ddb(%rip), %rsi      # 0x11fd8
leaq 0x4db2(%rip), %rdi      # 0xcfb6
xorl %eax, %eax
callq 0x3170
movl 0x1064(%rbx), %edx
movl 0x1068(%rbx), %esi
leaq 0x4dab(%rip), %rdi      # 0xcfc9
xorl %eax, %eax
callq 0x3170
movl 0x106c(%rbx), %eax
leal -0x2(%rax), %ecx
cmpl $0x6, %ecx
ja 0x824f
leaq 0x4b5a(%rip), %rcx      # 0xcd94
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
leaq 0x4d99(%rip), %rdi      # 0xcfe1
xorl %eax, %eax
callq 0x3170
movl 0x1078(%rbx), %eax
testl %eax, %eax
js 0x828e
testb $0x1, %al
jne 0x83c7
leaq 0x500a(%rip), %rdi      # 0xd272
xorl %eax, %eax
callq 0x3170
cmpl $0x18, 0x1078(%rbx)
jne 0x8286
leaq 0x5bf5(%rip), %rdi      # 0xde74
xorl %eax, %eax
callq 0x3170
pushq $0xa
popq %rdi
callq 0x3050
movss 0x107c(%rbx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x82a0
jnp 0x82d2
cvtss2sd %xmm0, %xmm0
leaq 0x4fd9(%rip), %rdi      # 0xd284
movb $0x1, %al
callq 0x3170
movl 0x1094(%rbx), %esi
testl %esi, %esi
je 0x82ca
leaq 0x4fd8(%rip), %rdi      # 0xd29b
xorl %eax, %eax
callq 0x3170
pushq $0xa
popq %rdi
callq 0x3050
movss 0x1090(%rbx), %xmm0
ucomiss 0x4b43(%rip), %xmm0     # 0xce24
jbe 0x82f5
cvtss2sd %xmm0, %xmm0
leaq 0x4fc7(%rip), %rdi      # 0xd2b5
movb $0x1, %al
callq 0x3170
movss 0x1080(%rbx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x8307
jnp 0x837a
cvtss2sd %xmm0, %xmm0
movsd 0x4b1d(%rip), %xmm1     # 0xce30
ucomisd %xmm0, %xmm1
leaq 0x4fae(%rip), %rax      # 0xd2cc
leaq 0x4fbf(%rip), %rdi      # 0xd2e4
cmovaq %rax, %rdi
movb $0x1, %al
callq 0x3170
movss 0x1080(%rbx), %xmm0
movss 0x4ae8(%rip), %xmm1     # 0xce28
ucomiss %xmm0, %xmm1
jb 0x836f
movss 0x4ad7(%rip), %xmm1     # 0xce24
divss %xmm0, %xmm1
cvtss2sd %xmm1, %xmm0
addsd 0x439b(%rip), %xmm0     # 0xc6f8
cvttsd2si %xmm0, %esi
leaq 0x4f94(%rip), %rdi      # 0xd2fc
xorl %eax, %eax
callq 0x3170
pushq $0xa
popq %rdi
callq 0x3050
xorps %xmm1, %xmm1
movss 0x1084(%rbx), %xmm0
ucomiss %xmm1, %xmm0
jne 0x8389
jnp 0x839b
cvtss2sd %xmm0, %xmm0
leaq 0x4f70(%rip), %rdi      # 0xd304
movb $0x1, %al
callq 0x3170
movss 0x1088(%rbx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x83b1
jnp 0x8447
ucomiss %xmm0, %xmm1
jbe 0x8435
leaq 0x587f(%rip), %rdi      # 0xdc3c
callq 0x30c0
jmp 0x8447
leaq 0x4c26(%rip), %rdi      # 0xcff4
xorl %eax, %eax
callq 0x3170
movl 0x1078(%rbx), %eax
leal -0x41(%rax), %ecx
cmpl $0xe, %ecx
jbe 0x8529
leal -0x5(%rax), %ecx
cmpl $0xa, %ecx
jbe 0x8545
cmpl $0x19, %eax
je 0x8278
cmpl $0x1d, %eax
je 0x86be
cmpl $0x1f, %eax
je 0x869a
cmpl $0x59, %eax
je 0x86b2
cmpl $0x5d, %eax
je 0x86a6
cmpl $0x5f, %eax
jne 0x8286
leaq 0x4e0b(%rip), %rdi      # 0xd23b
jmp 0x827f
cvtss2sd %xmm0, %xmm0
leaq 0x4edc(%rip), %rdi      # 0xd31c
movb $0x1, %al
callq 0x3170
movl 0x10a8(%rbx), %esi
testl %esi, %esi
je 0x845f
leaq 0x4edb(%rip), %rdi      # 0xd333
xorl %eax, %eax
callq 0x3170
movss 0x108c(%rbx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x8471
jnp 0x8483
cvtss2sd %xmm0, %xmm0
leaq 0x4ecb(%rip), %rdi      # 0xd347
movb $0x1, %al
callq 0x3170
movl 0x1098(%rbx), %eax
cmpl $0x1, %eax
je 0x849b
testl %eax, %eax
jne 0x84a7
leaq 0x57bb(%rip), %rdi      # 0xdc54
jmp 0x84a2
leaq 0x57c6(%rip), %rdi      # 0xdc68
callq 0x30c0
movl 0x10ac(%rbx), %eax
decl %eax
cmpl $0xa, %eax
ja 0x84d3
movl $0x50f, %ecx            # imm = 0x50F
btl %eax, %ecx
jae 0x84d3
movl %eax, %eax
leaq 0x48f1(%rip), %rcx      # 0xcdb8
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
callq 0x30c0
cmpl $0x0, 0x109c(%rbx)
jle 0x85a1
leaq 0x4e76(%rip), %rdi      # 0xd35d
xorl %eax, %eax
callq 0x3170
movl 0x109c(%rbx), %esi
leal -0x1(%rsi), %eax
cmpl $0x5, %eax
ja 0x8518
leaq 0x483d(%rip), %rcx      # 0xcd40
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x582f(%rip), %rdi      # 0xdd42
jmp 0x859c
cmpl $0xff, %esi
jne 0x8573
leaq 0x57ec(%rip), %rdi      # 0xdd13
jmp 0x859c
leaq 0x47d4(%rip), %rax      # 0xcd04
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x4b91(%rip), %rdi      # 0xd0d1
jmp 0x827f
leaq 0x478c(%rip), %rax      # 0xccd8
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x4aab(%rip), %rdi      # 0xd007
jmp 0x827f
leaq 0x57b9(%rip), %rdi      # 0xdd21
jmp 0x859c
leaq 0x57be(%rip), %rdi      # 0xdd2f
jmp 0x859c
leaq 0x4df3(%rip), %rdi      # 0xd36d
xorl %eax, %eax
callq 0x3170
jmp 0x85a1
leaq 0x579f(%rip), %rdi      # 0xdd29
jmp 0x859c
leaq 0x57a1(%rip), %rdi      # 0xdd34
jmp 0x859c
leaq 0x577d(%rip), %rdi      # 0xdd19
callq 0x30c0
movl 0x10a0(%rbx), %eax
decl %eax
cmpl $0x7, %eax
ja 0x85c3
movl %eax, %eax
leaq 0x482d(%rip), %rcx      # 0xcde4
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
callq 0x30c0
movl 0x10a4(%rbx), %eax
cmpl $0x1, %eax
je 0x85dc
cmpl $0x2, %eax
jne 0x85e8
leaq 0x58ce(%rip), %rdi      # 0xdea8
jmp 0x85e3
leaq 0x58af(%rip), %rdi      # 0xde92
callq 0x30c0
cmpl $0x0, 0x10b0(%rbx)
je 0x862c
leaq 0x4d83(%rip), %rdi      # 0xd37b
xorl %eax, %eax
callq 0x3170
movl 0x10b0(%rbx), %eax
decl %eax
cmpl $0x2, %eax
ja 0x8623
movl %eax, %eax
leaq 0x47ef(%rip), %rcx      # 0xce04
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
xorl %eax, %eax
callq 0x3170
pushq $0xa
popq %rdi
popq %rbx
jmp 0x3050
popq %rbx
retq
leaq 0x4b7a(%rip), %rdi      # 0xd1af
jmp 0x827f
leaq 0x4b0f(%rip), %rdi      # 0xd150
jmp 0x827f
leaq 0x4b25(%rip), %rdi      # 0xd172
jmp 0x827f
leaq 0x4ac6(%rip), %rdi      # 0xd11f
jmp 0x827f
leaq 0x4a86(%rip), %rdi      # 0xd0eb
jmp 0x827f
leaq 0x49d7(%rip), %rdi      # 0xd048
jmp 0x827f
leaq 0x49c1(%rip), %rdi      # 0xd03e
jmp 0x827f
leaq 0x499b(%rip), %rdi      # 0xd024
jmp 0x827f
leaq 0x49d8(%rip), %rdi      # 0xd06d
jmp 0x827f
leaq 0x4a11(%rip), %rdi      # 0xd0b2
jmp 0x827f
leaq 0x4b53(%rip), %rdi      # 0xd200
jmp 0x827f
leaq 0x4b27(%rip), %rdi      # 0xd1e0
jmp 0x827f
leaq 0x49ca(%rip), %rdi      # 0xd08f
jmp 0x827f