	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nes_alloc_fast_reg_page_list
_nes_alloc_fast_reg_page_list:          ## @nes_alloc_fast_reg_page_list
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	callq	_to_nesvnic
	movslq	%ebx, %rcx
	movq	_NES_4K_PBL_CHUNK_SIZE@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %rdx
	shrq	$2, %rdx
	cmpq	%rcx, %rdx
	jae	LBB0_2
## %bb.1:
	movq	_E2BIG@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_2:
	movq	(%rax), %r15
	leal	40(,%rbx,4), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	movq	%rax, %r14
	addq	$32, %rax
	movq	%rax, 24(%r14)
	movl	%ebx, 16(%r14)
	shll	$2, %ebx
	movl	(%r15), %edi
	movl	%ebx, %esi
	movq	%r14, %rdx
	callq	_pci_alloc_consistent
	movl	%eax, 8(%r14)
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:
	movq	%r14, %rbx
	addq	$16, %rbx
	movq	_NES_DBG_MR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	(%r14), %rcx
	movq	24(%r14), %r8
	movq	%rcx, (%rsp)
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdx
	movq	%rbx, %rcx
	movl	%eax, %r9d
	callq	_nes_debug
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%r14, %rdi
	callq	_kfree
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_8:
	xorl	%edi, %edi
	subl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NES_4K_PBL_CHUNK_SIZE,4,2      ## @NES_4K_PBL_CHUNK_SIZE
	.comm	_E2BIG,4,2                      ## @E2BIG
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_NES_DBG_MR,4,2                 ## @NES_DBG_MR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"nes_alloc_fast_reg_pbl: nes_frpl = %p, ibfrpl = %p, ibfrpl.page_list = %p, pbl.kva = %p, pbl.paddr = %llx\n"

	.no_dead_strip	_nes_alloc_fast_reg_page_list
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nes_alloc_fast_reg_page_list
_nes_alloc_fast_reg_page_list:          ; @nes_alloc_fast_reg_page_list
	.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	x20, x1
	bl	_to_nesvnic
	sxtw	x8, w20
Lloh0:
	adrp	x9, _NES_4K_PBL_CHUNK_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NES_4K_PBL_CHUNK_SIZE@GOTPAGEOFF]
Lloh2:
	ldrsw	x9, [x9]
	cmp	x8, x9, lsr #2
	b.ls	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _E2BIG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _E2BIG@GOTPAGEOFF]
	b	LBB0_7
LBB0_2:
	ldr	x23, [x0]
	lsl	w22, w20, #2
	add	w0, w22, #40
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_kmalloc
	cbz	x0, LBB0_6
; %bb.3:
	mov	x19, x0
	mov	x21, x0
	str	w20, [x21, #16]!
	add	x8, x0, #32
	str	x8, [x0, #24]
	ldr	w0, [x23]
	mov	x1, x22
	mov	x2, x19
	bl	_pci_alloc_consistent
	str	w0, [x19, #8]
	cbz	w0, LBB0_5
; %bb.4:
	mov	x5, x0
Lloh8:
	adrp	x8, _NES_DBG_MR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _NES_DBG_MR@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	ldr	x4, [x19, #24]
	ldr	x6, [x19]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	mov	x3, x21
	bl	_nes_debug
	mov	x0, x21
	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
LBB0_5:
	mov	x0, x19
	bl	_kfree
LBB0_6:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w0, w8
	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
	b	_ERR_PTR
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_NES_4K_PBL_CHUNK_SIZE,4,2      ; @NES_4K_PBL_CHUNK_SIZE
	.comm	_E2BIG,4,2                      ; @E2BIG
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_NES_DBG_MR,4,2                 ; @NES_DBG_MR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"nes_alloc_fast_reg_pbl: nes_frpl = %p, ibfrpl = %p, ibfrpl.page_list = %p, pbl.kva = %p, pbl.paddr = %llx\n"

	.no_dead_strip	_nes_alloc_fast_reg_page_list
.subsections_via_symbols
