// File: /workspace/github_c_makefile_star2_O2/hfiguiere[P]exifprobe/process.c
// Function: process_app12
unsigned long
process_app12(FILE *inptr,unsigned long app12_offset,unsigned short tag,
                struct image_summary *summary_entry,char *parent_name,
                int indent)
{
    char *app_string,*name;
    unsigned short app_length = 0;
    unsigned long dumplength = 0UL;
    unsigned long offset = 0UL;
    unsigned long end_offset = 0UL;
    unsigned long size = 0UL;
    int chpr = 0;
    int nextch;

    if(inptr)
    {
        if(summary_entry)
        {
            summary_entry->filesubformat |= FILESUBFMT_APPN;
            summary_entry->filesubformatAPPN[12] = 1;
        }
        name = tagname(tag);    /* never null                         */
        app_length = read_ushort(inptr,TIFF_MOTOROLA,app12_offset + 2);
        print_tag_address(SECTION,app12_offset,indent,"@");
        if(PRINT_SECTION)
            chpr += printf("<%s> %#x length %u, ",name,tag,app_length);
        else if((PRINT_ENTRY))
        {
            /* ###%%% pseudo-tags fpr LIST Mode here */
            print_tag_address(ENTRY,HERE,indent,"*");
            if((PRINT_TAGINFO))
            {
                if((PRINT_LONGNAMES))
                    chpr += printf("%s.",parent_name);
                chpr += printf("%-14.14s","APP12");
            }
            if((PRINT_VALUE))
                chpr += printf(" = @%lu:%-9u",app12_offset,app_length);
            chpr = newline(chpr);
        }
        app_string = read_appstring(inptr,tag,HERE);
        if(PRINT_SECTION)
            chpr += printf("\'%s\'",app_string ? app_string : "NULL ID");

        if(PRINT_APPNDUMP)
        {
            if((Max_appdump == DUMPALL) || (Max_appdump > (app_length + 2)))
                dumplength = app_length + 2;
            else if(Max_appdump > 0L)
                dumplength = Max_appdump;
            else
                dumplength = Max_undefined;
            if(dumplength)
            {
                if(PRINT_SECTION)
                    chpr = newline(chpr);
                hexdump(inptr,app12_offset,app_length + 2,dumplength,16,
                            indent + SMALLINDENT,SMALLINDENT);
                chpr = newline(1);
            }
        }
        else if((PRINT_APPENTRY) && (PRINT_ENTRY))
        {
            /* ###%%% in LIST mode, these should get an "APP12." prefix */
            end_offset = app12_offset + app_length + 1;
            offset = ftell(inptr);
            nextch = skip_past_newline(inptr,end_offset);
            offset = ftell(inptr);
            if(PRINT_SECTION)
                chpr = newline(chpr);
            if(offset < end_offset)
                nextch = putword(inptr,nextch,end_offset,indent);
            chpr = newline(chpr);
            offset = ftell(inptr);
            while(nextch && (nextch != EOF) && (offset < end_offset))
            {
                nextch = putword(inptr,nextch,end_offset,indent);
                if(nextch)
                    chpr = newline(chpr);
                offset = ftell(inptr);
            }
            while(offset < end_offset)
            {
                nextch = skip_to_bracket(inptr,end_offset);
                if(nextch == EOF)
                {
                    break;
                }
                size = ftell(inptr) - offset;
                if(nextch == '[')
                    --size;
                if(size > 1)
                {
                    chpr += printf(" length %lu",size);
                    if(Max_undefined)
                    {
                        chpr = newline(chpr);
                        hexdump(inptr,offset,size, Max_undefined,16,
                                    indent + SMALLINDENT,
                                    SMALLINDENT);
                        chpr = newline(1);
                        nextch = fgetc(inptr);
                        if((nextch == EOF) || (ftell(inptr) >= end_offset))
                            break;
                    }
                    else
                    {
                        printred(" (not dumped; use -U)");
                        chpr = newline(chpr);
                    }
                }
                else
                    chpr = newline(chpr);
                if(nextch)
                    nextch = putword(inptr,nextch,end_offset,indent);
                offset = ftell(inptr);
            }
        }

        print_tag_address(SECTION,app12_offset + app_length + 1,indent,"-");
        if(PRINT_SECTION)
        {
            chpr += printf("</%s>",name);
            chpr = newline(chpr);
        }
    }
    setcharsprinted(chpr);
    return(app12_offset + app_length + 2);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r13
testq %rdi, %rdi
je 0x14dc8
movq %rdi, %r12
movq %r8, 0x28(%rsp)
movq %r9, 0x18(%rsp)
testq %rcx, %rcx
je 0x14ce8
orb $-0x80, 0x19(%rcx)
movl $0x1, 0x4c(%rcx)
movzwl %dx, %ebp
movl %ebp, %edi
callq 0xa1c8
movq %rax, %rbx
leaq 0x2(%r13), %r15
movq %r12, %rdi
movl $0x4d4d, %esi           # imm = 0x4D4D
movq %r15, %rdx
callq 0x416a
movl %eax, %r14d
leaq 0x2a3c9(%rip), %rcx     # 0x3f0dc
movl $0x40000, %edi          # imm = 0x40000
movq %r13, 0x8(%rsp)
movq %r13, %rsi
movq 0x18(%rsp), %rdx
callq 0x5100
leaq 0x4244f(%rip), %rax     # 0x57180
movq (%rax), %rax
btl $0x12, %eax
movl %r14d, 0x34(%rsp)
movzwl %r14w, %ecx
movq %rcx, 0x10(%rsp)
jb 0x14dd8
movq %rbx, %r13
testl $0x4003333, %eax        # imm = 0x4003333
je 0x14df0
leaq 0x2abf8(%rip), %rcx     # 0x3f959
movl $0x4003333, %edi        # imm = 0x4003333
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq 0x18(%rsp), %rdx
callq 0x5100
leaq 0x42404(%rip), %rax     # 0x57180
movq (%rax), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x14df4
xorl %r14d, %r14d
testb $0x40, %al
je 0x14da2
leaq 0x2e714(%rip), %rdi     # 0x434a7
movq 0x28(%rsp), %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %r14d
leaq 0x2e2f8(%rip), %rdi     # 0x430a1
leaq 0x2cd52(%rip), %rsi     # 0x41b02
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
addl %r14d, %ebx
leaq 0x423bd(%rip), %rax     # 0x57180
movq (%rax), %rax
jmp 0x14df6
addq $0x2, %r13
xorl %ebx, %ebx
movq %r13, %r15
xorl %edi, %edi
jmp 0x15159
leaq 0x2e2ad(%rip), %rdi     # 0x4308c
movq %rbx, %r13
movq %rbx, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x3120
jmp 0x14e1b
xorl %ebx, %ebx
jmp 0x14e1d
xorl %ebx, %ebx
testb $0x30, %al
movq 0x10(%rsp), %rdx
je 0x14e14
leaq 0x2e2a4(%rip), %rdi     # 0x430aa
movq 0x8(%rsp), %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
movl %ebx, %edi
callq 0x160f7
movl %eax, %ebx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r12, %rdi
movl %ebp, %esi
callq 0x4c1f
leaq 0x4234d(%rip), %rbp     # 0x57180
movq (%rbp), %rcx
btl $0x12, %ecx
jae 0x14e5f
testq %rax, %rax
leaq 0x2e4fa(%rip), %rsi     # 0x43341
cmovneq %rax, %rsi
leaq 0x30736(%rip), %rdi     # 0x45588
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
movq (%rbp), %rcx
movq 0x18(%rsp), %r14
movq 0x10(%rsp), %rdi
btl $0x16, %ecx
movq %r13, 0x40(%rsp)
movl %ebx, %r13d
jb 0x14f3d
btl $0x14, %ecx
setae %al
testl $0x4003333, %ecx        # imm = 0x4003333
sete %cl
orb %al, %cl
jne 0x1510a
movq %r15, 0x20(%rsp)
movq 0x8(%rsp), %rax
leaq (%rax,%rdi), %rbp
incq %rbp
movq %r12, %rdi
callq 0x3190
movq %r12, %rdi
movq %rbp, %rsi
callq 0x15479
movl %eax, %r15d
movq %r12, %rdi
callq 0x3190
movq %rax, %rbx
leaq 0x422b4(%rip), %rax     # 0x57180
testb $0x4, 0x2(%rax)
je 0x14edd
movl %r13d, %edi
callq 0x160f7
movl %eax, %r13d
cmpq %rbp, %rbx
jae 0x14ef6
movq %r12, %rdi
movl %r15d, %esi
movq %rbp, %rdx
movl %r14d, %ecx
callq 0x154b1
movl %eax, %r15d
movl %r13d, %ebx
movl %ebx, %edi
callq 0x160f7
movl %eax, %ebx
movq %r12, %rdi
callq 0x3190
movq %rax, %r13
leal -0x1(%r15), %eax
cmpl $-0x3, %eax
ja 0x14fd1
cmpq %rbp, %r13
jae 0x14fd1
movq %r12, %rdi
movl %r15d, %esi
movq %rbp, %rdx
movl %r14d, %ecx
callq 0x154b1
movl %eax, %r15d
testl %eax, %eax
je 0x14f02
jmp 0x14ef9
movq %r15, %rbx
leaq 0x434d1(%rip), %rax     # 0x58418
movq (%rax), %rax
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpq %rdx, %rax
sete %dl
leaq 0x2(%rdi), %r15
cmpq %r15, %rax
seta %sil
orb %dl, %sil
jne 0x14f80
movq %rax, %r15
testq %rax, %rax
jne 0x14f77
leaq 0x43494(%rip), %rax     # 0x58408
movq (%rax), %r15
testq %r15, %r15
je 0x15107
btl $0x12, %ecx
jae 0x14f93
movl %r13d, %edi
callq 0x160f7
movq 0x10(%rsp), %rdi
leaq 0x2(%rdi), %rdx
leal 0x2(%r14), %r9d
movl $0x2, (%rsp)
pushq $0x10
popq %r8
movq %r12, %rdi
movq 0x8(%rsp), %r12
movq %r12, %rsi
movq %r15, %rcx
callq 0x6e93
pushq $0x1
popq %rdi
callq 0x160f7
movq 0x10(%rsp), %rdi
movl %eax, %r13d
movq %rbx, %r15
jmp 0x1510f
leal 0x2(%r14), %eax
movl %eax, 0x28(%rsp)
movq %r12, 0x38(%rsp)
cmpq %rbp, %r13
jae 0x150ec
movq %r12, %rdi
movq %rbp, %rsi
callq 0x15582
cmpl $-0x1, %eax
je 0x150ec
movl %eax, %r15d
movq %r12, %rdi
callq 0x3190
movq %rax, %r14
subq %r13, %r14
xorl %eax, %eax
cmpl $0x5b, %r15d
sete %al
subq %rax, %r14
cmpq $0x2, %r14
jb 0x150b8
leaq 0x316e1(%rip), %rdi     # 0x4670a
movq %r14, %rsi
xorl %eax, %eax
callq 0x3120
movl %ebx, %ecx
movl %eax, %ebx
addl %ecx, %ebx
leaq 0x433c8(%rip), %r12     # 0x58408
cmpq $0x0, (%r12)
je 0x150a7
movl %ebx, %edi
callq 0x160f7
movq (%r12), %rcx
movl $0x2, (%rsp)
movq 0x38(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
pushq $0x10
popq %r8
movl 0x28(%rsp), %r9d
callq 0x6e93
pushq $0x1
popq %rdi
callq 0x160f7
movl %eax, %ebx
movq %r12, %rdi
callq 0x3150
cmpl $-0x1, %eax
je 0x15173
movl %eax, %r15d
movq %r12, %rdi
callq 0x3190
cmpq %rbp, %rax
movq 0x18(%rsp), %r14
jb 0x150c6
jmp 0x150ec
leaq 0x2e2cf(%rip), %rdi     # 0x4337d
callq 0x56e2
movq 0x38(%rsp), %r12
movl %ebx, %edi
callq 0x160f7
movl %eax, %ebx
movq 0x18(%rsp), %r14
testl %r15d, %r15d
je 0x150dc
movq %r12, %rdi
movl %r15d, %esi
movq %rbp, %rdx
movl %r14d, %ecx
callq 0x154b1
movq %r12, %rdi
callq 0x3190
movq %rax, %r13
jmp 0x14fde
movl %ebx, %r13d
movq 0x20(%rsp), %r15
movq 0x8(%rsp), %r12
leaq 0x42080(%rip), %rbp     # 0x57180
movq 0x10(%rsp), %rdi
jmp 0x1510f
movq %rbx, %r15
movq 0x8(%rsp), %r12
leaq (%r12,%rdi), %rsi
incq %rsi
leaq 0x29fdc(%rip), %rcx     # 0x3f0f9
movl $0x40000, %edi          # imm = 0x40000
movl %r14d, %edx
callq 0x5100
testb $0x4, 0x2(%rbp)
movl 0x34(%rsp), %ebx
jne 0x15139
movl %r13d, %edi
jmp 0x15159
leaq 0x2a9ef(%rip), %rdi     # 0x3fb2f
movq 0x40(%rsp), %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movl %r13d, %edi
callq 0x160f7
movl %eax, %edi
callq 0x16a4f
movzwl %bx, %eax
addq %r15, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ebx, %r13d
movq 0x20(%rsp), %r15
movq 0x18(%rsp), %r14
jmp 0x150f4