// File: /workspace/github_c_makefile_star2_O3/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 0x15c3c
movq %rdi, %r12
movq %r8, 0x10(%rsp)
movq %r9, 0x20(%rsp)
testq %rcx, %rcx
je 0x15b5e
orb $-0x80, 0x19(%rcx)
movl $0x1, 0x4c(%rcx)
movzwl %dx, %ebp
movl %ebp, %edi
callq 0xaad8
movq %rax, %rbx
leaq 0x2(%r13), %r15
movq %r12, %rdi
movl $0x4d4d, %esi           # imm = 0x4D4D
movq %r15, %rdx
callq 0x45af
movl %eax, %r14d
leaq 0x2b553(%rip), %rcx     # 0x410dc
movl $0x40000, %edi          # imm = 0x40000
movq %r13, %rsi
movq 0x20(%rsp), %rdx
callq 0x55eb
leaq 0x425de(%rip), %rax     # 0x58180
movq (%rax), %rax
btl $0x12, %eax
movl %r14d, 0x3c(%rsp)
movzwl %r14w, %ecx
movq %rcx, 0x18(%rsp)
movq %rbx, 0x40(%rsp)
jb 0x15c4c
testl $0x4003333, %eax        # imm = 0x4003333
je 0x15c61
leaq 0x2bd85(%rip), %rcx     # 0x41959
movl $0x4003333, %edi        # imm = 0x4003333
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq 0x20(%rsp), %rdx
callq 0x55eb
leaq 0x42591(%rip), %rax     # 0x58180
movq (%rax), %rax
testl $0x3003, %eax           # imm = 0x3003
je 0x15c65
xorl %r14d, %r14d
testb $0x40, %al
je 0x15c16
leaq 0x2f8e4(%rip), %rdi     # 0x454eb
movq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %r14d
leaq 0x2f4c8(%rip), %rdi     # 0x450e5
leaq 0x2dede(%rip), %rsi     # 0x43b02
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
addl %r14d, %ebx
leaq 0x42549(%rip), %rax     # 0x58180
movq (%rax), %rax
jmp 0x15c67
addq $0x2, %r13
xorl %ebx, %ebx
movq %r13, %r15
xorl %edi, %edi
jmp 0x15fdd
leaq 0x2f47d(%rip), %rdi     # 0x450d0
movq %rbx, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x3120
jmp 0x15c8a
xorl %ebx, %ebx
jmp 0x15c8c
xorl %ebx, %ebx
testb $0x30, %al
movq 0x18(%rsp), %rdx
je 0x15c83
leaq 0x2f477(%rip), %rdi     # 0x450ee
movq %r13, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
movl %ebx, %edi
callq 0x1707a
movl %eax, %ebx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r12, %rdi
movl %ebp, %esi
callq 0x50a4
leaq 0x424de(%rip), %rbp     # 0x58180
movq (%rbp), %rcx
btl $0x12, %ecx
jae 0x15cce
testq %rax, %rax
leaq 0x2f6cf(%rip), %rsi     # 0x45385
cmovneq %rax, %rsi
leaq 0x31917(%rip), %rdi     # 0x475d8
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
movq (%rbp), %rcx
movq 0x20(%rsp), %r14
movq 0x18(%rsp), %rdi
btl $0x16, %ecx
movl %ebx, 0x10(%rsp)
jb 0x15f06
btl $0x14, %ecx
setae %al
testl $0x4003333, %ecx        # imm = 0x4003333
sete %cl
orb %al, %cl
jne 0x15f92
movq %r15, 0x28(%rsp)
leaq (%rdi,%r13), %rbp
incq %rbp
movq %r12, %rdi
callq 0x3190
movq %r12, %rdi
movq %rbp, %rsi
callq 0x16313
movl %eax, %r15d
movq %r12, %rdi
callq 0x3190
movq %rax, %rbx
leaq 0x4244e(%rip), %rax     # 0x58180
testb $0x4, 0x2(%rax)
je 0x15d45
movl 0x10(%rsp), %edi
callq 0x1707a
movl %eax, 0x10(%rsp)
cmpq %rbp, %rbx
movq %r13, 0x30(%rsp)
jae 0x15d63
movq %r12, %rdi
movl %r15d, %esi
movq %rbp, %rdx
movl %r14d, %ecx
callq 0x1634b
movl %eax, %r15d
movl 0x10(%rsp), %edi
callq 0x1707a
movl %eax, %ebx
movq %r12, %rdi
callq 0x3190
movq %rax, %r13
leal -0x1(%r15), %eax
cmpl $-0x2, %eax
setb %al
cmpq %rbp, %r13
setb %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x15dca
movq %r12, %rdi
movl %r15d, %esi
movq %rbp, %rdx
movl %r14d, %ecx
callq 0x1634b
movl %eax, %r15d
testl %eax, %eax
je 0x15db1
movl %ebx, %edi
callq 0x1707a
movl %eax, %ebx
movq %r12, %rdi
callq 0x3190
movq %rax, %r13
leal -0x1(%r15), %eax
cmpl $-0x3, %eax
ja 0x15dca
cmpq %rbp, %r13
jb 0x15d90
cmpq %rbp, %r13
jae 0x15ee7
leal 0x2(%r14), %eax
movl %eax, 0x10(%rsp)
movq %r12, %rdi
movq %rbp, %rsi
callq 0x1641b
cmpl $-0x1, %eax
je 0x15ee7
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 0x15eaf
leaq 0x3293d(%rip), %rdi     # 0x4875a
movq %r14, %rsi
xorl %eax, %eax
callq 0x3120
movl %ebx, %ecx
movl %eax, %ebx
addl %ecx, %ebx
leaq 0x435d4(%rip), %rax     # 0x59408
cmpq $0x0, (%rax)
je 0x15ea3
movl %ebx, %edi
movq %rax, %rbx
callq 0x1707a
movq (%rbx), %rcx
movl $0x2, (%rsp)
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
movl $0x10, %r8d
movl 0x10(%rsp), %r9d
callq 0x7480
movl $0x1, %edi
callq 0x1707a
movl %eax, %ebx
movq %r12, %rdi
callq 0x3150
cmpl $-0x1, %eax
je 0x15ff7
movl %eax, %r15d
movq %r12, %rdi
callq 0x3190
cmpq %rbp, %rax
movq 0x20(%rsp), %r14
movq 0x30(%rsp), %r13
jb 0x15ebd
jmp 0x1600a
leaq 0x2f517(%rip), %rdi     # 0x453c1
callq 0x5c26
movl %ebx, %edi
callq 0x1707a
movl %eax, %ebx
movq 0x20(%rsp), %r14
testl %r15d, %r15d
je 0x15ed3
movq %r12, %rdi
movl %r15d, %esi
movq %rbp, %rdx
movl %r14d, %ecx
callq 0x1634b
movq %r12, %rdi
callq 0x3190
movq %rax, %r13
cmpq %rbp, %rax
jb 0x15ddb
movl %ebx, 0x10(%rsp)
movq 0x28(%rsp), %r15
movq 0x30(%rsp), %r13
leaq 0x42284(%rip), %rbp     # 0x58180
movq 0x18(%rsp), %rdi
jmp 0x15f92
movq %r15, %rbx
leaq 0x43508(%rip), %rax     # 0x59418
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 0x15f45
movq %rax, %r15
testq %rax, %rax
jne 0x15f40
leaq 0x434cb(%rip), %rax     # 0x59408
movq (%rax), %r15
testq %r15, %r15
je 0x15f8f
btl $0x12, %ecx
jae 0x15f59
movl 0x10(%rsp), %edi
callq 0x1707a
movq 0x18(%rsp), %rdi
leaq 0x2(%rdi), %rdx
leal 0x2(%r14), %r9d
movl $0x2, (%rsp)
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rcx
movl $0x10, %r8d
callq 0x7480
movl $0x1, %edi
callq 0x1707a
movq 0x18(%rsp), %rdi
movl %eax, 0x10(%rsp)
movq %rbx, %r15
leaq (%rdi,%r13), %rsi
incq %rsi
leaq 0x2b159(%rip), %rcx     # 0x410f9
movl $0x40000, %edi          # imm = 0x40000
movl %r14d, %edx
callq 0x55eb
testb $0x4, 0x2(%rbp)
movl 0x3c(%rsp), %ebx
movq 0x40(%rsp), %rsi
jne 0x15fc2
movl 0x10(%rsp), %edi
jmp 0x15fdd
leaq 0x2bb66(%rip), %rdi     # 0x41b2f
xorl %eax, %eax
callq 0x3120
movl 0x10(%rsp), %edi
addl %eax, %edi
callq 0x1707a
movl %eax, %edi
callq 0x17a82
movzwl %bx, %eax
addq %r15, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ebx, 0x10(%rsp)
movq 0x28(%rsp), %r15
movq 0x20(%rsp), %r14
jmp 0x15ef0
movl %ebx, 0x10(%rsp)
movq 0x28(%rsp), %r15
jmp 0x15ef5