	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wait_until_can_do_something
_wait_until_can_do_something:           ## @wait_until_can_do_something
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %rax
	movq	%r8, %r12
	movq	%rcx, %r15
	movl	%edx, %r13d
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %rbx
	movq	24(%rbp), %r14
	movq	16(%rbp), %r8
	movq	$0, -72(%rbp)
	leaq	-72(%rbp), %r9
	movq	%rcx, %rsi
	movq	%r12, %rdx
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%rax, %rcx
	callq	_channel_prepare_select
	movq	-72(%rbp), %rax
	testq	%rax, %rax
	movl	%r13d, -48(%rbp)                ## 4-byte Spill
	je	LBB0_2
## %bb.1:
	imull	$1000, %eax, %esi               ## imm = 0x3E8
	movq	%r14, %rdi
	callq	_MINIMUM
	movq	%rax, %r14
LBB0_2:
	movq	_options@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	testq	%r13, %r13
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_4
## %bb.3:
	movabsq	$4294967296000, %rax            ## imm = 0x3E800000000
	imulq	%r13, %rax
	sarq	$32, %rax
	cmpq	%rax, %r14
	movq	%r14, %rcx
	cmovgq	%rax, %rcx
	testq	%r14, %r14
	cmoveq	%rax, %rcx
	movq	%rcx, %r14
LBB0_4:
	testq	%r13, %r13
	setne	%bl
	movq	(%r15), %rsi
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_FD_SET
	movq	(%r15), %rdi
	callq	_notify_prepare
	xorl	%eax, %eax
	callq	_packet_have_data_to_write
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	(%r12), %rsi
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	callq	_FD_SET
LBB0_6:
	movq	_child_terminated@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_10
## %bb.7:
	xorl	%eax, %eax
	callq	_packet_not_very_much_data_to_write
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	testb	%bl, %bl
	movl	$100, %eax
	movq	%r14, %rcx
	cmovneq	%rax, %rcx
	testq	%r14, %r14
	cmoveq	%rax, %rcx
	movq	%rcx, %r14
	jmp	LBB0_9
LBB0_10:
	testq	%r14, %r14
	je	LBB0_11
LBB0_9:
	movabsq	$2361183241434822607, %rcx      ## imm = 0x20C49BA5E353F7CF
	movq	%r14, %rax
	imulq	%rcx
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$7, %rdx
	addq	%rax, %rdx
	movq	%rdx, -80(%rbp)
	imull	$1000, %edx, %eax               ## imm = 0x3E8
	subl	%eax, %r14d
	imull	$1000, %r14d, %eax              ## imm = 0x3E8
	movl	%eax, -88(%rbp)
	leaq	-88(%rbp), %r8
	jmp	LBB0_12
LBB0_11:
	xorl	%r8d, %r8d
LBB0_12:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	incl	%edi
	movq	(%r15), %rsi
	movq	(%r12), %rdx
	xorl	%ecx, %ecx
	callq	_select
	cmpl	$-1, %eax
	je	LBB0_13
## %bb.15:
	testq	%r13, %r13
	je	LBB0_23
## %bb.16:
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_monotime
	testl	%ebx, %ebx
	je	LBB0_17
## %bb.18:
	movq	%rax, %r14
	movq	(%r15), %rsi
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_FD_ISSET
	testq	%rax, %rax
	je	LBB0_19
LBB0_22:
	movq	%r14, _wait_until_can_do_something.last_client_time(%rip)
	jmp	LBB0_23
LBB0_13:
	movq	(%r15), %rdi
	movq	16(%rbp), %rbx
	movl	(%rbx), %edx
	xorl	%esi, %esi
	callq	_memset
	movq	(%r12), %rdi
	movl	(%rbx), %edx
	xorl	%esi, %esi
	callq	_memset
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_EINTR@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	je	LBB0_23
## %bb.14:
	callq	_strerror
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_error
	jmp	LBB0_23
LBB0_17:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_client_alive_check
LBB0_23:
	movq	(%r15), %rdi
	callq	_notify_done
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movq	_wait_until_can_do_something.last_client_time(%rip), %rax
	testq	%rax, %rax
	je	LBB0_23
## %bb.20:
	movq	_options@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rax
	cmpq	%r14, %rax
	jg	LBB0_23
## %bb.21:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_client_alive_check
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_wait_until_can_do_something.last_client_time,8,3 ## @wait_until_can_do_something.last_client_time
	.comm	_options,8,3                    ## @options
	.comm	_child_terminated,8,3           ## @child_terminated
	.comm	_errno,8,3                      ## @errno
	.comm	_EINTR,8,3                      ## @EINTR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"select: %.100s"

	.no_dead_strip	_wait_until_can_do_something
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wait_until_can_do_something
_wait_until_can_do_something:           ; @wait_until_can_do_something
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x26, x7
	mov	x22, x6
	mov	x24, x5
	mov	x23, x4
	mov	x19, x3
	mov	x25, x2
	mov	x21, x1
	mov	x20, x0
	str	xzr, [sp, #8]
	add	x5, sp, #8
	mov	x1, x3
	mov	x2, x4
	mov	x3, x24
	mov	x4, x6
	bl	_channel_prepare_select
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_2
; %bb.1:
	mov	w9, #1000
	mul	w1, w8, w9
	mov	x0, x26
	bl	_MINIMUM
	mov	x26, x0
LBB0_2:
Lloh0:
	adrp	x8, _options@GOTPAGE
Lloh1:
	ldr	x8, [x8, _options@GOTPAGEOFF]
Lloh2:
	ldr	x28, [x8]
	mov	x8, #4294967296000
	mul	x8, x28, x8
	asr	x8, x8, #32
	cmp	x26, x8
	ccmp	x26, #0, #4, le
	csel	x8, x8, x26, eq
	cmp	x28, #0
	csel	x26, x26, x8, eq
	cmp	x28, #0
	cset	w27, ne
	ldr	x1, [x19]
	mov	x0, x21
	bl	_FD_SET
	ldr	x0, [x19]
	bl	_notify_prepare
	bl	_packet_have_data_to_write
	cbz	x0, LBB0_4
; %bb.3:
	ldr	x1, [x23]
	mov	x0, x25
	bl	_FD_SET
LBB0_4:
Lloh3:
	adrp	x8, _child_terminated@GOTPAGE
Lloh4:
	ldr	x8, [x8, _child_terminated@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cbz	x8, LBB0_7
; %bb.5:
	bl	_packet_not_very_much_data_to_write
	cbz	x0, LBB0_7
; %bb.6:
	cmp	x26, #0
	cset	w8, eq
	orr	w8, w8, w27
	cmp	w8, #0
	mov	w8, #100
	csel	x26, x8, x26, ne
	b	LBB0_8
LBB0_7:
	cbz	x26, LBB0_9
LBB0_8:
	mov	x8, #63439
	movk	x8, #58195, lsl #16
	movk	x8, #39845, lsl #32
	movk	x8, #8388, lsl #48
	smulh	x8, x26, x8
	asr	x9, x8, #7
	add	x8, x9, x8, lsr #63
	str	x8, [sp, #24]
	mov	w9, #1000
	msub	w8, w8, w9, w26
	mul	w8, w8, w9
	str	w8, [sp, #16]
	add	x4, sp, #16
	b	LBB0_10
LBB0_9:
	mov	x4, #0
LBB0_10:
	ldr	w8, [x24]
	add	w0, w8, #1
	ldr	x1, [x19]
	ldr	x2, [x23]
	mov	x3, #0
	bl	_select
	cmn	w0, #1
	b.eq	LBB0_15
; %bb.11:
	cbz	x28, LBB0_18
; %bb.12:
	mov	x24, x0
	bl	_monotime
	cbz	w24, LBB0_17
; %bb.13:
	mov	x22, x0
	ldr	x1, [x19]
	mov	x0, x21
	bl	_FD_ISSET
	cbz	x0, LBB0_19
; %bb.14:
	adrp	x8, _wait_until_can_do_something.last_client_time@PAGE
	str	x22, [x8, _wait_until_can_do_something.last_client_time@PAGEOFF]
	b	LBB0_18
LBB0_15:
	ldr	x0, [x19]
	ldr	w2, [x22]
	mov	w1, #0
	bl	_memset
	ldr	x0, [x23]
	ldr	w2, [x22]
	mov	w1, #0
	bl	_memset
Lloh6:
	adrp	x8, _errno@GOTPAGE
Lloh7:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh8:
	ldr	x0, [x8]
Lloh9:
	adrp	x8, _EINTR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINTR@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_18
; %bb.16:
	bl	_strerror
	mov	x1, x0
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_error
	b	LBB0_18
LBB0_17:
	mov	x0, x20
	bl	_client_alive_check
LBB0_18:
	ldr	x0, [x19]
	bl	_notify_done
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_19:
	adrp	x21, _wait_until_can_do_something.last_client_time@PAGE
	ldr	x8, [x21, _wait_until_can_do_something.last_client_time@PAGEOFF]
	cbz	x8, LBB0_18
; %bb.20:
Lloh14:
	adrp	x9, _options@GOTPAGE
Lloh15:
	ldr	x9, [x9, _options@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	add	x8, x9, x8
	cmp	x8, x22
	b.gt	LBB0_18
; %bb.21:
	mov	x0, x20
	bl	_client_alive_check
	str	x22, [x21, _wait_until_can_do_something.last_client_time@PAGEOFF]
	b	LBB0_18
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_wait_until_can_do_something.last_client_time,8,3 ; @wait_until_can_do_something.last_client_time
	.comm	_options,8,3                    ; @options
	.comm	_child_terminated,8,3           ; @child_terminated
	.comm	_errno,8,3                      ; @errno
	.comm	_EINTR,8,3                      ; @EINTR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"select: %.100s"

	.no_dead_strip	_wait_until_can_do_something
.subsections_via_symbols
