// File: /workspace/github_c_makefile_star2_O2/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 0x4de6
movq %rsi, %rdx
movq 0x8(%rdi), %rsi
cmpq $0x1a, %rsi
je 0x4d89
cmpq $0x2a, %rsi
je 0x4db7
cmpq $0x55, %rsi
je 0x4db0
cmpq $0x4655, %rsi           # imm = 0x4655
je 0x4d65
cmpq $0x4f52, %rsi           # imm = 0x4F52
je 0x4d7f
cmpq $0x5352, %rsi           # imm = 0x5352
je 0x4da6
cmpq $0xd0a870a, %rsi        # imm = 0xD0A870A
je 0x4d93
cmpq $0x4d524d, %rsi         # imm = 0x4D524D
je 0x4d75
cmpq $0xffd8, %rsi           # imm = 0xFFD8
jne 0x4dc3
leaq 0x5243c(%rip), %rcx     # 0x57180
xorl %ebx, %ebx
movl $0x0, %eax
testq %rdx, (%rcx)
je 0x4d61
movzwl (%rdi), %esi
leaq 0x3a7a6(%rip), %rdi     # 0x3f500
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
jmp 0x4d9f
leaq 0x3a42c(%rip), %rdi     # 0x3f198
xorl %eax, %eax
callq 0x3120
jmp 0x4ddd
movq %rdx, %rsi
callq 0x24304
jmp 0x4d9b
movzwl (%rdi), %esi
movl $0x4f52, %edi           # imm = 0x4F52
jmp 0x4dbd
movq %rdx, %rsi
callq 0x1f25d
jmp 0x4d9b
movq %rdx, %rsi
callq 0x1f5c5
movl %eax, %ebx
xorl %edi, %edi
callq 0x160f7
jmp 0x4e0b
movzwl (%rdi), %esi
movl $0x5352, %edi           # imm = 0x5352
jmp 0x4dbd
movzwl (%rdi), %esi
pushq $0x55
jmp 0x4dbc
movzwl (%rdi), %esi
pushq $0x2a
popq %rdi
popq %rbx
jmp 0x4e13
leaq 0x523b6(%rip), %rax     # 0x57180
testq %rdx, (%rax)
je 0x4e0f
leaq 0x3a739(%rip), %rdi     # 0x3f50f
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
callq 0x160f7
jmp 0x4e08
movq 0x5220b(%rip), %rax     # 0x56ff8
movq (%rax), %rdi
leaq 0x53671(%rip), %rax     # 0x58468
movq (%rax), %rdx
leaq 0x3a72a(%rip), %rsi     # 0x3f52b
xorl %eax, %eax
callq 0x3180
pushq $-0x1
popq %rbx
movl %ebx, %eax
popq %rbx
retq
xorl %edi, %edi
jmp 0x4ddf