	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mrb_basicsocket_setnonblock
_mrb_basicsocket_setnonblock:           ## @mrb_basicsocket_setnonblock
	.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
	movl	%esi, %ebx
	movq	%rdi, %r14
	leaq	L_.str(%rip), %rsi
	leaq	-32(%rbp), %rdx
	callq	_mrb_get_args
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_socket_fd
	movl	%eax, %r15d
	movq	_F_GETFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	xorl	%edx, %edx
	callq	_fcntl
	movl	%eax, %ebx
	cmpl	$1, %eax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_mrb_sys_fail
LBB0_2:
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%edx, %eax
	orl	%ebx, %eax
	notl	%edx
	andl	%ebx, %edx
	cmpq	$0, -32(%rbp)
	cmovnel	%eax, %edx
	movq	_F_SETFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	callq	_fcntl
	cmpl	$-1, %eax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_mrb_sys_fail
LBB0_4:
	xorl	%eax, %eax
	callq	_mrb_nil_value
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"b"

	.comm	_F_GETFL,4,2                    ## @F_GETFL
L_.str.1:                               ## @.str.1
	.asciz	"fcntl"

	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.comm	_F_SETFL,4,2                    ## @F_SETFL
	.comm	_FIONBIO,4,2                    ## @FIONBIO
	.comm	_NO_ERROR,4,2                   ## @NO_ERROR
	.no_dead_strip	_mrb_basicsocket_setnonblock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mrb_basicsocket_setnonblock
_mrb_basicsocket_setnonblock:           ; @mrb_basicsocket_setnonblock
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	add	x2, sp, #8
	bl	_mrb_get_args
	mov	x0, x19
	mov	x1, x20
	bl	_socket_fd
	mov	x20, x0
Lloh2:
	adrp	x8, _F_GETFL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _F_GETFL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_fcntl
	mov	x21, x0
	cmp	w0, #1
	b.ne	LBB0_2
; %bb.1:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_mrb_sys_fail
LBB0_2:
	ldr	x8, [sp, #8]
Lloh7:
	adrp	x9, _O_NONBLOCK@GOTPAGE
Lloh8:
	ldr	x9, [x9, _O_NONBLOCK@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	orr	w10, w9, w21
	bic	w9, w21, w9
	cmp	x8, #0
	csel	w2, w9, w10, eq
Lloh10:
	adrp	x8, _F_SETFL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _F_SETFL@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_fcntl
	cmn	w0, #1
	b.ne	LBB0_4
; %bb.3:
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_mrb_sys_fail
LBB0_4:
	bl	_mrb_nil_value
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"b"

	.comm	_F_GETFL,4,2                    ; @F_GETFL
l_.str.1:                               ; @.str.1
	.asciz	"fcntl"

	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.comm	_F_SETFL,4,2                    ; @F_SETFL
	.comm	_FIONBIO,4,2                    ; @FIONBIO
	.comm	_NO_ERROR,4,2                   ; @NO_ERROR
	.no_dead_strip	_mrb_basicsocket_setnonblock
.subsections_via_symbols
