// File: /workspace/github_cpp_makefile_star2_O3/4n6ist[P]usn_analytics/lib/utils.cpp
// Function: parse_datetimemicro[abi:cxx11](unsigned long, bool)
string parse_datetimemicro(uint64_t _time, bool lt) {  
  char buf1[32], buf2[7];
  struct tm *tm_info;
  int microseconds;
  time_t epoch;
  string time_str;
 
  // 11644473600.0 seconds from 1601/01/01 to 1970/01/01
  epoch = _time/(10*1000*1000) - 11644473600L;
  microseconds = (_time%(10*1000*1000))/10;
 
  if(lt)
    tm_info = localtime(&epoch);
  else
    tm_info = gmtime(&epoch);
 
  strftime(buf1, 20, "%Y/%m/%d %H:%M:%S", tm_info);
  sprintf(buf2, "%06d", microseconds);  
  time_str = string(buf1) + "." + string(buf2);
  
  return time_str;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movl %edx, %ecx
movq %rdi, %rbx
leaq 0x10(%rdi), %r13
movq %r13, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
movabsq $-0x29406b2a1a85bd43, %rdx # imm = 0xD6BF94D5E57A42BD
movq %rsi, %rax
mulq %rdx
shrq $0x17, %rdx
movabsq $-0x2b6109100, %rax     # imm = 0xFFFFFFFD49EF6F00
addq %rdx, %rax
movq %rax, 0x28(%rsp)
imulq $0x989680, %rdx, %rax   # imm = 0x989680
subq %rax, %rsi
imulq $0x1999999a, %rsi, %r14 # imm = 0x1999999A
shrq $0x20, %r14
leaq 0x28(%rsp), %rdi
testl %ecx, %ecx
je 0xca49
callq 0x3180
jmp 0xca4e
callq 0x31d0
leaq 0x2d66(%rip), %rdx      # 0xf7bb
leaq 0x90(%rsp), %r15
movl $0x14, %esi
movq %r15, %rdi
movq %rax, %rcx
callq 0x31a0
leaq 0x2d67(%rip), %rsi      # 0xf7db
leaq 0x1(%rsp), %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x3070
leaq 0x80(%rsp), %r12
movq %r12, -0x10(%r12)
movq %r15, %rdi
callq 0x30e0
leaq (%rsp,%rax), %rdx
addq $0x90, %rdx
leaq 0x70(%rsp), %rdi
movq %r15, %rsi
callq 0x981e
leaq 0x2ccf(%rip), %rsi      # 0xf786
leaq 0x70(%rsp), %rdi
callq 0x34a0
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xcae8
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0xcaef
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x60(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x1(%rsp), %r14
movq %r14, %rdi
callq 0x30e0
leaq (%rsp,%rax), %rdx
incq %rdx
leaq 0x50(%rsp), %rdi
movq %r14, %rsi
callq 0x981e
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %r8
movq 0x58(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r15, %rcx
je 0xcb53
movq 0x18(%rsp), %rdi
movq 0x50(%rsp), %rsi
cmpq %rdi, %rax
jbe 0xcb71
movl $0xf, %edi
cmpq %rbp, %rsi
je 0xcb6c
movq 0x60(%rsp), %rdi
cmpq %rdi, %rax
jbe 0xcb7d
leaq 0x8(%rsp), %rdi
callq 0x30b0
jmp 0xcb8b
leaq 0x50(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3290
leaq 0x40(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0xcbaf
movq %rsi, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0xcbb5
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x38(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x30(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3300
movq (%r14), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xcbfc
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3230
movq 0x50(%rsp), %rdi
cmpq %rbp, %rdi
je 0xcc13
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3230
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xcc2a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3230
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0xcc44
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3230
movq %rbx, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x50(%rsp), %rdi
cmpq %rbp, %rdi
je 0xcc78
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3230
jmp 0xcc78
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xcc94
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3230
jmp 0xcc94
movq %rax, %r14
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0xccb3
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3230
jmp 0xccb3
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0xccc7
movq (%r13), %rsi
incq %rsi
callq 0x3230
movq %r14, %rdi
callq 0x3460