	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_create                 ## -- Begin function pthread_create
	.p2align	4, 0x90
_pthread_create:                        ## @pthread_create
	.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	_EAGAIN@GOTPCREL(%rip), %rbx
	movq	_PTE_TRUE@GOTPCREL(%rip), %rax
	testq	%rsi, %rsi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r12
	je	LBB0_1
## %bb.2:
	movq	(%rsi), %r14
	jmp	LBB0_3
LBB0_1:
	xorl	%r14d, %r14d
LBB0_3:
	movl	(%rbx), %ebx
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_pte_new
	movq	%rax, %r13
	testq	%rax, %rax
	je	LBB0_25
## %bb.4:
	movl	(%r13), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	$24, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r15
	movq	%r13, 16(%rax)
	movq	%r12, (%rax)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 8(%r15)
	testq	%r14, %r14
	je	LBB0_13
## %bb.7:
	movq	(%r14), %r12
	movl	20(%r14), %eax
	movl	%eax, 36(%r13)
	movl	16(%r14), %ebx
	xorl	%eax, %eax
	callq	_pte_osThreadGetMaxPriority
	cmpl	%eax, %ebx
	jg	LBB0_9
## %bb.8:
	xorl	%eax, %eax
	callq	_pte_osThreadGetMinPriority
	cmpl	%eax, %ebx
	jge	LBB0_10
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_24
LBB0_5:
	xorl	%r15d, %r15d
LBB0_25:
	testl	%ebx, %ebx
	jne	LBB0_26
	jmp	LBB0_21
LBB0_13:
	movq	_PTHREAD_STACK_MIN@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movl	-48(%rbp), %r14d                ## 4-byte Reload
LBB0_14:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	jne	LBB0_15
## %bb.16:
	movq	_PThreadStateSuspended@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_15:
	movq	_PThreadStateInitial@GOTPCREL(%rip), %rax
LBB0_17:
	movl	(%rax), %eax
	movl	%eax, 32(%r13)
	movq	$0, 24(%r13)
	leaq	16(%r13), %rbx
	movq	%rbx, %rdi
	callq	_pthread_mutex_lock
	testl	%eax, %eax
	jne	LBB0_19
## %bb.18:
	movl	%r14d, (%r13)
	movq	%rbx, %rdi
	callq	_pthread_mutex_unlock
LBB0_19:
	movq	_pte_threadStart@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r13, %rbx
	addq	$8, %rbx
	movq	%r12, %rsi
	movl	%r14d, %edx
	movq	%r15, %rcx
	movq	%rbx, %r8
	callq	_pte_osThreadCreate
	movq	_PTE_OS_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_23
## %bb.20:
	movq	(%rbx), %rdi
	callq	_pte_osThreadStart
	jmp	LBB0_21
LBB0_23:
	movq	$0, (%rbx)
	movq	_EAGAIN@GOTPCREL(%rip), %rax
LBB0_24:
	movl	(%rax), %ebx
	testl	%ebx, %ebx
	je	LBB0_21
LBB0_26:
	movq	%r13, %rdi
	callq	_pte_threadDestroy
	testq	%r15, %r15
	je	LBB0_28
## %bb.27:
	movq	%r15, %rdi
	callq	_free
	jmp	LBB0_28
LBB0_21:
	xorl	%ebx, %ebx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_28
## %bb.22:
	movq	%r13, (%rax)
LBB0_28:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_PTHREAD_INHERIT_SCHED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	8(%r14), %rax
	jne	LBB0_11
## %bb.12:
	xorl	%eax, %eax
	callq	_pthread_self
	movl	(%rax), %r14d
	jmp	LBB0_14
LBB0_11:
	movl	%ebx, %r14d
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_PTE_TRUE,4,2                   ## @PTE_TRUE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PTHREAD_INHERIT_SCHED,8,3      ## @PTHREAD_INHERIT_SCHED
	.comm	_PTHREAD_STACK_MIN,8,3          ## @PTHREAD_STACK_MIN
	.comm	_PThreadStateInitial,4,2        ## @PThreadStateInitial
	.comm	_PThreadStateSuspended,4,2      ## @PThreadStateSuspended
	.comm	_pte_threadStart,4,2            ## @pte_threadStart
	.comm	_PTE_OS_OK,8,3                  ## @PTE_OS_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_create                 ; -- Begin function pthread_create
	.p2align	2
_pthread_create:                        ; @pthread_create
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x24, x3
	mov	x25, x2
	mov	x19, x0
Lloh0:
	adrp	x26, _EAGAIN@GOTPAGE
Lloh1:
	ldr	x26, [x26, _EAGAIN@GOTPAGEOFF]
	ldr	w23, [x26]
Lloh2:
	adrp	x8, _PTE_TRUE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PTE_TRUE@GOTPAGEOFF]
	cbz	x1, LBB0_2
; %bb.1:
	ldr	x28, [x1]
	b	LBB0_3
LBB0_2:
	mov	x28, #0
LBB0_3:
	ldr	w27, [x8]
	bl	_pte_new
	mov	x20, x0
	cbz	x0, LBB0_9
; %bb.4:
	ldr	w22, [x20]
	mov	w0, #24
	bl	_malloc
	mov	x21, x0
	cbz	x0, LBB0_10
; %bb.5:
	stp	x24, x20, [x21, #8]
	str	x25, [x21]
	cbz	x28, LBB0_13
; %bb.6:
	ldr	x23, [x28]
	ldp	w22, w8, [x28, #16]
	str	w8, [x20, #36]
	bl	_pte_osThreadGetMaxPriority
	cmp	w22, w0
	b.gt	LBB0_8
; %bb.7:
	bl	_pte_osThreadGetMinPriority
	cmp	w22, w0
	b.ge	LBB0_22
LBB0_8:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w23, [x8]
	cbnz	w23, LBB0_11
	b	LBB0_19
LBB0_9:
	mov	x21, #0
LBB0_10:
	cbz	w23, LBB0_19
LBB0_11:
	mov	x0, x20
	bl	_pte_threadDestroy
	cbz	x21, LBB0_21
; %bb.12:
	mov	x0, x21
	bl	_free
	b	LBB0_21
LBB0_13:
Lloh7:
	adrp	x8, _PTHREAD_STACK_MIN@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PTHREAD_STACK_MIN@GOTPAGEOFF]
Lloh9:
	ldr	x23, [x8]
LBB0_14:
Lloh10:
	adrp	x8, _PThreadStateInitial@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PThreadStateInitial@GOTPAGEOFF]
Lloh12:
	adrp	x9, _PThreadStateSuspended@GOTPAGE
Lloh13:
	ldr	x9, [x9, _PThreadStateSuspended@GOTPAGEOFF]
	cmp	w27, #0
	csel	x8, x9, x8, eq
	ldr	w8, [x8]
	str	w8, [x20, #32]
	str	xzr, [x20, #24]
	add	x24, x20, #16
	mov	x0, x24
	bl	_pthread_mutex_lock
	cbnz	w0, LBB0_16
; %bb.15:
	str	w22, [x20]
	mov	x0, x24
	bl	_pthread_mutex_unlock
LBB0_16:
Lloh14:
	adrp	x8, _pte_threadStart@GOTPAGE
Lloh15:
	ldr	x8, [x8, _pte_threadStart@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	add	x24, x20, #8
	mov	x1, x23
	mov	x2, x22
	mov	x3, x21
	mov	x4, x24
	bl	_pte_osThreadCreate
Lloh17:
	adrp	x8, _PTE_OS_OK@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PTE_OS_OK@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_18
; %bb.17:
	ldr	x0, [x24]
	bl	_pte_osThreadStart
	b	LBB0_19
LBB0_18:
	str	xzr, [x24]
	ldr	w23, [x26]
	cbnz	w23, LBB0_11
LBB0_19:
	mov	w23, #0
	cbz	x19, LBB0_21
; %bb.20:
	str	x20, [x19]
LBB0_21:
	mov	x0, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_22:
Lloh20:
	adrp	x8, _PTHREAD_INHERIT_SCHED@GOTPAGE
Lloh21:
	ldr	x8, [x8, _PTHREAD_INHERIT_SCHED@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	ldr	x9, [x28, #8]
	cmp	x8, x9
	b.ne	LBB0_14
; %bb.23:
	bl	_pthread_self
	ldr	w22, [x0]
	b	LBB0_14
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_PTE_TRUE,4,2                   ; @PTE_TRUE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PTHREAD_INHERIT_SCHED,8,3      ; @PTHREAD_INHERIT_SCHED
	.comm	_PTHREAD_STACK_MIN,8,3          ; @PTHREAD_STACK_MIN
	.comm	_PThreadStateInitial,4,2        ; @PThreadStateInitial
	.comm	_PThreadStateSuspended,4,2      ; @PThreadStateSuspended
	.comm	_pte_threadStart,4,2            ; @pte_threadStart
	.comm	_PTE_OS_OK,8,3                  ; @PTE_OS_OK
.subsections_via_symbols
