	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_overlay_put_image        ## -- Begin function intel_overlay_put_image
	.p2align	4, 0x90
_intel_overlay_put_image:               ## @intel_overlay_put_image
	.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	8(%rdi), %rax
	movq	(%rax), %r15
	testq	%r15, %r15
	je	LBB0_1
## %bb.2:
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	_I915_OVERLAY_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rsi)
	je	LBB0_3
## %bb.4:
	movq	%rdx, %r13
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$72, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.7:
	movq	%rax, %rbx
	movl	80(%r12), %esi
	movq	_DRM_MODE_OBJECT_CRTC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_drm_mode_object_find
	testq	%rax, %rax
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_8
## %bb.9:
	movq	%rax, %rdi
	callq	_obj_to_crtc
	movl	%eax, %edi
	callq	_to_intel_crtc
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	76(%r12), %edx
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_drm_gem_object_lookup
	movl	%eax, %edi
	callq	_to_intel_bo
	testq	%rax, %rax
	je	LBB0_8
## %bb.10:
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_drm_modeset_lock_all
	movq	%r14, %rdi
	callq	_mutex_lock
	cmpq	$0, 8(%rbx)
	je	LBB0_12
## %bb.11:
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
LBB0_26:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_27
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_3:
	movq	%r14, %rdi
	callq	_drm_modeset_lock_all
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%r15, %rdi
	callq	_intel_overlay_switch_off
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	%r14, %rdi
	callq	_drm_modeset_unlock_all
	movl	%ebx, %eax
	jmp	LBB0_34
LBB0_8:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_28
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_6:
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_33
LBB0_12:
	movq	%r15, %rdi
	callq	_intel_overlay_recover_from_interrupt
	movl	%eax, %r13d
	testl	%eax, %eax
	je	LBB0_13
LBB0_27:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	%r14, %rdi
	callq	_drm_modeset_unlock_all
	movq	%rbx, %rdi
	callq	_drm_gem_object_unreference_unlocked
LBB0_28:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_kfree
LBB0_33:
	movl	%r13d, %eax
LBB0_34:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpq	%rax, 8(%r15)
	je	LBB0_20
## %bb.14:
	movq	%r15, %rdi
	callq	_intel_overlay_switch_off
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_27
## %bb.15:
	movq	%r15, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_check_overlay_possible_on_crtc
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_27
## %bb.16:
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, 8(%r15)
	movq	%r15, 8(%r13)
	cmpl	$1025, 16(%r13)                 ## imm = 0x401
	jl	LBB0_19
## %bb.17:
	movq	%r14, %rdi
	callq	_intel_panel_fitter_pipe
	cmpq	(%r13), %rax
	jne	LBB0_19
## %bb.18:
	movl	$1, (%r15)
	movq	%r15, %rdi
	callq	_update_pfit_vscale_ratio
	jmp	LBB0_20
LBB0_19:
	movl	$0, (%r15)
LBB0_20:
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_check_overlay_dst
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_27
## %bb.21:
	cmpl	$0, (%r15)
	movl	4(%r12), %ecx
	je	LBB0_23
## %bb.22:
	shll	$12, %ecx
	movl	4(%r15), %esi
	movl	%ecx, %eax
	cltd
	idivl	%esi
	movl	8(%r12), %edx
	shll	$12, %edx
	movl	%eax, %ecx
	movl	%edx, %eax
	cltd
	idivl	%esi
	incl	%eax
	jmp	LBB0_24
LBB0_23:
	movl	8(%r12), %eax
LBB0_24:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%ecx, (%rdi)
	movl	%eax, 4(%rdi)
	movl	72(%r12), %eax
	movl	%eax, 68(%rdi)
	movl	68(%r12), %eax
	movl	%eax, 64(%rdi)
	movq	16(%r12), %rax
	movq	%rax, 8(%rdi)
	movq	24(%r12), %rdx
	movq	%rdx, 16(%rdi)
	movq	32(%r12), %rcx
	movq	%rcx, 24(%rdi)
	movq	40(%r12), %rsi
	movq	%rsi, 32(%rdi)
	cmpq	%rdx, %rsi
	jg	LBB0_26
## %bb.25:
	cmpq	%rax, %rcx
	jg	LBB0_26
## %bb.29:
	movq	%r14, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	callq	_check_overlay_src
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_27
## %bb.30:
	movq	_I915_OVERLAY_FLAGS_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	(%r12), %eax
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, 40(%rdi)
	movl	64(%r12), %eax
	movl	%eax, 60(%rdi)
	movups	48(%r12), %xmm0
	movups	%xmm0, 44(%rdi)
	callq	_check_overlay_scaling
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_27
## %bb.31:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_intel_overlay_do_put_image
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_27
## %bb.32:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	%r14, %rdi
	callq	_drm_modeset_unlock_all
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_kfree
	xorl	%r13d, %r13d
	jmp	LBB0_33
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"userspace bug: no overlay\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_I915_OVERLAY_ENABLE,4,2        ## @I915_OVERLAY_ENABLE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DRM_MODE_OBJECT_CRTC,4,2       ## @DRM_MODE_OBJECT_CRTC
	.comm	_ENOENT,4,2                     ## @ENOENT
L_.str.1:                               ## @.str.1
	.asciz	"buffer used for overlay image can not be tiled\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_overlay_put_image        ; -- Begin function intel_overlay_put_image
	.p2align	2
_intel_overlay_put_image:               ; @intel_overlay_put_image
	.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
	ldr	x8, [x0, #8]
	ldr	x21, [x8]
	cbz	x21, LBB0_8
; %bb.1:
	mov	x22, x1
	mov	x19, x0
	ldr	w8, [x1]
Lloh0:
	adrp	x9, _I915_OVERLAY_ENABLE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _I915_OVERLAY_ENABLE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.2:
	mov	x23, x2
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	w0, #72
	bl	_kmalloc
	cbz	x0, LBB0_11
; %bb.3:
	mov	x20, x0
	ldr	w1, [x22, #80]
Lloh6:
	adrp	x8, _DRM_MODE_OBJECT_CRTC@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DRM_MODE_OBJECT_CRTC@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_drm_mode_object_find
	cbz	x0, LBB0_10
; %bb.4:
	bl	_obj_to_crtc
	bl	_to_intel_crtc
	mov	x25, x0
	ldr	w2, [x22, #76]
	mov	x0, x19
	mov	x1, x23
	bl	_drm_gem_object_lookup
	bl	_to_intel_bo
	cbz	x0, LBB0_10
; %bb.5:
	mov	x23, x0
	mov	x0, x19
	bl	_drm_modeset_lock_all
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x23, #8]
	cbz	x8, LBB0_13
; %bb.6:
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
LBB0_7:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_14
LBB0_8:
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG
Lloh16:
	adrp	x8, _ENODEV@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_12
LBB0_9:
	mov	x0, x19
	bl	_drm_modeset_lock_all
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x21
	bl	_intel_overlay_switch_off
	mov	x20, x0
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x19
	bl	_drm_modeset_unlock_all
	mov	x0, x20
	b	LBB0_17
LBB0_10:
Lloh18:
	adrp	x8, _ENOENT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_15
LBB0_11:
Lloh21:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_16
LBB0_13:
	mov	x0, x21
	bl	_intel_overlay_recover_from_interrupt
	mov	x24, x0
	cbz	w0, LBB0_18
LBB0_14:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x19
	bl	_drm_modeset_unlock_all
	mov	x0, x23
	bl	_drm_gem_object_unreference_unlocked
LBB0_15:
	mov	x0, x20
	bl	_kfree
LBB0_16:
	mov	x0, x24
LBB0_17:
	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_18:
	ldr	x8, [x21, #8]
	cmp	x8, x25
	b.eq	LBB0_25
; %bb.19:
	mov	x0, x21
	bl	_intel_overlay_switch_off
	mov	x24, x0
	cbnz	w0, LBB0_14
; %bb.20:
	mov	x0, x21
	mov	x1, x25
	bl	_check_overlay_possible_on_crtc
	mov	x24, x0
	cbnz	w0, LBB0_14
; %bb.21:
	str	x25, [x21, #8]
	str	x21, [x25, #8]
	ldr	w8, [x25, #16]
	cmp	w8, #1025
	b.lt	LBB0_24
; %bb.22:
	mov	x0, x19
	bl	_intel_panel_fitter_pipe
	ldr	x8, [x25]
	cmp	x0, x8
	b.ne	LBB0_24
; %bb.23:
	mov	w8, #1
	str	w8, [x21]
	mov	x0, x21
	bl	_update_pfit_vscale_ratio
	b	LBB0_25
LBB0_24:
	str	wzr, [x21]
LBB0_25:
	mov	x0, x21
	mov	x1, x22
	bl	_check_overlay_dst
	mov	x24, x0
	cbnz	w0, LBB0_14
; %bb.26:
	ldr	w9, [x21]
	ldr	w8, [x22, #4]
	cbz	w9, LBB0_28
; %bb.27:
	lsl	w8, w8, #12
	ldr	w10, [x21, #4]
	ldr	w9, [x22, #8]
	lsl	w9, w9, #12
	sdiv	w9, w9, w10
	add	w9, w9, #1
	sdiv	w8, w8, w10
	b	LBB0_29
LBB0_28:
	ldr	w9, [x22, #8]
LBB0_29:
	stp	w8, w9, [x20]
	ldur	d0, [x22, #68]
	str	d0, [x20, #64]
	ldp	x8, x10, [x22, #16]
	stp	x8, x10, [x20, #8]
	ldp	x9, x11, [x22, #32]
	stp	x9, x11, [x20, #24]
	cmp	x11, x10
	b.gt	LBB0_7
; %bb.30:
	cmp	x9, x8
	b.gt	LBB0_7
; %bb.31:
	mov	x0, x19
	mov	x1, x22
	mov	x2, x23
	bl	_check_overlay_src
	mov	x24, x0
	cbnz	w0, LBB0_14
; %bb.32:
	ldr	w8, [x22]
Lloh23:
	adrp	x9, _I915_OVERLAY_FLAGS_MASK@GOTPAGE
Lloh24:
	ldr	x9, [x9, _I915_OVERLAY_FLAGS_MASK@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	bic	w8, w8, w9
	str	w8, [x20, #40]
	ldr	w8, [x22, #64]
	str	w8, [x20, #60]
	ldr	q0, [x22, #48]
	stur	q0, [x20, #44]
	mov	x0, x20
	bl	_check_overlay_scaling
	mov	x24, x0
	cbnz	w0, LBB0_14
; %bb.33:
	mov	x0, x21
	mov	x1, x23
	mov	x2, x20
	bl	_intel_overlay_do_put_image
	mov	x24, x0
	cbnz	w0, LBB0_14
; %bb.34:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x19
	bl	_drm_modeset_unlock_all
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"userspace bug: no overlay\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_I915_OVERLAY_ENABLE,4,2        ; @I915_OVERLAY_ENABLE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DRM_MODE_OBJECT_CRTC,4,2       ; @DRM_MODE_OBJECT_CRTC
	.comm	_ENOENT,4,2                     ; @ENOENT
l_.str.1:                               ; @.str.1
	.asciz	"buffer used for overlay image can not be tiled\n"

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