// File: /workspace/github_c_makefile_star2_O1/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 0xe47a
movq %rsi, %rbx
movq (%rdi), %rax
movq 0x8(%rdi), %r14
movq %rax, 0x8(%r14)
cmpb $0x0, 0x21(%r14)
je 0xe48c
movq (%r14), %r12
movq 0x10(%r14), %r15
testq %r15, %r15
je 0xe3dd
movq 0x28(%r15), %rdi
callq 0xa2e8
movq $0x0, 0x28(%r15)
movq 0x10(%r15), %r15
jmp 0xe3c1
xorl %r13d, %r13d
cmpb $0x0, 0x22(%r14)
jne 0xe475
movq %r12, -0x38(%rbp)
movl 0x3c(%r14), %r12d
xorl %eax, %eax
cmpl $0x2, %r12d
jb 0xe438
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 0x8641f(%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 0xe450
movl 0x863fd(%rip), %eax     # 0x94840
xorl %edx, %edx
divl 0x30(%r14)
incl %eax
cmpl %eax, %r12d
jne 0xe4b8
leaq 0x6b3bd(%rip), %rsi     # 0x79814
leaq 0x6b0db(%rip), %rcx     # 0x79539
movl $0xb, %r13d
movl $0xb, %edi
movl $0xce1f, %edx           # imm = 0xCE1F
xorl %eax, %eax
callq 0xb8cc
testl %r13d, %r13d
je 0xe48c
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x0, 0x23(%r14)
je 0xe49d
movq (%r14), %rax
movl 0x3c(%r14), %ecx
movl %ecx, 0x1c(%rax)
movq (%r14), %rdi
movq %rbx, %rsi
xorl %edx, %edx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe086
movq 0x18(%r14), %rax
movq 0x50(%rax), %rax
movl 0x24(%rax), %r13d
bswapl %r13d
movq %r14, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x2104d
cmpl %r12d, %eax
jbe 0xe4fd
leaq 0x6b333(%rip), %rsi     # 0x79814
leaq 0x6b051(%rip), %rcx     # 0x79539
movl $0xb, %r13d
movl $0xb, %edi
movl $0xce24, %edx           # imm = 0xCE24
jmp 0xe46e
movl %eax, %r15d
movl %r13d, -0x2c(%rbp)
xorl %r13d, %r13d
cmpl %r12d, %eax
jae 0xe51b
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x21124
movl %eax, %r13d
cmpl %r12d, %r15d
setb %cl
testl %r13d, %r13d
sete %al
andb %al, %cl
cmpb $0x1, %cl
jne 0xe556
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
movl $0x1, %ecx
callq 0x21222
movl %eax, %r13d
decl %r12d
testl %eax, %eax
sete %al
cmpl %r15d, %r12d
jbe 0xe556
testl %r13d, %r13d
je 0xe52e
cmpl $0x65, %r13d
sete %cl
cmpl $0x0, -0x2c(%rbp)
je 0xe5ae
orb %al, %cl
movq -0x38(%rbp), %r12
je 0xe5b2
movq 0x18(%r14), %rax
movq 0x68(%rax), %rdi
callq 0xdebf
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 %r15d, %ecx
bswapl %ecx
movl %ecx, 0x1c(%rax)
movb $0x1, 0x23(%r14)
movl %r15d, 0x3c(%r14)
jmp 0xe5b2
movq -0x38(%rbp), %r12
testl %r13d, %r13d
je 0xe475
movq %r12, %rdi
callq 0x1e053
jmp 0xe475