	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sm_select                      ## -- Begin function sm_select
	.p2align	4, 0x90
_sm_select:                             ## @sm_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %r14
	cmpl	$0, (%r14)
	jle	LBB0_1
## %bb.2:
	leaq	20(%r14), %r15
	movl	%esi, 20(%r14)
	movl	16(%r14), %edi
	movl	32(%r14), %esi
	movq	_SIZEOF_FD_SET@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	callq	_memcpy
	movl	12(%r14), %edi
	movl	28(%r14), %esi
	movl	(%rbx), %edx
	callq	_memcpy
	movl	8(%r14), %edi
	movl	24(%r14), %esi
	movl	(%rbx), %edx
	callq	_memcpy
	movl	(%r14), %edi
	movl	8(%r14), %ecx
	incl	%edi
	movl	12(%r14), %esi
	movl	16(%r14), %edx
	movq	%r15, %r8
	callq	_select
	movl	%eax, %r15d
	xorl	%eax, %eax
	testl	%r15d, %r15d
	je	LBB0_24
## %bb.3:
	js	LBB0_6
## %bb.4:
	cmpl	$0, (%r14)
	js	LBB0_5
## %bb.9:
	xorl	%ebx, %ebx
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	16(%r14), %esi
	movl	%ebx, %edi
	callq	_FD_ISSET
	movl	%eax, %r13d
	movl	12(%r14), %esi
	movl	%ebx, %edi
	callq	_FD_ISSET
	movl	%eax, %r12d
	movl	8(%r14), %esi
	movl	%ebx, %edi
	callq	_FD_ISSET
	testl	%r13d, %r13d
	jne	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	testl	%r12d, %r12d
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	testl	%eax, %eax
	je	LBB0_21
LBB0_13:                                ##   in Loop: Header=BB0_10 Depth=1
	decl	%r15d
	testl	%eax, %eax
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	callq	*(%rdi)
	jmp	LBB0_21
LBB0_15:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	4(%r14), %esi
	movl	%ebx, %edi
	callq	_FD_ISSET
	testl	%eax, %eax
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	callq	_sm_accept
	jmp	LBB0_21
LBB0_17:                                ##   in Loop: Header=BB0_10 Depth=1
	testl	%r13d, %r13d
	je	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	callq	_sm_resend
LBB0_19:                                ##   in Loop: Header=BB0_10 Depth=1
	testl	%r12d, %r12d
	je	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	callq	_sm_recv
	.p2align	4, 0x90
LBB0_21:                                ##   in Loop: Header=BB0_10 Depth=1
	cmpl	(%r14), %ebx
	jge	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_10 Depth=1
	incl	%ebx
	testl	%r15d, %r15d
	jg	LBB0_10
LBB0_23:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	jmp	LBB0_24
LBB0_1:
	movl	$-1, %eax
LBB0_24:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_errno@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	movq	_EINTR@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	je	LBB0_24
## %bb.7:
	movq	_EAGAIN@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	je	LBB0_24
## %bb.8:
	leaq	L_.str(%rip), %rdi
	callq	_perror
	xorl	%eax, %eax
	subl	(%rbx), %eax
	jmp	LBB0_24
LBB0_5:
	movl	%r15d, %eax
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_SIZEOF_FD_SET,4,2              ## @SIZEOF_FD_SET
	.comm	_errno,4,2                      ## @errno
	.comm	_EINTR,4,2                      ## @EINTR
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"select failed"

	.comm	_WSAEINTR,4,2                   ## @WSAEINTR
	.comm	_WSAEWOULDBLOCK,4,2             ## @WSAEWOULDBLOCK
	.comm	_stderr,4,2                     ## @stderr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sm_select                      ; -- Begin function sm_select
	.p2align	2
_sm_select:                             ; @sm_select
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldr	x24, [x0, #8]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.1:
	mov	x19, x0
	mov	x20, x24
	str	w1, [x20, #20]!
	ldr	w0, [x24, #16]
	ldr	w1, [x24, #32]
Lloh0:
	adrp	x21, _SIZEOF_FD_SET@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SIZEOF_FD_SET@GOTPAGEOFF]
	ldr	w2, [x21]
	bl	_memcpy
	ldr	w0, [x24, #12]
	ldr	w1, [x24, #28]
	ldr	w2, [x21]
	bl	_memcpy
	ldr	w0, [x24, #8]
	ldr	w1, [x24, #24]
	ldr	w2, [x21]
	bl	_memcpy
	ldr	w8, [x24]
	add	w0, w8, #1
	ldp	w1, w2, [x24, #12]
	ldr	w3, [x24, #8]
	mov	x4, x20
	bl	_select
	mov	x20, x0
	cbz	w0, LBB0_16
; %bb.2:
	tbnz	w20, #31, LBB0_17
; %bb.3:
	ldr	w8, [x24]
	tbnz	w8, #31, LBB0_16
; %bb.4:
	mov	w21, #0
	mov	x25, x20
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x19]
	mov	x0, x19
	mov	x1, x21
	blr	x8
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [x24]
	cmp	w21, w8
	add	w21, w21, #1
	ccmp	w25, #0, #4, lt
	b.le	LBB0_16
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x24, #16]
	mov	x0, x21
	bl	_FD_ISSET
	mov	x23, x0
	ldr	w1, [x24, #12]
	mov	x0, x21
	bl	_FD_ISSET
	mov	x22, x0
	ldr	w1, [x24, #8]
	mov	x0, x21
	bl	_FD_ISSET
	cmp	w23, #0
	ccmp	w22, #0, #0, eq
	ccmp	w0, #0, #0, eq
	b.eq	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	sub	w25, w25, #1
	cbnz	w0, LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w1, [x24, #4]
	mov	x0, x21
	bl	_FD_ISSET
	cbz	w0, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_sm_accept
	b	LBB0_6
LBB0_11:                                ;   in Loop: Header=BB0_7 Depth=1
	cbz	w23, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_sm_resend
LBB0_13:                                ;   in Loop: Header=BB0_7 Depth=1
	cbz	w22, LBB0_6
; %bb.14:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_sm_recv
	b	LBB0_6
LBB0_15:
	mov	w20, #-1
LBB0_16:
	mov	x0, x20
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_17:
	mov	w20, #0
Lloh2:
	adrp	x19, _errno@GOTPAGE
Lloh3:
	ldr	x19, [x19, _errno@GOTPAGEOFF]
	ldr	w8, [x19]
Lloh4:
	adrp	x9, _EINTR@GOTPAGE
Lloh5:
	ldr	x9, [x9, _EINTR@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_16
; %bb.18:
Lloh7:
	adrp	x9, _EAGAIN@GOTPAGE
Lloh8:
	ldr	x9, [x9, _EAGAIN@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_16
; %bb.19:
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_perror
	ldr	w8, [x19]
	neg	w20, w8
	b	LBB0_16
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_SIZEOF_FD_SET,4,2              ; @SIZEOF_FD_SET
	.comm	_errno,4,2                      ; @errno
	.comm	_EINTR,4,2                      ; @EINTR
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"select failed"

	.comm	_WSAEINTR,4,2                   ; @WSAEINTR
	.comm	_WSAEWOULDBLOCK,4,2             ; @WSAEWOULDBLOCK
	.comm	_stderr,4,2                     ; @stderr
.subsections_via_symbols
