// File: /workspace/github_c_makefile_star2_O3/hfiguiere[P]exifprobe/mrw.c
// Function: process_rif
unsigned long
process_rif(FILE *inptr,unsigned long offset,unsigned long blocklength,
            struct image_summary *summary_entry,int indent)
{
    unsigned long end_offset;
    unsigned short saturation,contrast;
    unsigned short sharpness,white_balance;
    unsigned short subject_program,iso;
    unsigned short color_mode,color_filter,bw_filter;
    unsigned short unknown;
    double fvalue;
    int chpr = 0;

    end_offset = offset + blocklength;

    chpr = newline(chpr);
    unknown = read_ubyte(inptr,offset);
    if((PRINT_ENTRY))
    {
        print_tag_address(ENTRY,offset,indent + 4,"@");
        if((PRINT_TAGINFO))
        {
            if((PRINT_LONGNAMES))
                chpr += printf("%s","MRW.RIF.");
            chpr += printf("%-*.*s",SHORTNAMEWIDTH,SHORTNAMEWIDTH,"unknown");
        }
        if((PRINT_VALUE))
            chpr += printf(" = %u",unknown);
        chpr = newline(chpr);
    }
    ++offset;
    saturation = read_ubyte(inptr,offset);
    if((PRINT_ENTRY))
    {
        print_tag_address(ENTRY,offset,indent + 4,"@");
        if((PRINT_TAGINFO))
        {
            if((PRINT_LONGNAMES))
                chpr += printf("%s","MRW.RIF.");
            chpr += printf("%-*.*s",SHORTNAMEWIDTH,SHORTNAMEWIDTH,"Saturation");
        }
        if((PRINT_VALUE))
            chpr += printf(" = %u",saturation);
        chpr = newline(chpr);
    }
    ++offset;
    contrast = read_ubyte(inptr,offset);
    if((PRINT_ENTRY))
    {
        print_tag_address(ENTRY,offset,indent + 4,"@");
        if((PRINT_TAGINFO))
        {
            if((PRINT_LONGNAMES))
                chpr += printf("%s","MRW.RIF.");
            chpr += printf("%-*.*s",SHORTNAMEWIDTH,SHORTNAMEWIDTH,"Contrast");
        }
        if((PRINT_VALUE))
            chpr += printf(" = %u",contrast);
        chpr = newline(chpr);
    }
    ++offset;
    sharpness = read_ubyte(inptr,offset);
    if((PRINT_ENTRY))
    {
        print_tag_address(ENTRY,offset,indent + 4,"@");
        if((PRINT_TAGINFO))
        {
            if((PRINT_LONGNAMES))
                chpr += printf("%s","MRW.RIF.");
            chpr += printf("%-*.*s",SHORTNAMEWIDTH,SHORTNAMEWIDTH,"Sharpness");
        }
        if((PRINT_VALUE))
            chpr += printf(" = %u",sharpness);
        chpr = newline(chpr);
    }
    ++offset;
    white_balance = read_ubyte(inptr,offset);
    if((PRINT_ENTRY))
    {
        print_tag_address(ENTRY,offset,indent + 4,"@");
        if((PRINT_TAGINFO))
        {
            if((PRINT_LONGNAMES))
                chpr += printf("%s","MRW.RIF.");
            chpr += printf("%-*.*s",SHORTNAMEWIDTH,SHORTNAMEWIDTH,"WhiteBalance");
        }
        if((PRINT_VALUE))
            chpr += printf(" = %u/%#x",white_balance,white_balance);
        chpr = newline(chpr);
    }
    ++offset;
    subject_program = read_ubyte(inptr,offset);
    if((PRINT_ENTRY))
    {
        print_tag_address(ENTRY,offset,indent + 4,"@");
        {
            if((PRINT_LONGNAMES))
                chpr += printf("%s","MRW.RIF.");
            chpr += printf("%-*.*s",SHORTNAMEWIDTH,SHORTNAMEWIDTH,"SubjectProgram");
        }
        if((PRINT_VALUE))
            chpr += printf(" = %u",subject_program);
        chpr = newline(chpr);
    }
    ++offset;
    iso = read_ubyte(inptr,offset);
    if((PRINT_ENTRY))
    {
        print_tag_address(ENTRY,offset,indent + 4,"@");
        if((PRINT_TAGINFO))
        {
            if((PRINT_LONGNAMES))
                chpr += printf("%s","MRW.RIF.");
            chpr += printf("%-*.*s",SHORTNAMEWIDTH,SHORTNAMEWIDTH,"CCDSensitivity");
        }
        if((PRINT_VALUE))
        {
            if(PRINT_RAW_VALUES)
                chpr += printf(" = %u",iso);
            fvalue = ((double)iso/8.0) - 1.0;
            chpr += printf(" = %.3g APEX",fvalue);
            fvalue = pow(2.0,fvalue) * 3.125;
            chpr += printf(" = %.3g ISO",fvalue);
        }
        chpr = newline(chpr);
    }
    ++offset;
    color_mode = read_ubyte(inptr,offset);
    if((PRINT_ENTRY))
    {
        print_tag_address(ENTRY,offset,indent + 4,"@");
        if((PRINT_TAGINFO))
        {
            if((PRINT_LONGNAMES))
                chpr += printf("%s","MRW.RIF.");
            chpr += printf("%-*.*s",SHORTNAMEWIDTH,SHORTNAMEWIDTH,"ColorMode");
        }
        if((PRINT_VALUE))
            chpr += printf(" = %u/%#x",color_mode,color_mode);
        chpr = newline(chpr);
    }
    ++offset;
    color_filter = read_ubyte(inptr,offset);
    if((PRINT_ENTRY))
    {
        print_tag_address(ENTRY,offset,indent + 4,"@");
        if((PRINT_TAGINFO))
        {
            if((PRINT_LONGNAMES))
                chpr += printf("%s","MRW.RIF.");
            chpr += printf("%-*.*s",SHORTNAMEWIDTH,SHORTNAMEWIDTH,"ColorFilter");
        }
        if((PRINT_VALUE))
            chpr += printf(" = %u/%#x",color_filter,color_filter);
        chpr = newline(chpr);
    }
    ++offset;
    bw_filter = read_ubyte(inptr,offset);
    if((PRINT_ENTRY))
    {
        print_tag_address(ENTRY,offset,indent + 4,"@");
        if((PRINT_TAGINFO))
        {
            if((PRINT_LONGNAMES))
                chpr += printf("%s","MRW.RIF.");
            chpr += printf("%-*.*s",SHORTNAMEWIDTH,SHORTNAMEWIDTH,"BWFilter");
        }
        if((PRINT_VALUE))
            chpr += printf(" = %u/%#x",bw_filter,bw_filter);
        chpr = newline(chpr);
    }
    ++offset;
    /* Remaining values are unknown                                   */
    return(end_offset);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, %ebx
movq %rdx, 0x10(%rsp)
movq %rsi, %r14
movq %rdi, %r12
xorl %edi, %edi
callq 0x1707a
movl %eax, %ebp
movq %r12, %rdi
movq %r14, %rsi
callq 0x4d48
leaq 0x30ff6(%rip), %r15     # 0x58180
testl $0x4003333, (%r15)      # imm = 0x4003333
movq %rbx, (%rsp)
je 0x2721f
movl %eax, %r13d
leal 0x4(%rbx), %edx
leaq 0x19f34(%rip), %rcx     # 0x410dc
movl $0x4003333, %edi        # imm = 0x4003333
movq %r14, %rsi
callq 0x55eb
movq (%r15), %rax
testl $0x3003, %eax           # imm = 0x3003
je 0x271fe
testb $0x40, %al
je 0x271da
leaq 0x19ecd(%rip), %rdi     # 0x41097
leaq 0x22424(%rip), %rsi     # 0x495f5
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
leaq 0x21950(%rip), %rdi     # 0x48b31
leaq 0x1e7c0(%rip), %rcx     # 0x459a8
movl $0x14, %esi
movl $0x14, %edx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%r15), %rax
testb $0x30, %al
je 0x27216
movzwl %r13w, %esi
leaq 0x1dd91(%rip), %rdi     # 0x44f9e
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl %ebp, %edi
callq 0x1707a
movl %eax, %ebp
leaq 0x1(%r14), %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4d48
testl $0x4003333, (%r15)      # imm = 0x4003333
je 0x272c3
movl %eax, %r13d
movq (%rsp), %rax
leal 0x4(%rax), %edx
leaq 0x19e90(%rip), %rcx     # 0x410dc
movl $0x4003333, %edi        # imm = 0x4003333
movq %rbx, %rsi
callq 0x55eb
movq (%r15), %rax
testl $0x3003, %eax           # imm = 0x3003
je 0x272a2
testb $0x40, %al
je 0x2727e
leaq 0x19e29(%rip), %rdi     # 0x41097
leaq 0x22380(%rip), %rsi     # 0x495f5
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
leaq 0x218ac(%rip), %rdi     # 0x48b31
leaq 0x23add(%rip), %rcx     # 0x4ad69
movl $0x14, %esi
movl $0x14, %edx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%r15), %rax
testb $0x30, %al
je 0x272ba
movzwl %r13w, %esi
leaq 0x1dced(%rip), %rdi     # 0x44f9e
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl %ebp, %edi
callq 0x1707a
movl %eax, %ebp
leaq 0x2(%r14), %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4d48
testl $0x4003333, (%r15)      # imm = 0x4003333
je 0x27367
movl %eax, %r13d
movq (%rsp), %rax
leal 0x4(%rax), %edx
leaq 0x19dec(%rip), %rcx     # 0x410dc
movl $0x4003333, %edi        # imm = 0x4003333
movq %rbx, %rsi
callq 0x55eb
movq (%r15), %rax
testl $0x3003, %eax           # imm = 0x3003
je 0x27346
testb $0x40, %al
je 0x27322
leaq 0x19d85(%rip), %rdi     # 0x41097
leaq 0x222dc(%rip), %rsi     # 0x495f5
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
leaq 0x21808(%rip), %rdi     # 0x48b31
leaq 0x1bf0c(%rip), %rcx     # 0x4323c
movl $0x14, %esi
movl $0x14, %edx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%r15), %rax
testb $0x30, %al
je 0x2735e
movzwl %r13w, %esi
leaq 0x1dc49(%rip), %rdi     # 0x44f9e
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl %ebp, %edi
callq 0x1707a
movl %eax, %ebp
leaq 0x3(%r14), %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4d48
testl $0x4003333, (%r15)      # imm = 0x4003333
je 0x2740b
movl %eax, %r13d
movq (%rsp), %rax
leal 0x4(%rax), %edx
leaq 0x19d48(%rip), %rcx     # 0x410dc
movl $0x4003333, %edi        # imm = 0x4003333
movq %rbx, %rsi
callq 0x55eb
movq (%r15), %rax
testl $0x3003, %eax           # imm = 0x3003
je 0x273ea
testb $0x40, %al
je 0x273c6
leaq 0x19ce1(%rip), %rdi     # 0x41097
leaq 0x22238(%rip), %rsi     # 0x495f5
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
leaq 0x21764(%rip), %rdi     # 0x48b31
leaq 0x1c0b1(%rip), %rcx     # 0x43485
movl $0x14, %esi
movl $0x14, %edx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%r15), %rax
testb $0x30, %al
je 0x27402
movzwl %r13w, %esi
leaq 0x1dba5(%rip), %rdi     # 0x44f9e
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl %ebp, %edi
callq 0x1707a
movl %eax, %ebp
leaq 0x4(%r14), %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4d48
testl $0x4003333, (%r15)      # imm = 0x4003333
je 0x274b1
movl %eax, %r13d
movq (%rsp), %rax
leal 0x4(%rax), %edx
leaq 0x19ca4(%rip), %rcx     # 0x410dc
movl $0x4003333, %edi        # imm = 0x4003333
movq %rbx, %rsi
callq 0x55eb
movq (%r15), %rax
testl $0x3003, %eax           # imm = 0x3003
je 0x2748e
testb $0x40, %al
je 0x2746a
leaq 0x19c3d(%rip), %rdi     # 0x41097
leaq 0x22194(%rip), %rsi     # 0x495f5
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
leaq 0x216c0(%rip), %rdi     # 0x48b31
leaq 0x1bd73(%rip), %rcx     # 0x431eb
movl $0x14, %esi
movl $0x14, %edx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%r15), %rax
testb $0x30, %al
je 0x274a8
movzwl %r13w, %edx
leaq 0x22161(%rip), %rdi     # 0x495fe
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl %ebp, %edi
callq 0x1707a
movl %eax, %ebp
leaq 0x5(%r14), %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4d48
testl $0x4003333, (%r15)      # imm = 0x4003333
je 0x2754e
movl %eax, %r13d
movq (%rsp), %rax
leal 0x4(%rax), %edx
leaq 0x19bfe(%rip), %rcx     # 0x410dc
movl $0x4003333, %edi        # imm = 0x4003333
movq %rbx, %rsi
callq 0x55eb
testb $0x40, (%r15)
je 0x27508
leaq 0x19b9f(%rip), %rdi     # 0x41097
leaq 0x220f6(%rip), %rsi     # 0x495f5
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
leaq 0x21622(%rip), %rdi     # 0x48b31
leaq 0x220f2(%rip), %rcx     # 0x49608
movl $0x14, %esi
movl $0x14, %edx
xorl %eax, %eax
callq 0x3120
movl %eax, %ebx
addl %ebp, %ebx
testb $0x30, (%r15)
je 0x27545
movzwl %r13w, %esi
leaq 0x1da62(%rip), %rdi     # 0x44f9e
xorl %eax, %eax
callq 0x3120
addl %eax, %ebx
movl %ebx, %edi
callq 0x1707a
movl %eax, %ebp
leaq 0x6(%r14), %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4d48
testl $0x4003333, (%r15)      # imm = 0x4003333
je 0x2764b
movl %eax, %r13d
movq (%rsp), %rax
leal 0x4(%rax), %edx
leaq 0x19b61(%rip), %rcx     # 0x410dc
movl $0x4003333, %edi        # imm = 0x4003333
movq %rbx, %rsi
callq 0x55eb
movq (%r15), %rax
testl $0x3003, %eax           # imm = 0x3003
je 0x275d1
testb $0x40, %al
je 0x275ad
leaq 0x19afa(%rip), %rdi     # 0x41097
leaq 0x22051(%rip), %rsi     # 0x495f5
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
leaq 0x2157d(%rip), %rdi     # 0x48b31
leaq 0x2205c(%rip), %rcx     # 0x49617
movl $0x14, %esi
movl $0x14, %edx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%r15), %rax
testb $0x30, %al
je 0x27642
btl $0x19, %eax
movzwl %r13w, %ebx
jae 0x275f1
leaq 0x1d9b8(%rip), %rdi     # 0x44f9e
movl %ebx, %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
cvtsi2sd %ebx, %xmm0
mulsd 0x21d6b(%rip), %xmm0    # 0x49368
addsd 0x21d6b(%rip), %xmm0    # 0x49370
movsd %xmm0, 0x8(%rsp)
leaq 0x22014(%rip), %rdi     # 0x49626
movb $0x1, %al
callq 0x3120
movl %eax, %ebx
addl %ebp, %ebx
movsd 0x8(%rsp), %xmm0
callq 0x3040
mulsd 0x21d48(%rip), %xmm0    # 0x49378
leaq 0x21ffc(%rip), %rdi     # 0x49633
movb $0x1, %al
callq 0x3120
movl %eax, %ebp
addl %ebx, %ebp
movl %ebp, %edi
callq 0x1707a
movl %eax, %ebp
leaq 0x7(%r14), %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4d48
testl $0x4003333, (%r15)      # imm = 0x4003333
je 0x276f1
movl %eax, %r13d
movq (%rsp), %rax
leal 0x4(%rax), %edx
leaq 0x19a64(%rip), %rcx     # 0x410dc
movl $0x4003333, %edi        # imm = 0x4003333
movq %rbx, %rsi
callq 0x55eb
movq (%r15), %rax
testl $0x3003, %eax           # imm = 0x3003
je 0x276ce
testb $0x40, %al
je 0x276aa
leaq 0x199fd(%rip), %rdi     # 0x41097
leaq 0x21f54(%rip), %rsi     # 0x495f5
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
leaq 0x21480(%rip), %rdi     # 0x48b31
leaq 0x21f87(%rip), %rcx     # 0x4963f
movl $0x14, %esi
movl $0x14, %edx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%r15), %rax
testb $0x30, %al
je 0x276e8
movzwl %r13w, %edx
leaq 0x21f21(%rip), %rdi     # 0x495fe
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl %ebp, %edi
callq 0x1707a
movl %eax, %ebp
leaq 0x8(%r14), %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4d48
testl $0x4003333, (%r15)      # imm = 0x4003333
je 0x27797
movl %eax, %r13d
movq (%rsp), %rax
leal 0x4(%rax), %edx
leaq 0x199be(%rip), %rcx     # 0x410dc
movl $0x4003333, %edi        # imm = 0x4003333
movq %rbx, %rsi
callq 0x55eb
movq (%r15), %rax
testl $0x3003, %eax           # imm = 0x3003
je 0x27774
testb $0x40, %al
je 0x27750
leaq 0x19957(%rip), %rdi     # 0x41097
leaq 0x21eae(%rip), %rsi     # 0x495f5
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
leaq 0x213da(%rip), %rdi     # 0x48b31
leaq 0x21eeb(%rip), %rcx     # 0x49649
movl $0x14, %esi
movl $0x14, %edx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%r15), %rax
testb $0x30, %al
je 0x2778e
movzwl %r13w, %edx
leaq 0x21e7b(%rip), %rdi     # 0x495fe
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl %ebp, %edi
callq 0x1707a
movl %eax, %ebp
leaq 0x9(%r14), %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4d48
testl $0x4003333, (%r15)      # imm = 0x4003333
je 0x2783b
movl %eax, %r12d
movq (%rsp), %rdx
addl $0x4, %edx
leaq 0x19918(%rip), %rcx     # 0x410dc
movl $0x4003333, %edi        # imm = 0x4003333
movq %rbx, %rsi
callq 0x55eb
movq (%r15), %rax
testl $0x3003, %eax           # imm = 0x3003
je 0x2781a
testb $0x40, %al
je 0x277f6
leaq 0x198b1(%rip), %rdi     # 0x41097
leaq 0x21e08(%rip), %rsi     # 0x495f5
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
leaq 0x21334(%rip), %rdi     # 0x48b31
leaq 0x21e51(%rip), %rcx     # 0x49655
movl $0x14, %esi
movl $0x14, %edx
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%r15), %rax
testb $0x30, %al
je 0x27834
movzwl %r12w, %edx
leaq 0x21dd5(%rip), %rdi     # 0x495fe
movl %edx, %esi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movl %ebp, %edi
callq 0x1707a
movq 0x10(%rsp), %rax
addq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop