// File: /workspace/github_c_makefile_star2_O3/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 0x381bb(%rip), %rax     # 0x58180
xorl %ebp, %ebp
testb $0x4, 0x2(%rax)
je 0x1ffe7
leaq 0x28785(%rip), %rdi     # 0x48759
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
callq 0x1707a
movl %eax, %ebp
addl $0x4, %r14d
leaq 0x210ea(%rip), %rcx     # 0x410dc
movl $0x4003333, %edi        # imm = 0x4003333
movq %r12, %rsi
movl %r14d, %edx
callq 0x55eb
leaq 0x38177(%rip), %r14     # 0x58180
movq (%r14), %rax
btl $0xc, %eax
jae 0x20033
testq %r13, %r13
leaq 0x250b0(%rip), %rsi     # 0x450cc
cmovneq %r13, %rsi
leaq 0x21070(%rip), %rdi     # 0x41097
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq (%r14), %rax
movzwl 0xc(%rsp), %r13d
testb $0x30, %al
je 0x2006a
movq %rbx, %r14
shrq $0x3, %r14
leaq 0x2a55d(%rip), %rdi     # 0x4a5a8
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq %r15, %rdi
movq %r14, %rsi
movl %r13d, %edx
movq %r12, %r14
movq %r12, %rcx
callq 0x8302
jmp 0x2006d
movq %r12, %r14
movq %r15, %rdi
movl %r13d, %esi
movq %r14, %rdx
callq 0x4707
movq %rax, 0x10(%rsp)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r15, %rdi
movl %r13d, %esi
callq 0x4707
movq %rax, %r12
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r15, %rdi
movl %r13d, %esi
callq 0x4707
movq %rax, %r15
leaq 0x380d3(%rip), %rax     # 0x58180
testb $0x30, (%rax)
je 0x2010f
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 0x2882d(%rip), %rdi     # 0x4890d
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 0x2010f
leaq 0x2882f(%rip), %rdi     # 0x48932
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
addq %r14, %rbx
movl %ebp, %edi
callq 0x1707a
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq