// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: readSuperJournal
static int readSuperJournal(sqlite3_file *pJrnl, char *zSuper, u32 nSuper){
  int rc;                    /* Return code */
  u32 len;                   /* Length in bytes of super-journal name */
  i64 szJ;                   /* Total size in bytes of journal file pJrnl */
  u32 cksum;                 /* MJ checksum value read from journal */
  u32 u;                     /* Unsigned loop counter */
  unsigned char aMagic[8];   /* A buffer to hold the magic header */
  zSuper[0] = '\0';

  if( SQLITE_OK!=(rc = sqlite3OsFileSize(pJrnl, &szJ))
   || szJ<16
   || SQLITE_OK!=(rc = read32bits(pJrnl, szJ-16, &len))
   || len>=nSuper
   || len>szJ-16
   || len==0
   || SQLITE_OK!=(rc = read32bits(pJrnl, szJ-12, &cksum))
   || SQLITE_OK!=(rc = sqlite3OsRead(pJrnl, aMagic, 8, szJ-8))
   || memcmp(aMagic, aJournalMagic, 8)
   || SQLITE_OK!=(rc = sqlite3OsRead(pJrnl, zSuper, len, szJ-16-len))
  ){
    return rc;
  }

  /* See if the checksum matches the super-journal name */
  for(u=0; u<len; u++){
    cksum -= zSuper[u];
  }
  if( cksum ){
    /* If the checksum doesn't add up, then one or more of the disk sectors
    ** containing the super-journal filename is corrupted. This means
    ** definitely roll back, so just return SQLITE_OK and report a (nul)
    ** super-journal filename.
    */
    len = 0;
  }
  zSuper[len] = '\0';
  zSuper[len+1] = '\0';

  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movb $0x0, (%rax)
movq -0x10(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3dfbd0
movl %eax, %ecx
movl %ecx, -0x20(%rbp)
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x3e367c
cmpq $0x10, -0x30(%rbp)
jl 0x3e367c
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
subq $0x10, %rsi
leaq -0x24(%rbp), %rdx
callq 0x3e3410
movl %eax, %ecx
movl %ecx, -0x20(%rbp)
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x3e367c
movl -0x24(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x3e367c
movl -0x24(%rbp), %eax
movq -0x30(%rbp), %rcx
subq $0x10, %rcx
cmpq %rcx, %rax
jg 0x3e367c
cmpl $0x0, -0x24(%rbp)
je 0x3e367c
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
subq $0xc, %rsi
leaq -0x34(%rbp), %rdx
callq 0x3e3410
movl %eax, %ecx
movl %ecx, -0x20(%rbp)
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x3e367c
movq -0x10(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movq -0x30(%rbp), %rcx
subq $0x8, %rcx
movl $0x8, %edx
callq 0x3dfc00
movl %eax, %ecx
movl %ecx, -0x20(%rbp)
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x3e367c
leaq -0x40(%rbp), %rax
movq (%rax), %rax
movabsq $-0x289c5edf06fa2a27, %rcx # imm = 0xD763A120F905D5D9
subq %rcx, %rax
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x3e367c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x24(%rbp), %edx
movq -0x30(%rbp), %rcx
subq $0x10, %rcx
movl -0x24(%rbp), %eax
subq %rax, %rcx
callq 0x3dfc00
movl %eax, %ecx
movl %ecx, -0x20(%rbp)
xorl %eax, %eax
cmpl %ecx, %eax
je 0x3e3684
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x3e36e0
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x3e36b1
movq -0x18(%rbp), %rax
movl -0x38(%rbp), %ecx
movsbl (%rax,%rcx), %ecx
movl -0x34(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x34(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x3e368b
cmpl $0x0, -0x34(%rbp)
je 0x3e36be
movl $0x0, -0x24(%rbp)
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)