	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wait_lwp
_wait_lwp:                              ## @wait_lwp
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	xorl	%edi, %edi
	cmpl	$0, 8(%r14)
	sete	%dil
	callq	_gdb_assert
	xorl	%edi, %edi
	cmpl	$0, 4(%r14)
	sete	%dil
	callq	_gdb_assert
	movl	(%r14), %edi
	callq	_GET_LWP
	leaq	-36(%rbp), %rsi
	movl	%eax, %edi
	xorl	%edx, %edx
	callq	_waitpid
	movl	%eax, %ebx
	cmpl	$-1, %eax
	jne	LBB0_7
## %bb.1:
	movq	_errno@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	_ECHILD@GOTPCREL(%rip), %r15
	movl	$-1, %ebx
	cmpq	(%r15), %rax
	jne	LBB0_7
## %bb.2:
	movl	(%r14), %edi
	callq	_GET_LWP
	movq	___WCLONE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leaq	-36(%rbp), %rsi
	movl	%eax, %edi
	callq	_waitpid
	movl	%eax, %ebx
	cmpl	$-1, %eax
	jne	LBB0_7
## %bb.3:
	movq	(%r12), %rax
	movl	$-1, %ebx
	cmpq	(%r15), %rax
	jne	LBB0_7
## %bb.4:
	movq	_debug_lin_lwp@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_5
## %bb.6:
	movq	_gdb_stdlog@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	(%r14), %edi
	callq	_target_pid_to_str
	leaq	L_.str(%rip), %rsi
	xorl	%r12d, %r12d
	movl	%ebx, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_fprintf_unfiltered
	jmp	LBB0_9
LBB0_7:
	movl	(%r14), %edi
	callq	_GET_LWP
	xorl	%edi, %edi
	cmpl	%eax, %ebx
	sete	%dil
	callq	_gdb_assert
	movq	_debug_lin_lwp@GOTPCREL(%rip), %rax
	movb	$1, %r12b
	cmpq	$0, (%rax)
	je	LBB0_9
## %bb.8:
	movq	_gdb_stdlog@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	(%r14), %edi
	callq	_target_pid_to_str
	movl	%eax, %ebx
	movl	-36(%rbp), %edi
	callq	_status_to_str
	leaq	L_.str.1(%rip), %rsi
	movl	%r15d, %edi
	movl	%ebx, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_fprintf_unfiltered
LBB0_9:
	movl	-36(%rbp), %edi
	callq	_WIFEXITED
	testq	%rax, %rax
	jne	LBB0_11
## %bb.10:
	movl	-36(%rbp), %edi
	callq	_WIFSIGNALED
	testq	%rax, %rax
	je	LBB0_13
LBB0_11:
	movq	_debug_lin_lwp@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_14
## %bb.12:
	movq	_gdb_stdlog@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	(%r14), %edi
	callq	_target_pid_to_str
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_fprintf_unfiltered
LBB0_14:
	movl	(%r14), %edi
	callq	_in_thread_list
	testq	%rax, %rax
	je	LBB0_18
## %bb.15:
	movl	(%r14), %edi
	movq	_inferior_ptid@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ptid_equal
	testl	%eax, %eax
	jne	LBB0_17
## %bb.16:
	movl	(%r14), %edi
	callq	_delete_thread
LBB0_17:
	movl	(%r14), %edi
	callq	_target_pid_to_str
	leaq	L_.str.3(%rip), %rdi
	movl	%eax, %esi
	callq	_printf_unfiltered
LBB0_18:
	movl	(%r14), %edi
	callq	_delete_lwp
	xorl	%eax, %eax
LBB0_20:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	testb	%r12b, %r12b
	je	LBB0_14
## %bb.19:
	movl	-36(%rbp), %edi
	callq	_WIFSTOPPED
	movl	%eax, %edi
	callq	_gdb_assert
	movl	-36(%rbp), %eax
	jmp	LBB0_20
LBB0_5:
	xorl	%r12d, %r12d
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_errno,8,3                      ## @errno
	.comm	_ECHILD,8,3                     ## @ECHILD
	.comm	___WCLONE,4,2                   ## @__WCLONE
	.comm	_debug_lin_lwp,8,3              ## @debug_lin_lwp
	.comm	_gdb_stdlog,4,2                 ## @gdb_stdlog
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"WL: %s vanished.\n"

L_.str.1:                               ## @.str.1
	.asciz	"WL: waitpid %s received %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"WL: %s exited.\n"

	.comm	_inferior_ptid,4,2              ## @inferior_ptid
L_.str.3:                               ## @.str.3
	.asciz	"[%s exited]\n"

	.no_dead_strip	_wait_lwp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wait_lwp
_wait_lwp:                              ; @wait_lwp
	.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, x0
	ldr	w8, [x0, #8]
	cmp	w8, #0
	cset	w0, eq
	bl	_gdb_assert
	ldr	w8, [x19, #4]
	cmp	w8, #0
	cset	w0, eq
	bl	_gdb_assert
	ldr	w0, [x19]
	bl	_GET_LWP
	add	x1, sp, #12
	mov	w2, #0
	bl	_waitpid
	mov	x20, x0
Lloh0:
	adrp	x23, _debug_lin_lwp@GOTPAGE
Lloh1:
	ldr	x23, [x23, _debug_lin_lwp@GOTPAGEOFF]
Lloh2:
	adrp	x22, _gdb_stdlog@GOTPAGE
Lloh3:
	ldr	x22, [x22, _gdb_stdlog@GOTPAGEOFF]
	cmn	w0, #1
	b.ne	LBB0_8
; %bb.1:
Lloh4:
	adrp	x21, _errno@GOTPAGE
Lloh5:
	ldr	x21, [x21, _errno@GOTPAGEOFF]
	ldr	x8, [x21]
Lloh6:
	adrp	x24, _ECHILD@GOTPAGE
Lloh7:
	ldr	x24, [x24, _ECHILD@GOTPAGEOFF]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.2:
	ldr	w0, [x19]
	bl	_GET_LWP
Lloh8:
	adrp	x8, ___WCLONE@GOTPAGE
Lloh9:
	ldr	x8, [x8, ___WCLONE@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	add	x1, sp, #12
	bl	_waitpid
	mov	x20, x0
	cmn	w0, #1
	b.ne	LBB0_8
; %bb.3:
	ldr	x8, [x21]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.4:
	ldr	x8, [x23]
	cbz	x8, LBB0_6
; %bb.5:
	ldr	w20, [x22]
	ldr	w0, [x19]
	bl	_target_pid_to_str
	mov	x2, x0
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_fprintf_unfiltered
LBB0_6:
	mov	w20, #0
	b	LBB0_11
LBB0_7:
	mov	w20, #-1
LBB0_8:
	ldr	w0, [x19]
	bl	_GET_LWP
	cmp	w20, w0
	cset	w0, eq
	bl	_gdb_assert
	ldr	x8, [x23]
	cbz	x8, LBB0_10
; %bb.9:
	ldr	w20, [x22]
	ldr	w0, [x19]
	bl	_target_pid_to_str
	mov	x21, x0
	ldr	w0, [sp, #12]
	bl	_status_to_str
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_fprintf_unfiltered
LBB0_10:
	mov	w20, #1
LBB0_11:
	ldr	w0, [sp, #12]
	bl	_WIFEXITED
	cbnz	x0, LBB0_13
; %bb.12:
	ldr	w0, [sp, #12]
	bl	_WIFSIGNALED
	cbz	x0, LBB0_21
LBB0_13:
	ldr	x8, [x23]
	cbz	x8, LBB0_15
; %bb.14:
	ldr	w20, [x22]
	ldr	w0, [x19]
	bl	_target_pid_to_str
	mov	x2, x0
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_fprintf_unfiltered
LBB0_15:
	ldr	w0, [x19]
	bl	_in_thread_list
	cbz	x0, LBB0_19
; %bb.16:
	ldr	w0, [x19]
Lloh17:
	adrp	x8, _inferior_ptid@GOTPAGE
Lloh18:
	ldr	x8, [x8, _inferior_ptid@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	bl	_ptid_equal
	cbnz	w0, LBB0_18
; %bb.17:
	ldr	w0, [x19]
	bl	_delete_thread
LBB0_18:
	ldr	w0, [x19]
	bl	_target_pid_to_str
	mov	x1, x0
Lloh20:
	adrp	x0, l_.str.3@PAGE
Lloh21:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_printf_unfiltered
LBB0_19:
	ldr	w0, [x19]
	bl	_delete_lwp
	mov	w0, #0
LBB0_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
	add	sp, sp, #80
	ret
LBB0_21:
	tbz	w20, #0, LBB0_15
; %bb.22:
	ldr	w0, [sp, #12]
	bl	_WIFSTOPPED
	bl	_gdb_assert
	ldr	w0, [sp, #12]
	b	LBB0_20
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_errno,8,3                      ; @errno
	.comm	_ECHILD,8,3                     ; @ECHILD
	.comm	___WCLONE,4,2                   ; @__WCLONE
	.comm	_debug_lin_lwp,8,3              ; @debug_lin_lwp
	.comm	_gdb_stdlog,4,2                 ; @gdb_stdlog
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"WL: %s vanished.\n"

l_.str.1:                               ; @.str.1
	.asciz	"WL: waitpid %s received %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"WL: %s exited.\n"

	.comm	_inferior_ptid,4,2              ; @inferior_ptid
l_.str.3:                               ; @.str.3
	.asciz	"[%s exited]\n"

	.no_dead_strip	_wait_lwp
.subsections_via_symbols
