	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pte_osThreadCreate             ## -- Begin function pte_osThreadCreate
	.p2align	4, 0x90
_pte_osThreadCreate:                    ## @pte_osThreadCreate
	.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	$152, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r13
	movq	%rcx, %r14
	movl	%edx, -180(%rbp)                ## 4-byte Spill
	movl	%esi, %ebx
	movl	%edi, %r12d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	_pte_osThreadCreate.threadNum(%rip), %eax
	leal	1(%rax), %ecx
	movq	_MAX_PSP_UID@GOTPCREL(%rip), %rdx
	xorl	%esi, %esi
	cmpl	(%rdx), %eax
	cmovgl	%esi, %ecx
	movl	%ecx, _pte_osThreadCreate.threadNum(%rip)
	movq	_DEFAULT_STACK_SIZE_BYTES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%ebx, %eax
	cmovgl	%eax, %ebx
	xorl	%eax, %eax
	callq	_pteTlsThreadInit
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r15
	movq	%r13, -192(%rbp)                ## 8-byte Spill
	movl	$24, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %r13
	movq	_threadDataKey@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movq	%r13, %rdx
	callq	_pteTlsSetValue
	movl	%r12d, 16(%r13)
	movq	%r14, 8(%r13)
	movl	_pte_osThreadCreate.threadNum(%rip), %ecx
	leaq	L_.str.2(%rip), %rdx
	leaq	-176(%rbp), %r14
	movq	%r14, %rdi
	movl	$64, %esi
	xorl	%eax, %eax
	callq	_snprintf
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	$255, %ecx
	xorl	%r8d, %r8d
	callq	_sceKernelCreateSema
	movl	%eax, (%r13)
	movl	_pte_osThreadCreate.threadNum(%rip), %ecx
	leaq	L_.str.3(%rip), %rdx
	leaq	-112(%rbp), %r14
	movq	%r14, %rdi
	movl	$64, %esi
	movl	%r15d, %r8d
	xorl	%eax, %eax
	callq	_snprintf
	movq	_pspStubThreadEntry@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	-180(%rbp), %edx                ## 4-byte Reload
	movl	%ebx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_sceKernelCreateThread
	movq	_SCE_KERNEL_ERROR_NO_MEMORY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.6:
	movq	%r13, %rdi
	callq	_free
	movq	%r15, %rdi
	callq	_pteTlsThreadDestroy
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_2
LBB0_1:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_2
LBB0_4:
	movq	%r15, %rdi
	callq	_pteTlsThreadDestroy
	leaq	L_.str.1(%rip), %rdi
LBB0_2:
	callq	_PSP_DEBUG
	movq	_PTE_OS_NO_RESOURCES@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %eax
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_12
## %bb.11:
	addq	$152, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	testq	%rax, %rax
	js	LBB0_8
## %bb.9:
	movq	-192(%rbp), %rcx                ## 8-byte Reload
	movq	%rax, (%rcx)
	movq	_PTE_OS_OK@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_8:
	movq	%r13, %rdi
	callq	_free
	movq	%r15, %rdi
	callq	_pteTlsThreadDestroy
	leaq	L_.str.5(%rip), %rdi
	callq	_PSP_DEBUG
	movq	_PTE_OS_GENERAL_FAILURE@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__DATA,__data
	.p2align	2                               ## @pte_osThreadCreate.threadNum
_pte_osThreadCreate.threadNum:
	.long	1                               ## 0x1

	.comm	_MAX_PSP_UID,4,2                ## @MAX_PSP_UID
	.comm	_DEFAULT_STACK_SIZE_BYTES,4,2   ## @DEFAULT_STACK_SIZE_BYTES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pteTlsThreadInit: PTE_OS_NO_RESOURCES\n"

	.comm	_PTE_OS_NO_RESOURCES,4,2        ## @PTE_OS_NO_RESOURCES
L_.str.1:                               ## @.str.1
	.asciz	"malloc(pspThreadData): PTE_OS_NO_RESOURCES\n"

	.comm	_threadDataKey,4,2              ## @threadDataKey
L_.str.2:                               ## @.str.2
	.asciz	"pthread_cancelSem%04d"

L_.str.3:                               ## @.str.3
	.asciz	"pthread%04d__%x"

	.comm	_pspStubThreadEntry,4,2         ## @pspStubThreadEntry
	.comm	_SCE_KERNEL_ERROR_NO_MEMORY,8,3 ## @SCE_KERNEL_ERROR_NO_MEMORY
L_.str.4:                               ## @.str.4
	.asciz	"sceKernelCreateThread: PTE_OS_NO_RESOURCES\n"

L_.str.5:                               ## @.str.5
	.asciz	"sceKernelCreateThread: PTE_OS_GENERAL_FAILURE\n"

	.comm	_PTE_OS_GENERAL_FAILURE,4,2     ## @PTE_OS_GENERAL_FAILURE
	.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_osThreadCreate             ; -- Begin function pte_osThreadCreate
	.p2align	2
_pte_osThreadCreate:                    ; @pte_osThreadCreate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #224
	.cfi_def_cfa_offset 224
	stp	x26, x25, [sp, #144]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #160]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #176]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #192]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #208]            ; 16-byte Folded Spill
	add	x29, sp, #208
	.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, x4
	mov	x24, x3
	mov	x21, x2
	mov	x25, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	adrp	x26, _pte_osThreadCreate.threadNum@PAGE
	ldr	w8, [x26, _pte_osThreadCreate.threadNum@PAGEOFF]
Lloh3:
	adrp	x9, _MAX_PSP_UID@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MAX_PSP_UID@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	csinc	w8, wzr, w8, gt
	str	w8, [x26, _pte_osThreadCreate.threadNum@PAGEOFF]
Lloh6:
	adrp	x8, _DEFAULT_STACK_SIZE_BYTES@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DEFAULT_STACK_SIZE_BYTES@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w1
	csel	w23, w8, w1, gt
	bl	_pteTlsThreadInit
	cbz	x0, LBB0_4
; %bb.1:
	mov	x20, x0
	mov	w0, #24
	bl	_malloc
	cbz	x0, LBB0_5
; %bb.2:
	mov	x22, x0
Lloh9:
	adrp	x8, _threadDataKey@GOTPAGE
Lloh10:
	ldr	x8, [x8, _threadDataKey@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x22
	bl	_pteTlsSetValue
	str	w25, [x22, #16]
	str	x24, [x22, #8]
	ldr	w3, [x26, _pte_osThreadCreate.threadNum@PAGEOFF]
Lloh12:
	adrp	x2, l_.str.2@PAGE
Lloh13:
	add	x2, x2, l_.str.2@PAGEOFF
	add	x0, sp, #8
	mov	w1, #64
	bl	_snprintf
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #0
	mov	w3, #255
	mov	w4, #0
	bl	_sceKernelCreateSema
	str	w0, [x22]
	ldr	w3, [x26, _pte_osThreadCreate.threadNum@PAGEOFF]
	str	x20, [sp]
Lloh14:
	adrp	x2, l_.str.3@PAGE
Lloh15:
	add	x2, x2, l_.str.3@PAGEOFF
	add	x0, sp, #72
	mov	w1, #64
	bl	_snprintf
Lloh16:
	adrp	x8, _pspStubThreadEntry@GOTPAGE
Lloh17:
	ldr	x8, [x8, _pspStubThreadEntry@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	add	x0, sp, #72
	mov	x2, x21
	mov	x3, x23
	mov	w4, #0
	mov	x5, #0
	bl	_sceKernelCreateThread
Lloh19:
	adrp	x8, _SCE_KERNEL_ERROR_NO_MEMORY@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SCE_KERNEL_ERROR_NO_MEMORY@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.3:
	mov	x0, x22
	bl	_free
	mov	x0, x20
	bl	_pteTlsThreadDestroy
Lloh22:
	adrp	x0, l_.str.4@PAGE
Lloh23:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_6
LBB0_4:
Lloh24:
	adrp	x0, l_.str@PAGE
Lloh25:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_6
LBB0_5:
	mov	x0, x20
	bl	_pteTlsThreadDestroy
Lloh26:
	adrp	x0, l_.str.1@PAGE
Lloh27:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_6:
	bl	_PSP_DEBUG
Lloh28:
	adrp	x8, _PTE_OS_NO_RESOURCES@GOTPAGE
Lloh29:
	ldr	x8, [x8, _PTE_OS_NO_RESOURCES@GOTPAGEOFF]
LBB0_7:
	ldr	w0, [x8]
	ldur	x8, [x29, #-72]
Lloh30:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh31:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.8:
	ldp	x29, x30, [sp, #208]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #192]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #176]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #160]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #144]            ; 16-byte Folded Reload
	add	sp, sp, #224
	ret
LBB0_9:
	tbnz	x0, #63, LBB0_11
; %bb.10:
	str	x0, [x19]
Lloh33:
	adrp	x8, _PTE_OS_OK@GOTPAGE
Lloh34:
	ldr	x8, [x8, _PTE_OS_OK@GOTPAGEOFF]
	b	LBB0_7
LBB0_11:
	mov	x0, x22
	bl	_free
	mov	x0, x20
	bl	_pteTlsThreadDestroy
Lloh35:
	adrp	x0, l_.str.5@PAGE
Lloh36:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_PSP_DEBUG
Lloh37:
	adrp	x8, _PTE_OS_GENERAL_FAILURE@GOTPAGE
Lloh38:
	ldr	x8, [x8, _PTE_OS_GENERAL_FAILURE@GOTPAGEOFF]
	b	LBB0_7
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpAdd	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.section	__DATA,__data
	.p2align	2                               ; @pte_osThreadCreate.threadNum
_pte_osThreadCreate.threadNum:
	.long	1                               ; 0x1

	.comm	_MAX_PSP_UID,4,2                ; @MAX_PSP_UID
	.comm	_DEFAULT_STACK_SIZE_BYTES,4,2   ; @DEFAULT_STACK_SIZE_BYTES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pteTlsThreadInit: PTE_OS_NO_RESOURCES\n"

	.comm	_PTE_OS_NO_RESOURCES,4,2        ; @PTE_OS_NO_RESOURCES
l_.str.1:                               ; @.str.1
	.asciz	"malloc(pspThreadData): PTE_OS_NO_RESOURCES\n"

	.comm	_threadDataKey,4,2              ; @threadDataKey
l_.str.2:                               ; @.str.2
	.asciz	"pthread_cancelSem%04d"

l_.str.3:                               ; @.str.3
	.asciz	"pthread%04d__%x"

	.comm	_pspStubThreadEntry,4,2         ; @pspStubThreadEntry
	.comm	_SCE_KERNEL_ERROR_NO_MEMORY,8,3 ; @SCE_KERNEL_ERROR_NO_MEMORY
l_.str.4:                               ; @.str.4
	.asciz	"sceKernelCreateThread: PTE_OS_NO_RESOURCES\n"

l_.str.5:                               ; @.str.5
	.asciz	"sceKernelCreateThread: PTE_OS_GENERAL_FAILURE\n"

	.comm	_PTE_OS_GENERAL_FAILURE,4,2     ; @PTE_OS_GENERAL_FAILURE
	.comm	_PTE_OS_OK,4,2                  ; @PTE_OS_OK
.subsections_via_symbols
