// File: /workspace/github_c_makefile_star2_O3/hfiguiere[P]exifprobe/print.c
// Function: print_header
int
print_header(struct fileheader *header,unsigned long section_id)
{
    int status = -1;
    int chpr = 0;

    if(header)
    {
        switch(header->probe_magic)
        {
        case JPEG_SOI:
            if(Print_options & section_id)
                chpr += printf("JPEG SOI %#06x",header->file_marker);
            status = 0;
            chpr = newline(chpr);
            break;
        case ORF1_MAGIC:
            status = print_tiff_header(ORF1_MAGIC,header->file_marker,section_id);
            /* no newline                                             */
            break;
        case ORF2_MAGIC:
            status = print_tiff_header(ORF2_MAGIC,header->file_marker,section_id);
            /* no newline                                             */
            break;
        case RW2_MAGIC:
            status = print_tiff_header(RW2_MAGIC,header->file_marker,section_id);
            /* no newline                                             */
            break;
        case TIFF_MAGIC:
            status = print_tiff_header(TIFF_MAGIC,header->file_marker,section_id);
            /* no newline                                             */
            break;
        case PROBE_CIFFMAGIC:
            status = print_ciff_header(header,section_id);
            chpr = newline(chpr);
            break;
        case PROBE_JP2MAGIC:
            status = print_jp2_header(header,section_id);
            chpr = newline(chpr);
            break;
        case PROBE_MRWMAGIC:
            status = print_mrw_header(header,section_id);
            chpr = newline(chpr);
            break;
        case PROBE_RAFMAGIC:
            chpr = printf("FUJIFILMCCD-RAW ");
            chpr = newline(chpr);
            break;
        default:
            if(Print_options & section_id)
                chpr += printf("UNKNOWN HEADER MAGIC %#06lx",header->probe_magic);
            chpr = newline(chpr);
            break;
        }
    }
    else
        fprintf(stderr,"%s: null fileheader to print_header()\n",Progname);
    return(status);
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x528e
movq %rsi, %rdx
movq 0x8(%rdi), %rsi
cmpq $0x4f51, %rsi           # imm = 0x4F51
jle 0x51d1
cmpq $0xffd7, %rsi           # imm = 0xFFD7
jle 0x5210
cmpq $0xd0a870a, %rsi        # imm = 0xD0A870A
je 0x5240
cmpq $0x4d524d, %rsi         # imm = 0x4D524D
je 0x5258
cmpq $0xffd8, %rsi           # imm = 0xFFD8
jne 0x526b
leaq 0x52fd3(%rip), %rcx     # 0x58180
xorl %ebx, %ebx
movl $0x0, %eax
testq %rdx, (%rcx)
je 0x51ca
movzwl (%rdi), %esi
leaq 0x3c33d(%rip), %rdi     # 0x41500
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
jmp 0x5264
cmpq $0x54, %rsi
jg 0x51f1
cmpq $0x1a, %rsi
je 0x522c
cmpq $0x2a, %rsi
jne 0x526b
movzwl (%rdi), %esi
movl $0x2a, %edi
jmp 0x5252
cmpq $0x55, %rsi
je 0x5236
cmpq $0x4655, %rsi           # imm = 0x4655
jne 0x526b
leaq 0x3bf91(%rip), %rdi     # 0x41198
xorl %eax, %eax
callq 0x3120
jmp 0x5285
cmpq $0x4f52, %rsi           # imm = 0x4F52
je 0x524a
cmpq $0x5352, %rsi           # imm = 0x5352
jne 0x526b
movzwl (%rdi), %esi
movl $0x5352, %edi           # imm = 0x5352
jmp 0x5252
movq %rdx, %rsi
callq 0x20533
jmp 0x5260
movzwl (%rdi), %esi
movl $0x55, %edi
jmp 0x5252
movq %rdx, %rsi
callq 0x20879
jmp 0x5260
movzwl (%rdi), %esi
movl $0x4f52, %edi           # imm = 0x4F52
popq %rbx
jmp 0x52a0
movq %rdx, %rsi
callq 0x25760
movl %eax, %ebx
xorl %edi, %edi
callq 0x1707a
jmp 0x5298
leaq 0x52f0e(%rip), %rax     # 0x58180
testq %rdx, (%rax)
je 0x529c
leaq 0x3c291(%rip), %rdi     # 0x4150f
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
callq 0x1707a
jmp 0x5293
callq 0x3348
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
retq
xorl %edi, %edi
jmp 0x5287