// File: /workspace/github_c_makefile_star2_O3/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 0x1707a
movl %eax, %ebp
leaq 0x2ce3a(%rip), %rdi     # 0x468d7
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
leaq 0x2ce34(%rip), %rdi     # 0x468e9
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl %ebp, %edi
callq 0x1707a
movl %eax, %r14d
leaq 0x2ce37(%rip), %rdi     # 0x46906
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
addl %r14d, %ebp
movq (%rbx), %rsi
cmpq $0x4, %rsi
je 0x19b83
cmpq $0x2, %rsi
je 0x19b14
cmpq $0x1, %rsi
jne 0x19c03
movq 0x8(%rbx), %rdx
leaq 0x2ce13(%rip), %rdi     # 0x46916
movl $0x1, %esi
xorl %eax, %eax
callq 0x3120
jmp 0x19c51
leaq 0x2ce1c(%rip), %rdi     # 0x46937
movl $0x2, %esi
xorl %eax, %eax
callq 0x3120
movl %eax, %r14d
addl %ebp, %r14d
movq 0x18(%rbx), %rax
cmpb $0x0, (%rax)
leaq 0x2ce15(%rip), %rsi     # 0x46950
cmovneq %rax, %rsi
leaq 0x2cdfe(%rip), %rdi     # 0x46944
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
movl 0x20(%rbx), %esi
movq 0x8(%rbx), %rdx
leaq 0x2cdfa(%rip), %rdi     # 0x46957
xorl %eax, %eax
callq 0x3120
movl %eax, %r15d
addl %r14d, %r15d
movl 0x28(%rbx), %esi
leaq 0x2ce00(%rip), %rdi     # 0x46974
xorl %eax, %eax
callq 0x3120
addl %r15d, %eax
jmp 0x19c51
leaq 0x2ce12(%rip), %rdi     # 0x4699c
movl $0x4, %esi
xorl %eax, %eax
callq 0x3120
movl %eax, %r14d
addl %ebp, %r14d
movq 0x18(%rbx), %rax
cmpb $0x0, (%rax)
leaq 0x2cda6(%rip), %rsi     # 0x46950
cmovneq %rax, %rsi
leaq 0x2cd8f(%rip), %rdi     # 0x46944
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
movl 0x20(%rbx), %esi
movq 0x8(%rbx), %rdx
leaq 0x2cdee(%rip), %rdi     # 0x469ba
xorl %eax, %eax
callq 0x3120
movl %eax, %r15d
addl %r14d, %r15d
movl 0x24(%rbx), %esi
leaq 0x2cdf4(%rip), %rdi     # 0x469d7
xorl %eax, %eax
callq 0x3120
movl %eax, %r14d
addl %r15d, %r14d
movl 0x28(%rbx), %esi
leaq 0x2ce0e(%rip), %rdi     # 0x46a08
xorl %eax, %eax
callq 0x3120
jmp 0x19c4e
leaq 0x2ce2a(%rip), %rdi     # 0x46a34
xorl %eax, %eax
callq 0x3120
movl %eax, %r14d
addl %ebp, %r14d
movq 0x18(%rbx), %rax
cmpb $0x0, (%rax)
leaq 0x2cd2b(%rip), %rsi     # 0x46950
cmovneq %rax, %rsi
leaq 0x2cd14(%rip), %rdi     # 0x46944
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
movl 0x20(%rbx), %esi
movq 0x8(%rbx), %rdx
leaq 0x2cdff(%rip), %rdi     # 0x46a46
xorl %eax, %eax
callq 0x3120
addl %r14d, %eax
addl %ebp, %eax
movl %eax, %edi
callq 0x1707a
movl %eax, %r14d
leaq 0x2cdfe(%rip), %rdi     # 0x46a62
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
addl %r14d, %ebp
movzwl 0x52(%rbx), %edi
movl $0x2, %esi
callq 0x538a
movzwl 0x52(%rbx), %eax
testw %ax, %ax
je 0x19c8d
cmpw 0x50(%rbx), %ax
jne 0x19c9f
movl %ebp, %edi
callq 0x1707a
movl %eax, %ebp
leaq 0x2e038(%rip), %rdi     # 0x47cd5
jmp 0x19ca6
leaq 0x2cdcf(%rip), %rdi     # 0x46a75
xorl %eax, %eax
callq 0x3120
movl %eax, %r14d
leaq 0x2cdc3(%rip), %rdi     # 0x46a7a
xorl %eax, %eax
callq 0x3120
movl %eax, %r15d
addl %r14d, %r15d
addl %ebp, %r15d
movzwl 0x50(%rbx), %edi
movl $0x2, %esi
callq 0x538a
movl %r15d, %edi
callq 0x1707a
movl %eax, %ebp
addl %r15d, %ebp
movl 0x30(%rbx), %eax
cmpl $0x2, %eax
je 0x19d3e
cmpl $0x1, %eax
je 0x19d13
testl %eax, %eax
jne 0x19d61
movq 0x48(%rbx), %rsi
leaq 0x2cd8e(%rip), %rdi     # 0x46a8c
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl %ebp, %edi
callq 0x1707a
movl %eax, %r14d
jmp 0x19d75
leaq 0x2cda1(%rip), %rdi     # 0x46abb
xorl %eax, %eax
callq 0x3120
movl %eax, %r14d
movq 0x8(%rbx), %rsi
leaq 0x2cbf9(%rip), %rdi     # 0x46928
xorl %eax, %eax
callq 0x3120
movl %eax, %r15d
addl %r14d, %r15d
jmp 0x19d4f
leaq 0x2cd9e(%rip), %rdi     # 0x46ae3
xorl %eax, %eax
callq 0x3120
movl %eax, %r15d
movl $0x1, %edi
callq 0x1707a
movl %eax, %r14d
addl %r15d, %r14d
jmp 0x19d72
leaq 0x2cd9f(%rip), %rdi     # 0x46b07
xorl %eax, %eax
callq 0x3120
movl %eax, %r14d
addl %ebp, %r14d
movl 0x2c(%rbx), %esi
leaq 0x2cd93(%rip), %rdi     # 0x46b12
xorl %eax, %eax
callq 0x3120
addl %eax, %r14d
movl %r14d, %edi
callq 0x1707a
movl %eax, %r14d
cmpq $0x0, (%rbx)
je 0x19dcb
cmpl $0x0, 0x34(%rbx)
je 0x19dcb
movl $0x9, %edi
callq 0x3060
leaq 0x2cd79(%rip), %rdi     # 0x46b2a
xorl %eax, %eax
callq 0x3120
addl %eax, %r14d
movl $0x1, %edi
callq 0x1707a
addl %eax, %r14d
incl %r14d
leaq 0x3f65e(%rip), %r15     # 0x59430
cmpq $0x0, (%r15)
je 0x19e11
movl $0x9, %edi
callq 0x3060
movq (%r15), %rsi
leaq 0x2cd51(%rip), %rdi     # 0x46b3d
xorl %eax, %eax
callq 0x3120
movl 0x38(%rbx), %esi
leaq 0x2cd4c(%rip), %rdi     # 0x46b49
xorl %eax, %eax
callq 0x3120
movl $0x1, %edi
callq 0x1707a
movl %eax, %r14d
leaq 0x3f620(%rip), %r15     # 0x59438
cmpq $0x0, (%r15)
je 0x19e57
movl $0x9, %edi
callq 0x3060
movq (%r15), %rsi
leaq 0x2cd29(%rip), %rdi     # 0x46b5b
xorl %eax, %eax
callq 0x3120
movl 0x3c(%rbx), %esi
leaq 0x2cd25(%rip), %rdi     # 0x46b68
xorl %eax, %eax
callq 0x3120
movl $0x1, %edi
callq 0x1707a
movl %eax, %r14d
leaq 0x3f5e2(%rip), %r15     # 0x59440
cmpq $0x0, (%r15)
je 0x19e8c
movl $0x9, %edi
callq 0x3060
movq (%r15), %rsi
leaq 0x2cd02(%rip), %rdi     # 0x46b7a
xorl %eax, %eax
callq 0x3120
movl $0x1, %edi
callq 0x1707a
movl %eax, %r14d
movl $0x9, %edi
callq 0x3060
movl 0x40(%rbx), %esi
movl 0x44(%rbx), %edx
leaq 0x2cce7(%rip), %rdi     # 0x46b8a
xorl %eax, %eax
callq 0x3120
leal (%r14,%rax), %edi
incl %edi
callq 0x1707a
movl $0x1, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1707a