	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pte_osThreadWaitForEnd         ## -- Begin function pte_osThreadWaitForEnd
	.p2align	4, 0x90
_pte_osThreadWaitForEnd:                ## @pte_osThreadWaitForEnd
	.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	%edi, %r14d
	xorl	%eax, %eax
	callq	_sceKernelGetThreadId
	movl	%eax, %edi
	callq	_getThreadData
	movq	%rax, %rbx
	leaq	-56(%rbp), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movl	$16, -56(%rbp)
	movl	%r14d, %edi
	movq	%r15, %rsi
	callq	_sceKernelReferThreadRunStatus
	movq	-48(%rbp), %rax
	movq	_PSP_THREAD_STOPPED@GOTPCREL(%rip), %r13
	cmpq	(%r13), %rax
	jne	LBB0_1
LBB0_9:
	movq	_PTE_OS_OK@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	leaq	-56(%rbp), %r15
	movq	_SCE_KERNEL_ERROR_OK@GOTPCREL(%rip), %r12
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movl	$16, -56(%rbp)
	movl	%r14d, %edi
	movq	%r15, %rsi
	callq	_sceKernelReferThreadRunStatus
	movq	-48(%rbp), %rax
	cmpq	(%r13), %rax
	je	LBB0_9
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	testq	%rbx, %rbx
	je	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rbx), %edi
	leaq	-64(%rbp), %rsi
	callq	_sceKernelReferSemaStatus
	cmpq	(%r12), %rax
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpq	$0, -64(%rbp)
	jg	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_POLLING_DELAY_IN_us@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_sceKernelDelayThread
	jmp	LBB0_8
LBB0_4:
	movq	_PTE_OS_GENERAL_FAILURE@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_6:
	movq	_PTE_OS_INTERRUPTED@GOTPCREL(%rip), %rax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_PSP_THREAD_STOPPED,8,3         ## @PSP_THREAD_STOPPED
	.comm	_PTE_OS_OK,4,2                  ## @PTE_OS_OK
	.comm	_SCE_KERNEL_ERROR_OK,8,3        ## @SCE_KERNEL_ERROR_OK
	.comm	_PTE_OS_INTERRUPTED,4,2         ## @PTE_OS_INTERRUPTED
	.comm	_POLLING_DELAY_IN_us,4,2        ## @POLLING_DELAY_IN_us
	.comm	_PTE_OS_GENERAL_FAILURE,4,2     ## @PTE_OS_GENERAL_FAILURE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pte_osThreadWaitForEnd         ; -- Begin function pte_osThreadWaitForEnd
	.p2align	2
_pte_osThreadWaitForEnd:                ; @pte_osThreadWaitForEnd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x19, x0
	bl	_sceKernelGetThreadId
	bl	_getThreadData
	mov	x20, x0
	mov	w21, #16
	add	x0, sp, #16
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	str	w21, [sp, #16]
	add	x1, sp, #16
	mov	x0, x19
	bl	_sceKernelReferThreadRunStatus
	ldr	x8, [sp, #24]
Lloh0:
	adrp	x22, _PSP_THREAD_STOPPED@GOTPAGE
Lloh1:
	ldr	x22, [x22, _PSP_THREAD_STOPPED@GOTPAGEOFF]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_2
LBB0_1:
Lloh2:
	adrp	x8, _PTE_OS_OK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PTE_OS_OK@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	b	LBB0_10
LBB0_2:
Lloh5:
	adrp	x25, _SCE_KERNEL_ERROR_OK@GOTPAGE
Lloh6:
	ldr	x25, [x25, _SCE_KERNEL_ERROR_OK@GOTPAGEOFF]
Lloh7:
	adrp	x23, _PTE_OS_GENERAL_FAILURE@GOTPAGE
Lloh8:
	ldr	x23, [x23, _PTE_OS_GENERAL_FAILURE@GOTPAGEOFF]
Lloh9:
	adrp	x24, _PTE_OS_INTERRUPTED@GOTPAGE
Lloh10:
	ldr	x24, [x24, _PTE_OS_INTERRUPTED@GOTPAGEOFF]
Lloh11:
	adrp	x26, _POLLING_DELAY_IN_us@GOTPAGE
Lloh12:
	ldr	x26, [x26, _POLLING_DELAY_IN_us@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x0, sp, #16
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	str	w21, [sp, #16]
	add	x1, sp, #16
	mov	x0, x19
	bl	_sceKernelReferThreadRunStatus
	ldr	x8, [sp, #24]
	ldr	x9, [x22]
	cmp	x8, x9
	b.eq	LBB0_1
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	cbz	x20, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x20]
	add	x1, sp, #8
	bl	_sceKernelReferSemaStatus
	ldr	x8, [x25]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [sp, #8]
	cmp	x8, #1
	b.ge	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x26]
	bl	_sceKernelDelayThread
	b	LBB0_3
LBB0_8:
	mov	x23, x24
LBB0_9:
	ldr	w0, [x23]
LBB0_10:
	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
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_PSP_THREAD_STOPPED,8,3         ; @PSP_THREAD_STOPPED
	.comm	_PTE_OS_OK,4,2                  ; @PTE_OS_OK
	.comm	_SCE_KERNEL_ERROR_OK,8,3        ; @SCE_KERNEL_ERROR_OK
	.comm	_PTE_OS_INTERRUPTED,4,2         ; @PTE_OS_INTERRUPTED
	.comm	_POLLING_DELAY_IN_us,4,2        ; @POLLING_DELAY_IN_us
	.comm	_PTE_OS_GENERAL_FAILURE,4,2     ; @PTE_OS_GENERAL_FAILURE
.subsections_via_symbols
