	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wait_for_reply                 ## -- Begin function wait_for_reply
	.p2align	4, 0x90
_wait_for_reply:                        ## @wait_for_reply
	.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	%rsi, -48(%rbp)                 ## 8-byte Spill
	movl	%edi, %r12d
	leal	1(%r12), %r15d
	movq	_NFDBITS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	callq	_howmany
	movl	%eax, %r14d
	shll	$2, %r14d
	movl	%r14d, %edi
	callq	_malloc
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_2:
	xorl	%r13d, %r13d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	%r14d, %edx
	callq	_memset
	movl	%r12d, %edi
	movq	%rbx, %rsi
	callq	_FD_SET
	movq	_waittime@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	movq	$0, -56(%rbp)
	leaq	-64(%rbp), %r8
	movl	%r15d, %edi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_select
	testq	%rax, %rax
	jle	LBB0_4
## %bb.3:
	movq	_rcvsock@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	xorl	%edx, %edx
	callq	_recvmsg
	movl	%eax, %r13d
LBB0_4:
	movq	%rbx, %rdi
	callq	_free
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NFDBITS,4,2                    ## @NFDBITS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"malloc"

	.comm	_waittime,4,2                   ## @waittime
	.comm	_rcvsock,4,2                    ## @rcvsock
	.comm	_POLLIN,4,2                     ## @POLLIN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wait_for_reply                 ; -- Begin function wait_for_reply
	.p2align	2
_wait_for_reply:                        ; @wait_for_reply
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x1
	mov	x22, x0
	add	w21, w0, #1
Lloh0:
	adrp	x8, _NFDBITS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NFDBITS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_howmany
	lsl	w23, w0, #2
	mov	x0, x23
	bl	_malloc
	mov	x20, x0
	cbnz	x0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_2:
	mov	x0, x20
	mov	w1, #0
	mov	x2, x23
	bl	_memset
	mov	x0, x22
	mov	x1, x20
	bl	_FD_SET
Lloh5:
	adrp	x8, _waittime@GOTPAGE
Lloh6:
	ldr	x8, [x8, _waittime@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w8, [sp]
	str	xzr, [sp, #8]
	mov	x4, sp
	mov	x0, x21
	mov	x1, x20
	mov	x2, #0
	mov	x3, #0
	bl	_select
	cmp	x0, #1
	b.lt	LBB0_4
; %bb.3:
Lloh8:
	adrp	x8, _rcvsock@GOTPAGE
Lloh9:
	ldr	x8, [x8, _rcvsock@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	mov	x1, x19
	mov	w2, #0
	bl	_recvmsg
	mov	x19, x0
	b	LBB0_5
LBB0_4:
	mov	w19, #0
LBB0_5:
	mov	x0, x20
	bl	_free
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_NFDBITS,4,2                    ; @NFDBITS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"malloc"

	.comm	_waittime,4,2                   ; @waittime
	.comm	_rcvsock,4,2                    ; @rcvsock
	.comm	_POLLIN,4,2                     ; @POLLIN
.subsections_via_symbols
