// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x90, %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)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
movl $0x0, -0x6c(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x1d59f
cmpq $0x0, -0x20(%rbp)
je 0x1d040
movq -0x20(%rbp), %rax
movl 0x18(%rax), %ecx
orl $0x8000, %ecx           # imm = 0x8000
movl %ecx, 0x18(%rax)
movq -0x20(%rbp), %rax
movl $0x1, 0x4c(%rax)
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 0x47062(%rip), %rcx     # 0x640dc
callq 0x5ed0
leaq 0x5a0fa(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x1d0ba
movq -0x40(%rbp), %rsi
movzwl -0x12(%rbp), %edx
movzwl -0x42(%rbp), %ecx
leaq 0x4a6b6(%rip), %rdi     # 0x6775e
movb $0x0, %al
callq 0x3110
addl -0x6c(%rbp), %eax
movl %eax, -0x6c(%rbp)
jmp 0x1d187
leaq 0x5a0bf(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x4003333, %rax        # imm = 0x4003333
cmpq $0x0, %rax
je 0x1d185
movl -0x2c(%rbp), %edx
movl $0x4003333, %edi        # imm = 0x4003333
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x4783c(%rip), %rcx     # 0x64924
callq 0x5ed0
leaq 0x5a08c(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x3003, %rax           # imm = 0x3003
cmpq $0x0, %rax
je 0x1d14a
leaq 0x5a076(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40, %rax
cmpq $0x0, %rax
je 0x1d12f
movq -0x28(%rbp), %rsi
leaq 0x4aa57(%rip), %rdi     # 0x67b79
movb $0x0, %al
callq 0x3110
addl -0x6c(%rbp), %eax
movl %eax, -0x6c(%rbp)
leaq 0x4a63d(%rip), %rdi     # 0x67773
leaq 0x491cd(%rip), %rsi     # 0x6630a
movb $0x0, %al
callq 0x3110
addl -0x6c(%rbp), %eax
movl %eax, -0x6c(%rbp)
leaq 0x5a02f(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x30, %rax
cmpq $0x0, %rax
je 0x1d17a
movq -0x10(%rbp), %rsi
movzwl -0x42(%rbp), %edx
leaq 0x4a60f(%rip), %rdi     # 0x6777c
movb $0x0, %al
callq 0x3110
addl -0x6c(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %edi
callq 0x1ef50
movl %eax, -0x6c(%rbp)
jmp 0x1d187
movq -0x8(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movzwl -0x12(%rbp), %esi
callq 0x5450
movq %rax, -0x38(%rbp)
leaq 0x59fdc(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x1d1e9
cmpq $0x0, -0x38(%rbp)
je 0x1d1c4
movq -0x38(%rbp), %rax
movq %rax, -0x78(%rbp)
jmp 0x1d1d1
leaq 0x4a848(%rip), %rax     # 0x67a13
movq %rax, -0x78(%rbp)
jmp 0x1d1d1
movq -0x78(%rbp), %rsi
leaq 0x4c934(%rip), %rdi     # 0x69b10
movb $0x0, %al
callq 0x3110
addl -0x6c(%rbp), %eax
movl %eax, -0x6c(%rbp)
leaq 0x59f90(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x400000, %rax         # imm = 0x400000
cmpq $0x0, %rax
je 0x1d2d3
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
leaq 0x5b209(%rip), %rax     # 0x78418
cmpq %rcx, (%rax)
je 0x1d22d
leaq 0x5b1fd(%rip), %rax     # 0x78418
movq (%rax), %rax
movzwl -0x42(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jbe 0x1d23c
movzwl -0x42(%rbp), %eax
addl $0x2, %eax
cltq
movq %rax, -0x50(%rbp)
jmp 0x1d269
leaq 0x5b1d5(%rip), %rax     # 0x78418
cmpq $0x0, (%rax)
jbe 0x1d259
leaq 0x5b1c8(%rip), %rax     # 0x78418
movq (%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x1d267
leaq 0x5b1a8(%rip), %rax     # 0x78408
movq (%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x1d269
cmpq $0x0, -0x50(%rbp)
je 0x1d2ce
leaq 0x59f09(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x1d291
movl -0x6c(%rbp), %edi
callq 0x1ef50
movl %eax, -0x6c(%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
addl $0x2, %r9d
movl $0x10, %r8d
movl $0x2, (%rsp)
callq 0x8aa0
movl $0x1, %edi
callq 0x1ef50
movl %eax, -0x6c(%rbp)
jmp 0x1d541
leaq 0x59ea6(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x100000, %rax         # imm = 0x100000
cmpq $0x0, %rax
je 0x1d53f
leaq 0x59e8c(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x4003333, %rax        # imm = 0x4003333
cmpq $0x0, %rax
je 0x1d53f
movq -0x10(%rbp), %rax
movzwl -0x42(%rbp), %ecx
addq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3180
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x1d9a0
movl %eax, -0x70(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3180
movq %rax, -0x58(%rbp)
leaq 0x59e35(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x1d365
movl -0x6c(%rbp), %edi
callq 0x1ef50
movl %eax, -0x6c(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x60(%rbp), %rax
jae 0x1d385
movq -0x8(%rbp), %rdi
movl -0x70(%rbp), %esi
movq -0x60(%rbp), %rdx
movl -0x2c(%rbp), %ecx
callq 0x1da10
movl %eax, -0x70(%rbp)
movl -0x6c(%rbp), %edi
callq 0x1ef50
movl %eax, -0x6c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3180
movq %rax, -0x58(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x70(%rbp)
movb %al, -0x79(%rbp)
je 0x1d3c1
xorl %eax, %eax
cmpl $-0x1, -0x70(%rbp)
movb %al, -0x79(%rbp)
je 0x1d3c1
movq -0x58(%rbp), %rax
cmpq -0x60(%rbp), %rax
setb %al
movb %al, -0x79(%rbp)
movb -0x79(%rbp), %al
testb $0x1, %al
jne 0x1d3ca
jmp 0x1d400
movq -0x8(%rbp), %rdi
movl -0x70(%rbp), %esi
movq -0x60(%rbp), %rdx
movl -0x2c(%rbp), %ecx
callq 0x1da10
movl %eax, -0x70(%rbp)
cmpl $0x0, -0x70(%rbp)
je 0x1d3f1
movl -0x6c(%rbp), %edi
callq 0x1ef50
movl %eax, -0x6c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3180
movq %rax, -0x58(%rbp)
jmp 0x1d39d
jmp 0x1d402
movq -0x58(%rbp), %rax
cmpq -0x60(%rbp), %rax
jae 0x1d53d
movq -0x8(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x1db70
movl %eax, -0x70(%rbp)
cmpl $-0x1, -0x70(%rbp)
jne 0x1d42b
jmp 0x1d53d
movq -0x8(%rbp), %rdi
callq 0x3180
subq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
cmpl $0x5b, -0x70(%rbp)
jne 0x1d44e
movq -0x68(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x68(%rbp)
cmpq $0x1, -0x68(%rbp)
jbe 0x1d504
movq -0x68(%rbp), %rsi
leaq 0x4d855(%rip), %rdi     # 0x6acb9
movb $0x0, %al
callq 0x3110
addl -0x6c(%rbp), %eax
movl %eax, -0x6c(%rbp)
leaq 0x5af90(%rip), %rax     # 0x78408
cmpq $0x0, (%rax)
je 0x1d4eb
movl -0x6c(%rbp), %edi
callq 0x1ef50
movl %eax, -0x6c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x68(%rbp), %rdx
leaq 0x5af6c(%rip), %rax     # 0x78408
movq (%rax), %rcx
movl -0x2c(%rbp), %r9d
addl $0x2, %r9d
movl $0x10, %r8d
movl $0x2, (%rsp)
callq 0x8aa0
movl $0x1, %edi
callq 0x1ef50
movl %eax, -0x6c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3140
movl %eax, -0x70(%rbp)
cmpl $-0x1, -0x70(%rbp)
je 0x1d4e7
movq -0x8(%rbp), %rdi
callq 0x3180
cmpq -0x60(%rbp), %rax
jb 0x1d4e9
jmp 0x1d53d
jmp 0x1d502
leaq 0x4a55d(%rip), %rdi     # 0x67a4f
callq 0x6860
movl -0x6c(%rbp), %edi
callq 0x1ef50
movl %eax, -0x6c(%rbp)
jmp 0x1d50f
movl -0x6c(%rbp), %edi
callq 0x1ef50
movl %eax, -0x6c(%rbp)
cmpl $0x0, -0x70(%rbp)
je 0x1d52b
movq -0x8(%rbp), %rdi
movl -0x70(%rbp), %esi
movq -0x60(%rbp), %rdx
movl -0x2c(%rbp), %ecx
callq 0x1da10
movl %eax, -0x70(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3180
movq %rax, -0x58(%rbp)
jmp 0x1d402
jmp 0x1d53f
jmp 0x1d541
movq -0x10(%rbp), %rsi
movzwl -0x42(%rbp), %eax
addq %rax, %rsi
addq $0x1, %rsi
movl -0x2c(%rbp), %edx
movl $0x40000, %edi          # imm = 0x40000
leaq 0x46b9a(%rip), %rcx     # 0x640f9
callq 0x5ed0
leaq 0x59c15(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x1d59d
movq -0x40(%rbp), %rsi
leaq 0x47575(%rip), %rdi     # 0x64afa
movb $0x0, %al
callq 0x3110
addl -0x6c(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %edi
callq 0x1ef50
movl %eax, -0x6c(%rbp)
jmp 0x1d59f
movl -0x6c(%rbp), %edi
callq 0x1ff00
movq -0x10(%rbp), %rax
movzwl -0x42(%rbp), %ecx
addq %rcx, %rax
addq $0x2, %rax
addq $0x90, %rsp
popq %rbp
retq
nop