	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pte_osSemaphoreCancellablePend ## -- Begin function pte_osSemaphoreCancellablePend
	.p2align	4, 0x90
_pte_osSemaphoreCancellablePend:        ## @pte_osSemaphoreCancellablePend
	.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
	movq	%rsi, %r15
	movl	%edi, %r14d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	xorl	%eax, %eax
	callq	_sceKernelGetThreadId
	movl	%eax, %edi
	callq	_getThreadData
	movq	%rax, %rbx
	xorl	%eax, %eax
	callq	_clock
	movl	%eax, %r12d
	testq	%r15, %r15
	je	LBB0_2
## %bb.1:
	imull	$1000, (%r15), %eax             ## imm = 0x3E8
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
LBB0_2:
	movq	$0, -56(%rbp)
	leaq	-56(%rbp), %rdx
	movl	%r14d, %edi
	movl	$1, %esi
	callq	_sceKernelWaitSema
	movq	_SCE_KERNEL_ERROR_OK@GOTPCREL(%rip), %r13
	movq	_PTE_OS_OK@GOTPCREL(%rip), %rcx
	cmpl	(%r13), %eax
	jne	LBB0_3
LBB0_6:
	movl	(%rcx), %eax
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	$0, -56(%rbp)
	movl	%r14d, %edi
	movl	$1, %esi
	leaq	-56(%rbp), %rdx
	callq	_sceKernelWaitSema
	cmpl	(%r13), %eax
	je	LBB0_16
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	testq	%r15, %r15
	je	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%eax, %eax
	callq	_clock
	subl	%r12d, %eax
	cmpl	-44(%rbp), %eax                 ## 4-byte Folded Reload
	ja	LBB0_5
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	testq	%rbx, %rbx
	je	LBB0_15
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%rbx), %edi
	leaq	-64(%rbp), %rsi
	callq	_sceKernelReferSemaStatus
	cmpl	(%r13), %eax
	jne	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	cmpq	$0, -64(%rbp)
	jg	LBB0_11
## %bb.14:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	_POLLING_DELAY_IN_us@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_sceKernelDelayThread
	jmp	LBB0_15
LBB0_16:
	movq	_PTE_OS_OK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %eax
	jmp	LBB0_13
LBB0_5:
	movq	_PTE_OS_TIMEOUT@GOTPCREL(%rip), %rcx
	jmp	LBB0_6
LBB0_9:
	movq	_PTE_OS_GENERAL_FAILURE@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_11:
	movq	_PTE_OS_INTERRUPTED@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %eax
LBB0_13:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PTE_OS_OK,4,2                  ## @PTE_OS_OK
	.comm	_SCE_KERNEL_ERROR_OK,4,2        ## @SCE_KERNEL_ERROR_OK
	.comm	_PTE_OS_TIMEOUT,4,2             ## @PTE_OS_TIMEOUT
	.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_osSemaphoreCancellablePend ; -- Begin function pte_osSemaphoreCancellablePend
	.p2align	2
_pte_osSemaphoreCancellablePend:        ; @pte_osSemaphoreCancellablePend
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	mov	x20, x0
	bl	_sceKernelGetThreadId
	bl	_getThreadData
	mov	x21, x0
	bl	_clock
	mov	x22, x0
	cbz	x19, LBB0_2
; %bb.1:
	ldr	w8, [x19]
	mov	w9, #1000
	mul	w23, w8, w9
	b	LBB0_3
LBB0_2:
	mov	w23, #0
LBB0_3:
	str	xzr, [sp, #8]
	add	x2, sp, #8
	mov	x0, x20
	mov	w1, #1
	bl	_sceKernelWaitSema
Lloh0:
	adrp	x24, _SCE_KERNEL_ERROR_OK@GOTPAGE
Lloh1:
	ldr	x24, [x24, _SCE_KERNEL_ERROR_OK@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w0, w8
	b.ne	LBB0_6
; %bb.4:
Lloh2:
	adrp	x25, _PTE_OS_OK@GOTPAGE
Lloh3:
	ldr	x25, [x25, _PTE_OS_OK@GOTPAGEOFF]
LBB0_5:
	ldr	w0, [x25]
	b	LBB0_17
LBB0_6:
Lloh4:
	adrp	x27, _PTE_OS_OK@GOTPAGE
Lloh5:
	ldr	x27, [x27, _PTE_OS_OK@GOTPAGEOFF]
Lloh6:
	adrp	x26, _PTE_OS_GENERAL_FAILURE@GOTPAGE
Lloh7:
	ldr	x26, [x26, _PTE_OS_GENERAL_FAILURE@GOTPAGEOFF]
Lloh8:
	adrp	x28, _POLLING_DELAY_IN_us@GOTPAGE
Lloh9:
	ldr	x28, [x28, _POLLING_DELAY_IN_us@GOTPAGEOFF]
Lloh10:
	adrp	x25, _PTE_OS_TIMEOUT@GOTPAGE
Lloh11:
	ldr	x25, [x25, _PTE_OS_TIMEOUT@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	str	xzr, [sp, #8]
	add	x2, sp, #8
	mov	x0, x20
	mov	w1, #1
	bl	_sceKernelWaitSema
	ldr	w8, [x24]
	cmp	w0, w8
	b.eq	LBB0_14
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	cbz	x19, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	bl	_clock
	sub	w8, w0, w22
	cmp	w8, w23
	b.hi	LBB0_5
LBB0_10:                                ;   in Loop: Header=BB0_8 Depth=1
	cbz	x21, LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w0, [x21]
	mov	x1, sp
	bl	_sceKernelReferSemaStatus
	ldr	w8, [x24]
	cmp	w0, w8
	b.ne	LBB0_16
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [sp]
	cmp	x8, #1
	b.ge	LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w0, [x28]
	bl	_sceKernelDelayThread
	b	LBB0_7
LBB0_14:
	mov	x25, x27
	ldr	w0, [x27]
	b	LBB0_17
LBB0_15:
Lloh12:
	adrp	x26, _PTE_OS_INTERRUPTED@GOTPAGE
Lloh13:
	ldr	x26, [x26, _PTE_OS_INTERRUPTED@GOTPAGEOFF]
LBB0_16:
	ldr	w0, [x26]
LBB0_17:
	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
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_PTE_OS_OK,4,2                  ; @PTE_OS_OK
	.comm	_SCE_KERNEL_ERROR_OK,4,2        ; @SCE_KERNEL_ERROR_OK
	.comm	_PTE_OS_TIMEOUT,4,2             ; @PTE_OS_TIMEOUT
	.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
