// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3BtreeCommitPhaseOne
SQLITE_PRIVATE int sqlite3BtreeCommitPhaseOne(Btree *p, const char *zMaster){
  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, zMaster, 0);
    sqlite3BtreeLeave(p);
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
xorl %r13d, %r13d
cmpb $0x2, 0x10(%rdi)
jne 0xe583
movq %rsi, %rbx
movq (%rdi), %rax
movq 0x8(%rdi), %r14
movq %rax, 0x8(%r14)
cmpb $0x0, 0x21(%r14)
je 0xe4d0
movq (%r14), %r12
movq 0x10(%r14), %r15
testq %r15, %r15
je 0xe4c9
movq 0x28(%r15), %rdi
callq 0xa3c7
movq $0x0, 0x28(%r15)
movq 0x10(%r15), %r15
jmp 0xe4ad
cmpb $0x0, 0x22(%r14)
je 0xe4f9
cmpb $0x0, 0x23(%r14)
movq (%r14), %rdi
je 0xe4e1
movl 0x3c(%r14), %eax
movl %eax, 0x1c(%rdi)
movq %rbx, %rsi
xorl %edx, %edx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe17d
movq %r12, -0x38(%rbp)
movl 0x3c(%r14), %r12d
xorl %eax, %eax
cmpl $0x2, %r12d
jb 0xe546
movl 0x34(%r14), %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 0x86311(%rip), %eax     # 0x94840
xorl %edx, %edx
divl 0x30(%r14)
leal 0x1(%rcx), %edx
xorl %esi, %esi
cmpl %eax, %edx
sete %sil
leal (%rcx,%rsi), %eax
addl $0x2, %eax
cmpl %r12d, %eax
je 0xe55e
movl 0x862ef(%rip), %eax     # 0x94840
xorl %edx, %edx
divl 0x30(%r14)
incl %eax
cmpl %eax, %r12d
jne 0xe595
leaq 0x6b2af(%rip), %rsi     # 0x79814
leaq 0x6afcd(%rip), %rcx     # 0x79539
movl $0xb, %r13d
movl $0xb, %edi
movl $0xce1f, %edx           # imm = 0xCE1F
xorl %eax, %eax
callq 0xb9c7
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%r14), %rax
movq 0x50(%rax), %rax
movl 0x24(%rax), %r15d
bswapl %r15d
movq %r14, %rdi
movl %r12d, %esi
movl %r15d, %edx
callq 0x20d20
movl %eax, -0x2c(%rbp)
cmpl %r12d, %eax
jbe 0xe5da
leaq 0x6b253(%rip), %rsi     # 0x79814
leaq 0x6af71(%rip), %rcx     # 0x79539
movl $0xb, %r13d
movl $0xb, %edi
movl $0xce24, %edx           # imm = 0xCE24
jmp 0xe57c
movl %r15d, -0x30(%rbp)
jae 0xe5fb
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x20df0
testl %eax, %eax
je 0xe674
movl %eax, %r13d
xorl %ecx, %ecx
jmp 0xe600
movb $0x1, %cl
xorl %r13d, %r13d
cmpl $0x65, %r13d
sete %al
cmpl $0x0, -0x30(%rbp)
je 0xe65a
orb %cl, %al
movq -0x38(%rbp), %r15
je 0xe65e
movq 0x18(%r14), %rax
movq 0x68(%rax), %rdi
callq 0xdfbf
movl %eax, %r13d
movq 0x18(%r14), %rax
movq 0x50(%rax), %rax
xorl %ecx, %ecx
movl %ecx, 0x20(%rax)
movq 0x18(%r14), %rax
movq 0x50(%rax), %rax
movl %ecx, 0x24(%rax)
movq 0x18(%r14), %rax
movq 0x50(%rax), %rax
movl -0x2c(%rbp), %edx
movl %edx, %ecx
bswapl %ecx
movl %ecx, 0x1c(%rax)
movb $0x1, 0x23(%r14)
movl %edx, 0x3c(%r14)
jmp 0xe65e
movq -0x38(%rbp), %r15
testl %r13d, %r13d
je 0xe4d0
movq %r15, %rdi
callq 0x1de22
jmp 0xe583
movl -0x2c(%rbp), %r15d
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
movl $0x1, %ecx
callq 0x20ed8
movl %eax, %r13d
decl %r12d
testl %eax, %eax
sete %cl
cmpl %r15d, %r12d
jbe 0xe600
testl %r13d, %r13d
je 0xe678
jmp 0xe600