// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/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 if( !validJulianDay(p->iJD) ){
    datetimeError(p);
    return;
  }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&32767))/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpb $0x0, 0x2a(%rax)
je 0x46cecb
jmp 0x46d060
movq -0x8(%rbp), %rax
cmpb $0x0, 0x28(%rax)
jne 0x46cefb
movq -0x8(%rbp), %rax
movl $0x7d0, 0x8(%rax)       # imm = 0x7D0
movq -0x8(%rbp), %rax
movl $0x1, 0xc(%rax)
movq -0x8(%rbp), %rax
movl $0x1, 0x10(%rax)
jmp 0x46d058
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x46c460
cmpl $0x0, %eax
jne 0x46cf1a
movq -0x8(%rbp), %rdi
callq 0x46d1c0
jmp 0x46d060
movq -0x8(%rbp), %rax
movq (%rax), %rax
addq $0x2932e00, %rax        # imm = 0x2932E00
movl $0x5265c00, %ecx        # imm = 0x5265C00
cqto
idivq %rcx
movl %eax, -0xc(%rbp)
cvtsi2sdl -0xc(%rbp), %xmm0
movsd 0x13dda7(%rip), %xmm1   # 0x5aace8
subsd %xmm1, %xmm0
movsd 0x13dd93(%rip), %xmm1   # 0x5aace0
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
addl -0x10(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x10(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x28(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
addl $0x5f4, %eax            # imm = 0x5F4
movl %eax, -0x14(%rbp)
cvtsi2sdl -0x14(%rbp), %xmm0
movsd 0x13dd47(%rip), %xmm1   # 0x5aacd8
subsd %xmm1, %xmm0
movsd 0x13dd33(%rip), %xmm1   # 0x5aacd0
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
andl $0x7fff, %eax           # imm = 0x7FFF
imull $0x8ead, %eax, %eax     # imm = 0x8EAD
movl $0x64, %ecx
cltd
idivl %ecx
movl %eax, -0x1c(%rbp)
movl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
cvtsi2sd %eax, %xmm0
movsd 0x13dcf5(%rip), %xmm1   # 0x5aacc8
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x20(%rbp)
cvtsi2sdl -0x20(%rbp), %xmm1
movsd 0x13dcdd(%rip), %xmm0   # 0x5aacc8
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x24(%rbp)
movl -0x14(%rbp), %ecx
subl -0x1c(%rbp), %ecx
subl -0x24(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x10(%rax)
cmpl $0xe, -0x20(%rbp)
jge 0x46d017
movl -0x20(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x46d020
movl -0x20(%rbp), %eax
subl $0xd, %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x8(%rbp), %rax
cmpl $0x2, 0xc(%rax)
jle 0x46d041
movl -0x18(%rbp), %eax
subl $0x126c, %eax           # imm = 0x126C
movl %eax, -0x30(%rbp)
jmp 0x46d04c
movl -0x18(%rbp), %eax
subl $0x126b, %eax           # imm = 0x126B
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x8(%rax)
jmp 0x46d058
movq -0x8(%rbp), %rax
movb $0x1, 0x2a(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)