	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_image_copyout_region           ## -- Begin function image_copyout_region
	.p2align	4, 0x90
_image_copyout_region:                  ## @image_copyout_region
	.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
	movq	%rdx, %r12
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	movq	_secsz@GOTPCREL(%rip), %r15
	imulq	(%r15), %r12
	testq	%r12, %r12
	jle	LBB0_1
## %bb.2:
	movq	%rsi, %r14
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_image_chunk_find
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rcx
	subq	(%rax), %rcx
	imulq	(%r15), %rcx
	movq	8(%rax), %rbx
	subq	%rcx, %rbx
	cmpq	%r12, %rbx
	cmovgeq	%r12, %rbx
	movl	16(%rax), %edx
	cmpl	$130, %edx
	je	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$129, %edx
	je	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$128, %edx
	jne	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	%rbx, %rsi
	callq	_image_copyout_zeroes
	movl	%eax, %r13d
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	28(%rax), %edx
	addl	24(%rax), %ecx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	%rbx, %rsi
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_image_copyout_file
	movl	%eax, %r13d
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	20(%rax), %edx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	%rbx, %rsi
	callq	_image_copyout_memory
	movl	%eax, %r13d
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	xorl	%r13d, %r13d
	xorl	%edi, %edi
	callq	_assert
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r15), %rcx
	movq	%rbx, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %rax
	xorl	%edx, %edx
	divq	%rcx
	testl	%r13d, %r13d
	je	LBB0_16
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
	testl	%r13d, %r13d
	jne	LBB0_17
LBB0_16:                                ##   in Loop: Header=BB0_3 Depth=1
	subq	%rbx, %r12
	addq	%rax, %r14
	testq	%r12, %r12
	jg	LBB0_3
	jmp	LBB0_17
LBB0_1:
	xorl	%r13d, %r13d
	jmp	LBB0_17
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_17:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_secsz,8,3                      ## @secsz
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_image_copyout_region           ; -- Begin function image_copyout_region
	.p2align	2
_image_copyout_region:                  ; @image_copyout_region
	.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
Lloh0:
	adrp	x22, _secsz@GOTPAGE
Lloh1:
	ldr	x22, [x22, _secsz@GOTPAGEOFF]
	ldr	x8, [x22]
	mul	x23, x8, x2
	cmp	x23, #1
	b.lt	LBB0_11
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w2, [x0, #20]
	mov	x0, x20
	mov	x1, x21
	bl	_image_copyout_memory
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	sub	x23, x23, x21
	ldr	x8, [x22]
	udiv	x8, x21, x8
	add	x19, x8, x19
	cmp	w0, #0
	ccmp	x23, #0, #4, eq
	b.le	LBB0_13
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_image_chunk_find
	cbz	x0, LBB0_12
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldp	x8, x9, [x0]
	sub	x8, x19, x8
	ldr	x10, [x22]
	mul	x8, x8, x10
	sub	x9, x9, x8
	cmp	x9, x23
	csel	x21, x9, x23, lt
	ldr	w9, [x0, #16]
	cmp	w9, #130
	b.eq	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w9, #129
	b.eq	LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w9, #128
	b.ne	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_image_copyout_zeroes
	b	LBB0_3
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldp	w9, w2, [x0, #24]
	add	w3, w9, w8
	mov	x0, x20
	mov	x1, x21
	bl	_image_copyout_file
	b	LBB0_3
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #0
	bl	_assert
	mov	w0, #0
	b	LBB0_3
LBB0_11:
	mov	w0, #0
	b	LBB0_13
LBB0_12:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
LBB0_13:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_secsz,8,3                      ; @secsz
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
