// File: /workspace/github_c_makefile_star2_O2/hfiguiere[P]exifprobe/process.c
// Function: process_appn
unsigned long
process_appn(FILE *inptr,unsigned long appn_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 = 0L;
    int chpr = 0;
    int tagwidth = 13;

    if(inptr)
    {
        if(summary_entry)
        {
            summary_entry->filesubformat |= FILESUBFMT_APPN;
            summary_entry->filesubformatAPPN[tag & 0xf] = 1;
        }
        name = tagname(tag);    /* never null                         */
        app_length = read_ushort(inptr,TIFF_MOTOROLA,appn_offset + 2);
        print_tag_address(SECTION,appn_offset,indent,"@");
        if(PRINT_SECTION)
            chpr += printf("<%s> %#x length %u, ",name,tag,app_length);
        app_string = read_appstring(inptr,tag,HERE);
        if(PRINT_SECTION)
            chpr += printf("%s",app_string ? app_string : "NULL ID");
        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);
                tagwidth = 13;
                if((tag & 0xf) > 9)
                    --tagwidth;
                chpr += printf("%-*.*s%d",tagwidth,tagwidth,"APP",tag & 0xf);
            }
            if((PRINT_VALUE))
                chpr += printf(" = @%lu:%-9u",appn_offset,app_length);
            chpr = newline(chpr);
        }

        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)
            {
                chpr = newline(1);
                hexdump(inptr,appn_offset,app_length + 2,dumplength,16,
                            indent,SMALLINDENT);
                chpr = newline(1);
            }
        }
        else if(PRINT_SECTION)
        {
            chpr += printf(" - unknown format (not dumped: use -A)");
            chpr = newline(chpr);
        }

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r12
testq %rdi, %rdi
je 0x1531a
movl %r9d, %r13d
movl %edx, %ebp
movq %rdi, %r15
movq %r8, 0x30(%rsp)
testq %rcx, %rcx
je 0x151c2
orb $-0x80, 0x19(%rcx)
movl %ebp, %eax
andl $0xf, %eax
movl $0x1, 0x1c(%rcx,%rax,4)
movzwl %bp, %ebx
movl %ebx, %edi
callq 0xa1c8
movq %rax, 0x20(%rsp)
leaq 0x2(%r12), %r14
movq %r15, 0x28(%rsp)
movq %r15, %rdi
movl $0x4d4d, %esi           # imm = 0x4D4D
movq %r14, %rdx
callq 0x416a
movl %eax, %r15d
leaq 0x29ee7(%rip), %rcx     # 0x3f0dc
movl $0x40000, %edi          # imm = 0x40000
movq %r12, %rsi
movl %r13d, 0x14(%rsp)
movl %r13d, %edx
callq 0x5100
leaq 0x41f6f(%rip), %rax     # 0x57180
xorl %r13d, %r13d
testb $0x4, 0x2(%rax)
movzwl %r15w, %eax
movq %rax, 0x18(%rsp)
je 0x15240
leaq 0x2de62(%rip), %rdi     # 0x4308c
movq 0x20(%rsp), %rsi
movl %ebx, %edx
movq 0x18(%rsp), %rcx
xorl %eax, %eax
callq 0x3120
movl %eax, %r13d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq 0x28(%rsp), %r15
movq %r15, %rdi
movl %ebx, %esi
callq 0x4c1f
leaq 0x41f25(%rip), %rcx     # 0x57180
movq (%rcx), %rcx
btl $0x12, %ecx
jb 0x1532b
testl $0x4003333, %ecx        # imm = 0x4003333
je 0x1534a
leaq 0x2a6de(%rip), %rcx     # 0x3f959
movl $0x4003333, %edi        # imm = 0x4003333
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl 0x14(%rsp), %edx
callq 0x5100
leaq 0x41eeb(%rip), %rax     # 0x57180
movq (%rax), %rax
testw $0x3003, %ax            # imm = 0x3003
je 0x152ee
testb $0x40, %al
je 0x152b8
leaq 0x2e1fe(%rip), %rdi     # 0x434a7
movq 0x30(%rsp), %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
andl $0xf, %ebp
cmpw $0xa, %bp
movl $0x0, %edx
adcl $0xc, %edx
leaq 0x2e07b(%rip), %rdi     # 0x43349
leaq 0x2e07d(%rip), %rcx     # 0x43352
movl %edx, %esi
movl %ebp, %r8d
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
leaq 0x41e95(%rip), %rax     # 0x57180
movq (%rax), %rax
testb $0x30, %al
movq 0x18(%rsp), %rbx
je 0x1530d
leaq 0x2ddac(%rip), %rdi     # 0x430aa
movq %r12, %rsi
movl %ebx, %edx
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movl %r13d, %edi
callq 0x160f7
movl %eax, %r13d
jmp 0x1534f
addq $0x2, %r12
xorl %ebp, %ebp
movq %r12, %r14
xorl %r13d, %r13d
jmp 0x1545c
testq %rax, %rax
leaq 0x2e00c(%rip), %rsi     # 0x43341
cmovneq %rax, %rsi
leaq 0x29d57(%rip), %rdi     # 0x3f097
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq 0x18(%rsp), %rbx
leaq 0x41e2a(%rip), %rax     # 0x57180
movq (%rax), %rax
btl $0x16, %eax
jb 0x1537f
btl $0x12, %eax
jae 0x153fc
leaq 0x2dfe6(%rip), %rdi     # 0x43356
xorl %eax, %eax
callq 0x3120
movl %eax, %r15d
addl %r13d, %r15d
jmp 0x153ec
leaq 0x43092(%rip), %rax     # 0x58418
movq (%rax), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rax
sete %cl
addq $0x2, %rbx
cmpq %rbx, %rax
seta %dl
orb %cl, %dl
movq %rbx, %rbp
jne 0x153bc
movq %rax, %rbp
testq %rax, %rax
jne 0x153b7
leaq 0x43054(%rip), %rax     # 0x58408
movq (%rax), %rbp
testq %rbp, %rbp
je 0x153fc
movq %r15, %r13
pushq $0x1
popq %r15
movl %r15d, %edi
callq 0x160f7
movl $0x2, (%rsp)
pushq $0x10
popq %r8
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %rbp, %rcx
movl 0x14(%rsp), %r9d
callq 0x6e93
movl %r15d, %edi
callq 0x160f7
movl %eax, %r13d
movq 0x28(%rsp), %r15
movq 0x18(%rsp), %rbp
leaq (%r12,%rbp), %rbx
leaq (%r12,%rbp), %rsi
incq %rsi
leaq 0x29ce6(%rip), %rcx     # 0x3f0f9
movl $0x40000, %edi          # imm = 0x40000
movl 0x14(%rsp), %edx
callq 0x5100
leaq 0x41d58(%rip), %rax     # 0x57180
testb $0x4, 0x2(%rax)
je 0x1544f
leaq 0x2a6fa(%rip), %rdi     # 0x3fb2f
movq 0x20(%rsp), %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movl %r13d, %edi
callq 0x160f7
movl %eax, %r13d
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x3210
addq %rbp, %r14
movl %r13d, %edi
callq 0x16a4f
movq %r14, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq