// File: /workspace/github_c_makefile_star2_O0/hfiguiere[P]exifprobe/process.c
// Function: process_subifd
unsigned long
process_subifd(FILE *inptr,unsigned short byteorder,
                    struct ifd_entry *subfile_entry,
                    unsigned long fileoffset_base,unsigned long max_offset,
                    struct image_summary *summary_entry,char *parent_name,
                    int ifdnum,int subifdnum,int ifdtype,int indent)
{
    unsigned long entry_offset;
    unsigned long subifd_offset;
    unsigned long max_value_offset = 0L;
    int chpr = 0;
    int nsubifds,num;

    if(inptr && subfile_entry)
    {
        entry_offset = subfile_entry->value + fileoffset_base;
        nsubifds = subfile_entry->count;

        if(subifdnum >= 0)
        {
            if(nsubifds > 1)
            {
                if((PRINT_VALUE_AT_OFFSET))
                {
                    if(max_offset && (entry_offset > max_offset))
                        print_tag_address(SECTION,entry_offset,indent,"+");
                    else
                        print_tag_address(SECTION,entry_offset,indent,"@");
                    if(PRINT_SECTION)
                    {
                        chpr += printf("%s - %lu offsets: [max parent offset = %lu]",
                                tagname(subfile_entry->tag),subfile_entry->count,
                                max_offset);
                    }
                    for(num = 0; num < nsubifds; ++num)
                    {
                        subifd_offset = read_ulong(inptr,byteorder,entry_offset)
                                                            + fileoffset_base;
                        entry_offset = ftell(inptr); /* where to get next one */
                        if((PRINT_SECTION))
                            chpr += printf(" %lu",subifd_offset);
                        if(ferror(inptr) || feof(inptr))
                            break;
                        /* goto blewit;                               */
                    }
                    if(PRINT_SECTION)
                        chpr = newline(chpr);
                }

                entry_offset = subfile_entry->value + fileoffset_base;
                for(num = 0; num < nsubifds; ++num)
                {
                    subifd_offset = read_ulong(inptr,byteorder,entry_offset) +
                                                        fileoffset_base;
                    /* where to get next one                          */
                    entry_offset = ftell(inptr);
                    /* The next subifd offset suggests a maximum for  */
                    /* this subifd; at least until some nitwit writes */
                    /* the second one first. Doesn't help for the     */
                    /* last one, though.                              */
                    if(num < (nsubifds - 1))
                        max_offset = read_ulong(inptr,byteorder,HERE);
                    else
                        max_offset = 0;
                    if(ferror(inptr) || feof(inptr))
                        goto blewit;
                    max_value_offset = process_tiff_ifd(inptr,byteorder,
                                            subifd_offset,fileoffset_base,
                                            max_offset,summary_entry,parent_name,
                                            ifdtype,ifdnum,subifdnum + num,
                                            indent);
                    /* ###%%% don't we check for errors here???           */
                }
            }
            else
            {
                max_value_offset = process_tiff_ifd(inptr,byteorder,
                                            subfile_entry->value,fileoffset_base,
                                            max_offset,summary_entry,parent_name,
                                            ifdtype,ifdnum,subifdnum,
                                            indent);
            }
        }
        else
        {
            printred("Negative subifd number");
            chpr += printf(" %d, ifdtype %d not processed for IFD %d",subifdnum,ifdtype,ifdnum);
            chpr = newline(chpr);
            goto blewit;
        }
    }
    else
    {
        fprintf(stderr,"%s: no open file pointer to read EXIF\n",Progname);
        max_value_offset = 0L;
    }
    setcharsprinted(chpr);
    return(max_value_offset);
blewit:
    /* we're going to keep trying, because the caller's next offset   */
    /* may be ok.                                                     */
    clearerr(inptr);
    return(0L);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x90, %rsp
movw %si, %ax
movl 0x30(%rbp), %esi
movl 0x28(%rbp), %esi
movl 0x20(%rbp), %esi
movl 0x18(%rbp), %esi
movq 0x10(%rbp), %rsi
movq %rdi, -0x20(%rbp)
movw %ax, -0x22(%rbp)
movq %rdx, -0x30(%rbp)
movq %rcx, -0x38(%rbp)
movq %r8, -0x40(%rbp)
movq %r9, -0x48(%rbp)
movq $0x0, -0x60(%rbp)
movl $0x0, -0x64(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x15c8e
cmpq $0x0, -0x30(%rbp)
je 0x15c8e
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, -0x68(%rbp)
cmpl $0x0, 0x20(%rbp)
jl 0x15c56
cmpl $0x1, -0x68(%rbp)
jle 0x15c04
leaq 0x617cc(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x1000000, %rax        # imm = 0x1000000
cmpq $0x0, %rax
je 0x15b0a
cmpq $0x0, -0x40(%rbp)
je 0x159f2
movq -0x50(%rbp), %rax
cmpq -0x40(%rbp), %rax
jbe 0x159f2
movq -0x50(%rbp), %rsi
movl 0x30(%rbp), %edx
movl $0x40000, %edi          # imm = 0x40000
leaq 0x4f162(%rip), %rcx     # 0x64b4d
callq 0x5ed0
jmp 0x15a0a
movq -0x50(%rbp), %rsi
movl 0x30(%rbp), %edx
movl $0x40000, %edi          # imm = 0x40000
leaq 0x4e6d7(%rip), %rcx     # 0x640dc
callq 0x5ed0
leaq 0x6176f(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x15a4f
movq -0x30(%rbp), %rax
movzwl (%rax), %edi
callq 0xd580
movq %rax, %rsi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x40(%rbp), %rcx
leaq 0x518b3(%rip), %rdi     # 0x672f5
movb $0x0, %al
callq 0x3110
addl -0x64(%rbp), %eax
movl %eax, -0x64(%rbp)
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0x68(%rbp), %eax
jge 0x15ae7
movq -0x20(%rbp), %rdi
movw -0x22(%rbp), %ax
movq -0x50(%rbp), %rdx
movzwl %ax, %esi
callq 0x4610
addq -0x38(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rdi
callq 0x3180
movq %rax, -0x50(%rbp)
leaq 0x616ee(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x15ab9
movq -0x58(%rbp), %rsi
leaq 0x553f3(%rip), %rdi     # 0x6ae9f
movb $0x0, %al
callq 0x3110
addl -0x64(%rbp), %eax
movl %eax, -0x64(%rbp)
movq -0x20(%rbp), %rdi
callq 0x30a0
cmpl $0x0, %eax
jne 0x15ad5
movq -0x20(%rbp), %rdi
callq 0x3190
cmpl $0x0, %eax
je 0x15ad7
jmp 0x15ae7
jmp 0x15ad9
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x15a56
leaq 0x61692(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x15b08
movl -0x64(%rbp), %edi
callq 0x1ef50
movl %eax, -0x64(%rbp)
jmp 0x15b0a
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x50(%rbp)
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0x68(%rbp), %eax
jge 0x15c02
movq -0x20(%rbp), %rdi
movw -0x22(%rbp), %ax
movq -0x50(%rbp), %rdx
movzwl %ax, %esi
callq 0x4610
addq -0x38(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rdi
callq 0x3180
movq %rax, -0x50(%rbp)
movl -0x6c(%rbp), %eax
movl -0x68(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x15b7b
movq -0x20(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movzwl -0x22(%rbp), %esi
callq 0x4610
movq %rax, -0x40(%rbp)
jmp 0x15b83
movq $0x0, -0x40(%rbp)
movq -0x20(%rbp), %rdi
callq 0x30a0
cmpl $0x0, %eax
jne 0x15b9f
movq -0x20(%rbp), %rdi
callq 0x3190
cmpl $0x0, %eax
je 0x15ba4
jmp 0x15cca
movq -0x20(%rbp), %rdi
movw -0x22(%rbp), %si
movq -0x58(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r8
movq -0x48(%rbp), %r9
movq 0x10(%rbp), %r14
movl 0x28(%rbp), %ebx
movl 0x18(%rbp), %r11d
movl 0x20(%rbp), %r10d
addl -0x6c(%rbp), %r10d
movl 0x30(%rbp), %eax
movzwl %si, %esi
movq %r14, (%rsp)
movl %ebx, 0x8(%rsp)
movl %r11d, 0x10(%rsp)
movl %r10d, 0x18(%rsp)
movl %eax, 0x20(%rsp)
callq 0x112e0
movq %rax, -0x60(%rbp)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x15b21
jmp 0x15c54
movq -0x20(%rbp), %rdi
movw -0x22(%rbp), %si
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r8
movq -0x48(%rbp), %r9
movq 0x10(%rbp), %r14
movl 0x28(%rbp), %ebx
movl 0x18(%rbp), %r11d
movl 0x20(%rbp), %r10d
movl 0x30(%rbp), %eax
movzwl %si, %esi
movq %r14, (%rsp)
movl %ebx, 0x8(%rsp)
movl %r11d, 0x10(%rsp)
movl %r10d, 0x18(%rsp)
movl %eax, 0x20(%rsp)
callq 0x112e0
movq %rax, -0x60(%rbp)
jmp 0x15c8c
leaq 0x516c4(%rip), %rdi     # 0x67321
callq 0x6860
movl 0x20(%rbp), %esi
movl 0x28(%rbp), %edx
movl 0x18(%rbp), %ecx
leaq 0x516c6(%rip), %rdi     # 0x67338
movb $0x0, %al
callq 0x3110
addl -0x64(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %edi
callq 0x1ef50
movl %eax, -0x64(%rbp)
jmp 0x15cca
jmp 0x15cb8
movq 0x61363(%rip), %rax     # 0x76ff8
movq (%rax), %rdi
leaq 0x627c9(%rip), %rax     # 0x78468
movq (%rax), %rdx
leaq 0x516b8(%rip), %rsi     # 0x67361
movb $0x0, %al
callq 0x3170
movq $0x0, -0x60(%rbp)
movl -0x64(%rbp), %edi
callq 0x1ff00
movq -0x60(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x15cdb
movq -0x20(%rbp), %rdi
callq 0x31a0
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax,%rax)