	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function thread_to_lwp
_thread_to_lwp:                         ## @thread_to_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	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movl	%edi, %ebx
	callq	_is_lwp
	testq	%rax, %rax
	jne	LBB0_8
## %bb.1:
	movq	_main_ta@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	%ebx, %edi
	callq	_GET_THREAD
	leaq	-36(%rbp), %rdx
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_p_td_ta_map_id2thr
	movq	_TD_NOTHR@GOTPCREL(%rip), %r15
	cmpq	(%r15), %rax
	je	LBB0_5
## %bb.2:
	movq	_TD_OK@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	je	LBB0_4
## %bb.3:
	movq	%rax, %rdi
	callq	_td_err_string
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_error
LBB0_4:
	leaq	-36(%rbp), %rdi
	leaq	-56(%rbp), %rsi
	callq	_p_td_thr_get_info
	cmpq	(%r15), %rax
	jne	LBB0_9
LBB0_5:
	movl	$-1, %edi
LBB0_6:
	callq	_pid_to_ptid
LBB0_7:
	movl	%eax, %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	cmpq	(%r12), %rax
	je	LBB0_11
## %bb.10:
	movq	%rax, %rdi
	callq	_td_err_string
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_error
LBB0_11:
	movq	-56(%rbp), %rdi
	movq	_TD_THR_ACTIVE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	je	LBB0_15
## %bb.12:
	cmpl	$-1, %r14d
	je	LBB0_14
## %bb.13:
	movl	%r14d, %edi
	jmp	LBB0_6
LBB0_14:
	callq	_td_state_string
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	callq	_error
LBB0_15:
	movl	-48(%rbp), %r14d
	movl	%ebx, %edi
	callq	_PIDGET
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_BUILD_LWP
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_main_ta,4,2                    ## @main_ta
	.comm	_TD_NOTHR,8,3                   ## @TD_NOTHR
	.comm	_TD_OK,8,3                      ## @TD_OK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"thread_to_lwp: td_ta_map_id2thr %s"

L_.str.1:                               ## @.str.1
	.asciz	"thread_to_lwp: td_thr_get_info: %s"

	.comm	_TD_THR_ACTIVE,8,3              ## @TD_THR_ACTIVE
L_.str.2:                               ## @.str.2
	.asciz	"thread_to_lwp: thread state not active: %s"

	.no_dead_strip	_thread_to_lwp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function thread_to_lwp
_thread_to_lwp:                         ; @thread_to_lwp
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x20, x1
	mov	x19, x0
	bl	_is_lwp
	cbnz	x0, LBB0_8
; %bb.1:
Lloh0:
	adrp	x8, _main_ta@GOTPAGE
Lloh1:
	ldr	x8, [x8, _main_ta@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	mov	x0, x19
	bl	_GET_THREAD
	mov	x1, x0
	add	x2, sp, #12
	mov	x0, x21
	bl	_p_td_ta_map_id2thr
Lloh3:
	adrp	x21, _TD_NOTHR@GOTPAGE
Lloh4:
	ldr	x21, [x21, _TD_NOTHR@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x0, x8
	b.eq	LBB0_5
; %bb.2:
Lloh5:
	adrp	x22, _TD_OK@GOTPAGE
Lloh6:
	ldr	x22, [x22, _TD_OK@GOTPAGEOFF]
	ldr	x8, [x22]
	cmp	x0, x8
	b.eq	LBB0_4
; %bb.3:
	bl	_td_err_string
	mov	x1, x0
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_error
LBB0_4:
	add	x0, sp, #12
	add	x1, sp, #16
	bl	_p_td_thr_get_info
	ldr	x8, [x21]
	cmp	x0, x8
	b.ne	LBB0_9
LBB0_5:
	mov	w0, #-1
LBB0_6:
	bl	_pid_to_ptid
LBB0_7:
	mov	x19, x0
LBB0_8:
	mov	x0, x19
	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
	add	sp, sp, #80
	ret
LBB0_9:
	ldr	x8, [x22]
	cmp	x0, x8
	b.eq	LBB0_11
; %bb.10:
	bl	_td_err_string
	mov	x1, x0
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_error
LBB0_11:
	ldr	x0, [sp, #16]
Lloh11:
	adrp	x8, _TD_THR_ACTIVE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _TD_THR_ACTIVE@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_15
; %bb.12:
	cmn	w20, #1
	b.eq	LBB0_14
; %bb.13:
	mov	x0, x20
	b	LBB0_6
LBB0_14:
	bl	_td_state_string
	mov	x1, x0
Lloh14:
	adrp	x0, l_.str.2@PAGE
Lloh15:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_error
LBB0_15:
	ldr	w20, [sp, #24]
	mov	x0, x19
	bl	_PIDGET
	mov	x1, x0
	mov	x0, x20
	bl	_BUILD_LWP
	b	LBB0_7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_main_ta,4,2                    ; @main_ta
	.comm	_TD_NOTHR,8,3                   ; @TD_NOTHR
	.comm	_TD_OK,8,3                      ; @TD_OK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"thread_to_lwp: td_ta_map_id2thr %s"

l_.str.1:                               ; @.str.1
	.asciz	"thread_to_lwp: td_thr_get_info: %s"

	.comm	_TD_THR_ACTIVE,8,3              ; @TD_THR_ACTIVE
l_.str.2:                               ; @.str.2
	.asciz	"thread_to_lwp: thread state not active: %s"

	.no_dead_strip	_thread_to_lwp
.subsections_via_symbols
