// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x70, %rsp
movw %dx, %ax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movw %ax, -0x12(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movw $0x0, -0x42(%rbp)
movq $0x0, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
movl $0xd, -0x58(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x1d983
cmpq $0x0, -0x20(%rbp)
je 0x1d637
movq -0x20(%rbp), %rax
movl 0x18(%rax), %ecx
orl $0x8000, %ecx           # imm = 0x8000
movl %ecx, 0x18(%rax)
movq -0x20(%rbp), %rax
movzwl -0x12(%rbp), %ecx
andl $0xf, %ecx
movslq %ecx, %rcx
movl $0x1, 0x1c(%rax,%rcx,4)
movzwl -0x12(%rbp), %edi
callq 0xd580
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
addq $0x2, %rdx
movl $0x4d4d, %esi           # imm = 0x4D4D
callq 0x4480
movw %ax, -0x42(%rbp)
movq -0x10(%rbp), %rsi
movl -0x2c(%rbp), %edx
movl $0x40000, %edi          # imm = 0x40000
leaq 0x46a6b(%rip), %rcx     # 0x640dc
callq 0x5ed0
leaq 0x59b03(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x1d6ac
movq -0x40(%rbp), %rsi
movzwl -0x12(%rbp), %edx
movzwl -0x42(%rbp), %ecx
leaq 0x4a0bf(%rip), %rdi     # 0x6775e
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movzwl -0x12(%rbp), %esi
callq 0x5450
movq %rax, -0x38(%rbp)
leaq 0x59ab7(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x1d713
cmpq $0x0, -0x38(%rbp)
je 0x1d6e9
movq -0x38(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0x1d6f6
leaq 0x4a323(%rip), %rax     # 0x67a13
movq %rax, -0x60(%rbp)
jmp 0x1d6f6
movq -0x60(%rbp), %rsi
leaq 0x46996(%rip), %rdi     # 0x64097
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x1d80b
leaq 0x59a66(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x4003333, %rax        # imm = 0x4003333
cmpq $0x0, %rax
je 0x1d809
movl -0x2c(%rbp), %edx
movl $0x4003333, %edi        # imm = 0x4003333
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x471e3(%rip), %rcx     # 0x64924
callq 0x5ed0
leaq 0x59a33(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x3003, %rax           # imm = 0x3003
cmpq $0x0, %rax
je 0x1d7ce
leaq 0x59a1d(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40, %rax
cmpq $0x0, %rax
je 0x1d788
movq -0x28(%rbp), %rsi
leaq 0x4a3fe(%rip), %rdi     # 0x67b79
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl $0xd, -0x58(%rbp)
movzwl -0x12(%rbp), %eax
andl $0xf, %eax
cmpl $0x9, %eax
jle 0x1d7a4
movl -0x58(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %esi
movl -0x58(%rbp), %edx
movzwl -0x12(%rbp), %r8d
andl $0xf, %r8d
leaq 0x4a261(%rip), %rdi     # 0x67a1b
leaq 0x4a263(%rip), %rcx     # 0x67a24
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
leaq 0x599ab(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x30, %rax
cmpq $0x0, %rax
je 0x1d7fe
movq -0x10(%rbp), %rsi
movzwl -0x42(%rbp), %edx
leaq 0x49f8b(%rip), %rdi     # 0x6777c
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %edi
callq 0x1ef50
movl %eax, -0x54(%rbp)
jmp 0x1d80b
leaq 0x5996e(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x400000, %rax         # imm = 0x400000
cmpq $0x0, %rax
je 0x1d8da
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
leaq 0x5abe7(%rip), %rax     # 0x78418
cmpq %rcx, (%rax)
je 0x1d84f
leaq 0x5abdb(%rip), %rax     # 0x78418
movq (%rax), %rax
movzwl -0x42(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jbe 0x1d85e
movzwl -0x42(%rbp), %eax
addl $0x2, %eax
cltq
movq %rax, -0x50(%rbp)
jmp 0x1d88b
leaq 0x5abb3(%rip), %rax     # 0x78418
cmpq $0x0, (%rax)
jbe 0x1d87b
leaq 0x5aba6(%rip), %rax     # 0x78418
movq (%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x1d889
leaq 0x5ab86(%rip), %rax     # 0x78408
movq (%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x1d88b
cmpq $0x0, -0x50(%rbp)
je 0x1d8d8
movl $0x1, %edi
callq 0x1ef50
movl %eax, -0x54(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movzwl -0x42(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rdx
movq -0x50(%rbp), %rcx
movl -0x2c(%rbp), %r9d
movl $0x10, %r8d
movl $0x2, (%rsp)
callq 0x8aa0
movl $0x1, %edi
callq 0x1ef50
movl %eax, -0x54(%rbp)
jmp 0x1d911
leaq 0x5989f(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x1d90f
leaq 0x4a131(%rip), %rdi     # 0x67a28
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %edi
callq 0x1ef50
movl %eax, -0x54(%rbp)
jmp 0x1d911
movq -0x10(%rbp), %rsi
movzwl -0x42(%rbp), %eax
addq %rax, %rsi
addq $0x1, %rsi
movl -0x2c(%rbp), %edx
movl $0x40000, %edi          # imm = 0x40000
leaq 0x467ca(%rip), %rcx     # 0x640f9
callq 0x5ed0
leaq 0x59845(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x1d96d
movq -0x40(%rbp), %rsi
leaq 0x471a5(%rip), %rdi     # 0x64afa
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %edi
callq 0x1ef50
movl %eax, -0x54(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movzwl -0x42(%rbp), %eax
addq %rax, %rsi
xorl %edx, %edx
callq 0x3200
movl -0x54(%rbp), %edi
callq 0x1ff00
movq -0x10(%rbp), %rax
movzwl -0x42(%rbp), %ecx
addq %rcx, %rax
addq $0x2, %rax
addq $0x70, %rsp
popq %rbp
retq