	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_omap_framebuffer_pin           ## -- Begin function omap_framebuffer_pin
	.p2align	4, 0x90
_omap_framebuffer_pin:                  ## @omap_framebuffer_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	%rdi, %r12
	callq	_to_omap_framebuffer
	movq	%rax, %rbx
	movq	8(%r12), %rax
	movl	(%rax), %r15d
	leaq	8(%rbx), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %rax
	testq	%rax, %rax
	jg	LBB0_10
## %bb.1:
	testl	%r15d, %r15d
	jle	LBB0_10
## %bb.2:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	$1, %ebx
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movl	(%rax,%r14,4), %edi
	leaq	(,%r14,8), %rsi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addq	16(%rax), %rsi
	callq	_omap_gem_pin
	testl	%eax, %eax
	jne	LBB0_4
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r12), %rax
	movl	(%rax,%r14,4), %edi
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_omap_gem_dma_sync_buffer
	incq	%r14
	incq	%rbx
	cmpq	%r15, %r14
	jne	LBB0_3
## %bb.9:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	-56(%rbp), %r14                 ## 8-byte Reload
LBB0_10:
	incq	%rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	xorl	%r13d, %r13d
	jmp	LBB0_11
LBB0_4:
	movl	%eax, %r13d
	testl	%r14d, %r14d
	je	LBB0_7
## %bb.5:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r15), %r14
	movq	(%r12), %rax
	movl	-8(%rax,%rbx,4), %edi
	callq	_omap_gem_unpin
	movq	$0, -16(%r14,%rbx,8)
	decq	%rbx
	cmpq	$1, %rbx
	jg	LBB0_6
LBB0_7:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
LBB0_11:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_omap_framebuffer_pin           ; -- Begin function omap_framebuffer_pin
	.p2align	2
_omap_framebuffer_pin:                  ; @omap_framebuffer_pin
	.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
	mov	x21, x0
	bl	_to_omap_framebuffer
	mov	x20, x0
	ldr	x8, [x21, #8]
	ldr	w24, [x8]
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x20]
	cmp	x8, #0
	ccmp	w24, #1, #8, le
	b.lt	LBB0_5
; %bb.1:
	mov	x25, #0
	mov	x23, #-1
Lloh0:
	adrp	x26, _DMA_TO_DEVICE@GOTPAGE
Lloh1:
	ldr	x26, [x26, _DMA_TO_DEVICE@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #16]
	ldr	x9, [x21]
	ldr	w0, [x9, x25, lsl #2]
	add	x1, x8, x25, lsl #3
	bl	_omap_gem_pin
	cbnz	w0, LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x21]
	ldr	w0, [x8, x25, lsl #2]
	ldr	w1, [x26]
	bl	_omap_gem_dma_sync_buffer
	add	x25, x25, #1
	add	x23, x23, #1
	cmp	x25, x24
	b.ne	LBB0_2
; %bb.4:
	ldr	x8, [x20]
LBB0_5:
	mov	w22, #0
	add	x8, x8, #1
	str	x8, [x20]
LBB0_6:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x22
	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_7:
	mov	x22, x0
	cbz	w25, LBB0_6
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x24, [x20, #16]
	ldr	x8, [x21]
	ldr	w0, [x8, x23, lsl #2]
	bl	_omap_gem_unpin
	str	xzr, [x24, x23, lsl #3]
	add	x8, x23, #1
	sub	x23, x23, #1
	cmp	x8, #1
	b.gt	LBB0_8
	b	LBB0_6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
.subsections_via_symbols
