	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function procstat_getrlimit_core
_procstat_getrlimit_core:               ## @procstat_getrlimit_core
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%esi, %esi
	js	LBB0_2
## %bb.1:
	movl	%esi, %ebx
	movq	_RLIM_NLIMITS@GOTPCREL(%rip), %r12
	cmpl	%esi, (%r12)
	jle	LBB0_2
## %bb.3:
	movq	%rdx, %r14
	movq	_PSC_TYPE_RLIMIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %rcx
	xorl	%edx, %edx
	callq	_procstat_core_get
	movl	$-1, %r15d
	testq	%rax, %rax
	je	LBB0_7
## %bb.4:
	movslq	(%r12), %rcx
	shlq	$2, %rcx
	cmpq	%rcx, -40(%rbp)
	jae	LBB0_6
## %bb.5:
	movq	%rax, %rdi
	callq	_free
	jmp	LBB0_7
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	leaq	L_.str(%rip), %rdi
	callq	_warn
	movl	$-1, %r15d
	jmp	LBB0_7
LBB0_6:
	movl	%ebx, %ecx
	movl	(%rax,%rcx,4), %ecx
	movl	%ecx, (%r14)
	movq	%rax, %rdi
	callq	_free
	xorl	%r15d, %r15d
LBB0_7:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RLIM_NLIMITS,4,2               ## @RLIM_NLIMITS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_errno,4,2                      ## @errno
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"getrlimit: which"

	.comm	_PSC_TYPE_RLIMIT,4,2            ## @PSC_TYPE_RLIMIT
	.no_dead_strip	_procstat_getrlimit_core
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function procstat_getrlimit_core
_procstat_getrlimit_core:               ; @procstat_getrlimit_core
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	tbnz	w1, #31, LBB0_5
; %bb.1:
	mov	x20, x1
Lloh0:
	adrp	x21, _RLIM_NLIMITS@GOTPAGE
Lloh1:
	ldr	x21, [x21, _RLIM_NLIMITS@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, w1
	b.le	LBB0_5
; %bb.2:
	mov	x19, x2
Lloh2:
	adrp	x8, _PSC_TYPE_RLIMIT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PSC_TYPE_RLIMIT@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	add	x3, sp, #8
	mov	x2, #0
	bl	_procstat_core_get
	cbz	x0, LBB0_6
; %bb.3:
	ldr	x8, [sp, #8]
	ldrsw	x9, [x21]
	cmp	x8, x9, lsl #2
	b.hs	LBB0_7
; %bb.4:
	bl	_free
	mov	w0, #-1
	b	LBB0_8
LBB0_5:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _errno@GOTPAGE
Lloh9:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh10:
	str	w8, [x9]
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_warn
LBB0_6:
	mov	w0, #-1
	b	LBB0_8
LBB0_7:
	ldr	w8, [x0, w20, uxtw #2]
	str	w8, [x19]
	bl	_free
	mov	w0, #0
LBB0_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotStr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_RLIM_NLIMITS,4,2               ; @RLIM_NLIMITS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_errno,4,2                      ; @errno
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"getrlimit: which"

	.comm	_PSC_TYPE_RLIMIT,4,2            ; @PSC_TYPE_RLIMIT
	.no_dead_strip	_procstat_getrlimit_core
.subsections_via_symbols
