// File: /workspace/github_c_makefile_star2_O2/hfiguiere[P]exifprobe/ciff.c
// Function: canon_ct_to_datetime
unsigned long
canon_ct_to_datetime(FILE *inptr,unsigned short byteorder,char *tagname,unsigned long offset,
                                                unsigned long dirlength,int indent)
{
    unsigned long end_offset = 0UL;
    unsigned long count;
    unsigned long timezone;
    unsigned long zoneinfo;
    struct tm *ts_time;
    long timestamp;
    int chpr = 0;

    if(PRINT_SECTION)
    {
        chpr += printf(", length %lu",dirlength);
        chpr = newline(chpr);
    }

    count = dirlength / sizeof(unsigned long);
    end_offset = offset + dirlength;
    print_tag_address(ENTRY,offset,indent+MEDIUMINDENT,"@");
    tagname = tagname ? tagname : QSTRING;
    if(PRINT_TAGNAME)
        chpr += printf("%s",tagname);
    if(PRINT_VALUE)
    {
        chpr += printf(" = ");
        print_ulong(inptr,count,byteorder,offset);
    }
    timestamp = read_ulong(inptr,byteorder,offset);
    timezone = read_ulong(inptr,byteorder,HERE);
    zoneinfo = read_ulong(inptr,byteorder,HERE);
    if(PRINT_VALUE)
    {
        ts_time = gmtime(&timestamp);
        chpr += printf(" = %02d:%02d:%02d %02d:%02d:%02d GMT",ts_time->tm_year+1900,ts_time->tm_mon+1,
                ts_time->tm_mday,ts_time->tm_hour,ts_time->tm_min,ts_time->tm_sec);
        if((zoneinfo & 0x80000000) && timezone)
            chpr += printf(" + %lu",timezone);
    }
    chpr = newline(chpr);

    return(end_offset);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %r14d
movq %r8, %rbx
movq %rcx, %r12
movq %rdx, %r13
movl %esi, 0xc(%rsp)
movq %rdi, %r15
leaq 0x3848e(%rip), %rax     # 0x57180
xorl %ebp, %ebp
testb $0x4, 0x2(%rax)
je 0x1ed14
leaq 0x27a08(%rip), %rdi     # 0x46709
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
callq 0x160f7
movl %eax, %ebp
addl $0x4, %r14d
leaq 0x203bd(%rip), %rcx     # 0x3f0dc
movl $0x4003333, %edi        # imm = 0x4003333
movq %r12, %rsi
movl %r14d, %edx
callq 0x5100
leaq 0x3844a(%rip), %r14     # 0x57180
movq (%r14), %rax
btl $0xc, %eax
jae 0x1ed60
testq %r13, %r13
leaq 0x2433f(%rip), %rsi     # 0x43088
cmovneq %r13, %rsi
leaq 0x20343(%rip), %rdi     # 0x3f097
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%r14), %rax
movzwl 0xc(%rsp), %r13d
testb $0x30, %al
je 0x1ed97
movq %rbx, %r14
shrq $0x3, %r14
leaq 0x297e0(%rip), %rdi     # 0x48558
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq %r15, %rdi
movq %r14, %rsi
movl %r13d, %edx
movq %r12, %r14
movq %r12, %rcx
callq 0x7caf
jmp 0x1ed9a
movq %r12, %r14
movq %r15, %rdi
movl %r13d, %esi
movq %r14, %rdx
callq 0x42ba
movq %rax, 0x10(%rsp)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r15, %rdi
movl %r13d, %esi
callq 0x42ba
movq %rax, %r12
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r15, %rdi
movl %r13d, %esi
callq 0x42ba
movq %rax, %r15
leaq 0x383a6(%rip), %rax     # 0x57180
testb $0x30, (%rax)
je 0x1ee3c
leaq 0x10(%rsp), %rdi
callq 0x3230
movl $0x76c, %esi            # imm = 0x76C
addl 0x14(%rax), %esi
movl 0x10(%rax), %edx
incl %edx
movl 0xc(%rax), %ecx
movl 0x8(%rax), %r8d
movl (%rax), %edi
movl 0x4(%rax), %r9d
movl %edi, (%rsp)
leaq 0x27ab0(%rip), %rdi     # 0x468bd
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
testl %r15d, %r15d
sets %al
testq %r12, %r12
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x1ee3c
leaq 0x27ab2(%rip), %rdi     # 0x468e2
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
addq %r14, %rbx
movl %ebp, %edi
callq 0x160f7
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq