// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3BtreeCommitPhaseOne
SQLITE_PRIVATE int sqlite3BtreeCommitPhaseOne(Btree *p, const char *zSuperJrnl){
  int rc = SQLITE_OK;
  if( p->inTrans==TRANS_WRITE ){
    BtShared *pBt = p->pBt;
    sqlite3BtreeEnter(p);
#ifndef SQLITE_OMIT_AUTOVACUUM
    if( pBt->autoVacuum ){
      rc = autoVacuumCommit(pBt);
      if( rc!=SQLITE_OK ){
        sqlite3BtreeLeave(p);
        return rc;
      }
    }
    if( pBt->bDoTruncate ){
      sqlite3PagerTruncateImage(pBt->pPager, pBt->nPage);
    }
#endif
    rc = sqlite3PagerCommitPhaseOne(pBt->pPager, zSuperJrnl, 0);
    sqlite3BtreeLeave(p);
  }
  return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %ebp, %ebp
cmpb $0x2, 0x10(%rdi)
jne 0x2778ea
movq %rsi, %rbx
movq (%rdi), %rax
movq 0x8(%rdi), %r15
movq %rax, 0x8(%r15)
cmpb $0x0, 0x21(%r15)
movq (%r15), %r14
je 0x277834
movq 0x10(%r15), %r13
testq %r13, %r13
je 0x27782d
movq %r13, %rax
andb $-0x5, 0x1(%rax)
movq 0x28(%rax), %rax
testq %rax, %rax
jne 0x277820
cmpb $0x0, 0x22(%r15)
je 0x27785e
cmpb $0x0, 0x23(%r15)
je 0x277843
movl 0x40(%r15), %eax
movl %eax, 0x1c(%r14)
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2774e2
movl 0x40(%r15), %r12d
xorl %eax, %eax
cmpl $0x2, %r12d
jb 0x2778a7
movl 0x38(%r15), %eax
movl $0xcccccccd, %esi       # imm = 0xCCCCCCCD
imulq %rax, %rsi
shrq $0x22, %rsi
incl %esi
leal -0x2(%r12), %ecx
movl %ecx, %eax
xorl %edx, %edx
divl %esi
subl %edx, %ecx
movl 0x244230(%rip), %eax    # 0x4bbac0
xorl %edx, %edx
divl 0x34(%r15)
leal 0x1(%rcx), %edx
xorl %esi, %esi
cmpl %eax, %edx
sete %sil
leal (%rcx,%rsi), %eax
addl $0x2, %eax
cmpl %r12d, %eax
je 0x2778bf
movl 0x24420e(%rip), %eax    # 0x4bbac0
xorl %edx, %edx
divl 0x34(%r15)
incl %eax
cmpl %eax, %r12d
jne 0x2778fb
leaq 0x15e305(%rip), %rsi    # 0x3d5bcb
leaq 0x15e40f(%rip), %rdx    # 0x3d5cdc
leaq 0x15e15d(%rip), %r8     # 0x3d5a31
movl $0xb, %ebp
movl $0xb, %edi
movl $0x10b44, %ecx          # imm = 0x10B44
xorl %eax, %eax
callq 0x274d08
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%r15), %rax
movq 0x50(%rax), %rax
movl 0x24(%rax), %ebp
bswapl %ebp
movq %r15, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0x28dc9e
movl %eax, (%rsp)
cmpl %r12d, %eax
jbe 0x277943
leaq 0x15e2a7(%rip), %rsi    # 0x3d5bcb
leaq 0x15e3b1(%rip), %rdx    # 0x3d5cdc
leaq 0x15e0ff(%rip), %r8     # 0x3d5a31
movl $0xb, %ebp
movl $0xb, %edi
movl $0x10b49, %ecx          # imm = 0x10B49
jmp 0x2778e3
movl %ebp, 0x4(%rsp)
xorl %ebp, %ebp
testq %r13, %r13
je 0x277962
cmpl %r12d, (%rsp)
jae 0x277962
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x28e021
movl %eax, %ebp
movl (%rsp), %r13d
cmpl %r13d, %r12d
seta %cl
testl %ebp, %ebp
sete %al
andb %al, %cl
cmpb $0x1, %cl
jne 0x27799e
movq %r15, %rdi
movl %r13d, %esi
movl %r12d, %edx
movl $0x1, %ecx
callq 0x28dd9a
movl %eax, %ebp
decl %r12d
testl %eax, %eax
sete %al
cmpl %r13d, %r12d
jbe 0x27799e
testl %ebp, %ebp
je 0x277978
cmpl $0x65, %ebp
sete %cl
cmpl $0x0, 0x4(%rsp)
je 0x2779ef
orb %al, %cl
je 0x2779ef
movq 0x18(%r15), %rax
movq 0x70(%rax), %rdi
callq 0x2774a1
movl %eax, %ebp
movq 0x18(%r15), %rax
movq 0x50(%rax), %rax
xorl %ecx, %ecx
movl %ecx, 0x20(%rax)
movq 0x18(%r15), %rax
movq 0x50(%rax), %rax
movl %ecx, 0x24(%rax)
movq 0x18(%r15), %rax
movq 0x50(%rax), %rax
movl %r13d, %ecx
bswapl %ecx
movl %ecx, 0x1c(%rax)
movb $0x1, 0x23(%r15)
movl %r13d, 0x40(%r15)
testl %ebp, %ebp
je 0x277a00
movq %r14, %rdi
callq 0x28942f
jmp 0x2778ea
movq (%r15), %r14
jmp 0x277834