LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: absFunc
static void absFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
  assert( argc==1 );
  UNUSED_PARAMETER(argc);
  switch( sqlite3_value_type(argv[0]) ){
    case SQLITE_INTEGER: {
      i64 iVal = sqlite3_value_int64(argv[0]);
      if( iVal<0 ){
        if( (iVal<<1)==0 ){
          /* IMP: R-35460-15084 If X is the integer -9223372036854775807 then
          ** abs(X) throws an integer overflow error since there is no
          ** equivalent positive 64-bit two complement value. */
          sqlite3_result_error(context, "integer overflow", -1);
          return;
        }
        iVal = -iVal;
      } 
      sqlite3_result_int64(context, iVal);
      break;
    }
    case SQLITE_NULL: {
      /* IMP: R-37434-19929 Abs(X) returns NULL if X is NULL. */
      sqlite3_result_null(context);
      break;
    }
    default: {
      /* Because sqlite3_value_double() returns 0.0 if the argument is not
      ** something that can be converted into a number, we have:
      ** IMP: R-57326-31541 Abs(X) return 0.0 if X is a string or blob that
      ** cannot be converted to a numeric value. 
      */
      double rVal = sqlite3_value_double(argv[0]);
      if( rVal<0 ) rVal = -rVal;
      sqlite3_result_double(context, rVal);
      break;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdx), %rdi
movzbl 0x26(%rdi), %eax
cmpl $0x5, %eax
je 0x63fcd
cmpl $0x1, %eax
jne 0x63fdd
callq 0xeeac
movq %rax, %r14
testq %rax, %rax
jns 0x63fb1
leaq (,%r14,2), %rax
testq %rax, %rax
je 0x64006
negq %r14
leaq 0x8(%rbx), %rdi
callq 0xecfd
movq %r14, 0x20(%rbx)
movw $0x4, 0x2c(%rbx)
movb $0x1, 0x2e(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
addq $0x8, %rbx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xf373
callq 0xee52
movapd 0x153c6(%rip), %xmm1    # 0x793b0
xorpd %xmm0, %xmm1
maxsd %xmm0, %xmm1
addq $0x8, %rbx
movq %rbx, %rdi
movapd %xmm1, %xmm0
popq %rbx
popq %r14
popq %rbp
jmp 0xf056
movl $0x1, 0x5c(%rbx)
movb $0x1, 0x61(%rbx)
addq $0x8, %rbx
leaq 0x18e9f(%rip), %rsi     # 0x7cebb
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq $-0x1, %r8
popq %rbx
popq %r14
popq %rbp
jmp 0xf0d7
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: roundFunc
static void roundFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
  int n = 0;
  double r;
  char *zBuf;
  assert( argc==1 || argc==2 );
  if( argc==2 ){
    if( SQLITE_NULL==sqlite3_value_type(argv[1]) ) return;
    n = sqlite3_value_int(argv[1]);
    if( n>30 ) n = 30;
    if( n<0 ) n = 0;
  }
  if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return;
  r = sqlite3_value_double(argv[0]);
  /* If Y==0 and X will fit in a 64-bit int,
  ** handle the rounding directly,
  ** otherwise use printf.
  */
  if( n==0 && r>=0 && r<LARGEST_INT64-1 ){
    r = (double)((sqlite_int64)(r+0.5));
  }else if( n==0 && r<0 && (-r)<LARGEST_INT64-1 ){
    r = -(double)((sqlite_int64)((-r)+0.5));
  }else{
    zBuf = sqlite3_mprintf("%.*f",n,r);
    if( zBuf==0 ){
      sqlite3_result_error_nomem(context);
      return;
    }
    sqlite3AtoF(zBuf, &r, sqlite3Strlen30(zBuf), SQLITE_UTF8);
    sqlite3_free(zBuf);
  }
  sqlite3_result_double(context, r);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rdi, %rbx
xorl %r14d, %r14d
cmpl $0x2, %esi
jne 0x64074
movq 0x8(%r15), %rdi
cmpb $0x5, 0x26(%rdi)
je 0x6407d
callq 0xeeac
cmpl $0x1e, %eax
movl $0x1e, %ecx
cmovll %eax, %ecx
xorl %r14d, %r14d
testl %ecx, %ecx
cmovgl %ecx, %r14d
movq (%r15), %rdi
cmpb $0x5, 0x26(%rdi)
jne 0x64088
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0xee52
movsd %xmm0, -0x20(%rbp)
testl %r14d, %r14d
jne 0x640c9
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x640c9
movsd 0x151ff(%rip), %xmm1    # 0x792a8
ucomisd %xmm0, %xmm1
jbe 0x640c9
addsd 0x151b9(%rip), %xmm0    # 0x79270
cvttsd2si %xmm0, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
jmp 0x64157
testl %r14d, %r14d
jne 0x64105
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jbe 0x64105
ucomisd 0x151f0(%rip), %xmm0    # 0x792d0
jbe 0x64105
movsd 0x15186(%rip), %xmm1    # 0x79270
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
xorpd 0x152ad(%rip), %xmm0    # 0x793b0
jmp 0x64157
leaq 0x18dc0(%rip), %rdi     # 0x7cecc
movb $0x1, %r15b
movl %r14d, %esi
movb $0x1, %al
callq 0xb868
testq %rax, %rax
je 0x6416d
movq %rax, %r14
xorl %edx, %edx
cmpb $0x0, (%r14,%rdx)
leaq 0x1(%rdx), %rdx
jne 0x64123
decl %edx
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
leaq -0x20(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
movl $0x1, %ecx
callq 0x243b1
movq %r14, %rdi
callq 0xa3c7
movsd (%r15), %xmm0
addq $0x8, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xf056
leaq 0x8(%rbx), %rdi
callq 0xf373
movl $0x7, 0x5c(%rbx)
movb %r15b, 0x61(%rbx)
movq 0x8(%rbx), %rax
movb %r15b, 0x50(%rax)
jmp 0x6407d
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: upperFunc
static void upperFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
  char *z1;
  const char *z2;
  int i, n;
  UNUSED_PARAMETER(argc);
  z2 = (char*)sqlite3_value_text(argv[0]);
  n = sqlite3_value_bytes(argv[0]);
  /* Verify that the call to _bytes() does not invalidate the _text() pointer */
  assert( z2==(char*)sqlite3_value_text(argv[0]) );
  if( z2 ){
    z1 = contextMalloc(context, ((i64)n)+1);
    if( z1 ){
      for(i=0; i<n; i++){
        z1[i] = (char)sqlite3Toupper(z2[i]);
      }
      sqlite3_result_text(context, z1, n, sqlite3_free);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rdi, %rbx
movq (%rdx), %rdi
movl $0x1, %esi
callq 0xef29
movq %rax, %r14
movq (%r15), %rdi
movl $0x1, %esi
callq 0xee02
testq %r14, %r14
je 0x6422a
movl %eax, %r15d
movslq %eax, %rsi
incq %rsi
movq %rbx, %rdi
callq 0x65096
testq %rax, %rax
je 0x6422a
testl %r15d, %r15d
jle 0x64206
movl %r15d, %ecx
xorl %edx, %edx
leaq 0x11dc9(%rip), %rsi     # 0x75fb0
movzbl (%r14,%rdx), %edi
movb (%rdi,%rsi), %r8b
notb %r8b
orb $-0x21, %r8b
andb %dil, %r8b
movb %r8b, (%rax,%rdx)
incq %rdx
cmpq %rdx, %rcx
jne 0x641e7
leaq -0x59e46(%rip), %r8     # 0xa3c7
movq %rbx, %rdi
movq %rax, %rsi
movl %r15d, %edx
movl $0x1, %ecx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xeffe
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: lowerFunc
static void lowerFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
  char *z1;
  const char *z2;
  int i, n;
  UNUSED_PARAMETER(argc);
  z2 = (char*)sqlite3_value_text(argv[0]);
  n = sqlite3_value_bytes(argv[0]);
  /* Verify that the call to _bytes() does not invalidate the _text() pointer */
  assert( z2==(char*)sqlite3_value_text(argv[0]) );
  if( z2 ){
    z1 = contextMalloc(context, ((i64)n)+1);
    if( z1 ){
      for(i=0; i<n; i++){
        z1[i] = sqlite3Tolower(z2[i]);
      }
      sqlite3_result_text(context, z1, n, sqlite3_free);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rdi, %rbx
movq (%rdx), %rdi
movl $0x1, %esi
callq 0xef29
movq %rax, %r14
movq (%r15), %rdi
movl $0x1, %esi
callq 0xee02
testq %r14, %r14
je 0x642c7
movl %eax, %r15d
movslq %eax, %rsi
incq %rsi
movq %rbx, %rdi
callq 0x65096
testq %rax, %rax
je 0x642c7
testl %r15d, %r15d
jle 0x642a3
movl %r15d, %ecx
xorl %edx, %edx
leaq 0x11e22(%rip), %rsi     # 0x760b0
movzbl (%r14,%rdx), %edi
movb (%rdi,%rsi), %dil
movb %dil, (%rax,%rdx)
incq %rdx
cmpq %rdx, %rcx
jne 0x6428e
leaq -0x59ee3(%rip), %r8     # 0xa3c7
movq %rbx, %rdi
movq %rax, %rsi
movl %r15d, %edx
movl $0x1, %ecx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xeffe
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: hexFunc
static void hexFunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  int i, n;
  const unsigned char *pBlob;
  char *zHex, *z;
  assert( argc==1 );
  UNUSED_PARAMETER(argc);
  pBlob = sqlite3_value_blob(argv[0]);
  n = sqlite3_value_bytes(argv[0]);
  assert( pBlob==sqlite3_value_blob(argv[0]) );  /* No encoding change */
  z = zHex = contextMalloc(context, ((i64)n)*2 + 1);
  if( zHex ){
    for(i=0; i<n; i++, pBlob++){
      unsigned char c = *pBlob;
      *(z++) = hexdigits[(c>>4)&0xf];
      *(z++) = hexdigits[c&0xf];
    }
    *z = 0;
    sqlite3_result_text(context, zHex, n*2, sqlite3_free);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
movq (%rdx), %rdi
callq 0xed3b
movq %rax, %r15
movq (%r14), %rdi
movl $0x1, %esi
callq 0xee02
movl %eax, %r14d
cltq
leaq 0x1(,%rax,2), %rsi
movq %rbx, %rdi
callq 0x65096
testq %rax, %rax
je 0x643a4
movq %rax, %rdx
testl %r14d, %r14d
jle 0x6437a
movl %r14d, %edx
xorl %ecx, %ecx
leaq 0x150ca(%rip), %rsi     # 0x79410
xorl %edi, %edi
movzbl (%r15,%rdi), %r8d
movl %r8d, %r9d
shrl $0x4, %r9d
movb (%r9,%rsi), %r9b
movb %r9b, (%rax,%rdi,2)
andl $0xf, %r8d
movb (%r8,%rsi), %r8b
movb %r8b, 0x1(%rax,%rdi,2)
incq %rdi
addq $-0x2, %rcx
cmpl %edi, %edx
jne 0x64348
movq %rax, %rdx
subq %rcx, %rdx
movb $0x0, (%rdx)
addl %r14d, %r14d
leaq -0x59fc0(%rip), %r8     # 0xa3c7
movq %rbx, %rdi
movq %rax, %rsi
movl %r14d, %edx
movl $0x1, %ecx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xeffe
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: randomFunc
static void randomFunc(
  sqlite3_context *context,
  int NotUsed,
  sqlite3_value **NotUsed2
){
  sqlite_int64 r;
  UNUSED_PARAMETER2(NotUsed, NotUsed2);
  sqlite3_randomness(sizeof(r), &r);
  if( r<0 ){
    /* We need to prevent a random number of 0x8000000000000000 
    ** (or -9223372036854775808) since when you do abs() of that
    ** number of you get the same value back again.  To do this
    ** in a way that is testable, mask the sign bit off of negative
    ** values, resulting in a positive value.  Then take the 
    ** 2s complement of that positive value.  The end result can
    ** therefore be no less than -9223372036854775807.
    */
    r = -(r & LARGEST_INT64);
  }
  sqlite3_result_int64(context, r);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq -0x18(%rbp), %r14
movl $0x8, %edi
movq %r14, %rsi
callq 0xbad4
movq (%r14), %rax
movq %rax, %r14
btrq $0x3f, %r14
negq %r14
testq %rax, %rax
cmovnsq %rax, %r14
leaq 0x8(%rbx), %rdi
callq 0xecfd
movq %r14, 0x20(%rbx)
movw $0x4, 0x2c(%rbx)
movb $0x1, 0x2e(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: randomBlob
static void randomBlob(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  int n;
  unsigned char *p;
  assert( argc==1 );
  UNUSED_PARAMETER(argc);
  n = sqlite3_value_int(argv[0]);
  if( n<1 ){
    n = 1;
  }
  p = contextMalloc(context, n);
  if( p ){
    sqlite3_randomness(n, p);
    sqlite3_result_blob(context, (char*)p, n, sqlite3_free);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdx), %rdi
callq 0xeeac
cmpl $0x2, %eax
movl $0x1, %r14d
cmovgel %eax, %r14d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x65096
testq %rax, %rax
je 0x64464
movq %rax, %r15
movl %r14d, %edi
movq %rax, %rsi
callq 0xbad4
leaq -0x5a083(%rip), %r8     # 0xa3c7
movq %rbx, %rdi
movq %r15, %rsi
movl %r14d, %edx
xorl %ecx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xeffe
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: nullifFunc
static void nullifFunc(
  sqlite3_context *context,
  int NotUsed,
  sqlite3_value **argv
){
  CollSeq *pColl = sqlite3GetFuncCollSeq(context);
  UNUSED_PARAMETER(NotUsed);
  if( sqlite3MemCompare(argv[0], argv[1], pColl)!=0 ){
    sqlite3_result_value(context, argv[0]);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rdi, %rbx
movq 0x48(%rdi), %rdx
movq (%r14), %rdi
movq 0x8(%r14), %rsi
callq 0x2ca3b
testl %eax, %eax
je 0x644a3
movq (%r14), %rsi
addq $0x8, %rbx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xf417
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: compileoptionusedFunc
static void compileoptionusedFunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  const char *zOptName;
  assert( argc==1 );
  UNUSED_PARAMETER(argc);
  /* IMP: R-39564-36305 The sqlite_compileoption_used() SQL
  ** function is a wrapper around the sqlite3_compileoption_used() C/C++
  ** function.
  */
  if( (zOptName = (const char*)sqlite3_value_text(argv[0]))!=0 ){
    sqlite3_result_int(context, sqlite3_compileoption_used(zOptName));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdx), %rdi
movl $0x1, %esi
callq 0xef29
testq %rax, %rax
je 0x6453f
movq %rax, %rdi
callq 0x935c
leaq 0x8(%rbx), %rdi
movl %eax, %r14d
callq 0xecfd
movq %r14, 0x20(%rbx)
movw $0x4, 0x2c(%rbx)
movb $0x1, 0x2e(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: compileoptiongetFunc
static void compileoptiongetFunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  int n;
  assert( argc==1 );
  UNUSED_PARAMETER(argc);
  /* IMP: R-04922-24076 The sqlite_compileoption_get() SQL function
  ** is a wrapper around the sqlite3_compileoption_get() C/C++ function.
  */
  n = sqlite3_value_int(argv[0]);
  sqlite3_result_text(context, sqlite3_compileoption_get(n), -1, SQLITE_STATIC);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdx), %rdi
callq 0xeeac
testl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
je 0x64560
xorl %esi, %esi
jmp 0x6456e
andl $0x1, %eax
leaq 0x2e6f6(%rip), %rcx     # 0x92c60
movq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
xorl %r8d, %r8d
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xeffe
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: last_insert_rowid
static void last_insert_rowid(
  sqlite3_context *context, 
  int NotUsed, 
  sqlite3_value **NotUsed2
){
  sqlite3 *db = sqlite3_context_db_handle(context);
  UNUSED_PARAMETER2(NotUsed, NotUsed2);
  /* IMP: R-51513-12026 The last_insert_rowid() SQL function is a
  ** wrapper around the sqlite3_last_insert_rowid() C/C++ interface
  ** function. */
  sqlite3_result_int64(context, sqlite3_last_insert_rowid(db));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
addq $0x8, %rdi
movq 0x8(%rbx), %rax
movq 0x30(%rax), %r14
callq 0xecfd
movq %r14, 0x20(%rbx)
movw $0x4, 0x2c(%rbx)
movb $0x1, 0x2e(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: total_changes
static void total_changes(
  sqlite3_context *context,
  int NotUsed,
  sqlite3_value **NotUsed2
){
  sqlite3 *db = sqlite3_context_db_handle(context);
  UNUSED_PARAMETER2(NotUsed, NotUsed2);
  /* IMP: R-52756-41993 This function is a wrapper around the
  ** sqlite3_total_changes() C/C++ interface. */
  sqlite3_result_int(context, sqlite3_total_changes(db));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
addq $0x8, %rdi
movq 0x8(%rbx), %rax
movslq 0x64(%rax), %r14
callq 0xecfd
movq %r14, 0x20(%rbx)
movw $0x4, 0x2c(%rbx)
movb $0x1, 0x2e(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: zeroblobFunc
static void zeroblobFunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  i64 n;
  sqlite3 *db = sqlite3_context_db_handle(context);
  assert( argc==1 );
  UNUSED_PARAMETER(argc);
  n = sqlite3_value_int64(argv[0]);
  testcase( n==db->aLimit[SQLITE_LIMIT_LENGTH] );
  testcase( n==db->aLimit[SQLITE_LIMIT_LENGTH]+1 );
  if( n>db->aLimit[SQLITE_LIMIT_LENGTH] ){
    sqlite3_result_error_toobig(context);
  }else{
    sqlite3_result_zeroblob(context, (int)n); /* IMP: R-00293-64994 */
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
movq 0x8(%rdi), %r12
movq (%rdx), %rdi
callq 0xeeac
movq %rax, %r15
movslq 0x68(%r12), %rax
cmpq %rax, %r15
jle 0x64b8c
movl $0x12, 0x5c(%rbx)
movb $0x1, 0x61(%rbx)
leaq 0x14907(%rip), %rsi     # 0x79476
movq %r14, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
xorl %r8d, %r8d
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xf0d7
movq %r14, %rdi
callq 0xecfd
movabsq $0x104401000000000, %rax # imm = 0x104401000000000
movq %rax, 0x28(%rbx)
xorl %eax, %eax
testl %r15d, %r15d
cmovgl %r15d, %eax
movl %eax, 0x20(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sumStep
static void sumStep(sqlite3_context *context, int argc, sqlite3_value **argv){
  SumCtx *p;
  int type;
  assert( argc==1 );
  UNUSED_PARAMETER(argc);
  p = sqlite3_aggregate_context(context, sizeof(*p));
  type = sqlite3_value_numeric_type(argv[0]);
  if( p && type!=SQLITE_NULL ){
    p->cnt++;
    if( type==SQLITE_INTEGER ){
      i64 v = sqlite3_value_int64(argv[0]);
      p->rSum += v;
      if( (p->approx|p->overflow)==0 && sqlite3AddInt64(&p->iSum, v) ){
        p->overflow = 1;
      }
    }else{
      p->rSum += sqlite3_value_double(argv[0]);
      p->approx = 1;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movl $0x20, %esi
callq 0x10263
movq %rax, %rbx
movq (%r14), %rdi
callq 0x10ff8
testq %rbx, %rbx
setne %cl
cmpl $0x5, %eax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x64c4e
incq 0x10(%rbx)
movq (%r14), %rdi
cmpl $0x1, %eax
jne 0x64c3d
callq 0xeeac
cvtsi2sd %rax, %xmm0
addsd (%rbx), %xmm0
movsd %xmm0, (%rbx)
movb 0x18(%rbx), %cl
orb 0x19(%rbx), %cl
jne 0x64c4e
movq 0x8(%rbx), %rcx
testq %rax, %rax
js 0x64c53
testq %rcx, %rcx
setg %dl
movabsq $0x7fffffffffffffff, %rsi # imm = 0x7FFFFFFFFFFFFFFF
subq %rcx, %rsi
cmpq %rax, %rsi
setb %sil
testb %sil, %dl
je 0x64c72
movb $0x1, 0x18(%rbx)
jmp 0x64c4e
callq 0xee52
addsd (%rbx), %xmm0
movsd %xmm0, (%rbx)
movb $0x1, 0x19(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
testq %rcx, %rcx
jns 0x64c72
movabsq $0x7fffffffffffffff, %rdx # imm = 0x7FFFFFFFFFFFFFFF
subq %rcx, %rdx
addq $0x2, %rdx
leaq 0x1(%rax), %rsi
cmpq %rsi, %rdx
jg 0x64c37
addq %rax, %rcx
movq %rcx, 0x8(%rbx)
jmp 0x64c4e
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sumFinalize
static void sumFinalize(sqlite3_context *context){
  SumCtx *p;
  p = sqlite3_aggregate_context(context, 0);
  if( p && p->cnt>0 ){
    if( p->overflow ){
      sqlite3_result_error(context,"integer overflow",-1);
    }else if( p->approx ){
      sqlite3_result_double(context, p->rSum);
    }else{
      sqlite3_result_int64(context, p->iSum);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq 0x40(%rdi), %r14
testb $0x20, 0x25(%r14)
jne 0x64ca9
movq %r14, %rdi
callq 0x102d5
movw $0x1, 0x24(%r14)
movq $0x0, 0x8(%r14)
jmp 0x64d2a
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x64d2a
cmpq $0x0, 0x10(%rax)
jle 0x64d2a
movq %rdi, %rbx
cmpb $0x0, 0x18(%rax)
je 0x64cf5
movl $0x1, 0x5c(%rbx)
movb $0x1, 0x61(%rbx)
addq $0x8, %rbx
leaq 0x181e3(%rip), %rsi     # 0x7cebb
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq $-0x1, %r8
popq %rbx
popq %r14
popq %rbp
jmp 0xf0d7
cmpb $0x0, 0x19(%rax)
je 0x64d0f
movsd (%rax), %xmm0
addq $0x8, %rbx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xf056
movq 0x8(%rax), %r14
leaq 0x8(%rbx), %rdi
callq 0xecfd
movq %r14, 0x20(%rbx)
movw $0x4, 0x2c(%rbx)
movb $0x1, 0x2e(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: totalFinalize
static void totalFinalize(sqlite3_context *context){
  SumCtx *p;
  p = sqlite3_aggregate_context(context, 0);
  /* (double)0 In case of SQLITE_OMIT_FLOATING_POINT... */
  sqlite3_result_double(context, p ? p->rSum : (double)0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x40(%rdi), %r14
testb $0x20, 0x25(%r14)
jne 0x64d5d
movq %r14, %rdi
callq 0x102d5
movw $0x1, 0x24(%r14)
movq $0x0, 0x8(%r14)
jmp 0x64d6c
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x64d6c
movsd (%rax), %xmm0
jmp 0x64d6f
xorps %xmm0, %xmm0
addq $0x8, %rbx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xf056
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: avgFinalize
static void avgFinalize(sqlite3_context *context){
  SumCtx *p;
  p = sqlite3_aggregate_context(context, 0);
  if( p && p->cnt>0 ){
    sqlite3_result_double(context, p->rSum/(double)p->cnt);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x40(%rdi), %rbx
testb $0x20, 0x25(%rbx)
jne 0x64da7
movq %rbx, %rdi
callq 0x102d5
movw $0x1, 0x24(%rbx)
movq $0x0, 0x8(%rbx)
jmp 0x64dd5
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x64dd5
movq 0x10(%rax), %rcx
testq %rcx, %rcx
jle 0x64dd5
movsd (%rax), %xmm0
cvtsi2sd %rcx, %xmm1
divsd %xmm1, %xmm0
addq $0x8, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xf056
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: countStep
static void countStep(sqlite3_context *context, int argc, sqlite3_value **argv){
  CountCtx *p;
  p = sqlite3_aggregate_context(context, sizeof(*p));
  if( (argc==0 || SQLITE_NULL!=sqlite3_value_type(argv[0])) && p ){
    p->n++;
  }

#ifndef SQLITE_OMIT_DEPRECATED
  /* The sqlite3_aggregate_count() function is deprecated.  But just to make
  ** sure it still operates correctly, verify that its count agrees with our 
  ** internal count when using count(*) and when the total count can be
  ** expressed as a 32-bit integer. */
  assert( argc==1 || p==0 || p->n>0x7fffffff
          || p->n==sqlite3_aggregate_count(context) );
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movl %esi, %r14d
movl $0x8, %esi
callq 0x10263
testl %r14d, %r14d
je 0x64e14
movq (%rbx), %rcx
cmpb $0x5, 0x26(%rcx)
setne %cl
testq %rax, %rax
setne %dl
testb %dl, %cl
je 0x64e0f
incq (%rax)
popq %rbx
popq %r14
popq %rbp
retq
testq %rax, %rax
jne 0x64e0c
jmp 0x64e0f
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: groupConcatStep
static void groupConcatStep(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  const char *zVal;
  StrAccum *pAccum;
  const char *zSep;
  int nVal, nSep;
  assert( argc==1 || argc==2 );
  if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return;
  pAccum = (StrAccum*)sqlite3_aggregate_context(context, sizeof(*pAccum));

  if( pAccum ){
    sqlite3 *db = sqlite3_context_db_handle(context);
    int firstTerm = pAccum->useMalloc==0;
    pAccum->useMalloc = 2;
    pAccum->mxAlloc = db->aLimit[SQLITE_LIMIT_LENGTH];
    if( !firstTerm ){
      if( argc==2 ){
        zSep = (char*)sqlite3_value_text(argv[1]);
        nSep = sqlite3_value_bytes(argv[1]);
      }else{
        zSep = ",";
        nSep = 1;
      }
      sqlite3StrAccumAppend(pAccum, zSep, nSep);
    }
    zVal = (char*)sqlite3_value_text(argv[0]);
    nVal = sqlite3_value_bytes(argv[0]);
    sqlite3StrAccumAppend(pAccum, zVal, nVal);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq (%rdx), %rax
cmpb $0x5, 0x26(%rax)
je 0x64ee5
movq %rdx, %rbx
movl %esi, %r15d
movq %rdi, %r12
movl $0x28, %esi
callq 0x10263
testq %rax, %rax
je 0x64ee5
movq %rax, %r14
cmpb $0x0, 0x24(%rax)
movq 0x8(%r12), %rax
movb $0x2, 0x24(%r14)
movl 0x68(%rax), %eax
movl %eax, 0x20(%r14)
je 0x64f05
cmpl $0x2, %r15d
jne 0x64eee
movq 0x8(%rbx), %rdi
movl $0x1, %esi
callq 0xef29
movq %rax, %r15
movq 0x8(%rbx), %rdi
movl $0x1, %esi
callq 0xee02
movl %eax, %edx
jmp 0x64efa
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x16458(%rip), %r15     # 0x7b34d
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x172f3
movq (%rbx), %rdi
movl $0x1, %esi
callq 0xef29
movq %rax, %r15
movq (%rbx), %rdi
movl $0x1, %esi
callq 0xee02
movq %r14, %rdi
movq %r15, %rsi
movl %eax, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x172f3
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: groupConcatFinalize
static void groupConcatFinalize(sqlite3_context *context){
  StrAccum *pAccum;
  pAccum = sqlite3_aggregate_context(context, 0);
  if( pAccum ){
    if( pAccum->accError==STRACCUM_TOOBIG ){
      sqlite3_result_error_toobig(context);
    }else if( pAccum->accError==STRACCUM_NOMEM ){
      sqlite3_result_error_nomem(context);
    }else{    
      sqlite3_result_text(context, sqlite3StrAccumFinish(pAccum), -1, 
                          sqlite3_free);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq 0x40(%rdi), %r14
testb $0x20, 0x25(%r14)
jne 0x64f62
movq %r14, %rdi
callq 0x102d5
movw $0x1, 0x24(%r14)
movq $0x0, 0x8(%r14)
jmp 0x64fc7
movq %rdi, %rbx
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x64fc7
movzbl 0x25(%rdi), %eax
cmpl $0x1, %eax
je 0x64fab
cmpl $0x2, %eax
jne 0x64fcc
movl $0x12, 0x5c(%rbx)
movb $0x1, 0x61(%rbx)
addq $0x8, %rbx
leaq 0x144e4(%rip), %rsi     # 0x79476
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
xorl %r8d, %r8d
popq %rbx
popq %r14
popq %rbp
jmp 0xf0d7
leaq 0x8(%rbx), %rdi
callq 0xf373
movl $0x7, 0x5c(%rbx)
movb $0x1, %al
movb %al, 0x61(%rbx)
movq 0x8(%rbx), %rcx
movb %al, 0x50(%rcx)
popq %rbx
popq %r14
popq %rbp
retq
callq 0xb7d6
leaq -0x5ac11(%rip), %r8     # 0xa3c7
movq %rbx, %rdi
movq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
popq %rbx
popq %r14
popq %rbp
jmp 0xeffe
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3FuncDefInsert
SQLITE_PRIVATE void sqlite3FuncDefInsert(
  FuncDefHash *pHash,  /* The hash table into which to insert */
  FuncDef *pDef        /* The function definition to insert */
){
  FuncDef *pOther;
  int nName = sqlite3Strlen30(pDef->zName);
  u8 c1 = (u8)pDef->zName[0];
  int h = (sqlite3UpperToLower[c1] + nName) % ArraySize(pHash->a);
  pOther = functionSearch(pHash, h, pDef->zName, nName);
  if( pOther ){
    assert( pOther!=pDef && pOther->pNext!=pDef );
    pDef->pNext = pOther->pNext;
    pOther->pNext = pDef;
  }else{
    pDef->pNext = 0;
    pDef->pHash = pHash->a[h];
    pHash->a[h] = pDef;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x30(%rsi), %rdx
testq %rdx, %rdx
je 0x65025
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rdx, %rax
incl %ecx
cmpb $0x0, (%rax)
leaq 0x1(%rax), %rax
jne 0x65012
andl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
jmp 0x65027
xorl %ecx, %ecx
movzbl (%rdx), %eax
leaq 0x1107f(%rip), %rsi     # 0x760b0
movzbl (%rax,%rsi), %eax
addl %ecx, %eax
movl $0xb21642c9, %r15d      # imm = 0xB21642C9
imulq %rax, %r15
shrq $0x24, %r15
leal (%r15,%r15,2), %esi
shll $0x3, %esi
subl %esi, %r15d
addl %eax, %r15d
movq %r14, %rdi
movl %r15d, %esi
callq 0x6511b
testq %rax, %rax
je 0x6506d
addq $0x10, %rax
movl $0x10, %ecx
jmp 0x65081
movq $0x0, 0x10(%rbx)
movl %r15d, %eax
leaq (%r14,%rax,8), %rax
movl $0x38, %ecx
movq (%rax), %rdx
movq %rdx, (%rbx,%rcx)
movq %rbx, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: contextMalloc
static void *contextMalloc(sqlite3_context *context, i64 nByte){
  char *z;
  sqlite3 *db = sqlite3_context_db_handle(context);
  assert( nByte>0 );
  testcase( nByte==db->aLimit[SQLITE_LIMIT_LENGTH] );
  testcase( nByte==db->aLimit[SQLITE_LIMIT_LENGTH]+1 );
  if( nByte>db->aLimit[SQLITE_LIMIT_LENGTH] ){
    sqlite3_result_error_toobig(context);
    z = 0;
  }else{
    z = sqlite3Malloc((int)nByte);
    if( !z ){
      sqlite3_result_error_nomem(context);
    }
  }
  return z;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
movq 0x8(%rdi), %rax
movslq 0x68(%rax), %rax
cmpq %rsi, %rax
jge 0x650e0
movl $0x12, 0x5c(%rbx)
movb $0x1, 0x61(%rbx)
leaq 0x143b0(%rip), %rsi     # 0x79476
xorl %r15d, %r15d
movq %r14, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0xf0d7
jmp 0x6510d
movl %esi, %edi
callq 0xa38c
movq %rax, %r15
testq %rax, %rax
jne 0x6510d
movq %r14, %rdi
callq 0xf373
movl $0x7, 0x5c(%rbx)
movb $0x1, %al
movb %al, 0x61(%rbx)
movq 0x8(%rbx), %rcx
movb %al, 0x50(%rcx)
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: functionSearch
static FuncDef *functionSearch(
  FuncDefHash *pHash,  /* Hash table to search */
  int h,               /* Hash of the name */
  const char *zFunc,   /* Name of function */
  int nFunc            /* Number of bytes in zFunc */
){
  FuncDef *p;
  for(p=pHash->a[h]; p; p=p->pHash){
    if( sqlite3StrNICmp(p->zName, zFunc, nFunc)==0 && p->zName[nFunc]==0 ){
      return p;
    }
  }
  return 0;
}

// Assembly:
movslq %esi, %rax
movq (%rdi,%rax,8), %rax
testq %rax, %rax
je 0x6519f
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movslq %ecx, %rsi
leal 0x1(%rsi), %edi
leaq 0x10f75(%rip), %r8      # 0x760b0
movq 0x30(%rax), %r9
testl %ecx, %ecx
jle 0x65188
xorl %r10d, %r10d
movl %edi, %r11d
movzbl (%r9,%r10), %ebx
testq %rbx, %rbx
je 0x65174
movzbl (%rbx,%r8), %ebx
movzbl (%rdx,%r10), %r14d
movb (%r14,%r8), %r14b
cmpb %r14b, %bl
jne 0x6517f
decl %r11d
incq %r10
cmpl $0x1, %r11d
ja 0x65149
jmp 0x65188
movzbl (%rdx,%r10), %r10d
movb (%r10,%r8), %r14b
xorl %ebx, %ebx
movzbl %r14b, %r10d
cmpl %r10d, %ebx
jne 0x6518f
cmpb $0x0, (%r9,%rsi)
je 0x6519a
movq 0x38(%rax), %rax
testq %rax, %rax
jne 0x6513b
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: juliandayFunc
static void juliandayFunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  DateTime x;
  if( isDate(context, argc, argv, &x)==0 ){
    computeJD(&x);
    sqlite3_result_double(context, x.iJD/86400000.0);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq -0x40(%rbp), %rcx
callq 0x65935
testl %eax, %eax
jne 0x651e2
leaq -0x40(%rbp), %r14
movq %r14, %rdi
callq 0x663a5
cvtsi2sdq (%r14), %xmm0
divsd 0x140ca(%rip), %xmm0    # 0x792a0
addq $0x8, %rbx
movq %rbx, %rdi
callq 0xf056
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: dateFunc
static void dateFunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  DateTime x;
  if( isDate(context, argc, argv, &x)==0 ){
    char zBuf[100];
    computeYMD(&x);
    sqlite3_snprintf(sizeof(zBuf), zBuf, "%04d-%02d-%02d", x.Y, x.M, x.D);
    sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq %rdi, %rbx
leaq -0x40(%rbp), %rcx
callq 0x65935
testl %eax, %eax
jne 0x6525a
leaq -0x40(%rbp), %r14
movq %r14, %rdi
callq 0x66a08
movl 0x8(%r14), %ecx
movl 0xc(%r14), %r8d
movl 0x10(%r14), %r9d
leaq 0x17d45(%rip), %rdx     # 0x7cf6d
leaq -0xb0(%rbp), %r14
movl $0x64, %edi
movq %r14, %rsi
xorl %eax, %eax
callq 0xb954
movq %rbx, %rdi
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq $-0x1, %r8
callq 0xeffe
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: timeFunc
static void timeFunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  DateTime x;
  if( isDate(context, argc, argv, &x)==0 ){
    char zBuf[100];
    computeHMS(&x);
    sqlite3_snprintf(sizeof(zBuf), zBuf, "%02d:%02d:%02d", x.h, x.m, (int)x.s);
    sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq %rdi, %rbx
leaq -0x40(%rbp), %rcx
callq 0x65935
testl %eax, %eax
jne 0x652d7
leaq -0x40(%rbp), %r14
movq %r14, %rdi
callq 0x66b15
movl 0x14(%r14), %ecx
movl 0x18(%r14), %r8d
cvttsd2si 0x20(%r14), %r9d
leaq 0x17ce6(%rip), %rdx     # 0x7cf8b
leaq -0xb0(%rbp), %r14
movl $0x64, %edi
movq %r14, %rsi
xorl %eax, %eax
callq 0xb954
movq %rbx, %rdi
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq $-0x1, %r8
callq 0xeffe
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: datetimeFunc
static void datetimeFunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  DateTime x;
  if( isDate(context, argc, argv, &x)==0 ){
    char zBuf[100];
    computeYMD_HMS(&x);
    sqlite3_snprintf(sizeof(zBuf), zBuf, "%04d-%02d-%02d %02d:%02d:%02d",
                     x.Y, x.M, x.D, x.h, x.m, (int)(x.s));
    sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
leaq -0x48(%rbp), %rcx
callq 0x65935
testl %eax, %eax
jne 0x65378
leaq -0x48(%rbp), %r14
movq %r14, %rdi
callq 0x66a08
movq %r14, %rdi
callq 0x66b15
movl 0x8(%r14), %ecx
movl 0xc(%r14), %r8d
movl 0x10(%r14), %r9d
movl 0x14(%r14), %r10d
movl 0x18(%r14), %r11d
cvttsd2si 0x20(%r14), %r15d
subq $0x8, %rsp
leaq 0x17c40(%rip), %rdx     # 0x7cf7c
leaq -0xb0(%rbp), %r14
movl $0x64, %edi
movq %r14, %rsi
xorl %eax, %eax
pushq %r15
pushq %r11
pushq %r10
callq 0xb954
addq $0x20, %rsp
movq %rbx, %rdi
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq $-0x1, %r8
callq 0xeffe
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: computeJD
static void computeJD(DateTime *p){
  int Y, M, D, A, B, X1, X2;

  if( p->validJD ) return;
  if( p->validYMD ){
    Y = p->Y;
    M = p->M;
    D = p->D;
  }else{
    Y = 2000;  /* If no YMD specified, assume 2000-Jan-01 */
    M = 1;
    D = 1;
  }
  if( M<=2 ){
    Y--;
    M += 12;
  }
  A = Y/100;
  B = 2 - A + (A/4);
  X1 = 36525*(Y+4716)/100;
  X2 = 306001*(M+1)/10000;
  p->iJD = (sqlite3_int64)((X1 + X2 + D + B - 1524.5 ) * 86400000);
  p->validJD = 1;
  if( p->validHMS ){
    p->iJD += p->h*3600000 + p->m*60000 + (sqlite3_int64)(p->s*1000);
    if( p->validTZ ){
      p->iJD -= p->tz*60000;
      p->validYMD = 0;
      p->validHMS = 0;
      p->validTZ = 0;
    }
  }
}

// Assembly:
cmpb $0x0, 0x2a(%rdi)
je 0x663ac
retq
cmpb $0x0, 0x28(%rdi)
je 0x663c0
movl 0x8(%rdi), %edx
movl 0xc(%rdi), %esi
movl 0x10(%rdi), %ecx
addl $0x2, %ecx
jmp 0x663cf
movl $0x7d0, %edx            # imm = 0x7D0
movl $0x1, %esi
movl $0x3, %ecx
pushq %rbp
movq %rsp, %rbp
leal 0xc(%rsi), %eax
xorl %r8d, %r8d
cmpl $0x3, %esi
setl %r8b
cmovgel %esi, %eax
subl %r8d, %edx
movslq %edx, %rdx
imulq $-0x51eb851f, %rdx, %rsi # imm = 0xAE147AE1
movq %rsi, %r8
shrq $0x3f, %r8
sarq $0x25, %rsi
addl %r8d, %esi
addl %ecx, %esi
imulq $0x51eb851f, %rdx, %rcx # imm = 0x51EB851F
movq %rcx, %r8
shrq $0x3f, %r8
sarq $0x27, %rcx
addl %r8d, %ecx
addl %esi, %ecx
imull $0x8ead, %edx, %edx     # imm = 0x8EAD
addl $0xa445afc, %edx        # imm = 0xA445AFC
movslq %edx, %rdx
imulq $0x51eb851f, %rdx, %rdx # imm = 0x51EB851F
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x25, %rdx
addl %esi, %edx
imull $0x4ab51, %eax, %eax    # imm = 0x4AB51
addl $0x4ab51, %eax          # imm = 0x4AB51
cltq
imulq $0x68db8bad, %rax, %rax # imm = 0x68DB8BAD
movq %rax, %rsi
shrq $0x3f, %rsi
sarq $0x2c, %rax
addl %esi, %eax
addl %ecx, %eax
addl %edx, %eax
cvtsi2sd %eax, %xmm0
addsd 0x12eb5(%rip), %xmm0    # 0x79320
mulsd 0x12e2d(%rip), %xmm0    # 0x792a0
cvttsd2si %xmm0, %rax
movq %rax, (%rdi)
movb $0x1, 0x2a(%rdi)
cmpb $0x0, 0x29(%rdi)
je 0x664da
movslq 0x14(%rdi), %rcx
imulq $0x36ee80, %rcx, %rcx   # imm = 0x36EE80
movslq 0x18(%rdi), %rdx
imulq $0xea60, %rdx, %rdx     # imm = 0xEA60
movsd 0x20(%rdi), %xmm0
mulsd 0x12e50(%rip), %xmm0    # 0x792f8
addq %rcx, %rdx
cvttsd2si %xmm0, %rcx
addq %rdx, %rcx
addq %rax, %rcx
movq %rcx, (%rdi)
cmpb $0x0, 0x2b(%rdi)
je 0x664da
movslq 0x1c(%rdi), %rax
imulq $0xea60, %rax, %rax     # imm = 0xEA60
subq %rax, %rcx
movq %rcx, (%rdi)
movw $0x0, 0x28(%rdi)
movb $0x0, 0x2b(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: getDigits
static int getDigits(const char *zDate, ...){
  va_list ap;
  int val;
  int N;
  int min;
  int max;
  int nextC;
  int *pVal;
  int cnt = 0;
  va_start(ap, zDate);
  do{
    N = va_arg(ap, int);
    min = va_arg(ap, int);
    max = va_arg(ap, int);
    nextC = va_arg(ap, int);
    pVal = va_arg(ap, int*);
    val = 0;
    while( N-- ){
      if( !sqlite3Isdigit(*zDate) ){
        goto end_getDigits;
      }
      val = val*10 + *zDate - '0';
      zDate++;
    }
    if( val<min || val>max || (nextC!=0 && nextC!=*zDate) ){
      goto end_getDigits;
    }
    *pVal = val;
    zDate++;
    cnt++;
  }while( nextC );
end_getDigits:
  va_end(ap);
  return cnt;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
leaq -0xe0(%rbp), %r10
movq %rsi, 0x8(%r10)
movq %rdx, 0x10(%r10)
movq %rcx, 0x18(%r10)
movq %r8, 0x20(%r10)
movq %r9, 0x28(%r10)
testb %al, %al
je 0x66732
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
movq %r10, -0x20(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, -0x30(%rbp)
xorl %eax, %eax
movl -0x30(%rbp), %r9d
cmpq $0x29, %r9
jae 0x667c3
movq -0x20(%rbp), %rdx
leaq 0x8(%r9), %rcx
movl %ecx, -0x30(%rbp)
movl (%rdx,%r9), %esi
cmpl $0x21, %r9d
jae 0x667d1
movq -0x20(%rbp), %rdx
leal 0x10(%r9), %r8d
movl %r8d, -0x30(%rbp)
movl (%rdx,%rcx), %ecx
cmpl $0x19, %r9d
jae 0x667df
movq -0x20(%rbp), %rdx
leaq 0x18(%r9), %r8
movl %r8d, -0x30(%rbp)
movl 0x10(%rdx,%r9), %edx
cmpl $0x11, %r9d
jae 0x667ed
movq -0x20(%rbp), %r11
movl %r9d, %r10d
orl $0x20, %r10d
movl %r10d, -0x30(%rbp)
movl (%r11,%r8), %r8d
cmpl $0x28, %r10d
ja 0x667fc
movl %r10d, %r10d
addq -0x20(%rbp), %r10
addl $0x28, %r9d
movl %r9d, -0x30(%rbp)
jmp 0x66808
movq -0x28(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x28(%rbp)
movl (%rcx), %esi
movq -0x28(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x28(%rbp)
movl (%rcx), %ecx
movq -0x28(%rbp), %rdx
leaq 0x8(%rdx), %r8
movq %r8, -0x28(%rbp)
movl (%rdx), %edx
movq -0x28(%rbp), %r8
leaq 0x8(%r8), %r9
movq %r9, -0x28(%rbp)
movl (%r8), %r8d
movq -0x28(%rbp), %r10
leaq 0x8(%r10), %r9
movq %r9, -0x28(%rbp)
movq (%r10), %r9
testl %esi, %esi
je 0x6684a
leal -0x1(%rsi), %r10d
addq %rdi, %r10
incq %r10
movl %esi, %r11d
xorl %ebx, %ebx
xorl %esi, %esi
movzbl (%rdi,%rbx), %r14d
leaq -0x3a(%r14), %r15
cmpq $-0xa, %r15
jb 0x66873
movsbl %r14b, %r14d
leal (%rsi,%rsi,4), %esi
leal (%r14,%rsi,2), %esi
addl $-0x30, %esi
incq %rbx
cmpl %ebx, %r11d
jne 0x66820
movq %r10, %rdi
jmp 0x6684c
xorl %esi, %esi
cmpl %ecx, %esi
jl 0x66873
cmpl %edx, %esi
jg 0x66873
testl %r8d, %r8d
je 0x6686e
movsbl (%rdi), %ecx
cmpl %ecx, %r8d
jne 0x66873
movl %esi, (%r9)
incq %rdi
incl %eax
jmp 0x6674e
movl %esi, (%r9)
incl %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: computeYMD
static void computeYMD(DateTime *p){
  int Z, A, B, C, D, E, X1;
  if( p->validYMD ) return;
  if( !p->validJD ){
    p->Y = 2000;
    p->M = 1;
    p->D = 1;
  }else{
    Z = (int)((p->iJD + 43200000)/86400000);
    A = (int)((Z - 1867216.25)/36524.25);
    A = Z + 1 + A - (A/4);
    B = A + 1524;
    C = (int)((B - 122.1)/365.25);
    D = (36525*C)/100;
    E = (int)((B-D)/30.6001);
    X1 = (int)(30.6001*E);
    p->D = B - D - X1;
    p->M = E<14 ? E-1 : E-13;
    p->Y = p->M>2 ? C - 4716 : C - 4715;
  }
  p->validYMD = 1;
}

// Assembly:
cmpb $0x0, 0x28(%rdi)
je 0x66a0f
retq
pushq %rbp
movq %rsp, %rbp
cmpb $0x0, 0x2a(%rdi)
je 0x66af7
movl $0x2932e00, %eax        # imm = 0x2932E00
addq (%rdi), %rax
movabsq $0x636ba875fd33dc87, %rcx # imm = 0x636BA875FD33DC87
imulq %rcx
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x19, %rdx
addl %eax, %edx
cvtsi2sd %edx, %xmm0
addsd 0x128ed(%rip), %xmm0    # 0x79338
divsd 0x128ed(%rip), %xmm0    # 0x79340
cvttsd2si %xmm0, %eax
leal 0x3(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
sarl $0x2, %ecx
addl %eax, %edx
subl %ecx, %edx
leal 0x5f5(%rdx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
addsd 0x128cd(%rip), %xmm0    # 0x79348
divsd 0x128cd(%rip), %xmm0    # 0x79350
cvttsd2si %xmm0, %eax
imull $0x8ead, %eax, %ecx     # imm = 0x8EAD
movslq %ecx, %rcx
imulq $-0x51eb851f, %rcx, %rcx # imm = 0xAE147AE1
movq %rcx, %rsi
shrq $0x3f, %rsi
sarq $0x25, %rcx
addl %esi, %ecx
addl %edx, %ecx
addl $0x5f5, %ecx            # imm = 0x5F5
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd 0x1289d(%rip), %xmm1    # 0x79358
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %esi
cvttpd2dq %xmm0, %xmm0
cvtdq2pd %xmm0, %xmm0
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %edx
subl %edx, %ecx
xorl %edx, %edx
cmpl $0xe, %esi
setl %dl
negl %edx
orl $-0xd, %edx
addl %esi, %edx
xorl %esi, %esi
cmpl $0x3, %edx
setge %sil
xorl $0xffffed95, %esi       # imm = 0xFFFFED95
addl %eax, %esi
jmp 0x66b06
movl $0x1, %edx
movl $0x7d0, %esi            # imm = 0x7D0
movl $0x1, %ecx
movl %esi, 0x8(%rdi)
movl %edx, 0xc(%rdi)
movl %ecx, 0x10(%rdi)
movb $0x1, 0x28(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: renameTableFunc
static void renameTableFunc(
  sqlite3_context *context,
  int NotUsed,
  sqlite3_value **argv
){
  unsigned char const *zSql = sqlite3_value_text(argv[0]);
  unsigned char const *zTableName = sqlite3_value_text(argv[1]);

  int token;
  Token tname;
  unsigned char const *zCsr = zSql;
  int len = 0;
  char *zRet;

  sqlite3 *db = sqlite3_context_db_handle(context);

  UNUSED_PARAMETER(NotUsed);

  /* The principle used to locate the table name in the CREATE TABLE 
  ** statement is that the table name is the first non-space token that
  ** is immediately followed by a TK_LP or TK_USING token.
  */
  if( zSql ){
    do {
      if( !*zCsr ){
        /* Ran out of input before finding an opening bracket. Return NULL. */
        return;
      }

      /* Store the token that zCsr points to in tname. */
      tname.z = (char*)zCsr;
      tname.n = len;

      /* Advance zCsr to the next token. Store that token type in 'token',
      ** and its length in 'len' (to be used next iteration of this loop).
      */
      do {
        zCsr += len;
        len = sqlite3GetToken(zCsr, &token);
      } while( token==TK_SPACE );
      assert( len>0 );
    } while( token!=TK_LP && token!=TK_USING );

    zRet = sqlite3MPrintf(db, "%.*s\"%w\"%s", ((u8*)tname.z) - zSql, zSql, 
       zTableName, tname.z+tname.n);
    sqlite3_result_text(context, zRet, -1, SQLITE_DYNAMIC);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rdi, %rbx
movq (%rdx), %rdi
movl $0x1, %esi
callq 0xef29
movq %rax, %r12
movq 0x8(%r14), %rdi
movl $0x1, %esi
callq 0xef29
testq %r12, %r12
je 0x66c61
cmpb $0x0, (%r12)
je 0x66c61
movq %rax, %rcx
movq 0x8(%rbx), %rax
movq %rax, -0x38(%rbp)
xorl %eax, %eax
leaq -0x2c(%rbp), %r13
movq %r12, %r14
movq %rbx, -0x48(%rbp)
movq %rcx, -0x40(%rbp)
movl %eax, %ebx
movq %r14, %r15
cltq
addq %rax, %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x35fcf
movl -0x2c(%rbp), %ecx
cmpl $0x95, %ecx
je 0x66c36
cmpl $0x79, %ecx
je 0x66c70
cmpl $0x16, %ecx
je 0x66c70
cmpb $0x0, (%r14)
jne 0x66c31
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdx
subq %r12, %rdx
movl %ebx, %r9d
addq %r15, %r9
leaq 0x16367(%rip), %rsi     # 0x7cfea
movq -0x38(%rbp), %rdi
movq %r12, %rcx
movq -0x40(%rbp), %r8
xorl %eax, %eax
callq 0x11900
leaq -0x5d38c(%rip), %r8     # 0x9910
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xeffe
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3MemMalloc
static void *sqlite3MemMalloc(int nByte){
#ifdef SQLITE_MALLOCSIZE
  void *p = SQLITE_MALLOC( nByte );
  if( p==0 ){
    testcase( sqlite3GlobalConfig.xLog!=0 );
    sqlite3_log(SQLITE_NOMEM, "failed to allocate %u bytes of memory", nByte);
  }
  return p;
#else
  sqlite3_int64 *p;
  assert( nByte>0 );
  nByte = ROUND8(nByte);
  p = SQLITE_MALLOC( nByte+8 );
  if( p ){
    p[0] = nByte;
    p++;
  }else{
    testcase( sqlite3GlobalConfig.xLog!=0 );
    sqlite3_log(SQLITE_NOMEM, "failed to allocate %u bytes of memory", nByte);
  }
  return (void *)p;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
addl $0x7, %ebx
andl $-0x8, %ebx
leal 0x8(%rbx), %eax
movslq %eax, %rdi
callq 0x8510
testq %rax, %rax
je 0x6701e
movq %rax, %r14
movslq %ebx, %rax
movq %rax, (%r14)
addq $0x8, %r14
jmp 0x67036
leaq 0x15fdb(%rip), %rsi     # 0x7d000
xorl %r14d, %r14d
movl $0x7, %edi
movl %ebx, %edx
xorl %eax, %eax
callq 0xb9c7
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3MemRealloc
static void *sqlite3MemRealloc(void *pPrior, int nByte){
#ifdef SQLITE_MALLOCSIZE
  void *p = SQLITE_REALLOC(pPrior, nByte);
  if( p==0 ){
    testcase( sqlite3GlobalConfig.xLog!=0 );
    sqlite3_log(SQLITE_NOMEM,
      "failed memory resize %u to %u bytes",
      SQLITE_MALLOCSIZE(pPrior), nByte);
  }
  return p;
#else
  sqlite3_int64 *p = (sqlite3_int64*)pPrior;
  assert( pPrior!=0 && nByte>0 );
  assert( nByte==ROUND8(nByte) ); /* EV: R-46199-30249 */
  p--;
  p = SQLITE_REALLOC(p, nByte+8 );
  if( p ){
    p[0] = nByte;
    p++;
  }else{
    testcase( sqlite3GlobalConfig.xLog!=0 );
    sqlite3_log(SQLITE_NOMEM,
      "failed memory resize %u to %u bytes",
      sqlite3MemSize(pPrior), nByte);
  }
  return (void*)p;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r12
leaq -0x8(%rdi), %r15
leal 0x8(%rbx), %eax
movslq %eax, %rsi
movq %r15, %rdi
callq 0x8680
testq %rax, %rax
je 0x67082
movq %rax, %r14
movslq %ebx, %rax
movq %rax, (%r14)
addq $0x8, %r14
jmp 0x670a6
testq %r12, %r12
je 0x6708c
movl (%r15), %edx
jmp 0x6708e
xorl %edx, %edx
leaq 0x15f91(%rip), %rsi     # 0x7d026
xorl %r14d, %r14d
movl $0x7, %edi
movl %ebx, %ecx
xorl %eax, %eax
callq 0xb9c7
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq