	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function parisc_agp_insert_memory
_parisc_agp_insert_memory:              ## @parisc_agp_insert_memory
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%edx, %edx
	jne	LBB0_2
## %bb.1:
	movq	%rdi, %r15
	cmpq	$0, (%rdi)
	jne	LBB0_2
## %bb.4:
	movl	%esi, %r13d
	movq	_parisc_agp_info@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	imull	%ecx, %r13d
	movl	8(%r15), %eax
	imull	%eax, %ecx
	leal	(%rcx,%r13), %esi
	cmpl	4(%r12), %esi
	jle	LBB0_5
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_20:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	testl	%ecx, %ecx
	jle	LBB0_10
## %bb.6:
	movq	8(%r12), %rcx
	movslq	%r13d, %rdx
	movslq	%esi, %rsi
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%rcx,%rdx,8)
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_8 Depth=1
	incq	%rdx
	cmpq	%rsi, %rdx
	jl	LBB0_8
LBB0_10:
	cmpl	$0, 12(%r15)
	jne	LBB0_12
## %bb.11:
	xorl	%eax, %eax
	callq	_global_cache_flush
	movl	$1, 12(%r15)
	movl	8(%r15), %eax
LBB0_12:
	testl	%eax, %eax
	jle	LBB0_19
## %bb.13:
	xorl	%ecx, %ecx
	movq	_agp_bridge@GOTPCREL(%rip), %r14
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_14 Depth=1
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	incq	%rcx
	movslq	8(%r15), %rax
	cmpq	%rax, %rcx
	jge	LBB0_19
LBB0_14:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_16 Depth 2
	movq	16(%r15), %rax
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movl	(%rax,%rcx,4), %edi
	callq	_page_to_phys
	cmpl	$0, (%r12)
	jle	LBB0_18
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	%rax, %rbx
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movslq	%r13d, %r15
	shlq	$3, %r15
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_16:                                ##   Parent Loop BB0_14 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r14), %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	callq	_parisc_agp_mask_memory
	movq	8(%r12), %rcx
	addq	%r15, %rcx
	movq	%rax, (%rcx,%r13,8)
	addq	16(%r12), %rbx
	incq	%r13
	cmpl	(%r12), %r13d
	jl	LBB0_16
## %bb.17:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	addl	%r13d, %eax
	movq	%rax, %r13
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_18
LBB0_19:
	movq	_agp_bridge@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	%r15, %rdi
	callq	*(%rax)
	xorl	%eax, %eax
	jmp	LBB0_20
LBB0_9:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_parisc_agp_info,24,3           ## @parisc_agp_info
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_agp_bridge,8,3                 ## @agp_bridge
	.no_dead_strip	_parisc_agp_insert_memory
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function parisc_agp_insert_memory
_parisc_agp_insert_memory:              ; @parisc_agp_insert_memory
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	cbnz	w2, LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0]
	cbnz	x8, LBB0_3
; %bb.2:
Lloh0:
	adrp	x21, _parisc_agp_info@GOTPAGE
Lloh1:
	ldr	x21, [x21, _parisc_agp_info@GOTPAGEOFF]
	ldp	w9, w10, [x21]
	mul	w24, w9, w1
	ldr	w8, [x19, #8]
	mul	w9, w8, w9
	add	w11, w9, w24
	cmp	w11, w10
	b.le	LBB0_6
LBB0_3:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_6:
	cmp	w9, #1
	b.lt	LBB0_10
; %bb.7:
	ldr	x9, [x21, #8]
	sxtw	x10, w24
	sxtw	x11, w11
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x12, [x9, x10, lsl #3]
	cbnz	x12, LBB0_20
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	add	x10, x10, #1
	cmp	x10, x11
	b.lt	LBB0_8
LBB0_10:
	ldr	w9, [x19, #12]
	cbnz	w9, LBB0_12
; %bb.11:
	bl	_global_cache_flush
	mov	w8, #1
	str	w8, [x19, #12]
	ldr	w8, [x19, #8]
LBB0_12:
Lloh4:
	adrp	x22, _agp_bridge@GOTPAGE
Lloh5:
	ldr	x22, [x22, _agp_bridge@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_19
; %bb.13:
	mov	x23, #0
                                        ; kill: def $w24 killed $w24 killed $x24 def $x24
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x19, #8]
	cmp	x23, x8
	b.ge	LBB0_19
LBB0_15:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_17 Depth 2
	ldr	x8, [x19, #16]
	ldr	w0, [x8, x23, lsl #2]
	bl	_page_to_phys
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x20, x0
	mov	x25, #0
	sbfiz	x26, x24, #3, #32
LBB0_17:                                ;   Parent Loop BB0_15 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x0, [x22]
	mov	x1, x20
	mov	w2, #0
	bl	_parisc_agp_mask_memory
	ldr	x8, [x21, #8]
	add	x8, x8, x26
	str	x0, [x8, x25, lsl #3]
	ldr	x8, [x21, #16]
	add	x20, x8, x20
	ldr	w8, [x21]
	add	x25, x25, #1
	cmp	w25, w8
	b.lt	LBB0_17
; %bb.18:                               ;   in Loop: Header=BB0_15 Depth=1
	add	w24, w24, w25
	b	LBB0_14
LBB0_19:
	ldr	x8, [x22]
	ldr	x8, [x8]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	mov	w0, #0
	b	LBB0_5
LBB0_20:
Lloh6:
	adrp	x8, _EBUSY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_parisc_agp_info,24,3           ; @parisc_agp_info
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_agp_bridge,8,3                 ; @agp_bridge
	.no_dead_strip	_parisc_agp_insert_memory
.subsections_via_symbols
