	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function assert_remapped
_assert_remapped:                       ## @assert_remapped
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movl	%edx, %edx
	movq	(%rsi), %rax
	cmpl	$0, (%rax,%rdx,8)
	je	LBB0_20
## %bb.1:
	movq	%rsi, %r12
	xorl	%r13d, %r13d
                                        ## implicit-def: $edi
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	cmpl	$0, 4(%rax,%rdx,8)
	je	LBB0_19
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%ebx, %ebx
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_4 Depth=2
	movq	%r14, %rdi
	callq	_sg_next
	movl	%r15d, %edi
	movq	%rax, %r14
LBB0_18:                                ##   in Loop: Header=BB0_4 Depth=2
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	addl	%ebx, %edi
	movq	(%r12), %rax
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	incq	%rbx
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	cmpl	4(%rax,%rdx,8), %ebx
	jae	LBB0_19
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	testq	%r14, %r14
	je	LBB0_5
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=2
	testl	%r13d, %r13d
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	%r14, %rdi
	callq	_sg_dma_len
	movl	%eax, %r13d
	xorl	%edi, %edi
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=2
	movl	%edi, %r15d
	movq	%r12, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	%ebx, %edx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	_remapped_index
	movq	%rax, %rbx
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, %rsi
	callq	_i915_gem_object_get_dma_address
	movq	%r13, %rcx
	movq	%rax, %r12
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jb	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=2
	decl	%eax
	testl	%ecx, %eax
	jne	LBB0_11
## %bb.13:                              ##   in Loop: Header=BB0_4 Depth=2
	movq	%r14, %rdi
	callq	_sg_dma_address
	movl	%r15d, %ecx
	addq	%rax, %rcx
	cmpq	%r12, %rcx
	jne	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_4 Depth=2
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	subl	%ebx, %r13d
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_4 Depth=2
	movl	%r15d, %edi
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	incl	%ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	cmpl	(%rax,%rdx,8), %ecx
	jb	LBB0_2
LBB0_20:
	movq	%r14, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	%r14, %rdi
	callq	_sg_dma_len
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movq	%rbx, %r9
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_12
LBB0_5:
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	leaq	L_.str(%rip), %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	%ebx, %edx
	jmp	LBB0_6
LBB0_14:
	leaq	L_.str.2(%rip), %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	%rbx, %rcx
LBB0_6:
	xorl	%eax, %eax
	callq	_pr_err
LBB0_12:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid sg table: too short at plane %d, (%d, %d)!\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"Invalid sg.length, found %d, expected %lu for remapped page (%d, %d) [src index %lu]\n"

L_.str.2:                               ## @.str.2
	.asciz	"Invalid address for remapped page (%d, %d) [src index %lu]\n"

	.no_dead_strip	_assert_remapped
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function assert_remapped
_assert_remapped:                       ; @assert_remapped
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x21, x3
	str	x0, [sp, #24]                   ; 8-byte Folded Spill
	mov	w28, w2
	ldr	x8, [x1]
	lsl	x10, x28, #3
	ldr	w9, [x8, x10]
	cbz	w9, LBB0_15
; %bb.1:
	mov	x20, x2
	mov	x22, x1
	mov	w24, #0
	mov	w19, #0
                                        ; implicit-def: $w23
	str	x10, [sp, #16]                  ; 8-byte Folded Spill
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	add	x9, x8, x28, lsl #3
	ldr	w9, [x9, #4]
	cbz	w9, LBB0_14
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x25, #0
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=2
	add	w23, w26, w23
	ldr	x8, [x22]
	add	x9, x8, x28, lsl #3
	ldr	w9, [x9, #4]
	add	x25, x25, #1
	cmp	w25, w9
	b.hs	LBB0_13
LBB0_5:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cbz	x21, LBB0_17
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	cbnz	w24, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	x0, x21
	bl	_sg_dma_len
	mov	x24, x0
	mov	w23, #0
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=2
	mov	x0, x22
	mov	x1, x20
	mov	x2, x25
	mov	x3, x19
	bl	_remapped_index
	mov	x26, x0
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	mov	x1, x26
	bl	_i915_gem_object_get_dma_address
Lloh0:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w24, w8
	b.lo	LBB0_16
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=2
	sub	w8, w8, #1
	tst	w8, w24
	b.ne	LBB0_16
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=2
	mov	x27, x0
	mov	x0, x21
	bl	_sg_dma_address
	add	x8, x0, w23, uxtw
	cmp	x8, x27
	b.ne	LBB0_18
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=2
Lloh3:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w26, [x8]
	subs	w24, w24, w26
	b.ne	LBB0_4
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=2
	mov	x0, x21
	bl	_sg_next
	mov	x21, x0
	b	LBB0_4
LBB0_13:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x10, [sp, #16]                  ; 8-byte Folded Reload
LBB0_14:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w19, w19, #1
	ldr	w9, [x8, x10]
	cmp	w19, w9
	b.lo	LBB0_2
LBB0_15:
	mov	x0, x21
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_16:
	mov	x0, x21
	bl	_sg_dma_len
	mov	x1, x0
Lloh6:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	stp	x19, x26, [sp]
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x3, x25
	b	LBB0_19
LBB0_17:
	mov	w3, w19
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x2, x25
	b	LBB0_19
LBB0_18:
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x25
	mov	x2, x19
	mov	x3, x26
LBB0_19:
	bl	_pr_err
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_ERR_PTR
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid sg table: too short at plane %d, (%d, %d)!\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"Invalid sg.length, found %d, expected %lu for remapped page (%d, %d) [src index %lu]\n"

l_.str.2:                               ; @.str.2
	.asciz	"Invalid address for remapped page (%d, %d) [src index %lu]\n"

	.no_dead_strip	_assert_remapped
.subsections_via_symbols
