	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_omap_gem_pin                   ## -- Begin function omap_gem_pin
	.p2align	4, 0x90
_omap_gem_pin:                          ## @omap_gem_pin
	.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
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	8(%rdi), %rax
	movq	8(%rax), %r13
	callq	_to_omap_bo
	movq	%rax, %rbx
	leaq	12(%rax), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	callq	_omap_gem_is_contiguous
	testq	%rax, %rax
	je	LBB0_1
LBB0_13:
	movq	%rbx, %rdi
	callq	_omap_gem_is_contiguous
	testq	%rax, %rax
	jne	LBB0_14
## %bb.15:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_16
LBB0_1:
	cmpq	$0, (%r13)
	je	LBB0_13
## %bb.2:
	movq	(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_3
LBB0_12:
	incq	%rax
	movq	%rax, (%rbx)
LBB0_14:
	movl	16(%rbx), %eax
	movl	%eax, (%r14)
	xorl	%r13d, %r13d
LBB0_16:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	(%r12), %edx
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %edx
	movl	%edx, -60(%rbp)                 ## 4-byte Spill
	movl	8(%rbx), %edi
	callq	_gem2fmt
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	24(%rbx), %rdi
	callq	_BUG_ON
	movq	%r12, %rdi
	callq	_omap_gem_attach_pages
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_16
## %bb.4:
	movl	-60(%rbp), %r13d                ## 4-byte Reload
	movq	_OMAP_BO_TILED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rbx)
	je	LBB0_6
## %bb.5:
	movl	40(%rbx), %edx
	movl	44(%rbx), %esi
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	xorl	%ecx, %ecx
	callq	_tiler_reserve_2d
	jmp	LBB0_7
LBB0_6:
	movl	(%r12), %edi
	callq	_tiler_reserve_1d
LBB0_7:
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_PTR_ERR
	movl	%eax, %r13d
	movq	8(%r12), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r13d, %edx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_16
LBB0_9:
	movl	32(%rbx), %ecx
	movl	36(%rbx), %esi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %edx
	movl	$1, %r8d
	callq	_tiler_pin
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %r13d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_tiler_release
	movq	8(%r12), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_16
LBB0_11:
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	callq	_tiler_ssptr
	movq	%rbx, %rsi
	addq	$16, %rsi
	movl	%eax, 16(%rbx)
	movq	%r12, 24(%rbx)
	leaq	L_.str.2(%rip), %rdi
	callq	_DBG
	movq	(%rbx), %rax
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_OMAP_BO_TILED,4,2              ## @OMAP_BO_TILED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not remap: %d (%d)\n"

L_.str.1:                               ## @.str.1
	.asciz	"could not pin: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"got dma address: %pad"

	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_omap_gem_pin                   ; -- Begin function omap_gem_pin
	.p2align	2
_omap_gem_pin:                          ; @omap_gem_pin
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x20, x1
	mov	x22, x0
	ldr	x8, [x0, #8]
	ldr	x23, [x8, #8]
	bl	_to_omap_bo
	mov	x21, x0
	add	x19, x0, #12
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x21
	bl	_omap_gem_is_contiguous
	cbz	x0, LBB0_3
LBB0_1:
	mov	x0, x21
	bl	_omap_gem_is_contiguous
	cbz	x0, LBB0_7
; %bb.2:
	mov	w24, #0
	b	LBB0_6
LBB0_3:
	ldr	x8, [x23]
	cbz	x8, LBB0_1
; %bb.4:
	ldr	x8, [x21]
	cbz	x8, LBB0_9
LBB0_5:
	mov	w24, #0
	add	x8, x8, #1
	str	x8, [x21]
LBB0_6:
	ldr	w8, [x21, #16]
	str	w8, [x20]
	b	LBB0_8
LBB0_7:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_8:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x24
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_9:
	ldr	w26, [x22]
Lloh3:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w27, [x8]
	ldr	w0, [x21, #8]
	bl	_gem2fmt
	mov	x23, x0
	ldr	x0, [x21, #24]
	bl	_BUG_ON
	mov	x0, x22
	bl	_omap_gem_attach_pages
	mov	x24, x0
	cbnz	w0, LBB0_8
; %bb.10:
	ldr	w8, [x21, #8]
Lloh6:
	adrp	x9, _OMAP_BO_TILED@GOTPAGE
Lloh7:
	ldr	x9, [x9, _OMAP_BO_TILED@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.11:
	ldp	w2, w1, [x21, #40]
	mov	x0, x23
	mov	w3, #0
	bl	_tiler_reserve_2d
	b	LBB0_13
LBB0_12:
	ldr	w0, [x22]
	bl	_tiler_reserve_1d
LBB0_13:
	mov	x25, x0
	bl	_IS_ERR
	cbz	x0, LBB0_15
; %bb.14:
	mov	x0, x25
	bl	_PTR_ERR
	mov	x24, x0
	ldr	x8, [x22, #8]
	ldr	w0, [x8]
	str	x23, [sp]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_17
LBB0_15:
	asr	w2, w26, w27
	ldp	w3, w1, [x21, #32]
	mov	x0, x25
	mov	w4, #1
	bl	_tiler_pin
	cbz	w0, LBB0_18
; %bb.16:
	mov	x24, x0
	mov	x0, x25
	bl	_tiler_release
	ldr	x8, [x22, #8]
	ldr	w0, [x8]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_17:
	mov	x2, x24
	bl	_dev_err
	b	LBB0_8
LBB0_18:
	mov	x0, x25
	bl	_tiler_ssptr
	mov	x1, x21
	str	w0, [x1, #16]!
	str	x25, [x21, #24]
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DBG
	ldr	x8, [x21]
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_OMAP_BO_TILED,4,2              ; @OMAP_BO_TILED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not remap: %d (%d)\n"

l_.str.1:                               ; @.str.1
	.asciz	"could not pin: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"got dma address: %pad"

	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
