	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function socket_wait
_socket_wait:                           ## @socket_wait
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movl	%edi, %r15d
	movl	$5, -48(%rbp)
	movq	$0, -40(%rbp)
	leaq	-28(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_FD_ZERO
	movl	%r15d, %edi
	movq	%rbx, %rsi
	callq	_FD_SET
	xorl	%eax, %eax
	testl	%r14d, %r14d
	movl	$0, %edx
	cmoveq	%rbx, %rdx
	cmoveq	%rax, %rbx
	incl	%r15d
	leaq	-48(%rbp), %r8
	movl	%r15d, %edi
	movq	%rbx, %rsi
	xorl	%ecx, %ecx
	callq	_select
	movl	%eax, %ebx
	cmpl	$-1, %eax
	je	LBB0_1
LBB0_2:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_perror
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"select"

	.no_dead_strip	_socket_wait
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function socket_wait
_socket_wait:                           ; @socket_wait
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x1
	mov	x20, x0
	mov	w8, #5
	str	w8, [sp, #8]
	str	xzr, [sp, #16]
	add	x21, sp, #28
	add	x0, sp, #28
	bl	_FD_ZERO
	add	x1, sp, #28
	mov	x0, x20
	bl	_FD_SET
	cmp	w19, #0
	csel	x2, x21, xzr, eq
	csel	x1, xzr, x21, eq
	add	w0, w20, #1
	add	x4, sp, #8
	mov	w3, #0
	bl	_select
	mov	x19, x0
	cmn	w0, #1
	b.eq	LBB0_2
LBB0_1:
	mov	x0, x19
	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
	add	sp, sp, #80
	ret
LBB0_2:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_perror
	b	LBB0_1
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"select"

	.no_dead_strip	_socket_wait
.subsections_via_symbols
