	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tilcdc_crtc_update_fb          ## -- Begin function tilcdc_crtc_update_fb
	.p2align	4, 0x90
_tilcdc_crtc_update_fb:                 ## @tilcdc_crtc_update_fb
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %r14
	movq	%rdi, %r15
	callq	_to_tilcdc_crtc
	cmpq	$0, 32(%rax)
	je	LBB0_2
## %bb.1:
	movq	(%r15), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_8
LBB0_2:
	movq	%rax, %rbx
	movq	%r12, 32(%rax)
	movq	%rax, %rdi
	callq	_mutex_lock
	cmpq	$0, 24(%rbx)
	je	LBB0_7
## %bb.3:
	movq	%rbx, %r12
	addq	$4, %r12
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movl	16(%rbx), %esi
	movl	20(%rbx), %edi
	callq	_ktime_add_us
	movl	%eax, %r13d
	xorl	%eax, %eax
	callq	_ktime_get
	movl	%r13d, %edi
	movl	%eax, %esi
	callq	_ktime_sub
	movl	%eax, %edi
	callq	_ktime_to_us
	movq	_TILCDC_VBLANK_SAFETY_THRESHOLD_US@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_5
## %bb.4:
	movq	%r14, 8(%rbx)
	jmp	LBB0_6
LBB0_5:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_set_scanout
LBB0_6:
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
LBB0_7:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"already pending page flip!\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_TILCDC_VBLANK_SAFETY_THRESHOLD_US,8,3 ## @TILCDC_VBLANK_SAFETY_THRESHOLD_US
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tilcdc_crtc_update_fb          ; -- Begin function tilcdc_crtc_update_fb
	.p2align	2
_tilcdc_crtc_update_fb:                 ; @tilcdc_crtc_update_fb
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x22, x2
	mov	x20, x1
	mov	x21, x0
	bl	_to_tilcdc_crtc
	ldr	x8, [x0, #32]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	x8, [x21]
	ldr	w0, [x8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh2:
	adrp	x8, _EBUSY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_2:
	mov	x19, x0
	str	x22, [x0, #32]
	bl	_mutex_lock
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_7
; %bb.3:
	add	x22, x19, #4
	mov	x0, x22
	bl	_spin_lock_irqsave
	ldp	w1, w0, [x19, #16]
	bl	_ktime_add_us
	mov	x23, x0
	bl	_ktime_get
	mov	x1, x0
	mov	x0, x23
	bl	_ktime_sub
	bl	_ktime_to_us
Lloh5:
	adrp	x8, _TILCDC_VBLANK_SAFETY_THRESHOLD_US@GOTPAGE
Lloh6:
	ldr	x8, [x8, _TILCDC_VBLANK_SAFETY_THRESHOLD_US@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ge	LBB0_5
; %bb.4:
	str	x20, [x19, #8]
	b	LBB0_6
LBB0_5:
	mov	x0, x21
	mov	x1, x20
	bl	_set_scanout
LBB0_6:
	mov	x0, x22
	bl	_spin_unlock_irqrestore
LBB0_7:
	mov	x0, x19
	bl	_mutex_unlock
	mov	w0, #0
LBB0_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"already pending page flip!\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_TILCDC_VBLANK_SAFETY_THRESHOLD_US,8,3 ; @TILCDC_VBLANK_SAFETY_THRESHOLD_US
.subsections_via_symbols
