	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mrb_cloexec_open               ## -- Begin function mrb_cloexec_open
	.p2align	4, 0x90
_mrb_cloexec_open:                      ## @mrb_cloexec_open
	.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
	movq	%rcx, %r13
	movq	%rdx, %rbx
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rdi
	movl	$-1, %esi
	callq	_mrb_locale_from_utf8
	movq	%rax, %r12
	movq	%rax, %rdi
	movl	%ebx, %esi
	movl	%r13d, %edx
	callq	_open
	movl	%eax, %r15d
	cmpl	$-1, %eax
	je	LBB0_1
LBB0_5:
	movq	%r12, %rdi
	callq	_mrb_locale_free
	cmpl	$2, %r15d
	jle	LBB0_6
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	$-2, %eax
	cmpl	$128, %eax
	jne	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mrb_garbage_collect
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%r13d, %edx
	callq	_open
	cmpl	$-1, %eax
	jne	LBB0_4
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	testl	%r14d, %r14d
	je	LBB0_2
LBB0_8:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_mrb_str_new_cstr
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_mrb_format
	movl	%eax, %r14d
	movl	%eax, %edi
	callq	_mrb_str_ptr
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_mrb_str_modify
	movl	%r14d, %edi
	callq	_RSTRING_PTR
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_mrb_sys_fail
	movq	%r12, %rdi
	callq	_mrb_locale_free
	movl	$-1, %r15d
LBB0_6:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %esi
	callq	_mrb_fd_cloexec
LBB0_7:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	%eax, %r15d
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_errno,4,2                      ## @errno
	.comm	_TRUE,4,2                       ## @TRUE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"open %S"

	.comm	_O_CLOEXEC,8,3                  ## @O_CLOEXEC
	.comm	_O_NOINHERIT,8,3                ## @O_NOINHERIT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mrb_cloexec_open               ; -- Begin function mrb_cloexec_open
	.p2align	2
_mrb_cloexec_open:                      ; @mrb_cloexec_open
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x3
	mov	x23, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _FALSE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh2:
	ldr	w25, [x8]
	mov	x0, x1
	mov	w1, #-1
	bl	_mrb_locale_from_utf8
	mov	x20, x0
	mov	x1, x23
	mov	x2, x22
	bl	_open
	mov	x24, x0
	cmn	w0, #1
	b.eq	LBB0_2
LBB0_1:
	mov	x0, x20
	bl	_mrb_locale_free
	cmp	w24, #2
	b.le	LBB0_8
	b	LBB0_9
LBB0_2:
Lloh3:
	adrp	x26, _errno@GOTPAGE
Lloh4:
	ldr	x26, [x26, _errno@GOTPAGEOFF]
Lloh5:
	adrp	x27, _TRUE@GOTPAGE
Lloh6:
	ldr	x27, [x27, _TRUE@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	cbnz	w25, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x26]
	and	w8, w8, #0xfffffffe
	cmp	w8, #128
	b.ne	LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	bl	_mrb_garbage_collect
	ldr	w25, [x27]
	mov	x0, x20
	mov	x1, x23
	mov	x2, x22
	bl	_open
	cmn	w0, #1
	b.eq	LBB0_3
; %bb.6:
	mov	x24, x0
	b	LBB0_1
LBB0_7:
	mov	x0, x19
	mov	x1, x21
	bl	_mrb_str_new_cstr
	mov	x2, x0
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_mrb_format
	mov	x21, x0
	bl	_mrb_str_ptr
	mov	x1, x0
	mov	x0, x19
	bl	_mrb_str_modify
	mov	x0, x21
	bl	_RSTRING_PTR
	mov	x1, x0
	mov	x0, x19
	bl	_mrb_sys_fail
	mov	x0, x20
	bl	_mrb_locale_free
	mov	w24, #-1
LBB0_8:
	mov	x0, x19
	mov	x1, x24
	bl	_mrb_fd_cloexec
LBB0_9:
	mov	x0, x24
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_errno,4,2                      ; @errno
	.comm	_TRUE,4,2                       ; @TRUE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"open %S"

	.comm	_O_CLOEXEC,8,3                  ; @O_CLOEXEC
	.comm	_O_NOINHERIT,8,3                ; @O_NOINHERIT
.subsections_via_symbols
