	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_agp_generic_alloc_pages        ## -- Begin function agp_generic_alloc_pages
	.p2align	4, 0x90
_agp_generic_alloc_pages:               ## @agp_generic_alloc_pages
	.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
	xorl	%eax, %eax
	testq	%rdx, %rdx
	je	LBB0_6
## %bb.1:
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	xorl	%r13d, %r13d
	movq	___GFP_ZERO@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_GFP_DMA32@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	orl	(%r14), %edi
	callq	_alloc_page
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_map_page_into_agp
	movq	%rbx, %rdi
	callq	_get_page
	movq	_agp_bridge@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_atomic_inc
	movq	(%r12), %rax
	movq	%rbx, (%rax,%r13,8)
	incl	8(%r12)
	incq	%r13
	cmpq	%r13, %r15
	jne	LBB0_2
## %bb.5:
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_3:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_GFP_DMA32,4,2                  ## @GFP_DMA32
	.comm	___GFP_ZERO,4,2                 ## @__GFP_ZERO
	.comm	_agp_bridge,8,3                 ## @agp_bridge
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_agp_generic_alloc_pages        ; -- Begin function agp_generic_alloc_pages
	.p2align	2
_agp_generic_alloc_pages:               ; @agp_generic_alloc_pages
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	cbz	x2, LBB0_4
; %bb.1:
	mov	x20, x2
	mov	x21, x1
	mov	x23, #0
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w19, w8
Lloh3:
	adrp	x24, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x24, [x24, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	adrp	x25, _GFP_DMA32@GOTPAGE
Lloh6:
	ldr	x25, [x25, _GFP_DMA32@GOTPAGEOFF]
Lloh7:
	adrp	x26, ___GFP_ZERO@GOTPAGE
Lloh8:
	ldr	x26, [x26, ___GFP_ZERO@GOTPAGEOFF]
Lloh9:
	adrp	x27, _agp_bridge@GOTPAGE
Lloh10:
	ldr	x27, [x27, _agp_bridge@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x24]
	ldr	w9, [x25]
	orr	w8, w9, w8
	ldr	w9, [x26]
	orr	w0, w8, w9
	bl	_alloc_page
	cbz	x0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x22, x0
	bl	_map_page_into_agp
	mov	x0, x22
	bl	_get_page
	ldr	x0, [x27]
	bl	_atomic_inc
	ldr	x8, [x21]
	str	x22, [x8, x23, lsl #3]
	ldr	w8, [x21, #8]
	add	w8, w8, #1
	str	w8, [x21, #8]
	add	x23, x23, #1
	cmp	x20, x23
	b.ne	LBB0_2
LBB0_4:
	mov	w19, #0
LBB0_5:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_GFP_DMA32,4,2                  ; @GFP_DMA32
	.comm	___GFP_ZERO,4,2                 ; @__GFP_ZERO
	.comm	_agp_bridge,8,3                 ; @agp_bridge
.subsections_via_symbols
