	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fptr_finalize
_fptr_finalize:                         ## @fptr_finalize
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rsi, %rsi
	je	LBB0_22
## %bb.1:
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	(%rsi), %edi
	xorl	%r13d, %r13d
	cmpl	$3, %edi
	jl	LBB0_5
## %bb.2:
	callq	_close
	xorl	%r13d, %r13d
	cmpl	$-1, %eax
	jne	LBB0_4
## %bb.3:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_4:
	movl	$-1, (%rbx)
LBB0_5:
	movl	4(%rbx), %edi
	cmpl	$3, %edi
	jl	LBB0_9
## %bb.6:
	callq	_close
	notl	%eax
	orl	%r13d, %eax
	jne	LBB0_8
## %bb.7:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_8:
	movl	$-1, 4(%rbx)
LBB0_9:
	movl	8(%rbx), %edi
	testl	%edi, %edi
	je	LBB0_19
## %bb.10:
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	leaq	-44(%rbp), %rsi
	xorl	%edx, %edx
	callq	_waitpid
	cmpl	$-1, %eax
	jne	LBB0_15
## %bb.11:
	movq	_errno@GOTPCREL(%rip), %r14
	movq	_EINTR@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	cmpl	%ecx, (%r14)
	jne	LBB0_15
## %bb.12:
	leaq	-44(%rbp), %r12
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	8(%rbx), %edi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_waitpid
	cmpl	$-1, %eax
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	(%r15), %ecx
	cmpl	%ecx, (%r14)
	je	LBB0_13
LBB0_15:
	movl	-48(%rbp), %r15d                ## 4-byte Reload
	testl	%r15d, %r15d
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jne	LBB0_18
## %bb.16:
	cmpl	8(%rbx), %eax
	jne	LBB0_18
## %bb.17:
	movl	-44(%rbp), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_io_set_process_status
LBB0_18:
	movl	$0, 8(%rbx)
LBB0_19:
	testl	%r15d, %r15d
	jne	LBB0_22
## %bb.20:
	testl	%r13d, %r13d
	je	LBB0_22
## %bb.21:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	%r13d, (%rax)
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_mrb_sys_fail
LBB0_22:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_errno,4,2                      ## @errno
	.comm	_EINTR,4,2                      ## @EINTR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fptr_finalize failed."

	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_INFINITE,4,2                   ## @INFINITE
	.comm	_PROCESS_QUERY_INFORMATION,4,2  ## @PROCESS_QUERY_INFORMATION
	.no_dead_strip	_fptr_finalize
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fptr_finalize
_fptr_finalize:                         ; @fptr_finalize
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	cbz	x1, LBB0_18
; %bb.1:
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	w0, [x1]
Lloh0:
	adrp	x22, _errno@GOTPAGE
Lloh1:
	ldr	x22, [x22, _errno@GOTPAGEOFF]
	cmp	w0, #3
	b.lt	LBB0_3
; %bb.2:
	bl	_close
	ldr	w8, [x22]
	cmn	w0, #1
	csel	w23, w8, wzr, eq
	mov	w8, #-1
	str	w8, [x21]
	b	LBB0_4
LBB0_3:
	mov	w23, #0
LBB0_4:
	ldr	w0, [x21, #4]
	cmp	w0, #3
	b.lt	LBB0_6
; %bb.5:
	bl	_close
	cmp	w23, #0
	mov	w8, #-1
	ccmp	w0, w8, #0, eq
	ldr	w9, [x22]
	csel	w23, w9, w23, eq
	str	w8, [x21, #4]
LBB0_6:
	ldr	w0, [x21, #8]
	cbz	w0, LBB0_15
; %bb.7:
	add	x1, sp, #12
	mov	w2, #0
	bl	_waitpid
	mov	x1, x0
	cmn	w0, #1
	b.ne	LBB0_11
; %bb.8:
	ldr	w8, [x22]
Lloh2:
	adrp	x24, _EINTR@GOTPAGE
Lloh3:
	ldr	x24, [x24, _EINTR@GOTPAGEOFF]
	ldr	w9, [x24]
	cmp	w8, w9
	b.ne	LBB0_11
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21, #8]
	add	x1, sp, #12
	mov	w2, #0
	bl	_waitpid
	ldr	w8, [x22]
	ldr	w9, [x24]
	cmn	w0, #1
	ccmp	w8, w9, #0, eq
	b.eq	LBB0_9
; %bb.10:
	mov	x1, x0
LBB0_11:
	cbnz	w20, LBB0_14
; %bb.12:
	ldr	w8, [x21, #8]
	cmp	w1, w8
	b.ne	LBB0_14
; %bb.13:
	ldr	w2, [sp, #12]
	mov	x0, x19
	bl	_io_set_process_status
LBB0_14:
	str	wzr, [x21, #8]
LBB0_15:
	cbnz	w20, LBB0_18
; %bb.16:
	cbz	w23, LBB0_18
; %bb.17:
	str	w23, [x22]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_mrb_sys_fail
LBB0_18:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_errno,4,2                      ; @errno
	.comm	_EINTR,4,2                      ; @EINTR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fptr_finalize failed."

	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_INFINITE,4,2                   ; @INFINITE
	.comm	_PROCESS_QUERY_INFORMATION,4,2  ; @PROCESS_QUERY_INFORMATION
	.no_dead_strip	_fptr_finalize
.subsections_via_symbols
