	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function procstat_getkstack_sysctl
_procstat_getkstack_sysctl:             ## @procstat_getkstack_sysctl
	.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	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	_CTL_KERN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	movq	_KERN_PROC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)
	movq	_KERN_PROC_KSTACK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movl	%r15d, -52(%rbp)
	movq	$0, -72(%rbp)
	leaq	-64(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_nitems
	leaq	-72(%rbp), %rcx
	movq	%rbx, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_sysctl
	testl	%eax, %eax
	js	LBB0_4
LBB0_1:
	movq	-72(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.2:
	movq	%rax, %r12
	leaq	-64(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_nitems
	leaq	-72(%rbp), %rcx
	movq	%rbx, %rdi
	movl	%eax, %esi
	movq	%r12, %rdx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_sysctl
	cmpl	$-1, %eax
	je	LBB0_13
## %bb.3:
	movq	-72(%rbp), %rax
	shrq	$2, %rax
	movl	%eax, (%r14)
	jmp	LBB0_15
LBB0_4:
	movq	_errno@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_ESRCH@GOTPCREL(%rip), %rsi
	movq	_ENOENT@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	cmpq	(%rsi), %rcx
	je	LBB0_10
## %bb.5:
	movq	_EPERM@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rcx
	je	LBB0_10
## %bb.6:
	cmpq	%rdx, %rcx
	je	LBB0_10
## %bb.7:
	leaq	L_.str(%rip), %rdi
	movq	%r15, %rsi
	jmp	LBB0_9
LBB0_8:
	leaq	L_.str.2(%rip), %rdi
	movq	%rbx, %rsi
LBB0_9:
	callq	_warn
	jmp	LBB0_14
LBB0_10:
	cmpl	$-1, %eax
	jne	LBB0_1
## %bb.11:
	cmpq	%rdx, %rcx
	jne	LBB0_14
## %bb.12:
	leaq	L_.str.1(%rip), %rdi
	callq	_warnx
	jmp	LBB0_14
LBB0_13:
	leaq	L_.str.3(%rip), %rdi
	movq	%r15, %rsi
	callq	_warn
	movq	%r12, %rdi
	callq	_free
LBB0_14:
	xorl	%r12d, %r12d
LBB0_15:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_18
## %bb.16:
	movq	%r12, %rax
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_CTL_KERN,4,2                   ## @CTL_KERN
	.comm	_KERN_PROC,4,2                  ## @KERN_PROC
	.comm	_KERN_PROC_KSTACK,4,2           ## @KERN_PROC_KSTACK
	.comm	_errno,8,3                      ## @errno
	.comm	_ESRCH,8,3                      ## @ESRCH
	.comm	_EPERM,8,3                      ## @EPERM
	.comm	_ENOENT,8,3                     ## @ENOENT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sysctl: kern.proc.kstack: %d"

L_.str.1:                               ## @.str.1
	.asciz	"sysctl: kern.proc.kstack unavailable (options DDB or options STACK required in kernel)"

L_.str.2:                               ## @.str.2
	.asciz	"malloc(%zu)"

L_.str.3:                               ## @.str.3
	.asciz	"sysctl: kern.proc.pid: %d"

	.no_dead_strip	_procstat_getkstack_sysctl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function procstat_getkstack_sysctl
_procstat_getkstack_sysctl:             ; @procstat_getkstack_sysctl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
Lloh3:
	adrp	x8, _CTL_KERN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CTL_KERN@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _KERN_PROC@GOTPAGE
Lloh7:
	ldr	x9, [x9, _KERN_PROC@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	stp	w8, w9, [sp, #8]
Lloh9:
	adrp	x8, _KERN_PROC_KSTACK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _KERN_PROC_KSTACK@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	stp	w8, w19, [sp, #16]
	str	xzr, [sp]
	add	x0, sp, #8
	bl	_nitems
	mov	x1, x0
	add	x0, sp, #8
	mov	x3, sp
	mov	x2, #0
	mov	x4, #0
	mov	w5, #0
	bl	_sysctl
	tbnz	w0, #31, LBB0_4
LBB0_1:
	ldr	x22, [sp]
	mov	x0, x22
	bl	_malloc
	mov	x21, x0
	cbz	x0, LBB0_8
; %bb.2:
	add	x0, sp, #8
	bl	_nitems
	mov	x1, x0
	add	x0, sp, #8
	mov	x3, sp
	mov	x2, x21
	mov	x4, #0
	mov	w5, #0
	bl	_sysctl
	cmn	w0, #1
	b.eq	LBB0_10
; %bb.3:
	ldr	x8, [sp]
	lsr	x8, x8, #2
	str	w8, [x20]
	b	LBB0_12
LBB0_4:
Lloh12:
	adrp	x8, _errno@GOTPAGE
Lloh13:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
Lloh15:
	adrp	x9, _ESRCH@GOTPAGE
Lloh16:
	ldr	x9, [x9, _ESRCH@GOTPAGEOFF]
Lloh17:
	ldr	x10, [x9]
Lloh18:
	adrp	x9, _EPERM@GOTPAGE
Lloh19:
	ldr	x9, [x9, _EPERM@GOTPAGEOFF]
Lloh20:
	ldr	x11, [x9]
Lloh21:
	adrp	x9, _ENOENT@GOTPAGE
Lloh22:
	ldr	x9, [x9, _ENOENT@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x8, x10
	ccmp	x8, x11, #4, ne
	ccmp	x8, x9, #4, ne
	b.ne	LBB0_9
; %bb.5:
	cmn	w0, #1
	b.ne	LBB0_1
; %bb.6:
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.7:
Lloh24:
	adrp	x0, l_.str.1@PAGE
Lloh25:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_warnx
	b	LBB0_11
LBB0_8:
Lloh26:
	adrp	x0, l_.str.2@PAGE
Lloh27:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x22
	bl	_warn
	b	LBB0_12
LBB0_9:
Lloh28:
	adrp	x0, l_.str@PAGE
Lloh29:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_warn
	b	LBB0_11
LBB0_10:
Lloh30:
	adrp	x0, l_.str.3@PAGE
Lloh31:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x19
	bl	_warn
	mov	x0, x21
	bl	_free
LBB0_11:
	mov	x21, #0
LBB0_12:
	ldr	x8, [sp, #24]
Lloh32:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh33:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh34:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.13:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_CTL_KERN,4,2                   ; @CTL_KERN
	.comm	_KERN_PROC,4,2                  ; @KERN_PROC
	.comm	_KERN_PROC_KSTACK,4,2           ; @KERN_PROC_KSTACK
	.comm	_errno,8,3                      ; @errno
	.comm	_ESRCH,8,3                      ; @ESRCH
	.comm	_EPERM,8,3                      ; @EPERM
	.comm	_ENOENT,8,3                     ; @ENOENT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sysctl: kern.proc.kstack: %d"

l_.str.1:                               ; @.str.1
	.asciz	"sysctl: kern.proc.kstack unavailable (options DDB or options STACK required in kernel)"

l_.str.2:                               ; @.str.2
	.asciz	"malloc(%zu)"

l_.str.3:                               ; @.str.3
	.asciz	"sysctl: kern.proc.pid: %d"

	.no_dead_strip	_procstat_getkstack_sysctl
.subsections_via_symbols
