// File: /workspace/github_c_makefile_star2_O1/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 0x52ce
movq %rsi, %rdx
movq 0x8(%rdi), %rsi
cmpq $0x4f51, %rsi           # imm = 0x4F51
jle 0x5211
cmpq $0xffd7, %rsi           # imm = 0xFFD7
jle 0x5250
cmpq $0xd0a870a, %rsi        # imm = 0xD0A870A
je 0x5280
cmpq $0x4d524d, %rsi         # imm = 0x4D524D
je 0x5298
cmpq $0xffd8, %rsi           # imm = 0xFFD8
jne 0x52ab
leaq 0x52f93(%rip), %rcx     # 0x58180
xorl %ebx, %ebx
movl $0x0, %eax
testq %rdx, (%rcx)
je 0x520a
movzwl (%rdi), %esi
leaq 0x3c2fd(%rip), %rdi     # 0x41500
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
jmp 0x52a4
cmpq $0x54, %rsi
jg 0x5231
cmpq $0x1a, %rsi
je 0x526c
cmpq $0x2a, %rsi
jne 0x52ab
movzwl (%rdi), %esi
movl $0x2a, %edi
jmp 0x5292
cmpq $0x55, %rsi
je 0x5276
cmpq $0x4655, %rsi           # imm = 0x4655
jne 0x52ab
leaq 0x3bf51(%rip), %rdi     # 0x41198
xorl %eax, %eax
callq 0x3120
jmp 0x52c5
cmpq $0x4f52, %rsi           # imm = 0x4F52
je 0x528a
cmpq $0x5352, %rsi           # imm = 0x5352
jne 0x52ab
movzwl (%rdi), %esi
movl $0x5352, %edi           # imm = 0x5352
jmp 0x5292
movq %rdx, %rsi
callq 0x1ff70
jmp 0x52a0
movzwl (%rdi), %esi
movl $0x55, %edi
jmp 0x5292
movq %rdx, %rsi
callq 0x202b5
jmp 0x52a0
movzwl (%rdi), %esi
movl $0x4f52, %edi           # imm = 0x4F52
popq %rbx
jmp 0x52e0
movq %rdx, %rsi
callq 0x25098
movl %eax, %ebx
xorl %edi, %edi
callq 0x16b56
jmp 0x52d8
leaq 0x52ece(%rip), %rax     # 0x58180
testq %rdx, (%rax)
je 0x52dc
leaq 0x3c251(%rip), %rdi     # 0x4150f
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
callq 0x16b56
jmp 0x52d3
callq 0x3348
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
retq
xorl %edi, %edi
jmp 0x52c7