// File: /workspace/github_c_makefile_star2_O1/Matthias-Wandel[P]imgcomp/src/exif.c
// Function: PrintFormatNumber
void PrintFormatNumber(void * ValuePtr, int Format, int ByteCount)
{
    int s,n;

    for(n=0;n<16;n++){
        switch(Format){
            case FMT_SBYTE:
            case FMT_BYTE:      printf("%02x",*(uchar *)ValuePtr); s=1;  break;
            case FMT_USHORT:    printf("%d",Get16u(ValuePtr)); s=2;      break;
            case FMT_ULONG:     
            case FMT_SLONG:     printf("%d",Get32s(ValuePtr)); s=4;      break;
            case FMT_SSHORT:    printf("%hd",(signed short)Get16u(ValuePtr)); s=2; break;
            case FMT_URATIONAL:
                printf("%u/%u",Get32s(ValuePtr), Get32s(4+(char *)ValuePtr)); 
                s = 8;
                break;

            case FMT_SRATIONAL: 
                printf("%d/%d",Get32s(ValuePtr), Get32s(4+(char *)ValuePtr)); 
                s = 8;
                break;

            case FMT_SINGLE:    printf("%f",(double)*(float *)ValuePtr); s=8; break;
            case FMT_DOUBLE:    printf("%f",*(double *)ValuePtr);        s=8; break;
            default: 
                printf("Unknown format %d:", Format);
                return;
        }
        ByteCount -= s;
        if (ByteCount <= 0) break;
        printf(", ");
        ValuePtr = (void *)((char *)ValuePtr + s);

    }
    if (n >= 16) printf("...");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
cmpl $0xc, %esi
ja 0x7cb5
movl $0x1f7a, %eax           # imm = 0x1F7A
btl %ebx, %eax
jae 0x7cb5
movl %edx, %ebp
movq %rdi, %r14
decl %ebx
leaq 0x50bd(%rip), %r12      # 0xcbf0
xorl %r15d, %r15d
cmpl $0xa, %ebx
ja 0x7c3f
movslq (%r12,%rbx,4), %rax
addq %r12, %rax
jmpq *%rax
movzbl (%r14), %esi
leaq 0x52a5(%rip), %rdi      # 0xcdf8
xorl %eax, %eax
callq 0x3170
movl $0x1, %r13d
jmp 0x7c58
movq %r14, %rdi
callq 0x7a83
leaq 0x6ab8(%rip), %rdi      # 0xe62c
movl %eax, %esi
xorl %eax, %eax
callq 0x3170
movl $0x4, %r13d
jmp 0x7c58
cmpl $0x0, 0xc98d(%rip)      # 0x1451c
leaq 0x1(%r14), %rax
movq %rax, %rcx
cmoveq %r14, %rcx
cmovneq %r14, %rax
movzbl (%rax), %eax
movzbl (%rcx), %esi
shll $0x18, %eax
shll $0x10, %esi
orl %eax, %esi
sarl $0x10, %esi
leaq 0x5247(%rip), %rdi      # 0xcdfd
jmp 0x7bfd
movq %r14, %rdi
callq 0x7a83
movl %eax, %r13d
leaq 0x4(%r14), %rdi
callq 0x7a83
leaq 0x5234(%rip), %rdi      # 0xce07
jmp 0x7c31
leaq 0x1(%r14), %rax
cmpl $0x0, 0xc93c(%rip)      # 0x1451c
movq %rax, %rcx
cmoveq %r14, %rcx
cmovneq %r14, %rax
movzbl (%rax), %eax
shll $0x8, %eax
movzbl (%rcx), %esi
orl %eax, %esi
leaq 0x6a2f(%rip), %rdi      # 0xe62c
xorl %eax, %eax
callq 0x3170
movl $0x2, %r13d
jmp 0x7c58
xorps %xmm0, %xmm0
cvtss2sd (%r14), %xmm0
jmp 0x7c44
movq %r14, %rdi
callq 0x7a83
movl %eax, %r13d
leaq 0x4(%r14), %rdi
callq 0x7a83
leaq 0x51d0(%rip), %rdi      # 0xce01
movl %r13d, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x3170
jmp 0x7c52
movsd (%r14), %xmm0
leaq 0x4819(%rip), %rdi      # 0xc464
movb $0x1, %al
callq 0x3170
movl $0x8, %r13d
subl %r13d, %ebp
jle 0x7c84
leaq 0x51bc(%rip), %rdi      # 0xce20
xorl %eax, %eax
callq 0x3170
movl %r13d, %eax
addq %rax, %r14
incl %r15d
cmpl $0x10, %r15d
jne 0x7b36
movl $0x10, %r15d
cmpl $0x10, %r15d
jb 0x7ca6
leaq 0x5192(%rip), %rdi      # 0xce23
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3170
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5151(%rip), %rdi      # 0xce0d
movl %ebx, %esi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3170