	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fbsd_thread_wait
_fbsd_thread_wait:                      ## @fbsd_thread_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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	_child_ops@GOTPCREL(%rip), %rax
	callq	*(%rax)
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_GET_PID
	testq	%rax, %rax
	js	LBB0_8
## %bb.1:
	movq	(%r14), %rax
	movq	_TARGET_WAITKIND_STOPPED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.2:
	movl	%ebx, %edi
	callq	_GET_PID
	movq	%rax, %rdi
	callq	_get_current_lwp
	movq	%rax, %r15
	movl	%ebx, %edi
	callq	_GET_PID
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_BUILD_LWP
	leaq	-32(%rbp), %rsi
	leaq	-28(%rbp), %rdx
	movl	%eax, %edi
	callq	_thread_from_lwp
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_in_thread_list
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	leaq	-32(%rbp), %rsi
	leaq	-28(%rbp), %rdx
	movl	%ebx, %edi
	movl	$1, %ecx
	callq	_attach_thread
LBB0_4:
	movq	8(%r14), %rax
	movq	_TARGET_SIGNAL_TRAP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	movl	%ebx, %edi
	callq	_check_event
LBB0_6:
	movq	_inferior_ptid@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_fbsd_thread_alive
	testl	%eax, %eax
	jne	LBB0_8
## %bb.7:
	movl	(%r14), %edi
	callq	_delete_thread
	movl	%ebx, (%r14)
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_child_ops,8,3                  ## @child_ops
	.comm	_TARGET_WAITKIND_STOPPED,8,3    ## @TARGET_WAITKIND_STOPPED
	.comm	_TARGET_SIGNAL_TRAP,8,3         ## @TARGET_SIGNAL_TRAP
	.comm	_inferior_ptid,4,2              ## @inferior_ptid
	.no_dead_strip	_fbsd_thread_wait
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fbsd_thread_wait
_fbsd_thread_wait:                      ; @fbsd_thread_wait
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x1
Lloh0:
	adrp	x8, _child_ops@GOTPAGE
Lloh1:
	ldr	x8, [x8, _child_ops@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	blr	x8
	mov	x19, x0
	bl	_GET_PID
	tbnz	x0, #63, LBB0_8
; %bb.1:
	ldr	x8, [x20]
Lloh3:
	adrp	x9, _TARGET_WAITKIND_STOPPED@GOTPAGE
Lloh4:
	ldr	x9, [x9, _TARGET_WAITKIND_STOPPED@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.2:
	mov	x0, x19
	bl	_GET_PID
	bl	_get_current_lwp
	mov	x21, x0
	mov	x0, x19
	bl	_GET_PID
	mov	x1, x0
	mov	x0, x21
	bl	_BUILD_LWP
	add	x1, sp, #12
	add	x2, sp, #8
	bl	_thread_from_lwp
	mov	x19, x0
	bl	_in_thread_list
	cbnz	w0, LBB0_4
; %bb.3:
	add	x1, sp, #12
	add	x2, sp, #8
	mov	x0, x19
	mov	w3, #1
	bl	_attach_thread
LBB0_4:
	ldr	x8, [x20, #8]
Lloh6:
	adrp	x9, _TARGET_SIGNAL_TRAP@GOTPAGE
Lloh7:
	ldr	x9, [x9, _TARGET_SIGNAL_TRAP@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_check_event
LBB0_6:
Lloh9:
	adrp	x20, _inferior_ptid@GOTPAGE
Lloh10:
	ldr	x20, [x20, _inferior_ptid@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_fbsd_thread_alive
	cbnz	w0, LBB0_8
; %bb.7:
	ldr	w0, [x20]
	bl	_delete_thread
	str	w19, [x20]
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_child_ops,8,3                  ; @child_ops
	.comm	_TARGET_WAITKIND_STOPPED,8,3    ; @TARGET_WAITKIND_STOPPED
	.comm	_TARGET_SIGNAL_TRAP,8,3         ; @TARGET_SIGNAL_TRAP
	.comm	_inferior_ptid,4,2              ; @inferior_ptid
	.no_dead_strip	_fbsd_thread_wait
.subsections_via_symbols
