	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fbsd_wait_for_process
_fbsd_wait_for_process:                 ## @fbsd_wait_for_process
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	(%rdi), %rax
	testq	%rax, %rax
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_1
## %bb.2:
	movl	(%rax), %r12d
	jmp	LBB0_3
LBB0_1:
	movl	$-1, %r12d
LBB0_3:
	movq	_WNOHANG@GOTPCREL(%rip), %r14
	movq	_ECHILD@GOTPCREL(%rip), %r13
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	%eax, %ebx
	testl	%eax, %eax
	jg	LBB0_9
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_usleep
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edx
	movl	%r12d, %edi
	movq	%r15, %rsi
	callq	_waitpid
	cmpl	$-1, %eax
	jne	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	(%r13), %rax
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	leaq	L_.str(%rip), %rdi
	callq	_perror_with_name
	jmp	LBB0_8
LBB0_9:
	movq	_debug_threads@GOTPCREL(%rip), %r13
	cmpq	$0, (%r13)
	je	LBB0_14
## %bb.10:
	movl	(%r15), %edi
	callq	_WIFSTOPPED
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:
	movl	(%r15), %edi
	callq	_WSTOPSIG
	cmpl	$32, %eax
	je	LBB0_14
## %bb.12:
	movl	(%r15), %edi
	callq	_WSTOPSIG
	cmpl	$33, %eax
	je	LBB0_14
LBB0_13:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r15), %ecx
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	callq	_fprintf
LBB0_14:
	cmpl	$-1, %r12d
	je	LBB0_16
## %bb.15:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	(%rbx), %rax
	jmp	LBB0_17
LBB0_16:
	movq	_all_processes@GOTPCREL(%rip), %rdi
	movl	%ebx, %esi
	callq	_find_inferior_id
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rax, (%rbx)
LBB0_17:
	movl	$1, 4(%rax)
	movq	$0, 16(%rax)
	cmpq	$0, (%r13)
	je	LBB0_20
## %bb.18:
	movl	(%r15), %edi
	callq	_WIFSTOPPED
	testq	%rax, %rax
	je	LBB0_20
## %bb.19:
	movq	(%rbx), %rax
	movl	8(%rax), %esi
	movq	_all_threads@GOTPCREL(%rip), %rdi
	callq	_find_inferior_id
	movq	_current_inferior@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movq	_the_low_target@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_20
## %bb.21:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_get_stop_pc                    ## TAILCALL
LBB0_20:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WNOHANG,4,2                    ## @WNOHANG
	.comm	_errno,8,3                      ## @errno
	.comm	_ECHILD,8,3                     ## @ECHILD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"waitpid"

	.comm	_debug_threads,8,3              ## @debug_threads
	.comm	_stderr,4,2                     ## @stderr
L_.str.1:                               ## @.str.1
	.asciz	"Got an event from %d (%x)\n"

	.comm	_all_processes,4,2              ## @all_processes
	.comm	_all_threads,4,2                ## @all_threads
	.comm	_current_inferior,8,3           ## @current_inferior
	.comm	_the_low_target,8,3             ## @the_low_target
	.no_dead_strip	_fbsd_wait_for_process
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fbsd_wait_for_process
_fbsd_wait_for_process:                 ; @fbsd_wait_for_process
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x0]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w21, [x8]
	b	LBB0_3
LBB0_2:
	mov	w21, #-1
LBB0_3:
Lloh0:
	adrp	x24, _WNOHANG@GOTPAGE
Lloh1:
	ldr	x24, [x24, _WNOHANG@GOTPAGEOFF]
Lloh2:
	adrp	x25, _errno@GOTPAGE
Lloh3:
	ldr	x25, [x25, _errno@GOTPAGEOFF]
Lloh4:
	adrp	x23, l_.str@PAGE
Lloh5:
	add	x23, x23, l_.str@PAGEOFF
Lloh6:
	adrp	x26, _ECHILD@GOTPAGE
Lloh7:
	ldr	x26, [x26, _ECHILD@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x22, x0
	cmp	w0, #0
	b.gt	LBB0_9
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	w0, #1000
	bl	_usleep
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w2, [x24]
	mov	x0, x21
	mov	x1, x20
	bl	_waitpid
	cmn	w0, #1
	b.ne	LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x25]
	ldr	x9, [x26]
	cmp	x8, x9
	b.eq	LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x23
	bl	_perror_with_name
	b	LBB0_5
LBB0_9:
Lloh8:
	adrp	x23, _debug_threads@GOTPAGE
Lloh9:
	ldr	x23, [x23, _debug_threads@GOTPAGEOFF]
	ldr	x8, [x23]
	cbz	x8, LBB0_14
; %bb.10:
	ldr	w0, [x20]
	bl	_WIFSTOPPED
	cbz	x0, LBB0_13
; %bb.11:
	ldr	w0, [x20]
	bl	_WSTOPSIG
	cmp	w0, #32
	b.eq	LBB0_14
; %bb.12:
	ldr	w0, [x20]
	bl	_WSTOPSIG
	cmp	w0, #33
	b.eq	LBB0_14
LBB0_13:
Lloh10:
	adrp	x8, _stderr@GOTPAGE
Lloh11:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	ldr	w3, [x20]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x22
	bl	_fprintf
LBB0_14:
	cmn	w21, #1
	b.eq	LBB0_16
; %bb.15:
	ldr	x0, [x19]
	b	LBB0_17
LBB0_16:
Lloh15:
	adrp	x0, _all_processes@GOTPAGE
Lloh16:
	ldr	x0, [x0, _all_processes@GOTPAGEOFF]
	mov	x1, x22
	bl	_find_inferior_id
	str	x0, [x19]
LBB0_17:
	mov	w8, #1
	str	w8, [x0, #4]
	str	xzr, [x0, #16]
	ldr	x8, [x23]
	cbz	x8, LBB0_21
; %bb.18:
	ldr	w0, [x20]
	bl	_WIFSTOPPED
	cbz	x0, LBB0_21
; %bb.19:
	ldr	x8, [x19]
	ldr	w1, [x8, #8]
Lloh17:
	adrp	x0, _all_threads@GOTPAGE
Lloh18:
	ldr	x0, [x0, _all_threads@GOTPAGEOFF]
	bl	_find_inferior_id
Lloh19:
	adrp	x8, _current_inferior@GOTPAGE
Lloh20:
	ldr	x8, [x8, _current_inferior@GOTPAGEOFF]
Lloh21:
	str	x0, [x8]
Lloh22:
	adrp	x8, _the_low_target@GOTPAGE
Lloh23:
	ldr	x8, [x8, _the_low_target@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	cbz	x8, LBB0_21
; %bb.20:
	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
	b	_get_stop_pc
LBB0_21:
	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
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotStr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_WNOHANG,4,2                    ; @WNOHANG
	.comm	_errno,8,3                      ; @errno
	.comm	_ECHILD,8,3                     ; @ECHILD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"waitpid"

	.comm	_debug_threads,8,3              ; @debug_threads
	.comm	_stderr,4,2                     ; @stderr
l_.str.1:                               ; @.str.1
	.asciz	"Got an event from %d (%x)\n"

	.comm	_all_processes,4,2              ; @all_processes
	.comm	_all_threads,4,2                ; @all_threads
	.comm	_current_inferior,8,3           ; @current_inferior
	.comm	_the_low_target,8,3             ; @the_low_target
	.no_dead_strip	_fbsd_wait_for_process
.subsections_via_symbols
