	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alloc_agpphysmem_i8xx
_alloc_agpphysmem_i8xx:                 ## @alloc_agpphysmem_i8xx
	.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
	movq	%rdi, %r14
	cmpq	$4, %rdi
	je	LBB0_3
## %bb.1:
	cmpq	$1, %r14
	jne	LBB0_11
## %bb.2:
	movq	_agp_bridge@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	(%rdi), %rax
	callq	*(%rax)
	jmp	LBB0_4
LBB0_3:
	xorl	%eax, %eax
	callq	_i8xx_alloc_pages
LBB0_4:
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_11
## %bb.5:
	movq	%r14, %rdi
	callq	_agp_create_memory
	testq	%rax, %rax
	je	LBB0_11
## %bb.6:
	movq	%rax, %rbx
	movq	16(%rax), %rax
	movq	%r15, (%rax)
	cmpq	$4, %r14
	jne	LBB0_8
## %bb.7:
	movq	16(%rbx), %rax
	movq	(%rax), %rcx
	addq	$4, %rcx
	movq	%rcx, 8(%rax)
	movq	16(%rbx), %rax
	movq	8(%rax), %rcx
	addq	$4, %rcx
	movq	%rcx, 16(%rax)
	movq	16(%rbx), %rax
	movq	16(%rax), %rcx
	addq	$4, %rcx
	movq	%rcx, 24(%rax)
LBB0_8:
	movq	%r14, (%rbx)
	movq	%r14, 8(%rbx)
	movq	_AGP_PHYS_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%rbx)
	movq	16(%rbx), %rax
	movq	(%rax), %rdi
	callq	_page_to_phys
	movl	%eax, 24(%rbx)
	jmp	LBB0_12
LBB0_11:
	xorl	%ebx, %ebx
LBB0_12:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_agp_bridge,8,3                 ## @agp_bridge
	.comm	_AGP_PHYS_MEMORY,4,2            ## @AGP_PHYS_MEMORY
	.no_dead_strip	_alloc_agpphysmem_i8xx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alloc_agpphysmem_i8xx
_alloc_agpphysmem_i8xx:                 ; @alloc_agpphysmem_i8xx
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x19, x0
	cmp	x0, #4
	b.eq	LBB0_4
; %bb.1:
	cmp	x19, #1
	b.ne	LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _agp_bridge@GOTPAGE
Lloh1:
	ldr	x8, [x8, _agp_bridge@GOTPAGEOFF]
Lloh2:
	ldr	x0, [x8]
	ldr	x8, [x0]
	ldr	x8, [x8]
	blr	x8
	mov	x21, x0
	cbnz	x0, LBB0_5
LBB0_3:
	mov	x20, #0
	b	LBB0_9
LBB0_4:
	bl	_i8xx_alloc_pages
	mov	x21, x0
	cbz	x0, LBB0_3
LBB0_5:
	mov	x0, x19
	bl	_agp_create_memory
	mov	x20, x0
	cbz	x0, LBB0_9
; %bb.6:
	ldr	x8, [x20, #16]
	str	x21, [x8]
	cmp	x19, #4
	b.ne	LBB0_8
; %bb.7:
	ldr	x8, [x20, #16]
	ldr	x9, [x8]
	add	x9, x9, #4
	str	x9, [x8, #8]
	ldr	x8, [x20, #16]
	ldr	x9, [x8, #8]
	add	x9, x9, #4
	str	x9, [x8, #16]
	ldr	x8, [x20, #16]
	ldr	x9, [x8, #16]
	add	x9, x9, #4
	str	x9, [x8, #24]
LBB0_8:
	stp	x19, x19, [x20]
Lloh3:
	adrp	x8, _AGP_PHYS_MEMORY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AGP_PHYS_MEMORY@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x20, #28]
	ldr	x8, [x20, #16]
	ldr	x0, [x8]
	bl	_page_to_phys
	str	w0, [x20, #24]
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_agp_bridge,8,3                 ; @agp_bridge
	.comm	_AGP_PHYS_MEMORY,4,2            ; @AGP_PHYS_MEMORY
	.no_dead_strip	_alloc_agpphysmem_i8xx
.subsections_via_symbols
