	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function image_cleanup
_image_cleanup:                         ## @image_cleanup
	.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	_image_chunks@GOTPCREL(%rip), %rdi
	callq	_TAILQ_FIRST
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	%rax, %rbx
	movq	_ch_list@GOTPCREL(%rip), %r15
	movq	_image_chunks@GOTPCREL(%rip), %r14
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%rbx), %rdi
	callq	_free
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r15), %edx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_TAILQ_REMOVE
	movq	%rbx, %rdi
	callq	_free
	movq	%r14, %rdi
	callq	_TAILQ_FIRST
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_8
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %eax
	cmpl	$128, %eax
	je	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$129, %eax
	jne	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	16(%rbx), %edi
	cmpl	$-1, %edi
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	callq	_close
	jmp	LBB0_7
LBB0_8:
	movq	_image_swap_fd@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	cmpl	$-1, %edi
	je	LBB0_10
## %bb.9:
	callq	_close
LBB0_10:
	movq	_image_swap_file@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_unlink                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_image_chunks,4,2               ## @image_chunks
	.comm	_ch_list,4,2                    ## @ch_list
	.comm	_image_swap_fd,4,2              ## @image_swap_fd
	.comm	_image_swap_file,4,2            ## @image_swap_file
	.no_dead_strip	_image_cleanup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function image_cleanup
_image_cleanup:                         ; @image_cleanup
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x0, _image_chunks@GOTPAGE
Lloh1:
	ldr	x0, [x0, _image_chunks@GOTPAGEOFF]
	bl	_TAILQ_FIRST
	cbz	x0, LBB0_8
; %bb.1:
	mov	x20, x0
Lloh2:
	adrp	x21, _ch_list@GOTPAGE
Lloh3:
	ldr	x21, [x21, _ch_list@GOTPAGEOFF]
Lloh4:
	adrp	x19, _image_chunks@GOTPAGE
Lloh5:
	ldr	x19, [x19, _image_chunks@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [x20, #8]
	bl	_free
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w2, [x21]
	mov	x0, x19
	mov	x1, x20
	bl	_TAILQ_REMOVE
	mov	x0, x20
	bl	_free
	mov	x0, x19
	bl	_TAILQ_FIRST
	mov	x20, x0
	cbz	x0, LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x20]
	cmp	w8, #128
	b.eq	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w8, #129
	b.ne	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x20, #16]
	cmn	w0, #1
	b.eq	LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_close
	b	LBB0_3
LBB0_8:
Lloh6:
	adrp	x8, _image_swap_fd@GOTPAGE
Lloh7:
	ldr	x8, [x8, _image_swap_fd@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	cmn	w0, #1
	b.eq	LBB0_10
; %bb.9:
	bl	_close
LBB0_10:
Lloh9:
	adrp	x8, _image_swap_file@GOTPAGE
Lloh10:
	ldr	x8, [x8, _image_swap_file@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_unlink
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_image_chunks,4,2               ; @image_chunks
	.comm	_ch_list,4,2                    ; @ch_list
	.comm	_image_swap_fd,4,2              ; @image_swap_fd
	.comm	_image_swap_file,4,2            ; @image_swap_file
	.no_dead_strip	_image_cleanup
.subsections_via_symbols
