// File: /workspace/github_c_makefile_star2_O1/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 0x8aa8
leaq 0x44a1(%rip), %rdi      # 0xcf24
leaq 0xa9ce(%rip), %rbx      # 0x13458
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3170
movl 0x1004(%rbx), %esi
leaq 0x4496(%rip), %rdi      # 0xcf37
xorl %eax, %eax
callq 0x3170
leaq 0xa9a9(%rip), %rbx      # 0x13458
cmpb $0x0, 0x1008(%rbx)
je 0x8ae2
leaq 0x1008(%rbx), %rsi
leaq 0x448a(%rip), %rdi      # 0xcf50
xorl %eax, %eax
callq 0x3170
leaq 0x1028(%rbx), %rsi
leaq 0x4488(%rip), %rdi      # 0xcf63
xorl %eax, %eax
callq 0x3170
cmpb $0x0, 0x1050(%rbx)
je 0x8b05
movl $0x1050, %esi           # imm = 0x1050
addq 0x94e1(%rip), %rsi      # 0x11fd8
leaq 0x4478(%rip), %rdi      # 0xcf76
xorl %eax, %eax
callq 0x3170
movl 0x1064(%rbx), %edx
movl 0x1068(%rbx), %esi
leaq 0x4471(%rip), %rdi      # 0xcf89
xorl %eax, %eax
callq 0x3170
movl 0x106c(%rbx), %eax
leal -0x2(%rax), %ecx
cmpl $0x6, %ecx
ja 0x8b49
leaq 0x4220(%rip), %rcx      # 0xcd54
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
leaq 0x445f(%rip), %rdi      # 0xcfa1
xorl %eax, %eax
callq 0x3170
movl 0x1078(%rbx), %eax
testl %eax, %eax
js 0x8b8a
testb $0x1, %al
jne 0x8cc3
leaq 0x46d0(%rip), %rdi      # 0xd232
xorl %eax, %eax
callq 0x3170
cmpl $0x18, 0x1078(%rbx)
jne 0x8b80
leaq 0x52bb(%rip), %rdi      # 0xde34
xorl %eax, %eax
callq 0x3170
movl $0xa, %edi
callq 0x3050
movss 0x107c(%rbx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x8b9c
jnp 0x8bd0
cvtss2sd %xmm0, %xmm0
leaq 0x469d(%rip), %rdi      # 0xd244
movb $0x1, %al
callq 0x3170
movl 0x1094(%rbx), %esi
testl %esi, %esi
je 0x8bc6
leaq 0x469c(%rip), %rdi      # 0xd25b
xorl %eax, %eax
callq 0x3170
movl $0xa, %edi
callq 0x3050
movss 0x1090(%rbx), %xmm0
ucomiss 0x4205(%rip), %xmm0     # 0xcde4
jbe 0x8bf3
cvtss2sd %xmm0, %xmm0
leaq 0x4689(%rip), %rdi      # 0xd275
movb $0x1, %al
callq 0x3170
movss 0x1080(%rbx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x8c05
jnp 0x8c7d
cvtss2sd %xmm0, %xmm0
movsd 0x41df(%rip), %xmm1     # 0xcdf0
ucomisd %xmm0, %xmm1
leaq 0x4670(%rip), %rax      # 0xd28c
leaq 0x4681(%rip), %rdi      # 0xd2a4
cmovaq %rax, %rdi
movb $0x1, %al
callq 0x3170
movss 0x1080(%rbx), %xmm0
movss 0x41aa(%rip), %xmm1     # 0xcde8
ucomiss %xmm0, %xmm1
jb 0x8c70
movss 0x4199(%rip), %xmm1     # 0xcde4
divss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
addsd 0x23ba(%rip), %xmm0     # 0xb018
cvttsd2si %xmm0, %esi
leaq 0x4653(%rip), %rdi      # 0xd2bc
xorl %eax, %eax
callq 0x3170
movl $0xa, %edi
callq 0x3050
xorps %xmm1, %xmm1
movss 0x1084(%rbx), %xmm0
ucomiss %xmm1, %xmm0
jne 0x8c8c
jnp 0x8c9e
cvtss2sd %xmm0, %xmm0
leaq 0x462d(%rip), %rdi      # 0xd2c4
movb $0x1, %al
callq 0x3170
movss 0x1088(%rbx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x8cb0
jnp 0x8d23
ucomiss %xmm0, %xmm1
jbe 0x8d11
leaq 0x4f40(%rip), %rdi      # 0xdbfc
callq 0x30c0
jmp 0x8d23
leaq 0x42ea(%rip), %rdi      # 0xcfb4
xorl %eax, %eax
callq 0x3170
movl 0x1078(%rbx), %eax
cmpl $0x40, %eax
jle 0x8e02
cmpl $0x58, %eax
jg 0x8f02
addl $-0x41, %eax
cmpl $0xe, %eax
ja 0x8b80
leaq 0x3fc4(%rip), %rcx      # 0xccc0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x4385(%rip), %rdi      # 0xd091
jmp 0x8b79
cvtss2sd %xmm0, %xmm0
leaq 0x45c0(%rip), %rdi      # 0xd2dc
movb $0x1, %al
callq 0x3170
movl 0x10a8(%rbx), %esi
testl %esi, %esi
je 0x8d3b
leaq 0x45bf(%rip), %rdi      # 0xd2f3
xorl %eax, %eax
callq 0x3170
movss 0x108c(%rbx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x8d4d
jnp 0x8d5f
cvtss2sd %xmm0, %xmm0
leaq 0x45af(%rip), %rdi      # 0xd307
movb $0x1, %al
callq 0x3170
movl 0x1098(%rbx), %eax
cmpl $0x1, %eax
je 0x8d77
testl %eax, %eax
jne 0x8d83
leaq 0x4e9f(%rip), %rdi      # 0xdc14
jmp 0x8d7e
leaq 0x4eaa(%rip), %rdi      # 0xdc28
callq 0x30c0
movl 0x10ac(%rbx), %eax
decl %eax
cmpl $0xa, %eax
ja 0x8daf
movl $0x50f, %ecx            # imm = 0x50F
btl %eax, %ecx
jae 0x8daf
movl %eax, %eax
leaq 0x3fd5(%rip), %rcx      # 0xcd78
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
callq 0x30c0
cmpl $0x0, 0x109c(%rbx)
jle 0x8e73
leaq 0x455a(%rip), %rdi      # 0xd31d
xorl %eax, %eax
callq 0x3170
movl 0x109c(%rbx), %esi
leal -0x1(%rsi), %eax
cmpl $0x5, %eax
ja 0x8df1
leaq 0x3f1d(%rip), %rcx      # 0xccfc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x4f13(%rip), %rdi      # 0xdd02
jmp 0x8e6e
cmpl $0xff, %esi
jne 0x8e45
leaq 0x4ed3(%rip), %rdi      # 0xdcd3
jmp 0x8e6e
cmpl $0x18, %eax
jg 0x8f29
addl $-0x5, %eax
cmpl $0xa, %eax
ja 0x8b80
leaq 0x3e76(%rip), %rcx      # 0xcc94
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x4199(%rip), %rdi      # 0xcfc7
jmp 0x8b79
leaq 0x4ea7(%rip), %rdi      # 0xdce1
jmp 0x8e6e
leaq 0x4eac(%rip), %rdi      # 0xdcef
jmp 0x8e6e
leaq 0x44e1(%rip), %rdi      # 0xd32d
xorl %eax, %eax
callq 0x3170
jmp 0x8e73
leaq 0x4e8d(%rip), %rdi      # 0xdce9
jmp 0x8e6e
leaq 0x4e8f(%rip), %rdi      # 0xdcf4
jmp 0x8e6e
leaq 0x4e6b(%rip), %rdi      # 0xdcd9
callq 0x30c0
movl 0x10a0(%rbx), %eax
decl %eax
cmpl $0x7, %eax
ja 0x8e95
movl %eax, %eax
leaq 0x3f1b(%rip), %rcx      # 0xcda4
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
callq 0x30c0
movl 0x10a4(%rbx), %eax
cmpl $0x1, %eax
je 0x8eae
cmpl $0x2, %eax
jne 0x8eba
leaq 0x4fbc(%rip), %rdi      # 0xde68
jmp 0x8eb5
leaq 0x4f9d(%rip), %rdi      # 0xde52
callq 0x30c0
cmpl $0x0, 0x10b0(%rbx)
je 0x8f00
leaq 0x4471(%rip), %rdi      # 0xd33b
xorl %eax, %eax
callq 0x3170
movl 0x10b0(%rbx), %eax
decl %eax
cmpl $0x2, %eax
ja 0x8ef5
movl %eax, %eax
leaq 0x3edd(%rip), %rcx      # 0xcdc4
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 0x8fbc
cmpl $0x5d, %eax
je 0x8fc8
cmpl $0x5f, %eax
jne 0x8b80
leaq 0x42d7(%rip), %rdi      # 0xd1fb
jmp 0x8b79
cmpl $0x19, %eax
je 0x8b72
cmpl $0x1d, %eax
je 0x8fd4
cmpl $0x1f, %eax
jne 0x8b80
leaq 0x4127(%rip), %rdi      # 0xd072
jmp 0x8b79
leaq 0x40b1(%rip), %rdi      # 0xd008
jmp 0x8b79
leaq 0x409b(%rip), %rdi      # 0xcffe
jmp 0x8b79
leaq 0x40be(%rip), %rdi      # 0xd02d
jmp 0x8b79
leaq 0x4069(%rip), %rdi      # 0xcfe4
jmp 0x8b79
leaq 0x4158(%rip), %rdi      # 0xd0df
jmp 0x8b79
leaq 0x417d(%rip), %rdi      # 0xd110
jmp 0x8b79
leaq 0x4193(%rip), %rdi      # 0xd132
jmp 0x8b79
leaq 0x4100(%rip), %rdi      # 0xd0ab
jmp 0x8b79
leaq 0x41b8(%rip), %rdi      # 0xd16f
jmp 0x8b79
leaq 0x41dd(%rip), %rdi      # 0xd1a0
jmp 0x8b79
leaq 0x41f1(%rip), %rdi      # 0xd1c0
jmp 0x8b79
leaq 0x4074(%rip), %rdi      # 0xd04f
jmp 0x8b79