// File: /workspace/github_cpp_makefile_star2_O1/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
movabsq $0x199999999999999a, %rdx # imm = 0x199999999999999A
movq %rsi, %rax
mulq %rdx
movq %rdx, %r14
leaq 0x28(%rsp), %rdi
testl %ecx, %ecx
je 0xca83
callq 0x3180
jmp 0xca88
callq 0x31d0
leaq 0x2d2d(%rip), %rdx      # 0xf7bc
leaq 0x90(%rsp), %r15
movl $0x14, %esi
movq %r15, %rdi
movq %rax, %rcx
callq 0x31a0
leaq 0x2d2e(%rip), %rsi      # 0xf7dc
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 0x97be
leaq 0x2c96(%rip), %rsi      # 0xf787
leaq 0x70(%rsp), %rdi
callq 0x34b0
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xcb22
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0xcb29
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 0x40(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x1(%rsp), %r14
movq %r14, %rdi
callq 0x30e0
leaq (%rsp,%rax), %rdx
incq %rdx
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0x97be
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %r8
movq 0x38(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r15, %rcx
je 0xcb8d
movq 0x18(%rsp), %rsi
cmpq %rsi, %rax
jbe 0xcba8
movl $0xf, %esi
cmpq %rbp, 0x30(%rsp)
je 0xcba3
movq 0x40(%rsp), %rsi
cmpq %rsi, %rax
jbe 0xcbb9
movq 0x30(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x30b0
jmp 0xcbc7
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3290
leaq 0x60(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0xcbeb
movq %rsi, 0x50(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x60(%rsp)
jmp 0xcbf1
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x58(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x50(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3300
movq (%r14), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0xcc38
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3230
movq 0x30(%rsp), %rdi
cmpq %rbp, %rdi
je 0xcc4f
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3230
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xcc66
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3230
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0xcc80
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 0x30(%rsp), %rdi
cmpq %rbp, %rdi
je 0xccb4
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3230
jmp 0xccb4
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xccd0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3230
jmp 0xccd0
movq %rax, %r14
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0xccef
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3230
jmp 0xccef
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0xcd03
movq (%r13), %rsi
incq %rsi
callq 0x3230
movq %r14, %rdi
callq 0x3470