	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_threads_limit
_get_threads_limit:                     ## @get_threads_limit
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -24
	movq	_RESOURCE_LIMIT_THREADS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movq	_CURRENT_KPROCESS_HANDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-12(%rbp), %rdi
	callq	_svcGetResourceLimit
	movl	-12(%rbp), %esi
	leaq	-40(%rbp), %rdi
	leaq	-24(%rbp), %rbx
	movq	%rbx, %rdx
	movl	$1, %ecx
	callq	_svcGetResourceLimitCurrentValues
	movl	-12(%rbp), %esi
	leaq	-32(%rbp), %rdi
	movq	%rbx, %rdx
	movl	$1, %ecx
	callq	_svcGetResourceLimitLimitValues
	movl	-12(%rbp), %edi
	callq	_svcCloseHandle
	movq	-32(%rbp), %rcx
	movq	_MCH2_THREAD_COUNT_MAX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rcx
	cmovlq	%rcx, %rax
	subq	-40(%rbp), %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RESOURCE_LIMIT_THREADS,8,3     ## @RESOURCE_LIMIT_THREADS
	.comm	_CURRENT_KPROCESS_HANDLE,4,2    ## @CURRENT_KPROCESS_HANDLE
	.comm	_MCH2_THREAD_COUNT_MAX,8,3      ## @MCH2_THREAD_COUNT_MAX
	.no_dead_strip	_get_threads_limit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_threads_limit
_get_threads_limit:                     ; @get_threads_limit
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh0:
	adrp	x8, _RESOURCE_LIMIT_THREADS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RESOURCE_LIMIT_THREADS@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp]
Lloh3:
	adrp	x8, _CURRENT_KPROCESS_HANDLE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CURRENT_KPROCESS_HANDLE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	sub	x0, x29, #4
	bl	_svcGetResourceLimit
	ldur	w1, [x29, #-4]
	add	x0, sp, #16
	mov	x2, sp
	mov	w3, #1
	bl	_svcGetResourceLimitCurrentValues
	ldur	w1, [x29, #-4]
	add	x0, sp, #8
	mov	x2, sp
	mov	w3, #1
	bl	_svcGetResourceLimitLimitValues
	ldur	w0, [x29, #-4]
	bl	_svcCloseHandle
	ldr	x8, [sp, #8]
Lloh6:
	adrp	x9, _MCH2_THREAD_COUNT_MAX@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MCH2_THREAD_COUNT_MAX@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	csel	x8, x8, x9, lt
	ldr	x9, [sp, #16]
	sub	x0, x8, x9
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_RESOURCE_LIMIT_THREADS,8,3     ; @RESOURCE_LIMIT_THREADS
	.comm	_CURRENT_KPROCESS_HANDLE,4,2    ; @CURRENT_KPROCESS_HANDLE
	.comm	_MCH2_THREAD_COUNT_MAX,8,3      ; @MCH2_THREAD_COUNT_MAX
	.no_dead_strip	_get_threads_limit
.subsections_via_symbols
