	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pvr2_ioread_init
_pvr2_ioread_init:                      ## @pvr2_ioread_init
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	$0, 16(%rdi)
	addq	$8, %rdi
	callq	_mutex_init
	movq	_BUFFER_COUNT@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	je	LBB0_1
## %bb.2:
	xorl	%ebx, %ebx
	movq	_BUFFER_SIZE@GOTPCREL(%rip), %r12
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %edi
	movl	(%r13), %esi
	callq	_kmalloc
	movq	(%r15), %rcx
	movl	%eax, (%rcx,%rbx,4)
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	movl	(%r14), %ecx
	cmpq	%rcx, %rbx
	jb	LBB0_3
	jmp	LBB0_6
LBB0_1:
	xorl	%eax, %eax
	jmp	LBB0_12
LBB0_4:
	movl	(%r14), %ecx
LBB0_6:
	xorl	%eax, %eax
	cmpl	%ebx, %ecx
	jbe	LBB0_12
## %bb.7:
	xorl	%ebx, %ebx
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	incq	%rbx
	movl	%ecx, %eax
	cmpq	%rax, %rbx
	jae	LBB0_11
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	movl	(%rax,%rbx,4), %edi
	testl	%edi, %edi
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	callq	_kfree
	movl	(%r14), %ecx
	jmp	LBB0_10
LBB0_11:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BUFFER_COUNT,4,2               ## @BUFFER_COUNT
	.comm	_BUFFER_SIZE,4,2                ## @BUFFER_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_pvr2_ioread_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pvr2_ioread_init
_pvr2_ioread_init:                      ; @pvr2_ioread_init
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	str	xzr, [x0, #16]
	add	x0, x0, #8
	bl	_mutex_init
Lloh0:
	adrp	x20, _BUFFER_COUNT@GOTPAGE
Lloh1:
	ldr	x20, [x20, _BUFFER_COUNT@GOTPAGEOFF]
	ldr	w8, [x20]
	cbz	w8, LBB0_10
; %bb.1:
	mov	x21, #0
Lloh2:
	adrp	x22, _BUFFER_SIZE@GOTPAGE
Lloh3:
	ldr	x22, [x22, _BUFFER_SIZE@GOTPAGEOFF]
Lloh4:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh5:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x22]
	ldr	w1, [x23]
	bl	_kmalloc
	ldr	x8, [x19]
	str	w0, [x8, x21, lsl #2]
	cbz	w0, LBB0_9
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x21, x21, #1
	ldr	w8, [x20]
	cmp	x21, x8
	b.lo	LBB0_2
; %bb.4:
	cmp	w8, w21
	b.ls	LBB0_10
LBB0_5:
	mov	x21, #0
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x21, x21, #1
	cmp	x21, w8, uxtw
	b.hs	LBB0_11
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19]
	ldr	w0, [x9, x21, lsl #2]
	cbz	w0, LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	bl	_kfree
	ldr	w8, [x20]
	b	LBB0_6
LBB0_9:
	ldr	w8, [x20]
	cmp	w8, w21
	b.hi	LBB0_5
LBB0_10:
	mov	w0, #0
	b	LBB0_12
LBB0_11:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_BUFFER_COUNT,4,2               ; @BUFFER_COUNT
	.comm	_BUFFER_SIZE,4,2                ; @BUFFER_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_pvr2_ioread_init
.subsections_via_symbols
