	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function image_swap_alloc
_image_swap_alloc:                      ## @image_swap_alloc
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_secsz@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_image_swap_pgsz@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rbx
	cmpq	%rbx, %rax
	cmovaq	%rax, %rbx
	leaq	-1(%rbx), %rax
	xorl	%edi, %edi
	testq	%rax, %rbx
	sete	%dil
	callq	_assert
	leaq	(%r14,%rbx), %rax
	decq	%rax
	negq	%rbx
	andq	%rax, %rbx
	movq	_image_swap_size@GOTPCREL(%rip), %r15
	movq	(%r15), %r14
	addq	%r14, %rbx
	movq	%rbx, (%r15)
	movq	_image_swap_fd@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_ftruncate
	cmpl	$-1, %eax
	jne	LBB0_2
## %bb.1:
	movq	%r14, (%r15)
	movq	$-1, %r14
LBB0_2:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_secsz,8,3                      ## @secsz
	.comm	_image_swap_pgsz,8,3            ## @image_swap_pgsz
	.comm	_image_swap_size,8,3            ## @image_swap_size
	.comm	_image_swap_fd,4,2              ## @image_swap_fd
	.no_dead_strip	_image_swap_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function image_swap_alloc
_image_swap_alloc:                      ; @image_swap_alloc
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x8, _secsz@GOTPAGE
Lloh1:
	ldr	x8, [x8, _secsz@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _image_swap_pgsz@GOTPAGE
Lloh4:
	ldr	x9, [x9, _image_swap_pgsz@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	csel	x20, x8, x9, hi
	sub	x8, x20, #1
	tst	x20, x8
	cset	w0, eq
	bl	_assert
	add	x8, x19, x20
	sub	x8, x8, #1
	neg	x9, x20
	and	x8, x8, x9
Lloh6:
	adrp	x20, _image_swap_size@GOTPAGE
Lloh7:
	ldr	x20, [x20, _image_swap_size@GOTPAGEOFF]
	ldr	x19, [x20]
	add	x1, x8, x19
	str	x1, [x20]
Lloh8:
	adrp	x8, _image_swap_fd@GOTPAGE
Lloh9:
	ldr	x8, [x8, _image_swap_fd@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_ftruncate
	cmn	w0, #1
	b.ne	LBB0_2
; %bb.1:
	str	x19, [x20]
	mov	x19, #-1
LBB0_2:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_secsz,8,3                      ; @secsz
	.comm	_image_swap_pgsz,8,3            ; @image_swap_pgsz
	.comm	_image_swap_size,8,3            ; @image_swap_size
	.comm	_image_swap_fd,4,2              ; @image_swap_fd
	.no_dead_strip	_image_swap_alloc
.subsections_via_symbols
