	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function readJournalHdr
_readJournalHdr:                        ## @readJournalHdr
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -72(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r12
	movq	%rdx, %r14
	movl	%esi, %r15d
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	28(%rdi), %edi
	callq	_isOpen
	movl	%eax, %edi
	callq	_assert
	movq	%r13, %rdi
	callq	_journalHdrOffset
	movq	%rax, %rbx
	movq	%rax, (%r13)
	movq	%r13, %rdi
	callq	_JOURNAL_HDR_SZ
	addq	%rbx, %rax
	cmpq	%r14, %rax
	jle	LBB0_2
LBB0_1:
	movq	_SQLITE_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_22
LBB0_2:
	movq	(%r13), %r14
	testl	%r15d, %r15d
	jne	LBB0_4
## %bb.3:
	cmpq	8(%r13), %r14
	je	LBB0_6
LBB0_4:
	movl	28(%r13), %edi
	leaq	-56(%rbp), %rsi
	movl	$8, %edx
	movq	%r14, %rcx
	callq	_sqlite3OsRead
	testl	%eax, %eax
	jne	LBB0_22
## %bb.5:
	movq	_aJournalMagic@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdi
	movl	$8, %edx
	callq	_memcmp
	testq	%rax, %rax
	jne	LBB0_1
LBB0_6:
	movq	_SQLITE_OK@GOTPCREL(%rip), %r15
	movl	(%r15), %ebx
	movl	28(%r13), %edi
	leaq	8(%r14), %rsi
	movq	%r12, %rdx
	callq	_read32bits
	cmpl	%eax, %ebx
	jne	LBB0_22
## %bb.7:
	movl	(%r15), %ebx
	movl	28(%r13), %edi
	leaq	12(%r14), %rsi
	leaq	16(%r13), %rdx
	callq	_read32bits
	cmpl	%eax, %ebx
	jne	LBB0_22
## %bb.8:
	movl	(%r15), %r12d
	movl	28(%r13), %edi
	leaq	16(%r14), %rsi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	callq	_read32bits
	cmpl	%eax, %r12d
	jne	LBB0_22
## %bb.9:
	cmpq	$0, (%r13)
	je	LBB0_10
LBB0_21:
	movq	%r13, %rdi
	callq	_JOURNAL_HDR_SZ
	addq	%rax, (%r13)
	movl	%r12d, %eax
	jmp	LBB0_22
LBB0_10:
	movl	(%r15), %ebx
	movl	28(%r13), %edi
	leaq	20(%r14), %rsi
	leaq	-64(%rbp), %rdx
	callq	_read32bits
	cmpl	%eax, %ebx
	jne	LBB0_22
## %bb.11:
	movl	(%r15), %ebx
	movl	28(%r13), %edi
	addq	$24, %r14
	leaq	-60(%rbp), %rdx
	movq	%r14, %rsi
	callq	_read32bits
	cmpl	%eax, %ebx
	jne	LBB0_22
## %bb.12:
	movl	-60(%rbp), %ecx
	testl	%ecx, %ecx
	jne	LBB0_14
## %bb.13:
	movl	20(%r13), %ecx
	movl	%ecx, -60(%rbp)
LBB0_14:
	cmpl	$512, %ecx                      ## imm = 0x200
	jl	LBB0_1
## %bb.15:
	movl	-64(%rbp), %eax
	cmpl	$32, %eax
	jl	LBB0_1
## %bb.16:
	movq	_SQLITE_MAX_PAGE_SIZE@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jg	LBB0_1
## %bb.17:
	movq	_MAX_SECTOR_SIZE@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %eax
	jg	LBB0_1
## %bb.18:
	movl	%ecx, %edx
	shrl	%edx
	andl	$1431655765, %edx               ## imm = 0x55555555
	subl	%edx, %ecx
	movl	%ecx, %edx
	andl	$858993459, %edx                ## imm = 0x33333333
	shrl	$2, %ecx
	andl	$858993459, %ecx                ## imm = 0x33333333
	addl	%edx, %ecx
	movl	%ecx, %edx
	shrl	$4, %edx
	addl	%ecx, %edx
	andl	$252645135, %edx                ## imm = 0xF0F0F0F
	imull	$16843009, %edx, %ecx           ## imm = 0x1010101
	shrl	$24, %ecx
	cmpl	$1, %ecx
	ja	LBB0_1
## %bb.19:
	movl	%eax, %ecx
	shrl	%ecx
	andl	$1431655765, %ecx               ## imm = 0x55555555
	subl	%ecx, %eax
	movl	%eax, %ecx
	andl	$858993459, %ecx                ## imm = 0x33333333
	shrl	$2, %eax
	andl	$858993459, %eax                ## imm = 0x33333333
	addl	%ecx, %eax
	movl	%eax, %ecx
	shrl	$4, %ecx
	addl	%eax, %ecx
	andl	$252645135, %ecx                ## imm = 0xF0F0F0F
	imull	$16843009, %ecx, %eax           ## imm = 0x1010101
	shrl	$24, %eax
	cmpl	$2, %eax
	jae	LBB0_1
## %bb.20:
	leaq	-60(%rbp), %rsi
	movq	%r13, %rdi
	movl	$-1, %edx
	callq	_sqlite3PagerSetPagesize
	movl	%eax, %r12d
	xorl	%edi, %edi
	cmpl	(%r15), %eax
	setne	%dil
	callq	_testcase
	movl	-64(%rbp), %eax
	movl	%eax, 24(%r13)
	jmp	LBB0_21
LBB0_22:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_24
## %bb.23:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_24:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_SQLITE_DONE,4,2                ## @SQLITE_DONE
	.comm	_aJournalMagic,4,2              ## @aJournalMagic
	.comm	_SQLITE_OK,4,2                  ## @SQLITE_OK
	.comm	_SQLITE_MAX_PAGE_SIZE,4,2       ## @SQLITE_MAX_PAGE_SIZE
	.comm	_MAX_SECTOR_SIZE,4,2            ## @MAX_SECTOR_SIZE
	.no_dead_strip	_readJournalHdr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function readJournalHdr
_readJournalHdr:                        ; @readJournalHdr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x4
	mov	x22, x3
	mov	x20, x2
	mov	x23, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldr	w0, [x0, #28]
	bl	_isOpen
	bl	_assert
	mov	x0, x19
	bl	_journalHdrOffset
	mov	x24, x0
	str	x0, [x19]
	mov	x0, x19
	bl	_JOURNAL_HDR_SZ
	add	x8, x0, x24
	cmp	x8, x20
	b.le	LBB0_2
LBB0_1:
Lloh3:
	adrp	x8, _SQLITE_DONE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SQLITE_DONE@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	b	LBB0_22
LBB0_2:
	ldr	x20, [x19]
	cbnz	w23, LBB0_4
; %bb.3:
	ldr	x8, [x19, #8]
	cmp	x20, x8
	b.eq	LBB0_6
LBB0_4:
	ldr	w0, [x19, #28]
	add	x1, sp, #16
	mov	w2, #8
	mov	x3, x20
	bl	_sqlite3OsRead
	cbnz	w0, LBB0_22
; %bb.5:
Lloh6:
	adrp	x8, _aJournalMagic@GOTPAGE
Lloh7:
	ldr	x8, [x8, _aJournalMagic@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	add	x0, sp, #16
	mov	w2, #8
	bl	_memcmp
	cbnz	x0, LBB0_1
LBB0_6:
Lloh9:
	adrp	x23, _SQLITE_OK@GOTPAGE
Lloh10:
	ldr	x23, [x23, _SQLITE_OK@GOTPAGEOFF]
	ldr	w24, [x23]
	ldr	w0, [x19, #28]
	add	x1, x20, #8
	mov	x2, x22
	bl	_read32bits
	cmp	w24, w0
	b.ne	LBB0_22
; %bb.7:
	ldr	w22, [x23]
	ldr	w0, [x19, #28]
	add	x1, x20, #12
	add	x2, x19, #16
	bl	_read32bits
	cmp	w22, w0
	b.ne	LBB0_22
; %bb.8:
	ldr	w22, [x23]
	ldr	w0, [x19, #28]
	add	x1, x20, #16
	mov	x2, x21
	bl	_read32bits
	cmp	w22, w0
	b.ne	LBB0_22
; %bb.9:
	ldr	x8, [x19]
	cbz	x8, LBB0_11
LBB0_10:
	mov	x0, x19
	bl	_JOURNAL_HDR_SZ
	ldr	x8, [x19]
	add	x8, x8, x0
	str	x8, [x19]
	mov	x0, x22
	b	LBB0_22
LBB0_11:
	ldr	w21, [x23]
	ldr	w0, [x19, #28]
	add	x1, x20, #20
	add	x2, sp, #8
	bl	_read32bits
	cmp	w21, w0
	b.ne	LBB0_22
; %bb.12:
	ldr	w21, [x23]
	ldr	w0, [x19, #28]
	add	x1, x20, #24
	add	x2, sp, #12
	bl	_read32bits
	cmp	w21, w0
	b.ne	LBB0_22
; %bb.13:
	ldr	w8, [sp, #12]
	cbnz	w8, LBB0_15
; %bb.14:
	ldr	w8, [x19, #20]
	str	w8, [sp, #12]
LBB0_15:
	cmp	w8, #512
	b.lt	LBB0_1
; %bb.16:
	ldr	w9, [sp, #8]
	cmp	w9, #32
	b.lt	LBB0_1
; %bb.17:
Lloh11:
	adrp	x10, _SQLITE_MAX_PAGE_SIZE@GOTPAGE
Lloh12:
	ldr	x10, [x10, _SQLITE_MAX_PAGE_SIZE@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	cmp	w8, w10
	b.gt	LBB0_1
; %bb.18:
Lloh14:
	adrp	x10, _MAX_SECTOR_SIZE@GOTPAGE
Lloh15:
	ldr	x10, [x10, _MAX_SECTOR_SIZE@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	cmp	w9, w10
	b.gt	LBB0_1
; %bb.19:
	fmov	s0, w9
	mov.s	v0[1], w8
	movi.2d	v1, #0xffffffffffffffff
	add.2s	v1, v0, v1
	and.8b	v0, v0, v1
	cmeq.2s	v0, v0, #0
	mov.s	w8, v0[1]
	tbz	w8, #0, LBB0_1
; %bb.20:
	fmov	w8, s0
	tbz	w8, #0, LBB0_1
; %bb.21:
	add	x1, sp, #12
	mov	x0, x19
	mov	w2, #-1
	bl	_sqlite3PagerSetPagesize
	mov	x22, x0
	ldr	w8, [x23]
	cmp	w0, w8
	cset	w0, ne
	bl	_testcase
	ldr	w8, [sp, #8]
	str	w8, [x19, #24]
	b	LBB0_10
LBB0_22:
	ldr	x8, [sp, #24]
Lloh17:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh18:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_24
; %bb.23:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_24:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_SQLITE_DONE,4,2                ; @SQLITE_DONE
	.comm	_aJournalMagic,4,2              ; @aJournalMagic
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.comm	_SQLITE_MAX_PAGE_SIZE,4,2       ; @SQLITE_MAX_PAGE_SIZE
	.comm	_MAX_SECTOR_SIZE,4,2            ; @MAX_SECTOR_SIZE
	.no_dead_strip	_readJournalHdr
.subsections_via_symbols
