// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: isDate
static int isDate(
  sqlite3_context *context, 
  int argc, 
  sqlite3_value **argv, 
  DateTime *p
){
  int i;
  const unsigned char *z;
  int eType;
  memset(p, 0, sizeof(*p));
  if( argc==0 ){
    return setDateTimeToCurrent(context, p);
  }
  if( (eType = sqlite3_value_type(argv[0]))==SQLITE_FLOAT
                   || eType==SQLITE_INTEGER ){
    p->iJD = (sqlite3_int64)(sqlite3_value_double(argv[0])*86400000.0 + 0.5);
    p->validJD = 1;
  }else{
    z = sqlite3_value_text(argv[0]);
    if( !z || parseDateOrTime(context, (char*)z, p) ){
      return 1;
    }
  }
  for(i=1; i<argc; i++){
    z = sqlite3_value_text(argv[i]);
    if( z==0 || parseModifier(context, (char*)z, p) ) return 1;
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rcx, %rbx
xorpd %xmm0, %xmm0
movupd %xmm0, 0x20(%rcx)
movupd %xmm0, 0x10(%rcx)
movupd %xmm0, (%rcx)
testl %esi, %esi
je 0x5a351
movq %rdx, %r12
movl %esi, %r15d
movq %rdi, -0x58(%rbp)
movq (%rdx), %rdi
movzbl 0x26(%rdi), %eax
decl %eax
cmpl $0x1, %eax
movq %rbx, -0x30(%rbp)
movq %rdx, -0x60(%rbp)
ja 0x5a36a
callq 0xdf89
mulsd 0x11656(%rip), %xmm0    # 0x6b2b0
addsd 0x1161e(%rip), %xmm0    # 0x6b280
cvttsd2si %xmm0, %rax
movq %rax, (%rbx)
movb $0x1, 0x2a(%rbx)
movslq %r15d, %rax
movq %rax, -0x98(%rbp)
pushq $0x1
popq %rbx
leaq 0xe2ee(%rip), %r14      # 0x67f70
leaq 0xe3e7(%rip), %r15      # 0x68070
cmpq -0x98(%rbp), %rbx
jge 0x5a49a
movq (%r12,%rbx,8), %rdi
callq 0xdf1e
testq %rax, %rax
je 0x5a494
movl $0x1, -0x34(%rbp)
xorl %ecx, %ecx
cmpq $0x1d, %rcx
je 0x59ccd
movzbl (%rax,%rcx), %edx
testq %rdx, %rdx
je 0x59ccd
movb (%rdx,%r15), %dl
movb %dl, -0x80(%rbp,%rcx)
incq %rcx
jmp 0x59cb1
movb $0x0, -0x80(%rbp,%rcx)
movzbl -0x80(%rbp), %r12d
leal -0x30(%r12), %eax
cmpl $0xa, %eax
jae 0x59e93
movq %rbx, -0x48(%rbp)
leaq -0x80(%rbp), %r13
pushq $0x1
popq %rdx
movzbl -0x80(%rbp,%rdx), %ebx
testl %ebx, %ebx
je 0x59d0d
cmpl $0x3a, %ebx
je 0x59d0d
testb $0x1, (%rbx,%r14)
jne 0x59d0d
incq %rdx
incq %r13
jmp 0x59cf0
leaq -0x80(%rbp), %rdi
leaq -0x50(%rbp), %rsi
pushq $0x1
popq %rcx
callq 0x20fe3
testl %eax, %eax
je 0x5a494
cmpl $0x3a, %ebx
jne 0x59dd2
addq $-0x3a, %r12
xorl %eax, %eax
cmpq $-0xa, %r12
setb %al
leaq (%rax,%rbp), %rdi
addq $-0x80, %rdi
xorpd %xmm0, %xmm0
movapd %xmm0, -0xb0(%rbp)
movapd %xmm0, -0xc0(%rbp)
movapd %xmm0, -0xd0(%rbp)
leaq -0xd0(%rbp), %rsi
callq 0x5a64f
testl %eax, %eax
movq -0x48(%rbp), %rbx
jne 0x5a33b
leaq -0xd0(%rbp), %rdi
callq 0x5a515
movq -0xd0(%rbp), %rax
addq $-0x2932e00, %rax       # imm = 0xFD6CD200
cqto
movl $0x5265c00, %ecx        # imm = 0x5265C00
idivq %rcx
movq %rdx, %rbx
negq %rbx
cmpb $0x2d, -0x80(%rbp)
cmovneq %rdx, %rbx
movq -0x30(%rbp), %r12
movq %r12, %rdi
callq 0x5a515
andw $0x0, 0x28(%r12)
movb $0x0, 0x2b(%r12)
addq %rbx, (%r12)
movq -0x48(%rbp), %rbx
andl $0x0, -0x34(%rbp)
jmp 0x5a33b
movzbl 0x1(%r13), %eax
incq %r13
testb $0x1, (%rax,%r14)
jne 0x59dd2
movq %r13, %rdi
callq 0x8f8e
leal -0xb(%rax), %ecx
cmpl $-0x8, %ecx
movq -0x48(%rbp), %rbx
jb 0x5a33b
movl %eax, %r12d
decl %eax
cmpb $0x73, (%r13,%rax)
jne 0x59e0f
movb $0x0, (%r13,%rax)
movl %eax, %r12d
movq -0x30(%rbp), %rdi
callq 0x5a515
andl $0x0, -0x34(%rbp)
movsd -0x50(%rbp), %xmm1
xorl %eax, %eax
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
seta %cl
addl $-0x3, %r12d
cmpl $0x3, %r12d
ja 0x5a1c5
movapd %xmm1, -0x90(%rbp)
movb %cl, %al
leaq 0x11593(%rip), %rcx     # 0x6b3e0
movsd (%rcx,%rax,8), %xmm0
movsd %xmm0, -0x40(%rbp)
leaq 0xe0ee(%rip), %rcx      # 0x67f4c
movslq (%rcx,%r12,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r13, %rdi
leaq 0x1508d(%rip), %rsi     # 0x6eefe
callq 0x8510
testl %eax, %eax
movapd -0x90(%rbp), %xmm0
jne 0x5a1c5
mulsd 0x11422(%rip), %xmm0    # 0x6b2b0
jmp 0x5a23c
cmpl $0x2b, %r12d
je 0x59ce5
cmpl $0x77, %r12d
je 0x5a02c
cmpl $0x6c, %r12d
je 0x59fde
cmpl $0x73, %r12d
je 0x59ed0
cmpl $0x75, %r12d
je 0x59f5c
cmpl $0x2d, %r12d
je 0x59ce5
jmp 0x5a33b
leaq -0x80(%rbp), %rdi
leaq 0x15073(%rip), %rsi     # 0x6ef4e
pushq $0x9
popq %rdx
callq 0x83e0
testl %eax, %eax
jne 0x5a33b
movq %rbx, %r13
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x5ab3c
movw $0x1, 0x29(%rbx)
andq $0x0, 0x14(%rbx)
andq $0x0, 0x20(%rbx)
movb $0x0, 0x2b(%rbx)
leaq -0x77(%rbp), %r12
movq %r12, %rdi
leaq 0x1503c(%rip), %rsi     # 0x6ef58
pushq $0x6
popq %rdx
callq 0x83e0
testl %eax, %eax
je 0x5a24f
movq %r12, %rdi
leaq 0x15028(%rip), %rsi     # 0x6ef5e
pushq $0x5
popq %rdx
callq 0x83e0
testl %eax, %eax
je 0x5a2a7
cmpl $0x796164, (%r12)       # imm = 0x796164
movq %r13, %rbx
jne 0x5a33b
jmp 0x5a2c4
leaq -0x80(%rbp), %rdi
leaq 0x14fdd(%rip), %rsi     # 0x6ef44
pushq $0xa
popq %rdx
callq 0x83e0
testl %eax, %eax
je 0x5a1d5
cmpl $0x637475, -0x80(%rbp)  # imm = 0x637475
jne 0x5a33b
movq %rbx, %r13
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x5a515
movq %rbx, %rdi
movq -0x58(%rbp), %rsi
leaq -0x34(%rbp), %rdx
callq 0x5a9df
cmpl $0x0, -0x34(%rbp)
jne 0x5a494
movq %rax, %r12
movq -0x30(%rbp), %rbx
subq %rax, (%rbx)
andw $0x0, 0x28(%rbx)
movb $0x0, 0x2b(%rbx)
movq %rbx, %rdi
movq -0x58(%rbp), %rsi
leaq -0x34(%rbp), %rdx
callq 0x5a9df
subq %rax, %r12
addq %r12, (%rbx)
movq %r13, %rbx
jmp 0x5a33b
leaq -0x80(%rbp), %rdi
leaq 0x162a5(%rip), %rsi     # 0x7028e
pushq $0xa
popq %rdx
callq 0x83e0
testl %eax, %eax
jne 0x5a33b
movq %rbx, %r12
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x5a515
movq %rbx, %rdi
movq -0x58(%rbp), %rsi
leaq -0x34(%rbp), %rdx
callq 0x5a9df
addq %rax, (%rbx)
andw $0x0, 0x28(%rbx)
movb $0x0, 0x2b(%rbx)
movq %r12, %rbx
jmp 0x5a33b
movabsq $0x207961646b656577, %rax # imm = 0x207961646B656577
cmpq %rax, -0x80(%rbp)
jne 0x5a33b
movq %rbx, %r13
leaq -0x78(%rbp), %rbx
movq %rbx, %rdi
callq 0x8f8e
movq %rbx, %rdi
movq %r13, %rbx
leaq -0x50(%rbp), %rsi
movl %eax, %edx
pushq $0x1
popq %rcx
callq 0x20fe3
testl %eax, %eax
je 0x5a33b
movsd -0x50(%rbp), %xmm0
movsd 0x112b0(%rip), %xmm1    # 0x6b328
ucomisd %xmm0, %xmm1
jbe 0x5a33b
cvttsd2si %xmm0, %r12d
testl %r12d, %r12d
js 0x5a33b
cvttpd2dq %xmm0, %xmm1
cvtdq2pd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x5a33b
jp 0x5a33b
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x5ab20
andw $0x0, 0x2a(%rbx)
movq %rbx, %rdi
callq 0x5a515
movq (%rbx), %rcx
leaq 0x7b98a00(%rcx), %rax
cqto
movl $0x5265c00, %esi        # imm = 0x5265C00
idivq %rsi
cqto
pushq $0x7
popq %rsi
idivq %rsi
movl %r12d, %eax
leaq -0x7(%rdx), %rsi
cmpq %rax, %rdx
cmovgq %rsi, %rdx
subq %rdx, %rax
imulq $0x5265c00, %rax, %rax  # imm = 0x5265C00
addq %rcx, %rax
movq %rax, (%rbx)
andw $0x0, 0x28(%rbx)
movb $0x0, 0x2b(%rbx)
jmp 0x5a2c1
movq %r13, %rdi
leaq 0x14e45(%rip), %rsi     # 0x6ef58
callq 0x8510
testl %eax, %eax
jne 0x5a1c5
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x5ab20
cvttsd2si -0x90(%rbp), %r12d
movl 0xc(%rbx), %ecx
addl %r12d, %ecx
jle 0x5a2ca
leal -0x1(%rcx), %eax
xorl %edx, %edx
pushq $0xc
popq %rsi
divl %esi
jmp 0x5a2d7
movq %r13, %rdi
leaq 0x14e0e(%rip), %rsi     # 0x6ef68
callq 0x8510
testl %eax, %eax
je 0x5a21a
movq %r13, %rdi
leaq 0x14dfe(%rip), %rsi     # 0x6ef6f
callq 0x8510
testl %eax, %eax
movapd -0x90(%rbp), %xmm0
jne 0x5a1c5
mulsd 0x1117e(%rip), %xmm0    # 0x6b308
jmp 0x5a23c
movq %r13, %rdi
leaq 0x14dca(%rip), %rsi     # 0x6ef63
callq 0x8510
testl %eax, %eax
je 0x5a22c
movq %r13, %rdi
leaq 0x14dae(%rip), %rsi     # 0x6ef5e
callq 0x8510
testl %eax, %eax
movapd -0x90(%rbp), %xmm0
je 0x5a258
movl $0x1, -0x34(%rbp)
movq -0x30(%rbp), %r13
jmp 0x5a330
movq -0x30(%rbp), %rax
cmpb $0x0, 0x2a(%rax)
je 0x59f77
movq -0x30(%rbp), %rcx
movq (%rcx), %rax
movl $0xa8c0, %edx           # imm = 0xA8C0
addq %rdx, %rax
cqto
movl $0x15180, %esi          # imm = 0x15180
idivq %rsi
movabsq $0xbfc83e532200, %rdx   # imm = 0xBFC83E532200
addq %rdx, %rax
movq %rax, (%rcx)
andw $0x0, 0x28(%rcx)
movb $0x0, 0x2b(%rcx)
jmp 0x5a2c4
movapd -0x90(%rbp), %xmm0
mulsd 0x110e6(%rip), %xmm0    # 0x6b310
jmp 0x5a23c
movapd -0x90(%rbp), %xmm0
mulsd 0x110e4(%rip), %xmm0    # 0x6b320
addsd -0x40(%rbp), %xmm0
cvttsd2si %xmm0, %rax
movq -0x30(%rbp), %r13
jmp 0x5a32c
movl $0x1, 0x10(%rbx)
jmp 0x5a2c1
cvttsd2si %xmm0, %ebx
movq -0x30(%rbp), %r13
movq %r13, %rdi
callq 0x5ab20
addl %ebx, 0x8(%r13)
movq -0x48(%rbp), %rbx
movb $0x0, 0x2a(%r13)
movq %r13, %rdi
callq 0x5a515
movapd -0x90(%rbp), %xmm1
cvttpd2dq %xmm1, %xmm0
cvtdq2pd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x5a299
jnp 0x5a330
subsd %xmm0, %xmm1
mulsd 0x11073(%rip), %xmm1    # 0x6b318
jmp 0x5a31a
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x5ab3c
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0xc(%rbx)
movq %r13, %rbx
movq -0x60(%rbp), %r12
jmp 0x5a349
pushq $0xc
popq %rsi
movl %esi, %eax
subl %ecx, %eax
xorl %edx, %edx
divl %esi
negl %eax
movq -0x48(%rbp), %rbx
movq -0x30(%rbp), %r13
addl %eax, 0x8(%r13)
imull $-0xc, %eax, %eax
addl %ecx, %eax
movl %eax, 0xc(%r13)
movb $0x0, 0x2a(%r13)
movq %r13, %rdi
callq 0x5a515
cvtsi2sd %r12d, %xmm0
movapd -0x90(%rbp), %xmm1
ucomisd %xmm0, %xmm1
jne 0x5a30e
jnp 0x5a330
subsd %xmm0, %xmm1
mulsd 0x10fe6(%rip), %xmm1    # 0x6b300
mulsd 0x10f8e(%rip), %xmm1    # 0x6b2b0
addsd -0x40(%rbp), %xmm1
cvttsd2si %xmm1, %rax
addq %rax, (%r13)
andw $0x0, 0x28(%r13)
movb $0x0, 0x2b(%r13)
cmpl $0x0, -0x34(%rbp)
movq -0x60(%rbp), %r12
jne 0x5a494
incq %rbx
jmp 0x59c89
movq %rbx, %rsi
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5a624
callq 0xdf1e
testq %rax, %rax
je 0x5a494
movq %rax, %r13
movb (%rax), %bl
xorl %r14d, %r14d
cmpb $0x2d, %bl
sete %r14b
leaq (%rax,%r14), %rdi
leaq -0x34(%rbp), %rax
movq %rax, 0x48(%rsp)
pushq $0x1
popq %rdx
movl %edx, 0x30(%rsp)
pushq $0x2
popq %rax
movl %eax, 0x28(%rsp)
leaq -0x50(%rbp), %rcx
movq %rcx, 0x20(%rsp)
movl %edx, 0x8(%rsp)
movl %eax, (%rsp)
andl $0x0, 0x40(%rsp)
movl $0x1f, 0x38(%rsp)
movl $0x2d, 0x18(%rsp)
movl $0xc, 0x10(%rsp)
pushq $0x4
popq %rsi
pushq $0x2d
popq %r8
leaq -0x80(%rbp), %r9
xorl %edx, %edx
movl $0x270f, %ecx           # imm = 0x270F
xorl %eax, %eax
callq 0x5a846
cmpl $0x3, %eax
jne 0x5a439
leaq (%r14,%r13), %r12
addq $0x9, %r12
leaq 0xdb74(%rip), %rax      # 0x67f70
movzbl 0x1(%r12), %ecx
incq %r12
cmpq $0x54, %rcx
je 0x5a3fc
movb (%rcx,%rax), %cl
andb $0x1, %cl
jne 0x5a3fc
movq %r12, %rdi
movq -0x30(%rbp), %r14
movq %r14, %rsi
callq 0x5a64f
testl %eax, %eax
je 0x5a4d4
cmpb $0x0, (%r12)
movq -0x60(%rbp), %r12
je 0x5a4cb
movq %r13, %rdi
movq -0x30(%rbp), %rbx
movq %rbx, %rsi
callq 0x5a64f
testl %eax, %eax
je 0x59c6e
leaq 0x14ae9(%rip), %rsi     # 0x6ef40
movq %r13, %rdi
callq 0xb1bf
testl %eax, %eax
je 0x5a4b2
movq %r13, %rdi
callq 0x8f8e
leaq -0xd0(%rbp), %rsi
pushq $0x1
popq %r14
movq %r13, %rdi
movl %eax, %edx
movl %r14d, %ecx
callq 0x20fe3
testl %eax, %eax
je 0x5a49d
movsd -0xd0(%rbp), %xmm0
jmp 0x59c52
pushq $0x1
popq %r14
jmp 0x5a49d
xorl %r14d, %r14d
movl %r14d, %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x58(%rbp), %rdi
movq %rbx, %rsi
callq 0x5a624
testl %eax, %eax
pushq $0x1
popq %r14
jne 0x5a49d
jmp 0x59c6e
movq -0x30(%rbp), %r14
movb $0x0, 0x29(%r14)
movb $0x0, 0x2a(%r14)
movb $0x1, 0x28(%r14)
movl -0x80(%rbp), %eax
movl %eax, %ecx
negl %ecx
cmpb $0x2d, %bl
cmovnel %eax, %ecx
movl %ecx, 0x8(%r14)
movl -0x50(%rbp), %eax
movl %eax, 0xc(%r14)
movl -0x34(%rbp), %eax
movl %eax, 0x10(%r14)
cmpb $0x0, 0x2b(%r14)
je 0x5a50c
movq %r14, %rdi
callq 0x5a515
movq -0x60(%rbp), %r12
jmp 0x59c6e