// File: /workspace/github_c_makefile_star2_O1/hfiguiere[P]exifprobe/print_maker.c
// Function: print_scheme
void
print_scheme(FILE *inptr,struct maker_scheme *maker_scheme)
{
    int chpr = 0;

    PUSHCOLOR(HI_BLACK);
    chpr = newline(1);
    chpr += printf("MakerNote Scheme:");
    chpr += printf(" (at offset %lu, length %lu)",maker_scheme->note_fileoffset,
                maker_scheme->note_length);
    chpr = newline(chpr);
    chpr += printf("\tScheme Type = ");
    switch(maker_scheme->scheme_type)
    {
        case PLAIN_IFD_SCHEME:
            chpr += printf("\"Plain IFD\" (%#lx) at offset %lu",maker_scheme->scheme_type,
                        maker_scheme->note_fileoffset);
            chpr = newline(chpr);
            break;
        case HAS_ID_SCHEME:
            chpr += printf("\"ID\" (%#lx)\n",maker_scheme->scheme_type);
            chpr += printf("\tID = \"%s\";",maker_scheme->id[0] ? maker_scheme->id : "(NONE)");
            chpr += printf(" length = %d, at offset %lu\n",maker_scheme->id_length,
                        maker_scheme->note_fileoffset);
            chpr += printf("\tIFD is offset %d from start of section",maker_scheme->ifd_offset);
            chpr = newline(chpr);
            break;
        case HAS_ID_PLUS_TIFFHDR_SCHEME:
            chpr += printf("\"ID plus TIFF header\" (%#lx)\n",maker_scheme->scheme_type);
            chpr += printf("\tID = \"%s\";",maker_scheme->id[0] ? maker_scheme->id : "(NONE)");
            chpr += printf("\tlength = %d, at offset %lu\n",maker_scheme->id_length,
                        maker_scheme->note_fileoffset);
            chpr += printf("\tTIFF header is offset %d from start of section\n",maker_scheme->tiffhdr_offset);
            chpr += printf("\tIFD is offset %d from start of TIFF header",maker_scheme->ifd_offset);
            chpr = newline(chpr);
            break;
        case UNKNOWN_SCHEME:
        default:
            chpr += printf("\"UNKNOWN\" (%#lx)\n",maker_scheme->scheme_type);
            chpr += printf("\tID = \"%s\";",maker_scheme->id[0] ? maker_scheme->id : "(NONE)");
            chpr += printf(" length = %d, at offset %lu",maker_scheme->id_length,
                        maker_scheme->note_fileoffset);
            chpr = newline(chpr);
            break;
    }
    if(maker_scheme->note_byteorder &&
            (maker_scheme->note_byteorder != maker_scheme->tiff_byteorder))
        PUSHCOLOR(HI_RED);

    chpr += printf("\tNote byteorder = ");
    print_byteorder(maker_scheme->note_byteorder,2);
    if(maker_scheme->note_byteorder &&
            (maker_scheme->note_byteorder != maker_scheme->tiff_byteorder))
    {
        chpr += printf(" != ");
        POPCOLOR();
    }
    else
    {
        chpr = newline(chpr);
        chpr += printf("\t");
    }
    chpr += printf("Tiff byteorder = ");
    print_byteorder(maker_scheme->tiff_byteorder,2);
    chpr += newline(chpr);
    switch(maker_scheme->offsets_relative_to)
    {
        case START_OF_TIFFHEADER:
                    chpr += printf("\tOffsets relative to TIFF header at offset %lu",
                                maker_scheme->fileoffset_base);
                    chpr = newline(chpr);
                    break;
        case START_OF_NOTE:
                    PUSHCOLOR(HI_RED);
                    chpr += printf("\tOffsets relative to start of MakerNote");
                    POPCOLOR();
                    chpr += printf(" at offset %lu",maker_scheme->note_fileoffset);
                    chpr += newline(1);
                    break;
        case START_OF_ENTRY:
                    PUSHCOLOR(HI_RED);
                    chpr += printf("\tOffsets relative to start of entry");
                    POPCOLOR();
                    chpr += newline(1);
                    break;
        default: chpr += printf("(UNKNOWN)\n");
                    break;
    }
    chpr += printf("\tNumber of entries = %d",maker_scheme->num_entries);
    chpr = newline(chpr);
    if((maker_scheme->scheme_type != UNKNOWN_SCHEME) && maker_scheme->no_nextifd_offset)
    {
        putchar('\t'); ++chpr;
        PUSHCOLOR(HI_RED);
        chpr += printf("No next IFD offset");
        POPCOLOR();
        chpr += newline(1);
    }
    if(Make_name)
    {
        putchar('\t'); ++chpr;
        chpr += printf("Make = \"%s\"",Make_name);
        chpr += printf("  (maker id = %d)",maker_scheme->make);
        chpr = newline(1);
    }
    if(Model_name)
    {
        putchar('\t'); ++chpr;
        chpr += printf("Model = \"%s\"",Model_name);
        chpr += printf("  (model id = %d)",maker_scheme->model);
        chpr = newline(1);
    }
    if(Software_name)
    {
        putchar('\t'); ++chpr;
        chpr += printf("Software = \"%s\"",Software_name);
        chpr = newline(1);
    }
    putchar('\t'); ++chpr;
    chpr += printf("Note version = %d (tagset = %d)",maker_scheme->note_version,maker_scheme->tagset);

    POPCOLOR();
    chpr = newline(chpr);
    chpr = newline(1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl $0x1, %edi
callq 0x16b56
movl %eax, %ebp
leaq 0x2d344(%rip), %rdi     # 0x46897
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
leaq 0x2d33e(%rip), %rdi     # 0x468a9
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl %ebp, %edi
callq 0x16b56
movl %eax, %r14d
leaq 0x2d341(%rip), %rdi     # 0x468c6
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
addl %r14d, %ebp
movq (%rbx), %rsi
cmpq $0x4, %rsi
je 0x19639
cmpq $0x2, %rsi
je 0x195ca
cmpq $0x1, %rsi
jne 0x196b9
movq 0x8(%rbx), %rdx
leaq 0x2d31d(%rip), %rdi     # 0x468d6
movl $0x1, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x19707
leaq 0x2d326(%rip), %rdi     # 0x468f7
movl $0x2, %esi
xorl %eax, %eax
callq 0x3120
movl %eax, %r14d
addl %ebp, %r14d
movq 0x18(%rbx), %rax
cmpb $0x0, (%rax)
leaq 0x2d31f(%rip), %rsi     # 0x46910
cmovneq %rax, %rsi
leaq 0x2d308(%rip), %rdi     # 0x46904
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
movl 0x20(%rbx), %esi
movq 0x8(%rbx), %rdx
leaq 0x2d304(%rip), %rdi     # 0x46917
xorl %eax, %eax
callq 0x3120
movl %eax, %r15d
addl %r14d, %r15d
movl 0x28(%rbx), %esi
leaq 0x2d30a(%rip), %rdi     # 0x46934
xorl %eax, %eax
callq 0x3120
addl %r15d, %eax
jmp 0x19707
leaq 0x2d31c(%rip), %rdi     # 0x4695c
movl $0x4, %esi
xorl %eax, %eax
callq 0x3120
movl %eax, %r14d
addl %ebp, %r14d
movq 0x18(%rbx), %rax
cmpb $0x0, (%rax)
leaq 0x2d2b0(%rip), %rsi     # 0x46910
cmovneq %rax, %rsi
leaq 0x2d299(%rip), %rdi     # 0x46904
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
movl 0x20(%rbx), %esi
movq 0x8(%rbx), %rdx
leaq 0x2d2f8(%rip), %rdi     # 0x4697a
xorl %eax, %eax
callq 0x3120
movl %eax, %r15d
addl %r14d, %r15d
movl 0x24(%rbx), %esi
leaq 0x2d2fe(%rip), %rdi     # 0x46997
xorl %eax, %eax
callq 0x3120
movl %eax, %r14d
addl %r15d, %r14d
movl 0x28(%rbx), %esi
leaq 0x2d318(%rip), %rdi     # 0x469c8
xorl %eax, %eax
callq 0x3120
jmp 0x19704
leaq 0x2d334(%rip), %rdi     # 0x469f4
xorl %eax, %eax
callq 0x3120
movl %eax, %r14d
addl %ebp, %r14d
movq 0x18(%rbx), %rax
cmpb $0x0, (%rax)
leaq 0x2d235(%rip), %rsi     # 0x46910
cmovneq %rax, %rsi
leaq 0x2d21e(%rip), %rdi     # 0x46904
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
movl 0x20(%rbx), %esi
movq 0x8(%rbx), %rdx
leaq 0x2d309(%rip), %rdi     # 0x46a06
xorl %eax, %eax
callq 0x3120
addl %r14d, %eax
addl %ebp, %eax
movl %eax, %edi
callq 0x16b56
movl %eax, %r14d
leaq 0x2d308(%rip), %rdi     # 0x46a22
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
addl %r14d, %ebp
movzwl 0x52(%rbx), %edi
movl $0x2, %esi
callq 0x53d5
movzwl 0x52(%rbx), %eax
testw %ax, %ax
je 0x19743
cmpw 0x50(%rbx), %ax
jne 0x19755
movl %ebp, %edi
callq 0x16b56
movl %eax, %ebp
leaq 0x2e542(%rip), %rdi     # 0x47c95
jmp 0x1975c
leaq 0x2d2d9(%rip), %rdi     # 0x46a35
xorl %eax, %eax
callq 0x3120
movl %eax, %r14d
leaq 0x2d2cd(%rip), %rdi     # 0x46a3a
xorl %eax, %eax
callq 0x3120
movl %eax, %r15d
addl %r14d, %r15d
addl %ebp, %r15d
movzwl 0x50(%rbx), %edi
movl $0x2, %esi
callq 0x53d5
movl %r15d, %edi
callq 0x16b56
movl %eax, %ebp
addl %r15d, %ebp
movl 0x30(%rbx), %eax
cmpl $0x2, %eax
je 0x197f4
cmpl $0x1, %eax
je 0x197c9
testl %eax, %eax
jne 0x19817
movq 0x48(%rbx), %rsi
leaq 0x2d298(%rip), %rdi     # 0x46a4c
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl %ebp, %edi
callq 0x16b56
movl %eax, %r14d
jmp 0x1982b
leaq 0x2d2ab(%rip), %rdi     # 0x46a7b
xorl %eax, %eax
callq 0x3120
movl %eax, %r14d
movq 0x8(%rbx), %rsi
leaq 0x2d103(%rip), %rdi     # 0x468e8
xorl %eax, %eax
callq 0x3120
movl %eax, %r15d
addl %r14d, %r15d
jmp 0x19805
leaq 0x2d2a8(%rip), %rdi     # 0x46aa3
xorl %eax, %eax
callq 0x3120
movl %eax, %r15d
movl $0x1, %edi
callq 0x16b56
movl %eax, %r14d
addl %r15d, %r14d
jmp 0x19828
leaq 0x2d2a9(%rip), %rdi     # 0x46ac7
xorl %eax, %eax
callq 0x3120
movl %eax, %r14d
addl %ebp, %r14d
movl 0x2c(%rbx), %esi
leaq 0x2d29d(%rip), %rdi     # 0x46ad2
xorl %eax, %eax
callq 0x3120
addl %eax, %r14d
movl %r14d, %edi
callq 0x16b56
movl %eax, %r14d
cmpq $0x0, (%rbx)
je 0x19881
cmpl $0x0, 0x34(%rbx)
je 0x19881
movl $0x9, %edi
callq 0x3060
leaq 0x2d283(%rip), %rdi     # 0x46aea
xorl %eax, %eax
callq 0x3120
addl %eax, %r14d
movl $0x1, %edi
callq 0x16b56
addl %eax, %r14d
incl %r14d
leaq 0x3fba8(%rip), %r15     # 0x59430
cmpq $0x0, (%r15)
je 0x198c7
movl $0x9, %edi
callq 0x3060
movq (%r15), %rsi
leaq 0x2d25b(%rip), %rdi     # 0x46afd
xorl %eax, %eax
callq 0x3120
movl 0x38(%rbx), %esi
leaq 0x2d256(%rip), %rdi     # 0x46b09
xorl %eax, %eax
callq 0x3120
movl $0x1, %edi
callq 0x16b56
movl %eax, %r14d
leaq 0x3fb6a(%rip), %r15     # 0x59438
cmpq $0x0, (%r15)
je 0x1990d
movl $0x9, %edi
callq 0x3060
movq (%r15), %rsi
leaq 0x2d233(%rip), %rdi     # 0x46b1b
xorl %eax, %eax
callq 0x3120
movl 0x3c(%rbx), %esi
leaq 0x2d22f(%rip), %rdi     # 0x46b28
xorl %eax, %eax
callq 0x3120
movl $0x1, %edi
callq 0x16b56
movl %eax, %r14d
leaq 0x3fb2c(%rip), %r15     # 0x59440
cmpq $0x0, (%r15)
je 0x19942
movl $0x9, %edi
callq 0x3060
movq (%r15), %rsi
leaq 0x2d20c(%rip), %rdi     # 0x46b3a
xorl %eax, %eax
callq 0x3120
movl $0x1, %edi
callq 0x16b56
movl %eax, %r14d
movl $0x9, %edi
callq 0x3060
movl 0x40(%rbx), %esi
movl 0x44(%rbx), %edx
leaq 0x2d1f1(%rip), %rdi     # 0x46b4a
xorl %eax, %eax
callq 0x3120
leal (%r14,%rax), %edi
incl %edi
callq 0x16b56
movl $0x1, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x16b56