	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__citrus_db_open                ## -- Begin function _citrus_db_open
	.p2align	4, 0x90
__citrus_db_open:                       ## @_citrus_db_open
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movl	%ecx, %r15d
	movq	%rdx, %r14
	movq	%rsi, %r13
	movq	%rdi, %r12
	leaq	-48(%rbp), %rbx
	movq	%rbx, %rdi
	callq	__memstream_bind
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$12, %edx
	callq	__memstream_getregion
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	%rax, %rbx
	movl	8(%rax), %edi
	movq	__CITRUS_DB_MAGIC_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rsi
	callq	_strncmp
	testq	%rax, %rax
	jne	LBB0_4
## %bb.2:
	movl	4(%rbx), %edi
	callq	_be32toh
	movq	_SEEK_SET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leaq	-48(%rbp), %rdi
	movl	%eax, %esi
	callq	__memstream_seek
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movl	(%rbx), %edi
	callq	_be32toh
	movl	%eax, %ebx
	movq	__CITRUS_DB_ENTRY_SIZE@GOTPCREL(%rip), %rax
	imull	(%rax), %ebx
	leaq	-48(%rbp), %rdi
	callq	__memstream_remainder
	cmpl	%eax, %ebx
	jle	LBB0_7
LBB0_4:
	movq	_EFTYPE@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %eax
LBB0_6:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	$16, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movl	(%r13), %ecx
	movl	%ecx, 12(%rax)
	movl	%r15d, 8(%rax)
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, (%rax)
	movq	%rax, (%r12)
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_9:
	movq	_errno@GOTPCREL(%rip), %rax
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_EFTYPE,4,2                     ## @EFTYPE
	.comm	__CITRUS_DB_MAGIC_SIZE,4,2      ## @_CITRUS_DB_MAGIC_SIZE
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	__CITRUS_DB_ENTRY_SIZE,4,2      ## @_CITRUS_DB_ENTRY_SIZE
	.comm	_errno,4,2                      ## @errno
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__citrus_db_open                ; -- Begin function _citrus_db_open
	.p2align	2
__citrus_db_open:                       ; @_citrus_db_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x4
	mov	x20, x3
	mov	x24, x2
	mov	x22, x1
	mov	x21, x0
	add	x0, sp, #8
	bl	__memstream_bind
	add	x0, sp, #8
	mov	x1, #0
	mov	w2, #12
	bl	__memstream_getregion
	cbz	x0, LBB0_4
; %bb.1:
	mov	x23, x0
	ldr	w0, [x0, #8]
Lloh0:
	adrp	x8, __CITRUS_DB_MAGIC_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, __CITRUS_DB_MAGIC_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x1, x24
	bl	_strncmp
	cbnz	x0, LBB0_4
; %bb.2:
	ldr	w0, [x23, #4]
	bl	_be32toh
	mov	x1, x0
Lloh3:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	add	x0, sp, #8
	bl	__memstream_seek
	cbnz	x0, LBB0_4
; %bb.3:
	ldr	w0, [x23]
	bl	_be32toh
Lloh6:
	adrp	x8, __CITRUS_DB_ENTRY_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, __CITRUS_DB_ENTRY_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	mul	w23, w8, w0
	add	x0, sp, #8
	bl	__memstream_remainder
	cmp	w23, w0
	b.le	LBB0_7
LBB0_4:
Lloh9:
	adrp	x8, _EFTYPE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EFTYPE@GOTPAGEOFF]
LBB0_5:
	ldr	w0, [x8]
LBB0_6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_7:
	mov	w0, #16
	bl	_malloc
	cbz	x0, LBB0_9
; %bb.8:
	mov	x8, x0
	mov	w0, #0
	ldr	w9, [x22]
	stp	w20, w9, [x8, #8]
	str	x19, [x8]
	str	x8, [x21]
	b	LBB0_6
LBB0_9:
Lloh11:
	adrp	x8, _errno@GOTPAGE
Lloh12:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EFTYPE,4,2                     ; @EFTYPE
	.comm	__CITRUS_DB_MAGIC_SIZE,4,2      ; @_CITRUS_DB_MAGIC_SIZE
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	__CITRUS_DB_ENTRY_SIZE,4,2      ; @_CITRUS_DB_ENTRY_SIZE
	.comm	_errno,4,2                      ; @errno
.subsections_via_symbols
