// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/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( Y<-4713 || Y>9999 || p->rawS ){
    datetimeError(p);
    return;
  }
  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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpb $0x0, 0x28(%rax)
je 0x46b7cb
jmp 0x46b970
movq -0x8(%rbp), %rax
cmpb $0x0, 0x2a(%rax)
je 0x46b7f5
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x14(%rbp)
jmp 0x46b80a
movl $0x7d0, -0xc(%rbp)      # imm = 0x7D0
movl $0x1, -0x10(%rbp)
movl $0x1, -0x14(%rbp)
cmpl $0xffffed97, -0xc(%rbp) # imm = 0xFFFFED97
jl 0x46b829
cmpl $0x270f, -0xc(%rbp)     # imm = 0x270F
jg 0x46b829
movq -0x8(%rbp), %rax
movsbl 0x29(%rax), %eax
cmpl $0x0, %eax
je 0x46b837
movq -0x8(%rbp), %rdi
callq 0x46d1c0
jmp 0x46b970
cmpl $0x2, -0x10(%rbp)
jg 0x46b84f
movl -0xc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xc(%rbp)
movl -0x10(%rbp), %eax
addl $0xc, %eax
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
movl $0x64, %ecx
cltd
idivl %ecx
movl %eax, -0x18(%rbp)
movl $0x2, %eax
subl -0x18(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x18(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x28(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x1c(%rbp)
movl -0xc(%rbp), %eax
addl $0x126c, %eax           # imm = 0x126C
imull $0x8ead, %eax, %eax     # imm = 0x8EAD
movl $0x64, %ecx
cltd
idivl %ecx
movl %eax, -0x20(%rbp)
movl -0x10(%rbp), %eax
addl $0x1, %eax
imull $0x4ab51, %eax, %eax    # imm = 0x4AB51
movl $0x2710, %ecx           # imm = 0x2710
cltd
idivl %ecx
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %eax
addl -0x24(%rbp), %eax
addl -0x14(%rbp), %eax
addl -0x1c(%rbp), %eax
cvtsi2sd %eax, %xmm0
movsd 0x13f3db(%rip), %xmm1   # 0x5aaca0
subsd %xmm1, %xmm0
movsd 0x13f37f(%rip), %xmm1   # 0x5aac50
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movb $0x1, 0x28(%rax)
movq -0x8(%rbp), %rax
cmpb $0x0, 0x2b(%rax)
je 0x46b970
movq -0x8(%rbp), %rax
imull $0x36ee80, 0x14(%rax), %eax # imm = 0x36EE80
movq -0x8(%rbp), %rcx
imull $0xea60, 0x18(%rcx), %ecx # imm = 0xEA60
addl %ecx, %eax
movslq %eax, %rcx
movq -0x8(%rbp), %rax
movsd 0xeb0e6(%rip), %xmm0    # 0x556a00
mulsd 0x20(%rax), %xmm0
cvttsd2si %xmm0, %rax
addq %rax, %rcx
movq -0x8(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
cmpb $0x0, 0x2c(%rax)
je 0x46b96e
movq -0x8(%rbp), %rax
imull $0xea60, 0x1c(%rax), %eax # imm = 0xEA60
movslq %eax, %rdx
movq -0x8(%rbp), %rax
movq (%rax), %rcx
subq %rdx, %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x2a(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x2b(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x2c(%rax)
jmp 0x46b970
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)