	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pte_osSemaphoreCreate          ## -- Begin function pte_osSemaphoreCreate
	.p2align	4, 0x90
_pte_osSemaphoreCreate:                 ## @pte_osSemaphoreCreate
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movl	%edi, %r15d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movl	_pte_osSemaphoreCreate.semCtr(%rip), %eax
	movq	_MAX_PSP_UID@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpl	(%rcx), %eax
	leal	1(%rax), %ecx
	cmovgl	%edx, %ecx
	movl	%ecx, _pte_osSemaphoreCreate.semCtr(%rip)
	leaq	L_.str(%rip), %rdx
	leaq	-64(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$32, %esi
	callq	_snprintf
	movq	_SEM_VALUE_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	%r15d, %edx
	xorl	%r8d, %r8d
	callq	_sceKernelCreateSema
	movl	%eax, (%r14)
	movq	_PTE_OS_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-32(%rbp), %rcx
	jne	LBB0_2
## %bb.1:
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_pte_osSemaphoreCreate.semCtr,4,2 ## @pte_osSemaphoreCreate.semCtr
	.comm	_MAX_PSP_UID,4,2                ## @MAX_PSP_UID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pthread_sem%d"

	.comm	_SEM_VALUE_MAX,4,2              ## @SEM_VALUE_MAX
	.comm	_PTE_OS_OK,4,2                  ## @PTE_OS_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pte_osSemaphoreCreate          ; -- Begin function pte_osSemaphoreCreate
	.p2align	2
_pte_osSemaphoreCreate:                 ; @pte_osSemaphoreCreate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
	adrp	x8, _pte_osSemaphoreCreate.semCtr@PAGE
	ldr	w9, [x8, _pte_osSemaphoreCreate.semCtr@PAGEOFF]
Lloh3:
	adrp	x10, _MAX_PSP_UID@GOTPAGE
Lloh4:
	ldr	x10, [x10, _MAX_PSP_UID@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	cmp	w9, w10
	csinc	w3, wzr, w9, gt
	str	w3, [x8, _pte_osSemaphoreCreate.semCtr@PAGEOFF]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	add	x0, sp, #8
	mov	w1, #32
	bl	_snprintf
Lloh8:
	adrp	x8, _SEM_VALUE_MAX@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SEM_VALUE_MAX@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
	add	x0, sp, #8
	mov	w1, #0
	mov	x2, x20
	mov	w4, #0
	bl	_sceKernelCreateSema
	str	w0, [x19]
Lloh11:
	adrp	x8, _PTE_OS_OK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PTE_OS_OK@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	ldur	x8, [x29, #-24]
Lloh14:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh15:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_2
; %bb.1:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_2:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_pte_osSemaphoreCreate.semCtr,4,2 ; @pte_osSemaphoreCreate.semCtr
	.comm	_MAX_PSP_UID,4,2                ; @MAX_PSP_UID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pthread_sem%d"

	.comm	_SEM_VALUE_MAX,4,2              ; @SEM_VALUE_MAX
	.comm	_PTE_OS_OK,4,2                  ; @PTE_OS_OK
.subsections_via_symbols
