	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vdbePmaWriteBlob
_vdbePmaWriteBlob:                      ## @vdbePmaWriteBlob
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%edx, %edx
	jle	LBB0_6
## %bb.1:
	movl	%edx, %r15d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	%edx, %r13d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%edi, %edi
	cmpl	%eax, %edx
	setl	%dil
	callq	_assert
	subl	%r12d, %r13d
	jle	LBB0_6
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%rbx)
	jne	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	8(%rbx), %r12d
	movslq	12(%rbx), %rdi
	subl	%edi, %r12d
	cmpl	%r12d, %r13d
	cmovll	%r13d, %r12d
	shlq	$2, %rdi
	addq	32(%rbx), %rdi
	movl	%r15d, %eax
	subl	%r13d, %eax
	cltq
	leaq	(%r14,%rax,4), %rsi
	movl	%r12d, %edx
	callq	_memcpy
	movslq	12(%rbx), %rax
	movslq	%r12d, %rdx
	addq	%rax, %rdx
	movl	%edx, 12(%rbx)
	movl	8(%rbx), %eax
	cmpl	%eax, %edx
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	16(%rbx), %rcx
	leaq	(,%rcx,4), %rsi
	addq	32(%rbx), %rsi
	movl	40(%rbx), %edi
	subq	%rcx, %rdx
	addq	24(%rbx), %rcx
	callq	_sqlite3OsWrite
	movq	%rax, (%rbx)
	movl	$0, 12(%rbx)
	movq	$0, 16(%rbx)
	movslq	8(%rbx), %rax
	addq	%rax, 24(%rbx)
	xorl	%edx, %edx
	jmp	LBB0_5
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_vdbePmaWriteBlob
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vdbePmaWriteBlob
_vdbePmaWriteBlob:                      ; @vdbePmaWriteBlob
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	cmp	w2, #1
	b.lt	LBB0_6
; %bb.1:
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	mov	x23, x2
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	cmp	w8, w9
	cset	w0, lt
	bl	_assert
	sub	w23, w23, w22
	cmp	w23, #0
	b.le	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	cbnz	x8, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldp	w8, w9, [x21, #8]
                                        ; kill: def $w9 killed $w9 def $x9
	sxtw	x9, w9
	sub	w8, w8, w9
	cmp	w23, w8
	csel	w22, w23, w8, lt
	ldr	x8, [x21, #32]
	add	x0, x8, x9, lsl #2
	sub	w8, w19, w23
	add	x1, x20, w8, sxtw #2
	mov	x2, x22
	bl	_memcpy
	ldp	w9, w8, [x21, #8]
                                        ; kill: def $w8 killed $w8 def $x8
	sxtw	x8, w8
	add	x8, x8, w22, sxtw
	str	w8, [x21, #12]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x21, #40]
	ldp	x11, x9, [x21, #24]
	ldr	x10, [x21, #16]
	add	x1, x9, x10, lsl #2
	sub	x2, x8, x10
	add	x3, x11, x10
	bl	_sqlite3OsWrite
	mov	w8, #0
	str	x0, [x21]
	str	wzr, [x21, #12]
	ldrsw	x9, [x21, #8]
	ldr	x10, [x21, #24]
	add	x10, x10, x9
	stp	xzr, x10, [x21, #16]
	b	LBB0_2
LBB0_6:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_vdbePmaWriteBlob
.subsections_via_symbols
