// File: /workspace/github_c_makefile_star2_O1/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 $0xa8, %rsp
movq %rcx, %rbx
movq %rdi, %r14
xorpd %xmm0, %xmm0
movupd %xmm0, 0x20(%rcx)
movupd %xmm0, 0x10(%rcx)
movupd %xmm0, (%rcx)
testl %esi, %esi
je 0x65b45
movq %rdx, %r15
movl %esi, %r13d
movq (%rdx), %rdi
movzbl 0x26(%rdi), %eax
decl %eax
cmpl $0x1, %eax
movq %rbx, -0x38(%rbp)
movq %rdx, -0x50(%rbp)
ja 0x65b6b
callq 0xed72
mulsd 0x13774(%rip), %xmm0    # 0x792a0
addsd 0x1373c(%rip), %xmm0    # 0x79270
cvttsd2si %xmm0, %rax
movq %rax, (%rbx)
movb $0x1, 0x2a(%rbx)
jmp 0x65d5c
movq 0x8(%r14), %rax
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x25588
movl $0x1, %r12d
testl %eax, %eax
jne 0x66548
movb $0x1, 0x2a(%rbx)
jmp 0x6653d
movl $0x1, %r12d
movl $0x1, %esi
callq 0xee49
testq %rax, %rax
je 0x66548
movq %rax, %r15
movq %r14, -0x48(%rbp)
movb (%rax), %al
xorl %r14d, %r14d
movb %al, -0x98(%rbp)
cmpb $0x2d, %al
sete %r14b
leaq (%r15,%r14), %rdi
leaq -0x2c(%rbp), %r10
movl $0x1, %r11d
movl $0x2, %r12d
leaq -0x78(%rbp), %rbx
leaq -0x70(%rbp), %r9
movl $0x4, %esi
xorl %edx, %edx
movl $0x270f, %ecx           # imm = 0x270F
movl $0x2d, %r8d
xorl %eax, %eax
pushq %r10
pushq $0x0
pushq $0x1f
pushq %r11
pushq %r12
pushq %rbx
pushq $0x2d
pushq $0xc
pushq %r11
pushq %r12
callq 0x668a1
addq $0x50, %rsp
cmpl $0x3, %eax
jne 0x65c35
leaq (%r14,%r15), %r12
addq $0x9, %r12
leaq 0x10364(%rip), %rax     # 0x75f60
movzbl 0x1(%r12), %ecx
incq %r12
cmpq $0x54, %rcx
je 0x65bfc
movb (%rcx,%rax), %cl
andb $0x1, %cl
jne 0x65bfc
movq %r12, %rdi
movq -0x38(%rbp), %rbx
movq %rbx, %rsi
callq 0x66694
testl %eax, %eax
je 0x65d1e
cmpb $0x0, (%r12)
je 0x65d16
movq %r15, %rdi
movq -0x38(%rbp), %rbx
movq %rbx, %rsi
callq 0x66694
testl %eax, %eax
movq -0x48(%rbp), %r14
je 0x65d58
movb (%r15), %cl
testb %cl, %cl
je 0x65c8a
movq %r15, %rdx
incq %rdx
leaq 0x172bc(%rip), %rax     # 0x7cf20
leaq 0x103f5(%rip), %rsi     # 0x76060
movzbl %cl, %edi
movb (%rdi,%rsi), %dil
movzbl (%rax), %r8d
cmpb (%r8,%rsi), %dil
jne 0x65c91
incq %rax
movb (%rdx), %cl
incq %rdx
testb %cl, %cl
jne 0x65c6b
jmp 0x65c91
leaq 0x1728f(%rip), %rax     # 0x7cf20
movzbl %cl, %ecx
leaq 0x103c5(%rip), %rdx     # 0x76060
movb (%rcx,%rdx), %cl
movzbl (%rax), %eax
cmpb (%rax,%rdx), %cl
jne 0x65cbf
movq 0x8(%r14), %rax
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x25588
testl %eax, %eax
jne 0x66542
jmp 0x65d10
xorl %eax, %eax
movq %rax, %rdx
incq %rax
cmpb $0x0, (%r15,%rdx)
jne 0x65cc1
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
leaq -0xd0(%rbp), %rsi
movq %r15, %rdi
movl $0x1, %ecx
callq 0x248aa
testl %eax, %eax
je 0x66542
movsd -0xd0(%rbp), %xmm0
mulsd 0x135a0(%rip), %xmm0    # 0x792a0
addsd 0x13568(%rip), %xmm0    # 0x79270
cvttsd2si %xmm0, %rax
movq %rax, (%rbx)
movb $0x1, 0x2a(%rbx)
jmp 0x65d58
movq -0x38(%rbp), %rbx
movb $0x0, 0x29(%rbx)
movb $0x0, 0x2a(%rbx)
movb $0x1, 0x28(%rbx)
movl -0x70(%rbp), %eax
movl %eax, %ecx
negl %ecx
cmpb $0x2d, -0x98(%rbp)
cmovnel %eax, %ecx
movl %ecx, 0x8(%rbx)
movl -0x78(%rbp), %eax
movl %eax, 0xc(%rbx)
movl -0x2c(%rbp), %eax
movl %eax, 0x10(%rbx)
cmpb $0x0, 0x2b(%rbx)
je 0x65d54
movq %rbx, %rdi
callq 0x6655d
movq -0x48(%rbp), %r14
movq -0x50(%rbp), %r15
cmpl $0x2, %r13d
jl 0x6653d
movq %r14, -0x48(%rbp)
movl %r13d, %eax
movq %rax, -0x98(%rbp)
movl $0x1, %r12d
leaq 0x102df(%rip), %r14     # 0x76060
movq (%r15,%r12,8), %rdi
movl $0x1, %esi
callq 0xee49
testq %rax, %rax
je 0x66542
movl $0x1, -0x2c(%rbp)
xorl %ecx, %ecx
leaq 0x101b8(%rip), %rsi     # 0x75f60
movzbl (%rax,%rcx), %edx
testq %rdx, %rdx
je 0x65dc7
movb (%rdx,%r14), %dl
movb %dl, -0x70(%rbp,%rcx)
incq %rcx
cmpq $0x1d, %rcx
jne 0x65da8
movl $0x1d, %ecx
movl %ecx, %eax
movb $0x0, -0x70(%rbp,%rax)
movzbl -0x70(%rbp), %ebx
cmpl $0x6b, %ebx
jg 0x66054
leal -0x30(%rbx), %eax
cmpl $0xa, %eax
jae 0x660fe
movl $0x1, %edx
leaq -0x70(%rbp), %r13
movq %r13, %rax
movzbl -0x70(%rbp,%rdx), %r15d
testl %r15d, %r15d
je 0x65e16
cmpl $0x3a, %r15d
je 0x65e16
testb $0x1, (%r15,%rsi)
jne 0x65e16
incq %rdx
incq %r13
incq %rax
jmp 0x65df3
leaq -0x70(%rbp), %rdi
leaq -0x78(%rbp), %rsi
movl $0x1, %ecx
callq 0x248aa
testl %eax, %eax
je 0x660f2
cmpl $0x3a, %r15d
leaq 0x10125(%rip), %rcx     # 0x75f60
jne 0x65f0f
addq $-0x3a, %rbx
xorl %eax, %eax
cmpq $-0xa, %rbx
setb %al
leaq (%rax,%rbp), %rdi
addq $-0x70, %rdi
xorpd %xmm0, %xmm0
movapd %xmm0, -0xb0(%rbp)
movapd %xmm0, -0xc0(%rbp)
movapd %xmm0, -0xd0(%rbp)
leaq -0xd0(%rbp), %rsi
callq 0x66694
testl %eax, %eax
movq -0x50(%rbp), %r15
jne 0x66486
leaq -0xd0(%rbp), %rdi
callq 0x6655d
movq -0xd0(%rbp), %rcx
addq $-0x2932e00, %rcx       # imm = 0xFD6CD200
movq %rcx, %rax
movabsq $0x636ba875fd33dc87, %rdx # imm = 0x636BA875FD33DC87
imulq %rdx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x19, %rdx
addq %rax, %rdx
imulq $0x5265c00, %rdx, %rax  # imm = 0x5265C00
subq %rax, %rcx
movq %rcx, -0xd0(%rbp)
cmpb $0x2d, -0x70(%rbp)
jne 0x65ee3
negq %rcx
movq %rcx, -0xd0(%rbp)
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
callq 0x6655d
movw $0x0, 0x28(%rbx)
movb $0x0, 0x2b(%rbx)
movq -0xd0(%rbp), %rax
addq %rax, (%rbx)
movl $0x0, -0x2c(%rbp)
jmp 0x66486
movzbl 0x1(%r13), %eax
incq %r13
testb $0x1, (%rax,%rcx)
jne 0x65f0f
movl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
xorl %ecx, %ecx
movq -0x50(%rbp), %r15
movq %rcx, %rbx
incl %eax
incq %rcx
cmpb $0x0, (%r13,%rbx)
jne 0x65f28
andl $0x3fffffff, %ebx       # imm = 0x3FFFFFFF
leal -0xb(%rbx), %ecx
cmpl $-0x8, %ecx
jb 0x66486
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
decl %eax
cmpb $0x73, (%r13,%rax)
jne 0x65f61
decl %ebx
movb $0x0, (%r13,%rax)
movq -0x38(%rbp), %rdi
callq 0x6655d
movl $0x0, -0x2c(%rbp)
movsd -0x78(%rbp), %xmm1
xorl %eax, %eax
xorpd %xmm0, %xmm0
movapd %xmm1, -0x90(%rbp)
ucomisd %xmm1, %xmm0
seta %al
leaq 0x1342e(%rip), %rcx     # 0x793c0
movsd (%rcx,%rax,8), %xmm0
movsd %xmm0, -0x40(%rbp)
cmpl $0x3, %ebx
jne 0x65fb8
movq %r13, %rdi
leaq 0x16f33(%rip), %rsi     # 0x7cede
callq 0x8530
testl %eax, %eax
je 0x66376
cmpl $0x4, %ebx
jne 0x65fd4
movq %r13, %rdi
leaq 0x16f7c(%rip), %rsi     # 0x7cf43
callq 0x8530
testl %eax, %eax
je 0x6638b
cmpl $0x5, %ebx
je 0x66011
cmpl $0x6, %ebx
jne 0x66028
movq %r13, %rdi
leaq 0x16f60(%rip), %rsi     # 0x7cf48
callq 0x8530
testl %eax, %eax
je 0x663e1
movq %r13, %rdi
leaq 0x16f50(%rip), %rsi     # 0x7cf4f
callq 0x8530
testl %eax, %eax
je 0x66455
cmpl $0x5, %ebx
jne 0x66028
movq %r13, %rdi
leaq 0x16f1d(%rip), %rsi     # 0x7cf38
callq 0x8530
testl %eax, %eax
je 0x663a0
cmpl $0x4, %ebx
jne 0x66044
movq %r13, %rdi
leaq 0x16f07(%rip), %rsi     # 0x7cf3e
callq 0x8530
testl %eax, %eax
je 0x663f3
movl $0x1, -0x2c(%rbp)
movq -0x38(%rbp), %r15
jmp 0x66476
cmpl $0x74, %ebx
jg 0x66115
cmpl $0x6c, %ebx
je 0x66253
cmpl $0x73, %ebx
jne 0x66486
movq -0x70(%rbp), %rax
movabsq $0x666f207472617473, %rcx # imm = 0x666F207472617473
xorq %rcx, %rax
movzbl -0x68(%rbp), %ecx
xorq $0x20, %rcx
orq %rax, %rcx
jne 0x66486
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
callq 0x66bfb
movw $0x1, 0x29(%rbx)
xorl %eax, %eax
movq %rax, 0x14(%rbx)
movq %rax, 0x20(%rbx)
movb $0x0, 0x2b(%rbx)
movl -0x67(%rbp), %eax
movl $0x746e6f6d, %ecx       # imm = 0x746E6F6D
xorl %ecx, %eax
movzwl -0x63(%rbp), %ecx
xorl $0x68, %ecx
orl %eax, %ecx
je 0x66449
movl -0x67(%rbp), %eax
movl $0x72616579, %ecx       # imm = 0x72616579
xorl %ecx, %eax
movzbl -0x63(%rbp), %ecx
orl %eax, %ecx
je 0x664a5
cmpl $0x796164, -0x67(%rbp)  # imm = 0x796164
jne 0x66486
jmp 0x65f03
movl $0x1, -0x2c(%rbp)
jmp 0x66482
cmpl $0x2b, %ebx
je 0x65de7
cmpl $0x2d, %ebx
je 0x65de7
jmp 0x66486
cmpl $0x75, %ebx
je 0x662a3
cmpl $0x77, %ebx
jne 0x66486
movabsq $0x207961646b656577, %rax # imm = 0x207961646B656577
cmpq %rax, -0x70(%rbp)
jne 0x66486
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leaq -0x68(%rbp), %rax
incl %edx
cmpb $0x0, (%rax)
leaq 0x1(%rax), %rax
jne 0x66144
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
leaq -0x68(%rbp), %rdi
leaq -0x78(%rbp), %rsi
movl $0x1, %ecx
callq 0x248aa
testl %eax, %eax
je 0x66486
movsd -0x78(%rbp), %xmm0
movsd 0x1319c(%rip), %xmm1    # 0x79318
ucomisd %xmm0, %xmm1
jbe 0x66486
cvttsd2si %xmm0, %ebx
testl %ebx, %ebx
js 0x66486
cvttpd2dq %xmm0, %xmm1
cvtdq2pd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x66486
jp 0x66486
movq -0x38(%rbp), %r15
movq %r15, %rdi
callq 0x66bfb
movq %r15, %rdi
callq 0x66d16
xorl %r13d, %r13d
movw %r13w, 0x2a(%r15)
movq %r15, %rdi
callq 0x6655d
movq (%r15), %rsi
leaq 0x7b98a00(%rsi), %rax
movabsq $0x636ba875fd33dc87, %rcx # imm = 0x636BA875FD33DC87
imulq %rcx
movq %rdx, %rcx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x19, %rcx
addq %rax, %rcx
movq %rcx, %rax
movabsq $0x4924924924924925, %rdx # imm = 0x4924924924924925
imulq %rdx
movq %rdx, %rax
shrq $0x3f, %rax
sarq %rdx
addq %rax, %rdx
leaq (,%rdx,8), %rax
subq %rax, %rdx
leaq (%rcx,%rdx), %rax
movl %ebx, %edi
cmpq %rdi, %rax
leaq -0x7(%rdx,%rcx), %rcx
cmovleq %rax, %rcx
subq %rcx, %rdi
imulq $0x5265c00, %rdi, %rax  # imm = 0x5265C00
addq %rsi, %rax
movq %rax, (%r15)
movw %r13w, 0x28(%r15)
movb $0x0, 0x2b(%r15)
movq -0x50(%rbp), %r15
jmp 0x65f03
movq -0x70(%rbp), %rax
movabsq $0x6d69746c61636f6c, %rcx # imm = 0x6D69746C61636F6C
xorq %rcx, %rax
movzwl -0x68(%rbp), %ecx
xorq $0x65, %rcx
orq %rax, %rcx
jne 0x66486
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
callq 0x6655d
movq %rbx, %rdi
movq -0x48(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
callq 0x66a51
addq %rax, (%rbx)
movw $0x0, 0x28(%rbx)
movb $0x0, 0x2b(%rbx)
jmp 0x66486
movq -0x70(%rbp), %rax
movabsq $0x636f706578696e75, %rcx # imm = 0x636F706578696E75
xorq %rcx, %rax
movzwl -0x68(%rbp), %ecx
xorq $0x68, %rcx
orq %rax, %rcx
je 0x66323
cmpl $0x637475, -0x70(%rbp)  # imm = 0x637475
jne 0x66486
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
callq 0x6655d
movq %rbx, %rdi
movq -0x48(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
callq 0x66a51
cmpl $0x0, -0x2c(%rbp)
jne 0x66486
movq %rax, %r13
movq -0x38(%rbp), %rbx
subq %rax, (%rbx)
movw $0x0, 0x28(%rbx)
movb $0x0, 0x2b(%rbx)
movq %rbx, %rdi
movq -0x48(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
callq 0x66a51
subq %rax, %r13
addq %r13, (%rbx)
jmp 0x66486
movq -0x38(%rbp), %rax
cmpb $0x0, 0x2a(%rax)
je 0x662c1
movq -0x38(%rbp), %rcx
movq (%rcx), %rax
movl $0xa8c0, %edx           # imm = 0xA8C0
addq %rdx, %rax
movabsq $0x1845c8a0ce512957, %rdx # imm = 0x1845C8A0CE512957
imulq %rdx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0xd, %rdx
addq %rax, %rdx
movabsq $0xbfc83e532200, %rax   # imm = 0xBFC83E532200
addq %rax, %rdx
movq %rdx, (%rcx)
movw $0x0, 0x28(%rcx)
movb $0x0, 0x2b(%rcx)
jmp 0x65f03
movapd -0x90(%rbp), %xmm0
mulsd 0x12f1a(%rip), %xmm0    # 0x792a0
jmp 0x66465
movapd -0x90(%rbp), %xmm0
mulsd 0x12f75(%rip), %xmm0    # 0x79310
jmp 0x66465
movq -0x38(%rbp), %r15
movq %r15, %rdi
callq 0x66bfb
movq %r15, %rdi
callq 0x66d16
cvttsd2si -0x90(%rbp), %ebx
movl 0xc(%r15), %eax
addl %ebx, %eax
movl %eax, 0xc(%r15)
jle 0x664c4
leal -0x1(%rax), %ecx
movl $0xaaaaaaab, %edx       # imm = 0xAAAAAAAB
imulq %rdx, %rcx
shrq $0x23, %rcx
jmp 0x664de
movapd -0x90(%rbp), %xmm0
mulsd 0x12f0f(%rip), %xmm0    # 0x79300
jmp 0x66465
cvttsd2si -0x90(%rbp), %ebx
movq -0x38(%rbp), %r15
movq %r15, %rdi
callq 0x66bfb
movq %r15, %rdi
callq 0x66d16
addl %ebx, 0x8(%r15)
movb $0x0, 0x2a(%r15)
movq %r15, %rdi
callq 0x6655d
movapd -0x90(%rbp), %xmm1
cvttpd2dq %xmm1, %xmm0
cvtdq2pd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x66438
jnp 0x66476
subsd %xmm0, %xmm1
mulsd 0x12ec4(%rip), %xmm1    # 0x79308
jmp 0x66526
movl $0x1, 0x10(%rbx)
jmp 0x65f03
movapd -0x90(%rbp), %xmm0
mulsd 0x12e93(%rip), %xmm0    # 0x792f8
addsd -0x40(%rbp), %xmm0
cvttsd2si %xmm0, %rax
movq -0x38(%rbp), %r15
addq %rax, (%r15)
movw $0x0, 0x28(%r15)
movb $0x0, 0x2b(%r15)
movq -0x50(%rbp), %r15
cmpl $0x0, -0x2c(%rbp)
jne 0x66542
incq %r12
cmpq -0x98(%rbp), %r12
jne 0x65d81
jmp 0x6653d
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
callq 0x66bfb
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0xc(%rbx)
jmp 0x65f03
leal -0xc(%rax), %ecx
movslq %ecx, %rcx
imulq $0x2aaaaaab, %rcx, %rcx # imm = 0x2AAAAAAB
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x21, %rcx
addl %edx, %ecx
movq -0x38(%rbp), %r15
addl %ecx, 0x8(%r15)
shll $0x2, %ecx
leal (%rcx,%rcx,2), %ecx
subl %ecx, %eax
movl %eax, 0xc(%r15)
movb $0x0, 0x2a(%r15)
movq %r15, %rdi
callq 0x6655d
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
movapd -0x90(%rbp), %xmm1
ucomisd %xmm0, %xmm1
jne 0x6651a
jnp 0x66476
subsd %xmm0, %xmm1
mulsd 0x12dca(%rip), %xmm1    # 0x792f0
mulsd 0x12d72(%rip), %xmm1    # 0x792a0
addsd -0x40(%rbp), %xmm1
cvttsd2si %xmm1, %rax
jmp 0x66473
xorl %r12d, %r12d
jmp 0x66548
movl $0x1, %r12d
movl %r12d, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq