	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vdbeSorterOpenTempFile
_vdbeSorterOpenTempFile:                ## @vdbeSorterOpenTempFile
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %r14
	movq	%rdi, %r15
	movl	$202, %edi
	callq	_sqlite3FaultSim
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_SQLITE_IOERR_ACCESS@GOTPCREL(%rip), %rbx
	jmp	LBB0_5
LBB0_2:
	movq	_SQLITE_OPEN_TEMP_JOURNAL@GOTPCREL(%rip), %rax
	movq	_SQLITE_OPEN_READWRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_SQLITE_OPEN_CREATE@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_SQLITE_OPEN_EXCLUSIVE@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	(%r15), %edi
	movq	_SQLITE_OPEN_DELETEONCLOSE@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	leaq	-36(%rbp), %rbx
	xorl	%esi, %esi
	movq	%r12, %rdx
	movq	%rbx, %r8
	callq	_sqlite3OsOpenMalloc
	movl	%eax, -36(%rbp)
	movq	_SQLITE_OK@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_5
## %bb.3:
	movq	_SQLITE_MAX_MMAP_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%r12), %rdi
	movq	_SQLITE_FCNTL_MMAP_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	callq	_sqlite3OsFileControlHint
	testq	%r14, %r14
	jle	LBB0_5
## %bb.4:
	movq	(%r12), %rsi
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_vdbeSorterExtendFile
LBB0_5:
	movl	(%rbx), %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SQLITE_IOERR_ACCESS,4,2        ## @SQLITE_IOERR_ACCESS
	.comm	_SQLITE_OPEN_TEMP_JOURNAL,4,2   ## @SQLITE_OPEN_TEMP_JOURNAL
	.comm	_SQLITE_OPEN_READWRITE,4,2      ## @SQLITE_OPEN_READWRITE
	.comm	_SQLITE_OPEN_CREATE,4,2         ## @SQLITE_OPEN_CREATE
	.comm	_SQLITE_OPEN_EXCLUSIVE,4,2      ## @SQLITE_OPEN_EXCLUSIVE
	.comm	_SQLITE_OPEN_DELETEONCLOSE,4,2  ## @SQLITE_OPEN_DELETEONCLOSE
	.comm	_SQLITE_OK,4,2                  ## @SQLITE_OK
	.comm	_SQLITE_MAX_MMAP_SIZE,8,3       ## @SQLITE_MAX_MMAP_SIZE
	.comm	_SQLITE_FCNTL_MMAP_SIZE,4,2     ## @SQLITE_FCNTL_MMAP_SIZE
	.no_dead_strip	_vdbeSorterOpenTempFile
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vdbeSorterOpenTempFile
_vdbeSorterOpenTempFile:                ; @vdbeSorterOpenTempFile
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	mov	w0, #202
	bl	_sqlite3FaultSim
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x22, _SQLITE_IOERR_ACCESS@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SQLITE_IOERR_ACCESS@GOTPAGEOFF]
	b	LBB0_6
LBB0_2:
Lloh2:
	adrp	x8, _SQLITE_OPEN_TEMP_JOURNAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SQLITE_OPEN_TEMP_JOURNAL@GOTPAGEOFF]
	ldr	w0, [x20]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _SQLITE_OPEN_READWRITE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SQLITE_OPEN_READWRITE@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh8:
	adrp	x9, _SQLITE_OPEN_CREATE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SQLITE_OPEN_CREATE@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh11:
	adrp	x9, _SQLITE_OPEN_EXCLUSIVE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _SQLITE_OPEN_EXCLUSIVE@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh14:
	adrp	x9, _SQLITE_OPEN_DELETEONCLOSE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _SQLITE_OPEN_DELETEONCLOSE@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w3, w8, w9
	add	x22, sp, #12
	add	x4, sp, #12
	mov	w1, #0
	mov	x2, x21
	bl	_sqlite3OsOpenMalloc
	str	w0, [sp, #12]
Lloh17:
	adrp	x8, _SQLITE_OK@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SQLITE_OK@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_6
; %bb.3:
Lloh20:
	adrp	x8, _SQLITE_MAX_MMAP_SIZE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SQLITE_MAX_MMAP_SIZE@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	str	x8, [sp]
	ldr	x0, [x21]
Lloh23:
	adrp	x8, _SQLITE_FCNTL_MMAP_SIZE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SQLITE_FCNTL_MMAP_SIZE@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	mov	x2, sp
	bl	_sqlite3OsFileControlHint
	cmp	x19, #1
	b.lt	LBB0_5
; %bb.4:
	ldr	x1, [x21]
	mov	x0, x20
	mov	x2, x19
	bl	_vdbeSorterExtendFile
LBB0_5:
	add	x22, sp, #12
LBB0_6:
	ldr	w0, [x22]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_SQLITE_IOERR_ACCESS,4,2        ; @SQLITE_IOERR_ACCESS
	.comm	_SQLITE_OPEN_TEMP_JOURNAL,4,2   ; @SQLITE_OPEN_TEMP_JOURNAL
	.comm	_SQLITE_OPEN_READWRITE,4,2      ; @SQLITE_OPEN_READWRITE
	.comm	_SQLITE_OPEN_CREATE,4,2         ; @SQLITE_OPEN_CREATE
	.comm	_SQLITE_OPEN_EXCLUSIVE,4,2      ; @SQLITE_OPEN_EXCLUSIVE
	.comm	_SQLITE_OPEN_DELETEONCLOSE,4,2  ; @SQLITE_OPEN_DELETEONCLOSE
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.comm	_SQLITE_MAX_MMAP_SIZE,8,3       ; @SQLITE_MAX_MMAP_SIZE
	.comm	_SQLITE_FCNTL_MMAP_SIZE,4,2     ; @SQLITE_FCNTL_MMAP_SIZE
	.no_dead_strip	_vdbeSorterOpenTempFile
.subsections_via_symbols
