	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function proc_stats_rid_open
_proc_stats_rid_open:                   ## @proc_stats_rid_open
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movq	%rsi, %r15
	callq	_PDE_DATA
	movq	(%rax), %r13
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movl	$16, %edi
	callq	_kzalloc
	movq	%rax, (%r15)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movl	(%r14), %esi
	movl	$4096, %edi                     ## imm = 0x1000
	callq	_kmalloc
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	leaq	-72(%rbp), %rsi
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	movl	%r12d, %edx
	movl	$1, %ecx
	callq	_readStatsRid
	movl	-72(%rbp), %edi
	callq	_le16_to_cpu
	movl	%eax, %r13d
	movq	_statsLabels@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	(%rcx), %rdi
	testl	%r13d, %r13d
	setg	%al
	xorl	%ebx, %ebx
	cmpq	$-1, %rdi
	je	LBB0_13
## %bb.5:
	testl	%r13d, %r13d
	jle	LBB0_13
## %bb.6:
	xorl	%ebx, %ebx
	movl	$4, %r15d
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	callq	_strlen
	addl	%ebx, %eax
	cmpl	$4080, %eax                     ## imm = 0xFF0
	jg	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movslq	%ebx, %r12
	shlq	$2, %r12
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addq	8(%rax), %r12
	movq	_statsLabels@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-8(%rax,%r15,2), %r14
	callq	_le32_to_cpu
	movq	%r12, %rdi
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdx
	movl	%eax, %ecx
	callq	_sprintf
	addl	%ebx, %eax
	movq	_statsLabels@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%eax, %ebx
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	(%rcx,%r15,2), %rdi
	cmpl	%r13d, %r15d
	setl	%al
	cmpq	$-1, %rdi
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%r15, %rdx
	addq	$4, %rdx
	cmpl	%r13d, %r15d
	movq	%rdx, %r15
	jl	LBB0_7
LBB0_13:
	testb	%al, %al
	je	LBB0_15
## %bb.14:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_17
LBB0_3:
	movq	(%r15), %rdi
	callq	_kfree
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_18
LBB0_15:
	leaq	L_.str.2(%rip), %rsi
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_16
LBB0_9:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	leaq	L_.str(%rip), %rsi
LBB0_16:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_airo_print_warn
LBB0_17:
	movl	%ebx, (%r14)
	xorl	%eax, %eax
LBB0_18:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_statsLabels,8,3                ## @statsLabels
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Potentially disastrous buffer overflow averted!"

L_.str.1:                               ## @.str.1
	.asciz	"%s: %u\n"

L_.str.2:                               ## @.str.2
	.asciz	"Got a short rid"

	.no_dead_strip	_proc_stats_rid_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function proc_stats_rid_open
_proc_stats_rid_open:                   ; @proc_stats_rid_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x21, x2
	mov	x22, x1
	bl	_PDE_DATA
	ldr	x20, [x0]
Lloh0:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	w0, #16
	bl	_kzalloc
	str	x0, [x22]
	cbz	x0, LBB0_7
; %bb.1:
	mov	x19, x0
	ldr	w1, [x23]
	mov	w0, #4096
	bl	_kmalloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_6
; %bb.2:
	mov	x1, sp
	mov	x0, x20
	mov	x2, x21
	mov	w3, #1
	bl	_readStatsRid
	ldr	w0, [sp]
	bl	_le16_to_cpu
	mov	x21, x0
Lloh2:
	adrp	x27, _statsLabels@GOTPAGE
Lloh3:
	ldr	x27, [x27, _statsLabels@GOTPAGEOFF]
	ldr	x8, [x27]
	ldr	x0, [x8]
	cmp	w21, #0
	cset	w9, gt
	cmn	x0, #1
	ccmp	w21, #1, #8, ne
	b.ge	LBB0_8
; %bb.3:
	mov	w26, #0
LBB0_4:
	tbnz	w9, #0, LBB0_15
; %bb.5:
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_14
LBB0_6:
	ldr	x0, [x22]
	bl	_kfree
LBB0_7:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_16
LBB0_8:
	mov	x28, #0
	mov	w26, #0
	mov	w22, #4
Lloh9:
	adrp	x23, l_.str.1@PAGE
Lloh10:
	add	x23, x23, l_.str.1@PAGEOFF
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x9, x8, x28
	ldr	x0, [x9, #8]
	cmp	w22, w21
	cset	w9, lt
	add	x28, x28, #8
	cmn	x0, #1
	ccmp	w22, w21, #0, ne
	add	w22, w22, #4
	b.ge	LBB0_4
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	cbz	x0, LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	bl	_strlen
	add	w8, w0, w26
	cmp	w8, #4080
	b.gt	LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [x19, #8]
	add	x24, x8, w26, sxtw #2
	ldr	x8, [x27]
	ldr	x25, [x8, x28]
	bl	_le32_to_cpu
	mov	x3, x0
	mov	x0, x24
	mov	x1, x23
	mov	x2, x25
	bl	_sprintf
	add	w26, w26, w0
	ldr	x8, [x27]
	b	LBB0_9
LBB0_13:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
LBB0_14:
	ldr	x8, [x20]
	ldr	w0, [x8]
	bl	_airo_print_warn
LBB0_15:
	mov	w0, #0
	str	w26, [x19]
LBB0_16:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_statsLabels,8,3                ; @statsLabels
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Potentially disastrous buffer overflow averted!"

l_.str.1:                               ; @.str.1
	.asciz	"%s: %u\n"

l_.str.2:                               ; @.str.2
	.asciz	"Got a short rid"

	.no_dead_strip	_proc_stats_rid_open
.subsections_via_symbols
