	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wait_for_connection
_wait_for_connection:                   ## @wait_for_connection
	.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
	movl	%edx, %ebx
	movq	%rsi, %r14
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	leaq	-52(%rbp), %rdi
	callq	_FD_ZERO
	movl	%ebx, %r12d
	movl	%ebx, -56(%rbp)                 ## 4-byte Spill
	testl	%ebx, %ebx
	je	LBB0_1
## %bb.2:
	movl	$-1, %r13d
	xorl	%ebx, %ebx
	leaq	-52(%rbp), %r15
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14,%rbx,8), %rdi
	movq	%r15, %rsi
	callq	_FD_SET
	movq	(%r14,%rbx,8), %rsi
	movl	%r13d, %edi
	callq	_max
	movl	%eax, %r13d
	incq	%rbx
	cmpq	%rbx, %r12
	jne	LBB0_3
## %bb.4:
	incl	%r13d
	jmp	LBB0_5
LBB0_1:
	xorl	%r13d, %r13d
LBB0_5:
	xorl	%eax, %eax
	callq	_getpid
	movq	_pgrp@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	xorl	%edi, %edi
	movl	%eax, %esi
	callq	_setpgid
	testq	%rax, %rax
	jns	LBB0_7
## %bb.6:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_7:
	movq	_SIGTERM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_terminate@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_signal
	movq	_SIGINT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%rbx), %esi
	callq	_signal
	movq	_SIGCHLD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_sigchld@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_signal
	jmp	LBB0_8
LBB0_21:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	leaq	L_.str.2(%rip), %rsi
	callq	_krb5_warnx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_15 Depth 2
	movq	_term_flag@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_18
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	-52(%rbp), %eax
	movl	%eax, -48(%rbp)
	movl	%r13d, %edi
	leaq	-48(%rbp), %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_select
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_rk_IS_SOCKET_ERROR
	testq	%rax, %rax
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	_rk_SOCK_ERRNO@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_EINTR@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	je	LBB0_8
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	leaq	L_.str.1(%rip), %rdx
	callq	_krb5_warn
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_8 Depth=1
	testl	%ebx, %ebx
	je	LBB0_21
## %bb.13:                              ##   in Loop: Header=BB0_8 Depth=1
	cmpl	$0, -56(%rbp)                   ## 4-byte Folded Reload
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	je	LBB0_8
## %bb.14:                              ##   in Loop: Header=BB0_8 Depth=1
	xorl	%r15d, %r15d
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_15 Depth=2
	incq	%r15
	cmpq	%r15, %r12
	je	LBB0_8
LBB0_15:                                ##   Parent Loop BB0_8 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r14,%r15,8), %rdi
	leaq	-48(%rbp), %rsi
	callq	_FD_ISSET
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=2
	movl	%ebx, %edi
	movq	%r14, %rsi
	movl	%r12d, %edx
	movl	%r15d, %ecx
	callq	_spawn_child
	testq	%rax, %rax
	jne	LBB0_17
## %bb.22:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movq	_SIGCHLD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SIG_IGN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_signal
	movq	_WNOHANG@GOTPCREL(%rip), %r14
	leaq	-60(%rbp), %rbx
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edx
	movl	$-1, %edi
	movq	%rbx, %rsi
	callq	_waitpid
	testq	%rax, %rax
	jg	LBB0_19
## %bb.20:
	xorl	%edi, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_pgrp,4,2                       ## @pgrp
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"setpgid"

	.comm	_SIGTERM,4,2                    ## @SIGTERM
	.comm	_terminate,4,2                  ## @terminate
	.comm	_SIGINT,4,2                     ## @SIGINT
	.comm	_SIGCHLD,4,2                    ## @SIGCHLD
	.comm	_sigchld,4,2                    ## @sigchld
	.comm	_term_flag,8,3                  ## @term_flag
	.comm	_rk_SOCK_ERRNO,8,3              ## @rk_SOCK_ERRNO
	.comm	_EINTR,8,3                      ## @EINTR
L_.str.1:                               ## @.str.1
	.asciz	"select"

L_.str.2:                               ## @.str.2
	.asciz	"select returned 0"

	.comm	_SIG_IGN,4,2                    ## @SIG_IGN
	.comm	_WNOHANG,4,2                    ## @WNOHANG
	.comm	_FD_SETSIZE,8,3                 ## @FD_SETSIZE
	.no_dead_strip	_wait_for_connection
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wait_for_connection
_wait_for_connection:                   ; @wait_for_connection
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x2
	mov	x20, x1
	mov	x21, x0
	add	x0, sp, #12
	bl	_FD_ZERO
	mov	w22, w19
	cbz	w19, LBB0_4
; %bb.1:
	mov	w23, #-1
	mov	x24, x22
	mov	x25, x20
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x25]
	add	x1, sp, #12
	bl	_FD_SET
	ldr	x1, [x25], #8
	mov	x0, x23
	bl	_max
	mov	x23, x0
	subs	x24, x24, #1
	b.ne	LBB0_2
; %bb.3:
	add	w23, w23, #1
	b	LBB0_5
LBB0_4:
	mov	w23, #0
LBB0_5:
	bl	_getpid
	mov	x1, x0
Lloh0:
	adrp	x8, _pgrp@GOTPAGE
Lloh1:
	ldr	x8, [x8, _pgrp@GOTPAGEOFF]
Lloh2:
	str	w0, [x8]
	mov	w0, #0
	bl	_setpgid
	tbz	x0, #63, LBB0_7
; %bb.6:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_7:
Lloh5:
	adrp	x8, _SIGTERM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SIGTERM@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
Lloh8:
	adrp	x24, _terminate@GOTPAGE
Lloh9:
	ldr	x24, [x24, _terminate@GOTPAGEOFF]
	ldr	w1, [x24]
	bl	_signal
Lloh10:
	adrp	x8, _SIGINT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SIGINT@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	ldr	w1, [x24]
	bl	_signal
Lloh13:
	adrp	x8, _SIGCHLD@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SIGCHLD@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
Lloh16:
	adrp	x8, _sigchld@GOTPAGE
Lloh17:
	ldr	x8, [x8, _sigchld@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	bl	_signal
Lloh19:
	adrp	x28, _term_flag@GOTPAGE
Lloh20:
	ldr	x28, [x28, _term_flag@GOTPAGEOFF]
	ldr	x8, [x28]
	cbnz	x8, LBB0_21
; %bb.8:
Lloh21:
	adrp	x27, _rk_SOCK_ERRNO@GOTPAGE
Lloh22:
	ldr	x27, [x27, _rk_SOCK_ERRNO@GOTPAGEOFF]
Lloh23:
	adrp	x24, _EINTR@GOTPAGE
Lloh24:
	ldr	x24, [x24, _EINTR@GOTPAGEOFF]
Lloh25:
	adrp	x25, l_.str.1@PAGE
Lloh26:
	add	x25, x25, l_.str.1@PAGEOFF
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x21
Lloh27:
	adrp	x1, l_.str.2@PAGE
Lloh28:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_krb5_warnx
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	ldr	x8, [x28]
	cbnz	x8, LBB0_21
LBB0_11:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_18 Depth 2
	ldr	w8, [sp, #12]
	str	w8, [sp, #8]
	add	x1, sp, #8
	mov	x0, x23
	mov	x2, #0
	mov	x3, #0
	mov	x4, #0
	bl	_select
	mov	x26, x0
	bl	_rk_IS_SOCKET_ERROR
	cbz	x0, LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	x1, [x27]
	ldr	x8, [x24]
	cmp	x1, x8
	b.eq	LBB0_10
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x21
	mov	x2, x25
	bl	_krb5_warn
	b	LBB0_10
LBB0_14:                                ;   in Loop: Header=BB0_11 Depth=1
	cbz	w26, LBB0_9
; %bb.15:                               ;   in Loop: Header=BB0_11 Depth=1
	cbz	w19, LBB0_10
; %bb.16:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x26, #0
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_18 Depth=2
	add	x26, x26, #1
	cmp	x22, x26
	b.eq	LBB0_10
LBB0_18:                                ;   Parent Loop BB0_11 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x0, [x20, x26, lsl #3]
	add	x1, sp, #8
	bl	_FD_ISSET
	cbz	x0, LBB0_17
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=2
	mov	x0, x21
	mov	x1, x20
	mov	x2, x22
	mov	x3, x26
	bl	_spawn_child
	cbnz	x0, LBB0_17
; %bb.20:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_21:
Lloh29:
	adrp	x8, _SIGCHLD@GOTPAGE
Lloh30:
	ldr	x8, [x8, _SIGCHLD@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
Lloh32:
	adrp	x8, _SIG_IGN@GOTPAGE
Lloh33:
	ldr	x8, [x8, _SIG_IGN@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	bl	_signal
Lloh35:
	adrp	x19, _WNOHANG@GOTPAGE
Lloh36:
	ldr	x19, [x19, _WNOHANG@GOTPAGEOFF]
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	ldr	w2, [x19]
	add	x1, sp, #4
	mov	w0, #-1
	bl	_waitpid
	cmp	x0, #0
	b.gt	LBB0_22
; %bb.23:
	mov	w0, #0
	bl	_exit
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_pgrp,4,2                       ; @pgrp
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"setpgid"

	.comm	_SIGTERM,4,2                    ; @SIGTERM
	.comm	_terminate,4,2                  ; @terminate
	.comm	_SIGINT,4,2                     ; @SIGINT
	.comm	_SIGCHLD,4,2                    ; @SIGCHLD
	.comm	_sigchld,4,2                    ; @sigchld
	.comm	_term_flag,8,3                  ; @term_flag
	.comm	_rk_SOCK_ERRNO,8,3              ; @rk_SOCK_ERRNO
	.comm	_EINTR,8,3                      ; @EINTR
l_.str.1:                               ; @.str.1
	.asciz	"select"

l_.str.2:                               ; @.str.2
	.asciz	"select returned 0"

	.comm	_SIG_IGN,4,2                    ; @SIG_IGN
	.comm	_WNOHANG,4,2                    ; @WNOHANG
	.comm	_FD_SETSIZE,8,3                 ; @FD_SETSIZE
	.no_dead_strip	_wait_for_connection
.subsections_via_symbols
