// File: /workspace/github_c_makefile_star2_O1/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 $0x28, %rsp
movq %rsi, %rbx
testq %rdi, %rdi
je 0x15c4f
movl %r9d, %r13d
movl %edx, %r12d
movq %rdi, %r14
movq %r8, 0x20(%rsp)
testq %rcx, %rcx
je 0x15b19
orb $-0x80, 0x19(%rcx)
movl %r12d, %eax
andl $0xf, %eax
movl $0x1, 0x1c(%rcx,%rax,4)
movzwl %r12w, %ebp
movl %ebp, %edi
callq 0xa958
movq %rax, 0x18(%rsp)
leaq 0x2(%rbx), %rdx
movq %r14, %rdi
movl $0x4d4d, %esi           # imm = 0x4D4D
callq 0x4574
movl %eax, %r15d
leaq 0x2b598(%rip), %rcx     # 0x410dc
movl $0x40000, %edi          # imm = 0x40000
movq %rbx, %rsi
movl %r13d, 0x14(%rsp)
movl %r13d, %edx
callq 0x5605
leaq 0x42620(%rip), %rax     # 0x58180
xorl %r13d, %r13d
testb $0x4, 0x2(%rax)
movzwl %r15w, %r15d
je 0x15b88
leaq 0x2f518(%rip), %rdi     # 0x4508c
movq 0x18(%rsp), %rsi
movl %ebp, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x3120
movl %eax, %r13d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r14, %rdi
movl %ebp, %esi
callq 0x50e2
leaq 0x425e2(%rip), %rbp     # 0x58180
movq (%rbp), %rcx
btl $0x12, %ecx
jb 0x15c5a
testl $0x4003333, %ecx        # imm = 0x4003333
je 0x15c79
leaq 0x2bd9a(%rip), %rcx     # 0x41959
movl $0x4003333, %edi        # imm = 0x4003333
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl 0x14(%rsp), %edx
callq 0x5605
movq (%rbp), %rax
testl $0x3003, %eax           # imm = 0x3003
je 0x15c25
testb $0x40, %al
je 0x15bf7
leaq 0x2f8bf(%rip), %rdi     # 0x454a7
movq 0x20(%rsp), %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
andl $0xf, %r12d
cmpw $0xa, %r12w
movl $0x0, %edx
adcl $0xc, %edx
leaq 0x2f73a(%rip), %rdi     # 0x45349
leaq 0x2f73c(%rip), %rcx     # 0x45352
movl %edx, %esi
movl %r12d, %r8d
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
testb $0x30, (%rbp)
je 0x15c42
leaq 0x2f478(%rip), %rdi     # 0x450aa
movq %rbx, %rsi
movl %r15d, %edx
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movl %r13d, %edi
callq 0x16b56
movl %eax, %r13d
jmp 0x15c79
xorl %r15d, %r15d
xorl %r13d, %r13d
jmp 0x15d64
testq %rax, %rax
leaq 0x2f6dd(%rip), %rsi     # 0x45341
cmovneq %rax, %rsi
leaq 0x2b428(%rip), %rdi     # 0x41097
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movq (%rbp), %rax
btl $0x16, %eax
jb 0x15ca2
btl $0x12, %eax
jae 0x15d10
leaq 0x2f6c2(%rip), %rdi     # 0x45356
xorl %eax, %eax
callq 0x3120
movl %eax, %ebp
addl %r13d, %ebp
jmp 0x15cff
leaq 0x4376f(%rip), %rax     # 0x59418
movq (%rax), %r12
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %r12
je 0x15cc3
leaq 0x2(%r15), %rax
cmpq %rax, %r12
jbe 0x15d83
leaq 0x2(%r15), %r12
testq %r12, %r12
je 0x15d10
movl $0x1, %ebp
movl $0x1, %edi
callq 0x16b56
leaq 0x2(%r15), %rdx
movl $0x2, (%rsp)
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rcx
movl $0x10, %r8d
movl 0x14(%rsp), %r9d
callq 0x7446
movl %ebp, %edi
callq 0x16b56
movl %eax, %r13d
leaq 0x42470(%rip), %rbp     # 0x58180
leaq (%r15,%rbx), %r12
leaq (%r15,%rbx), %rsi
incq %rsi
leaq 0x2b3d7(%rip), %rcx     # 0x410f9
movl $0x40000, %edi          # imm = 0x40000
movl 0x14(%rsp), %edx
callq 0x5605
testb $0x4, 0x2(%rbp)
je 0x15d57
leaq 0x2bdf2(%rip), %rdi     # 0x41b2f
movq 0x18(%rsp), %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %r13d
movl %r13d, %edi
callq 0x16b56
movl %eax, %r13d
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x3210
movl %r13d, %edi
callq 0x17530
leaq (%rbx,%r15), %rax
addq $0x2, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %r12, %r12
jne 0x15cc7
leaq 0x43675(%rip), %rax     # 0x59408
movq (%rax), %r12
jmp 0x15cc7