	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mrb_io_s_select
_mrb_io_s_select:                       ## @mrb_io_s_select
	.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	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	leaq	L_.str(%rip), %rsi
	leaq	-136(%rbp), %rdx
	leaq	-124(%rbp), %rcx
	callq	_mrb_get_args
	movl	-124(%rbp), %edi
	leal	-5(%rdi), %eax
	cmpl	$-5, %eax
	ja	LBB0_2
## %bb.1:
	movq	_E_ARGUMENT_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_mrb_fixnum_value
	leaq	L_.str.1(%rip), %rdx
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%eax, %ecx
	callq	_mrb_raisef
LBB0_2:
	xorl	%eax, %eax
	callq	_mrb_nil_value
	movl	%eax, %r14d
	xorl	%eax, %eax
	callq	_mrb_nil_value
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_mrb_nil_value
	movl	-124(%rbp), %ecx
	cmpl	$4, %ecx
	jl	LBB0_4
## %bb.3:
	movq	-136(%rbp), %rax
	movl	12(%rax), %r14d
	jmp	LBB0_6
LBB0_4:
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	cmpl	$3, %ecx
	jne	LBB0_7
## %bb.5:
	movq	-136(%rbp), %rax
LBB0_6:
	movl	8(%rax), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
LBB0_8:
	movl	4(%rax), %ecx
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
LBB0_9:
	movl	(%rax), %ebx
	movl	%r14d, %edi
	callq	_mrb_nil_p
	xorl	%r13d, %r13d
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	xorl	%eax, %eax
	jmp	LBB0_12
LBB0_11:
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_time2timeval
	movq	%rax, -160(%rbp)
	movq	%rdx, -152(%rbp)
	leaq	-160(%rbp), %rax
LBB0_12:
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	-120(%rbp), %rdi
	callq	_FD_ZERO
	movl	%ebx, %edi
	callq	_mrb_nil_p
	testq	%rax, %rax
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	movl	%ebx, -108(%rbp)                ## 4-byte Spill
	movb	$1, %al
	je	LBB0_14
## %bb.13:
	movl	%eax, -92(%rbp)                 ## 4-byte Spill
	xorl	%eax, %eax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	jmp	LBB0_23
LBB0_14:
	movl	%eax, -92(%rbp)                 ## 4-byte Spill
	movq	_MRB_TT_ARRAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_mrb_check_type
	leaq	-116(%rbp), %r14
	movq	%r14, %rdi
	callq	_FD_ZERO
	movl	%ebx, %edi
	callq	_RARRAY_LEN
	testl	%eax, %eax
	jle	LBB0_15
## %bb.16:
	xorl	%r12d, %r12d
	leaq	-116(%rbp), %rax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	xorl	%r13d, %r13d
	movl	$0, -72(%rbp)                   ## 4-byte Folded Spill
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_17 Depth=1
	movl	(%rbx), %eax
	cmpl	%eax, %r13d
	cmovlel	%eax, %r13d
	incq	%r12
	movl	-108(%rbp), %ebx                ## 4-byte Reload
	movl	%ebx, %edi
	callq	_RARRAY_LEN
	cltq
	cmpq	%rax, %r12
	jge	LBB0_20
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_RARRAY_PTR
	movl	(%rax,%r12,4), %r14d
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_io_get_open_fptr
	movq	%rax, %rbx
	movl	(%rax), %edi
	leaq	-116(%rbp), %rsi
	callq	_FD_SET
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_mrb_io_read_data_pending
	testq	%rax, %rax
	je	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	incl	-72(%rbp)                       ## 4-byte Folded Spill
	movl	(%rbx), %edi
	leaq	-120(%rbp), %rsi
	callq	_FD_SET
	jmp	LBB0_19
LBB0_7:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	-136(%rbp), %rax
	cmpl	$2, %ecx
	jge	LBB0_8
	jmp	LBB0_9
LBB0_20:
	cmpl	$0, -72(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_22
## %bb.21:
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -160(%rbp)
	leaq	-160(%rbp), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	$0, -92(%rbp)                   ## 4-byte Folded Spill
LBB0_22:
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_23
LBB0_15:
	movq	%r14, -104(%rbp)                ## 8-byte Spill
LBB0_23:
	movl	-60(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	callq	_mrb_nil_p
	testq	%rax, %rax
	je	LBB0_25
## %bb.24:
	xorl	%eax, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_32
LBB0_25:
	movq	_MRB_TT_ARRAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_mrb_check_type
	leaq	-112(%rbp), %r14
	movq	%r14, %rdi
	callq	_FD_ZERO
	movl	%ebx, %edi
	callq	_RARRAY_LEN
	testl	%eax, %eax
	jle	LBB0_26
## %bb.27:
	xorl	%r14d, %r14d
	leaq	-112(%rbp), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	-60(%rbp), %ebx                 ## 4-byte Reload
	jmp	LBB0_28
	.p2align	4, 0x90
LBB0_30:                                ##   in Loop: Header=BB0_28 Depth=1
	incq	%r14
	movl	-60(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	callq	_RARRAY_LEN
	cltq
	cmpq	%rax, %r14
	jge	LBB0_31
LBB0_28:                                ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %r15d
	movl	%ebx, %edi
	callq	_RARRAY_PTR
	movl	(%rax,%r14,4), %esi
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_io_get_open_fptr
	movq	%rax, %rbx
	movl	(%rax), %edi
	leaq	-112(%rbp), %r12
	movq	%r12, %rsi
	callq	_FD_SET
	movl	(%rbx), %r13d
	movl	4(%rbx), %edi
	cmpl	%r13d, %r15d
	cmovgl	%r15d, %r13d
	testl	%edi, %edi
	js	LBB0_30
## %bb.29:                              ##   in Loop: Header=BB0_28 Depth=1
	movq	%r12, %rsi
	callq	_FD_SET
	movl	4(%rbx), %eax
	cmpl	%eax, %r13d
	cmovlel	%eax, %r13d
	jmp	LBB0_30
LBB0_31:
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_32
LBB0_26:
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
LBB0_32:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	callq	_mrb_nil_p
	testq	%rax, %rax
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	je	LBB0_34
## %bb.33:
	xorl	%eax, %eax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	jmp	LBB0_41
LBB0_34:
	movq	_MRB_TT_ARRAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_mrb_check_type
	movl	%ebx, %r15d
	leaq	-140(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_FD_ZERO
	movl	%r15d, %edi
	callq	_RARRAY_LEN
	testl	%eax, %eax
	jle	LBB0_35
## %bb.36:
	xorl	%r14d, %r14d
	leaq	-140(%rbp), %r12
	movl	%r15d, %ebx
	jmp	LBB0_37
	.p2align	4, 0x90
LBB0_39:                                ##   in Loop: Header=BB0_37 Depth=1
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	incq	%r14
	movl	%ebx, %edi
	callq	_RARRAY_LEN
	cltq
	cmpq	%rax, %r14
	jge	LBB0_40
LBB0_37:                                ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %r15d
	movl	%ebx, %edi
	callq	_RARRAY_PTR
	movl	(%rax,%r14,4), %esi
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_io_get_open_fptr
	movq	%rax, %rbx
	movl	(%rax), %edi
	movq	%r12, %rsi
	callq	_FD_SET
	movl	(%rbx), %r13d
	movl	4(%rbx), %edi
	cmpl	%r13d, %r15d
	cmovgl	%r15d, %r13d
	testl	%edi, %edi
	js	LBB0_39
## %bb.38:                              ##   in Loop: Header=BB0_37 Depth=1
	movq	%r12, %rsi
	callq	_FD_SET
	movl	4(%rbx), %eax
	cmpl	%eax, %r13d
	cmovlel	%eax, %r13d
	jmp	LBB0_39
LBB0_40:
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	jmp	LBB0_41
LBB0_35:
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
LBB0_41:
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	incl	%r13d
	movq	_errno@GOTPCREL(%rip), %r12
	movq	_EINTR@GOTPCREL(%rip), %rbx
	leaq	L_.str.2(%rip), %r15
	jmp	LBB0_42
	.p2align	4, 0x90
LBB0_45:                                ##   in Loop: Header=BB0_42 Depth=1
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	testq	%r8, %r8
	jne	LBB0_46
LBB0_42:                                ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %edi
	movq	-104(%rbp), %rsi                ## 8-byte Reload
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	callq	_select
	movl	%eax, %r14d
	testl	%eax, %eax
	jns	LBB0_48
## %bb.43:                              ##   in Loop: Header=BB0_42 Depth=1
	movq	(%r12), %rax
	cmpq	(%rbx), %rax
	je	LBB0_45
## %bb.44:                              ##   in Loop: Header=BB0_42 Depth=1
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	callq	_mrb_sys_fail
	jmp	LBB0_45
LBB0_48:
	sete	%al
	movl	-92(%rbp), %ecx                 ## 4-byte Reload
	andb	%al, %cl
	cmpb	$1, %cl
	jne	LBB0_46
## %bb.49:
	xorl	%eax, %eax
	callq	_mrb_nil_value
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	jmp	LBB0_81
LBB0_46:
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movl	$3, %esi
	callq	_mrb_ary_new_capa
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	-104(%rbp), %r13                ## 8-byte Reload
	movq	%r15, %rdi
	testq	%r13, %r13
	je	LBB0_50
## %bb.47:
	callq	_mrb_ary_new
	jmp	LBB0_51
LBB0_50:
	xorl	%esi, %esi
	callq	_mrb_ary_new_capa
LBB0_51:
	movl	-60(%rbp), %r12d                ## 4-byte Reload
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%r15, %rdi
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	movl	%eax, %edx
	callq	_mrb_ary_push
	movq	%r15, %rdi
	testq	%rbx, %rbx
	je	LBB0_53
## %bb.52:
	callq	_mrb_ary_new
	jmp	LBB0_54
LBB0_53:
	xorl	%esi, %esi
	callq	_mrb_ary_new_capa
LBB0_54:
	movq	%r15, %rdi
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	movl	%eax, %edx
	callq	_mrb_ary_push
	cmpq	$0, -88(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_56
## %bb.55:
	movq	%r15, %rdi
	callq	_mrb_ary_new
	jmp	LBB0_57
LBB0_56:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_mrb_ary_new_capa
LBB0_57:
	movq	%r15, %rdi
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	movl	%eax, %edx
	callq	_mrb_ary_push
	testl	%r14d, %r14d
	js	LBB0_81
## %bb.58:
	testq	%r13, %r13
	movl	-108(%rbp), %r13d               ## 4-byte Reload
	je	LBB0_65
## %bb.59:
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	callq	_RARRAY_PTR
	movl	(%rax), %r14d
	movl	%r13d, %edi
	callq	_RARRAY_LEN
	testl	%eax, %eax
	jle	LBB0_65
## %bb.60:
	xorl	%ebx, %ebx
	jmp	LBB0_61
	.p2align	4, 0x90
LBB0_63:                                ##   in Loop: Header=BB0_61 Depth=1
	movl	%r13d, %edi
	callq	_RARRAY_PTR
	movl	(%rax,%rbx,4), %edx
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movl	%r14d, %esi
	callq	_mrb_ary_push
LBB0_64:                                ##   in Loop: Header=BB0_61 Depth=1
	incq	%rbx
	movl	%r13d, %edi
	callq	_RARRAY_LEN
	cltq
	cmpq	%rax, %rbx
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	jge	LBB0_65
LBB0_61:                                ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %edi
	callq	_RARRAY_PTR
	movl	(%rax,%rbx,4), %esi
	movq	%r15, %rdi
	callq	_io_get_open_fptr
	movq	%rax, %r15
	movl	(%rax), %edi
	movq	-104(%rbp), %rsi                ## 8-byte Reload
	callq	_FD_ISSET
	testq	%rax, %rax
	jne	LBB0_63
## %bb.62:                              ##   in Loop: Header=BB0_61 Depth=1
	movl	(%r15), %edi
	leaq	-120(%rbp), %rsi
	callq	_FD_ISSET
	testq	%rax, %rax
	jne	LBB0_63
	jmp	LBB0_64
LBB0_65:
	cmpq	$0, -72(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_73
## %bb.66:
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	callq	_RARRAY_PTR
	movl	4(%rax), %r14d
	movl	%r12d, %edi
	callq	_RARRAY_LEN
	testl	%eax, %eax
	jle	LBB0_73
## %bb.67:
	xorl	%ebx, %ebx
	jmp	LBB0_68
	.p2align	4, 0x90
LBB0_71:                                ##   in Loop: Header=BB0_68 Depth=1
	movl	%r12d, %edi
	callq	_RARRAY_PTR
	movl	(%rax,%rbx,4), %edx
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_mrb_ary_push
LBB0_72:                                ##   in Loop: Header=BB0_68 Depth=1
	incq	%rbx
	movl	%r12d, %edi
	callq	_RARRAY_LEN
	cltq
	cmpq	%rax, %rbx
	jge	LBB0_73
LBB0_68:                                ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %edi
	callq	_RARRAY_PTR
	movl	(%rax,%rbx,4), %esi
	movq	%r15, %rdi
	callq	_io_get_open_fptr
	movq	%rax, %r13
	movl	(%rax), %edi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_FD_ISSET
	testq	%rax, %rax
	jne	LBB0_71
## %bb.69:                              ##   in Loop: Header=BB0_68 Depth=1
	movl	4(%r13), %edi
	testl	%edi, %edi
	js	LBB0_72
## %bb.70:                              ##   in Loop: Header=BB0_68 Depth=1
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_FD_ISSET
	testq	%rax, %rax
	jne	LBB0_71
	jmp	LBB0_72
LBB0_73:
	cmpq	$0, -88(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_81
## %bb.74:
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	callq	_RARRAY_PTR
	movl	8(%rax), %r14d
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_RARRAY_LEN
	testl	%eax, %eax
	jle	LBB0_81
## %bb.75:
	xorl	%ebx, %ebx
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	jmp	LBB0_76
	.p2align	4, 0x90
LBB0_79:                                ##   in Loop: Header=BB0_76 Depth=1
	movl	%r12d, %edi
	callq	_RARRAY_PTR
	movl	(%rax,%rbx,4), %edx
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_mrb_ary_push
LBB0_80:                                ##   in Loop: Header=BB0_76 Depth=1
	incq	%rbx
	movl	%r12d, %edi
	callq	_RARRAY_LEN
	cltq
	cmpq	%rax, %rbx
	jge	LBB0_81
LBB0_76:                                ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %edi
	callq	_RARRAY_PTR
	movl	(%rax,%rbx,4), %esi
	movq	%r15, %rdi
	callq	_io_get_open_fptr
	movq	%rax, %r13
	movl	(%rax), %edi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	callq	_FD_ISSET
	testq	%rax, %rax
	jne	LBB0_79
## %bb.77:                              ##   in Loop: Header=BB0_76 Depth=1
	movl	4(%r13), %edi
	testl	%edi, %edi
	js	LBB0_80
## %bb.78:                              ##   in Loop: Header=BB0_76 Depth=1
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	callq	_FD_ISSET
	testq	%rax, %rax
	jne	LBB0_79
	jmp	LBB0_80
LBB0_81:
	movl	-56(%rbp), %eax                 ## 4-byte Reload
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"*"

	.comm	_E_ARGUMENT_ERROR,4,2           ## @E_ARGUMENT_ERROR
L_.str.1:                               ## @.str.1
	.asciz	"wrong number of arguments (%S for 1..4)"

	.comm	_MRB_TT_ARRAY,4,2               ## @MRB_TT_ARRAY
	.comm	_errno,8,3                      ## @errno
	.comm	_EINTR,8,3                      ## @EINTR
L_.str.2:                               ## @.str.2
	.asciz	"select failed"

	.no_dead_strip	_mrb_io_s_select
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mrb_io_s_select
_mrb_io_s_select:                       ; @mrb_io_s_select
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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	x19, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	add	x2, sp, #56
	add	x3, sp, #52
	bl	_mrb_get_args
	ldr	w0, [sp, #52]
	sub	w8, w0, #5
	cmn	w8, #5
	b.hi	LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _E_ARGUMENT_ERROR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _E_ARGUMENT_ERROR@GOTPAGEOFF]
Lloh4:
	ldr	w20, [x8]
	bl	_mrb_fixnum_value
	mov	x3, x0
Lloh5:
	adrp	x2, l_.str.1@PAGE
Lloh6:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x1, x20
	bl	_mrb_raisef
LBB0_2:
	bl	_mrb_nil_value
	mov	x23, x0
	bl	_mrb_nil_value
	mov	x21, x0
	bl	_mrb_nil_value
	ldr	w9, [sp, #52]
	cmp	w9, #4
	b.lt	LBB0_4
; %bb.3:
	ldr	x8, [sp, #56]
	ldp	w21, w23, [x8, #8]
	b	LBB0_7
LBB0_4:
	cmp	w9, #3
	b.ne	LBB0_6
; %bb.5:
	ldr	x8, [sp, #56]
	ldr	w21, [x8, #8]
	b	LBB0_7
LBB0_6:
	mov	x28, x0
	ldr	x8, [sp, #56]
	cmp	w9, #2
	b.lt	LBB0_8
LBB0_7:
	ldr	w28, [x8, #4]
LBB0_8:
	ldr	w20, [x8]
	mov	x0, x23
	bl	_mrb_nil_p
	cbz	x0, LBB0_10
; %bb.9:
	mov	x26, #0
	b	LBB0_11
LBB0_10:
	mov	x0, x19
	mov	x1, x23
	bl	_time2timeval
	stp	x0, x1, [sp, #32]
	add	x26, sp, #32
LBB0_11:
	add	x0, sp, #28
	bl	_FD_ZERO
	mov	x0, x20
	bl	_mrb_nil_p
	str	w20, [sp, #12]                  ; 4-byte Folded Spill
	cbz	x0, LBB0_16
; %bb.12:
	mov	x22, #0
LBB0_13:
	mov	w27, #0
	mov	w8, #1
	str	w8, [sp, #8]                    ; 4-byte Folded Spill
LBB0_14:
	mov	x0, x28
	bl	_mrb_nil_p
	cbz	x0, LBB0_21
; %bb.15:
	mov	x24, #0
	b	LBB0_29
LBB0_16:
Lloh7:
	adrp	x8, _MRB_TT_ARRAY@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MRB_TT_ARRAY@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_mrb_check_type
	add	x22, sp, #24
	add	x0, sp, #24
	bl	_FD_ZERO
	mov	x0, x20
	bl	_RARRAY_LEN
	cmp	w0, #1
	b.lt	LBB0_13
; %bb.17:
	mov	x24, #0
	mov	w27, #0
	mov	w25, #0
	ldr	w22, [sp, #12]                  ; 4-byte Folded Reload
	b	LBB0_19
LBB0_18:                                ;   in Loop: Header=BB0_19 Depth=1
	ldr	w8, [x23]
	cmp	w27, w8
	csel	w27, w27, w8, gt
	add	x24, x24, #1
	mov	x0, x22
	bl	_RARRAY_LEN
	cmp	x24, w0, sxtw
	b.ge	LBB0_26
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_RARRAY_PTR
	ldr	w20, [x0, x24, lsl #2]
	mov	x0, x19
	mov	x1, x20
	bl	_io_get_open_fptr
	mov	x23, x0
	ldr	w0, [x0]
	add	x1, sp, #24
	bl	_FD_SET
	mov	x0, x19
	mov	x1, x20
	bl	_mrb_io_read_data_pending
	cbz	x0, LBB0_18
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=1
	add	w25, w25, #1
	ldr	w0, [x23]
	add	x1, sp, #28
	bl	_FD_SET
	b	LBB0_18
LBB0_21:
Lloh10:
	adrp	x8, _MRB_TT_ARRAY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MRB_TT_ARRAY@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x28
	bl	_mrb_check_type
	add	x24, sp, #20
	add	x0, sp, #20
	bl	_FD_ZERO
	mov	x0, x28
	bl	_RARRAY_LEN
	cmp	w0, #1
	b.lt	LBB0_29
; %bb.22:
	mov	x24, #0
	b	LBB0_24
LBB0_23:                                ;   in Loop: Header=BB0_24 Depth=1
	add	x24, x24, #1
	mov	x0, x28
	bl	_RARRAY_LEN
	cmp	x24, w0, sxtw
	b.ge	LBB0_28
LBB0_24:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x28
	bl	_RARRAY_PTR
	ldr	w1, [x0, x24, lsl #2]
	mov	x0, x19
	bl	_io_get_open_fptr
	mov	x20, x0
	ldr	w0, [x0]
	add	x1, sp, #20
	bl	_FD_SET
	ldp	w8, w0, [x20]
	cmp	w27, w8
	csel	w27, w27, w8, gt
	tbnz	w0, #31, LBB0_23
; %bb.25:                               ;   in Loop: Header=BB0_24 Depth=1
	add	x1, sp, #20
	bl	_FD_SET
	ldr	w8, [x20, #4]
	cmp	w27, w8
	csel	w27, w27, w8, gt
	b	LBB0_23
LBB0_26:
	cbz	w25, LBB0_78
; %bb.27:
	str	wzr, [sp, #8]                   ; 4-byte Folded Spill
	stp	xzr, xzr, [sp, #32]
	add	x22, sp, #24
	add	x26, sp, #32
	b	LBB0_14
LBB0_28:
	add	x24, sp, #20
LBB0_29:
	mov	x0, x21
	bl	_mrb_nil_p
	stp	w28, w21, [sp]                  ; 8-byte Folded Spill
	cbz	x0, LBB0_31
; %bb.30:
	mov	x25, #0
	b	LBB0_37
LBB0_31:
Lloh13:
	adrp	x8, _MRB_TT_ARRAY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MRB_TT_ARRAY@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x21
	bl	_mrb_check_type
	add	x25, sp, #16
	add	x0, sp, #16
	bl	_FD_ZERO
	mov	x0, x21
	bl	_RARRAY_LEN
	cmp	w0, #1
	b.lt	LBB0_37
; %bb.32:
	mov	x25, #0
	b	LBB0_34
LBB0_33:                                ;   in Loop: Header=BB0_34 Depth=1
	add	x25, x25, #1
	mov	x0, x21
	bl	_RARRAY_LEN
	cmp	x25, w0, sxtw
	b.ge	LBB0_36
LBB0_34:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_RARRAY_PTR
	ldr	w1, [x0, x25, lsl #2]
	mov	x0, x19
	bl	_io_get_open_fptr
	mov	x20, x0
	ldr	w0, [x0]
	add	x1, sp, #16
	bl	_FD_SET
	ldp	w8, w0, [x20]
	cmp	w27, w8
	csel	w27, w27, w8, gt
	tbnz	w0, #31, LBB0_33
; %bb.35:                               ;   in Loop: Header=BB0_34 Depth=1
	add	x1, sp, #16
	bl	_FD_SET
	ldr	w8, [x20, #4]
	cmp	w27, w8
	csel	w27, w27, w8, gt
	b	LBB0_33
LBB0_36:
	add	x25, sp, #16
LBB0_37:
	add	w28, w27, #1
Lloh16:
	adrp	x21, _errno@GOTPAGE
Lloh17:
	ldr	x21, [x21, _errno@GOTPAGEOFF]
Lloh18:
	adrp	x23, _EINTR@GOTPAGE
Lloh19:
	ldr	x23, [x23, _EINTR@GOTPAGEOFF]
Lloh20:
	adrp	x20, l_.str.2@PAGE
Lloh21:
	add	x20, x20, l_.str.2@PAGEOFF
	b	LBB0_39
LBB0_38:                                ;   in Loop: Header=BB0_39 Depth=1
	cbnz	x26, LBB0_44
LBB0_39:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x28
	mov	x1, x22
	mov	x2, x24
	mov	x3, x25
	mov	x4, x26
	bl	_select
	mov	x27, x0
	tbz	w0, #31, LBB0_42
; %bb.40:                               ;   in Loop: Header=BB0_39 Depth=1
	ldr	x8, [x21]
	ldr	x9, [x23]
	cmp	x8, x9
	b.eq	LBB0_38
; %bb.41:                               ;   in Loop: Header=BB0_39 Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_mrb_sys_fail
	b	LBB0_38
LBB0_42:
	cmp	w27, #0
	cset	w8, eq
	ldr	w9, [sp, #8]                    ; 4-byte Folded Reload
	and	w8, w9, w8
	cmp	w8, #1
	b.ne	LBB0_44
; %bb.43:
	bl	_mrb_nil_value
	mov	x26, x0
	b	LBB0_77
LBB0_44:
	mov	x0, x19
	mov	w1, #3
	bl	_mrb_ary_new_capa
	mov	x26, x0
	mov	x21, x22
	mov	x0, x19
	cbz	x22, LBB0_46
; %bb.45:
	bl	_mrb_ary_new
	b	LBB0_47
LBB0_46:
	mov	w1, #0
	bl	_mrb_ary_new_capa
LBB0_47:
	mov	x2, x0
	ldr	w22, [sp, #12]                  ; 4-byte Folded Reload
	mov	x0, x19
	mov	x1, x26
	bl	_mrb_ary_push
	mov	x0, x19
	cbz	x24, LBB0_49
; %bb.48:
	bl	_mrb_ary_new
	b	LBB0_50
LBB0_49:
	mov	w1, #0
	bl	_mrb_ary_new_capa
LBB0_50:
	mov	x2, x0
	mov	x0, x19
	mov	x1, x26
	bl	_mrb_ary_push
	mov	x0, x19
	cbz	x25, LBB0_52
; %bb.51:
	bl	_mrb_ary_new
	b	LBB0_53
LBB0_52:
	mov	w1, #0
	bl	_mrb_ary_new_capa
LBB0_53:
	mov	x2, x0
	mov	x0, x19
	mov	x1, x26
	bl	_mrb_ary_push
	tbnz	w27, #31, LBB0_77
; %bb.54:
	cbz	x21, LBB0_61
; %bb.55:
	mov	x0, x26
	bl	_RARRAY_PTR
	ldr	w27, [x0]
	mov	x0, x22
	bl	_RARRAY_LEN
	cmp	w0, #1
	b.lt	LBB0_61
; %bb.56:
	mov	x28, #0
	b	LBB0_59
LBB0_57:                                ;   in Loop: Header=BB0_59 Depth=1
	mov	x0, x22
	bl	_RARRAY_PTR
	ldr	w2, [x0, x28, lsl #2]
	mov	x0, x19
	mov	x1, x27
	bl	_mrb_ary_push
LBB0_58:                                ;   in Loop: Header=BB0_59 Depth=1
	add	x28, x28, #1
	mov	x0, x22
	bl	_RARRAY_LEN
	cmp	x28, w0, sxtw
	b.ge	LBB0_61
LBB0_59:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_RARRAY_PTR
	ldr	w1, [x0, x28, lsl #2]
	mov	x0, x19
	bl	_io_get_open_fptr
	mov	x20, x0
	ldr	w0, [x0]
	mov	x1, x21
	bl	_FD_ISSET
	cbnz	x0, LBB0_57
; %bb.60:                               ;   in Loop: Header=BB0_59 Depth=1
	ldr	w0, [x20]
	add	x1, sp, #28
	bl	_FD_ISSET
	cbnz	x0, LBB0_57
	b	LBB0_58
LBB0_61:
	ldp	w21, w27, [sp]                  ; 8-byte Folded Reload
	cbz	x24, LBB0_69
; %bb.62:
	mov	x0, x26
	bl	_RARRAY_PTR
	ldr	w22, [x0, #4]
	mov	x0, x21
	bl	_RARRAY_LEN
	cmp	w0, #1
	b.lt	LBB0_69
; %bb.63:
	mov	x23, #0
	b	LBB0_66
LBB0_64:                                ;   in Loop: Header=BB0_66 Depth=1
	mov	x0, x21
	bl	_RARRAY_PTR
	ldr	w2, [x0, x23, lsl #2]
	mov	x0, x19
	mov	x1, x22
	bl	_mrb_ary_push
LBB0_65:                                ;   in Loop: Header=BB0_66 Depth=1
	add	x23, x23, #1
	mov	x0, x21
	bl	_RARRAY_LEN
	cmp	x23, w0, sxtw
	b.ge	LBB0_69
LBB0_66:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_RARRAY_PTR
	ldr	w1, [x0, x23, lsl #2]
	mov	x0, x19
	bl	_io_get_open_fptr
	mov	x20, x0
	ldr	w0, [x0]
	mov	x1, x24
	bl	_FD_ISSET
	cbnz	x0, LBB0_64
; %bb.67:                               ;   in Loop: Header=BB0_66 Depth=1
	ldr	w0, [x20, #4]
	tbnz	w0, #31, LBB0_65
; %bb.68:                               ;   in Loop: Header=BB0_66 Depth=1
	mov	x1, x24
	bl	_FD_ISSET
	cbnz	x0, LBB0_64
	b	LBB0_65
LBB0_69:
	cbz	x25, LBB0_77
; %bb.70:
	mov	x0, x26
	bl	_RARRAY_PTR
	ldr	w21, [x0, #8]
	mov	x0, x27
	bl	_RARRAY_LEN
	cmp	w0, #1
	b.lt	LBB0_77
; %bb.71:
	mov	x22, #0
	b	LBB0_74
LBB0_72:                                ;   in Loop: Header=BB0_74 Depth=1
	mov	x0, x27
	bl	_RARRAY_PTR
	ldr	w2, [x0, x22, lsl #2]
	mov	x0, x19
	mov	x1, x21
	bl	_mrb_ary_push
LBB0_73:                                ;   in Loop: Header=BB0_74 Depth=1
	add	x22, x22, #1
	mov	x0, x27
	bl	_RARRAY_LEN
	cmp	x22, w0, sxtw
	b.ge	LBB0_77
LBB0_74:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x27
	bl	_RARRAY_PTR
	ldr	w1, [x0, x22, lsl #2]
	mov	x0, x19
	bl	_io_get_open_fptr
	mov	x20, x0
	ldr	w0, [x0]
	mov	x1, x25
	bl	_FD_ISSET
	cbnz	x0, LBB0_72
; %bb.75:                               ;   in Loop: Header=BB0_74 Depth=1
	ldr	w0, [x20, #4]
	tbnz	w0, #31, LBB0_73
; %bb.76:                               ;   in Loop: Header=BB0_74 Depth=1
	mov	x1, x25
	bl	_FD_ISSET
	cbnz	x0, LBB0_72
	b	LBB0_73
LBB0_77:
	mov	x0, x26
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_78:
	mov	w8, #1
	str	w8, [sp, #8]                    ; 4-byte Folded Spill
	add	x22, sp, #24
	b	LBB0_14
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"*"

	.comm	_E_ARGUMENT_ERROR,4,2           ; @E_ARGUMENT_ERROR
l_.str.1:                               ; @.str.1
	.asciz	"wrong number of arguments (%S for 1..4)"

	.comm	_MRB_TT_ARRAY,4,2               ; @MRB_TT_ARRAY
	.comm	_errno,8,3                      ; @errno
	.comm	_EINTR,8,3                      ; @EINTR
l_.str.2:                               ; @.str.2
	.asciz	"select failed"

	.no_dead_strip	_mrb_io_s_select
.subsections_via_symbols
