	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_gem_object_get_sg         ## -- Begin function i915_gem_object_get_sg
	.p2align	4, 0x90
_i915_gem_object_get_sg:                ## @i915_gem_object_get_sg
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movl	%esi, %ebx
	movq	%rdi, %r14
	xorl	%eax, %eax
	callq	_might_sleep
	movl	(%r14), %eax
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shrl	%cl, %eax
	xorl	%edi, %edi
	cmpl	%ebx, %eax
	setbe	%dil
	callq	_GEM_BUG_ON
	movq	%r14, %rdi
	callq	_i915_gem_object_has_pinned_pages
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_GEM_BUG_ON
	movl	8(%r14), %edi
	callq	_READ_ONCE
	cmpl	%ebx, %eax
	ja	LBB0_19
## %bb.1:
	leaq	16(%r14), %rdi
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movq	24(%r14), %r13
	movl	8(%r14), %r15d
	movq	%r13, %rdi
	callq	___sg_page_count
	movl	%eax, %r12d
	addl	%r15d, %eax
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	cmpl	%ebx, %eax
	ja	LBB0_13
## %bb.2:
	leaq	12(%r14), %rcx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movl	%r15d, %ebx
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_____sg_next
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	___sg_page_count
	movl	%eax, %r12d
	movl	-52(%rbp), %r15d                ## 4-byte Reload
	addl	%r15d, %eax
	movl	%r15d, %ebx
	cmpl	-44(%rbp), %eax                 ## 4-byte Folded Reload
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	ja	LBB0_13
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	movq	%r13, %rdx
	callq	_radix_tree_insert
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_EEXIST@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	jne	LBB0_5
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edi
	callq	_xa_mk_value
	cmpl	$2, %r12d
	jb	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rax, %rbx
	movl	%r12d, %r15d
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	movl	$1, %r13d
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=2
	incq	%r13
	cmpq	%r13, %r15
	je	LBB0_11
LBB0_8:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leal	(%r14,%r13), %esi
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rdx
	callq	_radix_tree_insert
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=2
	movq	_EEXIST@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	je	LBB0_10
## %bb.12:
	movl	-48(%rbp), %r15d                ## 4-byte Reload
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	-80(%rbp), %r13                 ## 8-byte Reload
LBB0_13:
	movq	%r13, 24(%r14)
	movl	%r15d, 8(%r14)
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	xorl	%edi, %edi
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	cmpl	%ebx, %r15d
	seta	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_14
LBB0_19:
	xorl	%eax, %eax
	callq	_rcu_read_lock
	addq	$12, %r14
	movl	%ebx, %esi
	movq	%r14, %rdi
	callq	_radix_tree_lookup
	movq	%rax, %r13
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_GEM_BUG_ON
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movl	$0, (%r12)
	movq	%r13, %rdi
	callq	_xa_is_value
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_21
## %bb.20:
	movq	%r13, %rdi
	callq	_xa_to_value
	movq	%rax, %r15
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_radix_tree_lookup
	movq	%rax, %r13
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_GEM_BUG_ON
	subl	%r15d, %ebx
	movl	%ebx, (%r12)
LBB0_21:
	xorl	%eax, %eax
	callq	_rcu_read_unlock
LBB0_22:
	movq	%r13, %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	addl	%r15d, %r12d
	cmpl	%ebx, %r12d
	jbe	LBB0_16
## %bb.15:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	jmp	LBB0_18
LBB0_16:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %r15d
	movq	%r13, %rdi
	callq	_____sg_next
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	___sg_page_count
	movl	%eax, %r12d
	addl	%r15d, %r12d
	cmpl	%r14d, %r12d
	jbe	LBB0_17
LBB0_18:
	subl	%r15d, %r14d
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	%r14d, (%rax)
	jmp	LBB0_22
LBB0_5:
	movl	%ebx, %r15d
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_EEXIST,4,2                     ## @EEXIST
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_gem_object_get_sg         ; -- Begin function i915_gem_object_get_sg
	.p2align	2
_i915_gem_object_get_sg:                ; @i915_gem_object_get_sg
	.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	x19, x2
	mov	x20, x1
	mov	x22, x0
	bl	_might_sleep
	ldr	w8, [x22]
Lloh0:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	lsr	w8, w8, w9
	cmp	w8, w20
	cset	w0, ls
	bl	_GEM_BUG_ON
	mov	x0, x22
	bl	_i915_gem_object_has_pinned_pages
	cmp	w0, #0
	cset	w0, eq
	bl	_GEM_BUG_ON
	ldr	w0, [x22, #8]
	bl	_READ_ONCE
	cmp	w0, w20
	b.hi	LBB0_14
; %bb.1:
	add	x0, x22, #16
	stp	x0, x19, [sp, #8]               ; 16-byte Folded Spill
	bl	_mutex_lock
	ldr	x21, [x22, #24]
	ldr	w26, [x22, #8]
	mov	x0, x21
	bl	___sg_page_count
	mov	x24, x0
	add	w8, w0, w26
	cmp	w8, w20
	b.ls	LBB0_3
LBB0_2:
	mov	x28, x26
	b	LBB0_13
LBB0_3:
	add	x25, x22, #12
	str	w20, [sp, #28]                  ; 4-byte Folded Spill
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x21
	bl	_____sg_next
	mov	x21, x0
	bl	___sg_page_count
	mov	x24, x0
	add	w8, w0, w28
	ldr	w20, [sp, #28]                  ; 4-byte Folded Reload
	cmp	w8, w20
	mov	x26, x28
	b.hi	LBB0_13
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	mov	x28, x8
	mov	x0, x25
	mov	x1, x26
	mov	x2, x21
	bl	_radix_tree_insert
	cbz	w0, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh3:
	adrp	x8, _EEXIST@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EEXIST@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_2
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x26
	bl	_xa_mk_value
	cmp	w24, #2
	b.lo	LBB0_4
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x27, x0
	mov	w23, w24
	mov	w20, #1
	mov	w19, w26
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=2
	add	x20, x20, #1
	cmp	x23, x20
	b.eq	LBB0_4
LBB0_10:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	w1, w19, w20
	mov	x0, x25
	mov	x2, x27
	bl	_radix_tree_insert
	cbz	w0, LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
Lloh6:
	adrp	x8, _EEXIST@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EEXIST@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmn	w0, w8
	b.eq	LBB0_9
; %bb.12:
	mov	x28, x26
	ldr	w20, [sp, #28]                  ; 4-byte Folded Reload
LBB0_13:
	str	x21, [x22, #24]
	str	w28, [x22, #8]
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	bl	_mutex_unlock
	cmp	w28, w20
	cset	w0, hi
	bl	_unlikely
	ldr	x19, [sp, #16]                  ; 8-byte Folded Reload
	cbz	x0, LBB0_18
LBB0_14:
	bl	_rcu_read_lock
	add	x22, x22, #12
	mov	w1, w20
	mov	x0, x22
	bl	_radix_tree_lookup
	mov	x21, x0
	cmp	x0, #0
	cset	w0, eq
	bl	_GEM_BUG_ON
	str	wzr, [x19]
	mov	x0, x21
	bl	_xa_is_value
	bl	_unlikely
	cbz	x0, LBB0_16
; %bb.15:
	mov	x0, x21
	bl	_xa_to_value
	mov	x23, x0
	mov	x0, x22
	mov	x1, x23
	bl	_radix_tree_lookup
	mov	x21, x0
	cmp	x0, #0
	cset	w0, eq
	bl	_GEM_BUG_ON
	sub	w8, w20, w23
	str	w8, [x19]
LBB0_16:
	bl	_rcu_read_unlock
LBB0_17:
	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_18:
	add	w8, w24, w28
	cmp	w8, w20
	b.hi	LBB0_20
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	mov	x28, x8
	mov	x0, x21
	bl	_____sg_next
	mov	x21, x0
	bl	___sg_page_count
	add	w8, w0, w28
	cmp	w8, w20
	b.ls	LBB0_19
LBB0_20:
	sub	w8, w20, w28
	str	w8, [x19]
	b	LBB0_17
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_EEXIST,4,2                     ; @EEXIST
.subsections_via_symbols
