	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hibmc_plane_atomic_update
_hibmc_plane_atomic_update:             ## @hibmc_plane_atomic_update
	.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	%rdi, %rax
	movq	8(%rdi), %r13
	movq	(%r13), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.1:
	movq	(%rax), %rax
	movq	(%rax), %r12
	callq	_to_hibmc_framebuffer
	movl	(%rax), %edi
	callq	_drm_gem_vram_of_gem
	movq	%rax, %rbx
	movq	_DRM_GEM_VRAM_PL_FLAG_VRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_drm_gem_vram_pin
	testl	%eax, %eax
	je	LBB0_2
## %bb.5:
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DRM_ERROR                      ## TAILCALL
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%rbx, %rdi
	callq	_drm_gem_vram_offset
	testq	%rax, %rax
	js	LBB0_6
## %bb.3:
	movq	_HIBMC_CRT_FB_ADDRESS@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	(%r12), %rsi
	movl	%eax, %edi
	callq	_writel
	movq	(%r13), %rax
	movq	8(%rax), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx), %esi
	imull	(%rax), %esi
	movl	$16, %edi
	callq	_PADDING
	movq	%rax, %r14
	movq	(%r13), %rax
	movq	8(%rax), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx), %esi
	imull	(%rax), %esi
	movl	$16, %edi
	callq	_PADDING
	movq	%rax, %r15
	movq	_HIBMC_CRT_FB_WIDTH_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r14d, %esi
	callq	_HIBMC_FIELD
	movl	%eax, %ebx
	movq	_HIBMC_CRT_FB_WIDTH_OFFS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r15d, %esi
	callq	_HIBMC_FIELD
	orl	%eax, %ebx
	movq	_HIBMC_CRT_FB_WIDTH@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r12), %rsi
	movl	%ebx, %edi
	callq	_writel
	movq	_HIBMC_CRT_DISP_CTL@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	addq	(%r12), %rdi
	callq	_readl
	movq	_HIBMC_CRT_DISP_CTL_FORMAT_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	notl	%ebx
	andl	%eax, %ebx
	movq	_HIBMC_CRT_DISP_CTL_FORMAT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r13), %rax
	movq	8(%rax), %rax
	movq	(%rax), %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	shrl	$31, %esi
	addl	%eax, %esi
	sarl	%esi
	callq	_HIBMC_FIELD
	orl	%eax, %ebx
	movq	(%r14), %rsi
	addq	(%r12), %rsi
	movl	%ebx, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_writel                         ## TAILCALL
LBB0_6:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_drm_gem_vram_unpin             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_GEM_VRAM_PL_FLAG_VRAM,4,2  ## @DRM_GEM_VRAM_PL_FLAG_VRAM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to pin bo: %d"

	.comm	_HIBMC_CRT_FB_ADDRESS,8,3       ## @HIBMC_CRT_FB_ADDRESS
	.comm	_HIBMC_CRT_FB_WIDTH_WIDTH,4,2   ## @HIBMC_CRT_FB_WIDTH_WIDTH
	.comm	_HIBMC_CRT_FB_WIDTH_OFFS,4,2    ## @HIBMC_CRT_FB_WIDTH_OFFS
	.comm	_HIBMC_CRT_FB_WIDTH,8,3         ## @HIBMC_CRT_FB_WIDTH
	.comm	_HIBMC_CRT_DISP_CTL,8,3         ## @HIBMC_CRT_DISP_CTL
	.comm	_HIBMC_CRT_DISP_CTL_FORMAT_MASK,4,2 ## @HIBMC_CRT_DISP_CTL_FORMAT_MASK
	.comm	_HIBMC_CRT_DISP_CTL_FORMAT,4,2  ## @HIBMC_CRT_DISP_CTL_FORMAT
	.no_dead_strip	_hibmc_plane_atomic_update
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hibmc_plane_atomic_update
_hibmc_plane_atomic_update:             ; @hibmc_plane_atomic_update
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x8, x0
	ldr	x22, [x0, #8]
	ldr	x0, [x22]
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x8, [x8]
	ldr	x21, [x8]
	bl	_to_hibmc_framebuffer
	ldr	w0, [x0]
	bl	_drm_gem_vram_of_gem
	mov	x19, x0
Lloh0:
	adrp	x8, _DRM_GEM_VRAM_PL_FLAG_VRAM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DRM_GEM_VRAM_PL_FLAG_VRAM@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_drm_gem_vram_pin
	cbz	w0, LBB0_4
; %bb.2:
	mov	x1, x0
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_DRM_ERROR
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_4:
	mov	x0, x19
	bl	_drm_gem_vram_offset
	tbnz	x0, #63, LBB0_6
; %bb.5:
	ldr	x8, [x21]
Lloh5:
	adrp	x9, _HIBMC_CRT_FB_ADDRESS@GOTPAGE
Lloh6:
	ldr	x9, [x9, _HIBMC_CRT_FB_ADDRESS@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	add	x1, x9, x8
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_writel
	ldr	x8, [x22]
	ldr	w9, [x8]
	ldr	x8, [x8, #8]
	ldr	x8, [x8]
	ldr	w8, [x8]
	mul	w1, w8, w9
	mov	w0, #16
	bl	_PADDING
	mov	x19, x0
	ldr	x8, [x22]
	ldr	w9, [x8]
	ldr	x8, [x8, #8]
	ldr	x8, [x8]
	ldr	w8, [x8]
	mul	w1, w8, w9
	mov	w0, #16
	bl	_PADDING
	mov	x20, x0
Lloh8:
	adrp	x8, _HIBMC_CRT_FB_WIDTH_WIDTH@GOTPAGE
Lloh9:
	ldr	x8, [x8, _HIBMC_CRT_FB_WIDTH_WIDTH@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_HIBMC_FIELD
	mov	x19, x0
Lloh11:
	adrp	x8, _HIBMC_CRT_FB_WIDTH_OFFS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _HIBMC_CRT_FB_WIDTH_OFFS@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_HIBMC_FIELD
	orr	w0, w0, w19
	ldr	x8, [x21]
Lloh14:
	adrp	x9, _HIBMC_CRT_FB_WIDTH@GOTPAGE
Lloh15:
	ldr	x9, [x9, _HIBMC_CRT_FB_WIDTH@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x21]
Lloh17:
	adrp	x19, _HIBMC_CRT_DISP_CTL@GOTPAGE
Lloh18:
	ldr	x19, [x19, _HIBMC_CRT_DISP_CTL@GOTPAGEOFF]
	ldr	x9, [x19]
	add	x0, x9, x8
	bl	_readl
Lloh19:
	adrp	x8, _HIBMC_CRT_DISP_CTL_FORMAT_MASK@GOTPAGE
Lloh20:
	ldr	x8, [x8, _HIBMC_CRT_DISP_CTL_FORMAT_MASK@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	bic	w20, w0, w8
Lloh22:
	adrp	x8, _HIBMC_CRT_DISP_CTL_FORMAT@GOTPAGE
Lloh23:
	ldr	x8, [x8, _HIBMC_CRT_DISP_CTL_FORMAT@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	ldr	x8, [x22]
	ldr	x8, [x8, #8]
	ldr	x8, [x8]
	ldr	w8, [x8]
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w1, w8, #1
	bl	_HIBMC_FIELD
	orr	w0, w0, w20
	ldr	x8, [x21]
	ldr	x9, [x19]
	add	x1, x9, x8
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_writel
LBB0_6:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_drm_gem_vram_unpin
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_GEM_VRAM_PL_FLAG_VRAM,4,2  ; @DRM_GEM_VRAM_PL_FLAG_VRAM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to pin bo: %d"

	.comm	_HIBMC_CRT_FB_ADDRESS,8,3       ; @HIBMC_CRT_FB_ADDRESS
	.comm	_HIBMC_CRT_FB_WIDTH_WIDTH,4,2   ; @HIBMC_CRT_FB_WIDTH_WIDTH
	.comm	_HIBMC_CRT_FB_WIDTH_OFFS,4,2    ; @HIBMC_CRT_FB_WIDTH_OFFS
	.comm	_HIBMC_CRT_FB_WIDTH,8,3         ; @HIBMC_CRT_FB_WIDTH
	.comm	_HIBMC_CRT_DISP_CTL,8,3         ; @HIBMC_CRT_DISP_CTL
	.comm	_HIBMC_CRT_DISP_CTL_FORMAT_MASK,4,2 ; @HIBMC_CRT_DISP_CTL_FORMAT_MASK
	.comm	_HIBMC_CRT_DISP_CTL_FORMAT,4,2  ; @HIBMC_CRT_DISP_CTL_FORMAT
	.no_dead_strip	_hibmc_plane_atomic_update
.subsections_via_symbols
