	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_overlay_put_image_ioctl  ## -- Begin function intel_overlay_put_image_ioctl
	.p2align	4, 0x90
_intel_overlay_put_image_ioctl:         ## @intel_overlay_put_image_ioctl
	.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	%rdx, %r14
	movq	%rsi, %rbx
	movq	%rdi, %r12
	callq	_to_i915
	movq	(%rax), %r15
	testq	%r15, %r15
	je	LBB0_1
## %bb.2:
	movq	%rax, %r13
	movq	_I915_OVERLAY_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_3
## %bb.4:
	movl	52(%rbx), %edx
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_drm_crtc_find
	testq	%rax, %rax
	je	LBB0_5
## %bb.7:
	movq	%rax, %rdi
	callq	_to_intel_crtc
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	48(%rbx), %esi
	movq	%r14, %rdi
	callq	_i915_gem_object_lookup
	testq	%rax, %rax
	je	LBB0_5
## %bb.8:
	movq	%rax, %r14
	movq	%r12, %rdi
	callq	_drm_modeset_lock_all
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_i915_gem_object_is_tiled
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_DEBUG_KMS
LBB0_23:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_24
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_5:
	movq	_ENOENT@GOTPCREL(%rip), %rax
LBB0_6:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_29:
	movl	%r14d, %eax
	jmp	LBB0_30
LBB0_3:
	movq	%r12, %rdi
	callq	_drm_modeset_lock_all
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	%r15, %rdi
	callq	_intel_overlay_switch_off
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	%r12, %rdi
	callq	_drm_modeset_unlock_all
	movl	%ebx, %eax
LBB0_30:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_intel_overlay_recover_from_interrupt
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_11
LBB0_24:
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	%r12, %rdi
	callq	_drm_modeset_unlock_all
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_i915_gem_object_put
	jmp	LBB0_29
LBB0_11:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpq	%rax, 8(%r15)
	je	LBB0_18
## %bb.12:
	movq	%r15, %rdi
	callq	_intel_overlay_switch_off
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_24
## %bb.13:
	movq	%r15, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_check_overlay_possible_on_crtc
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_24
## %bb.14:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 8(%r15)
	movq	%r15, 8(%rax)
	movq	(%rax), %rax
	cmpl	$1025, (%rax)                   ## imm = 0x401
	jl	LBB0_17
## %bb.15:
	movq	_PFIT_ENABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 4(%rax)
	je	LBB0_17
## %bb.16:
	movl	$1, (%r15)
	movq	%r15, %rdi
	callq	_update_pfit_vscale_ratio
	jmp	LBB0_18
LBB0_17:
	movl	$0, (%r15)
LBB0_18:
	movq	%r15, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_check_overlay_dst
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_24
## %bb.19:
	cmpl	$0, (%r15)
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	je	LBB0_21
## %bb.20:
	movl	4(%rsi), %eax
	movl	8(%rsi), %ecx
	shll	$12, %eax
	movl	4(%r15), %edi
	cltd
	idivl	%edi
	movl	%eax, 4(%rsi)
	shll	$12, %ecx
	movl	%ecx, %eax
	cltd
	idivl	%edi
	incl	%eax
	movl	%eax, 8(%rsi)
LBB0_21:
	movq	16(%rsi), %rax
	cmpq	24(%rsi), %rax
	jg	LBB0_23
## %bb.22:
	movq	32(%rsi), %rax
	cmpq	40(%rsi), %rax
	jg	LBB0_23
## %bb.25:
	movq	%r13, %rdi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_check_overlay_src
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_24
## %bb.26:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_check_overlay_scaling
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_24
## %bb.27:
	movq	%r15, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_intel_overlay_do_put_image
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_24
## %bb.28:
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	%r12, %rdi
	callq	_drm_modeset_unlock_all
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_i915_gem_object_put
	xorl	%r14d, %r14d
	jmp	LBB0_29
	.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	_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	_PFIT_ENABLE,4,2                ## @PFIT_ENABLE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_overlay_put_image_ioctl  ; -- Begin function intel_overlay_put_image_ioctl
	.p2align	2
_intel_overlay_put_image_ioctl:         ; @intel_overlay_put_image_ioctl
	.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	x20, x2
	mov	x22, x1
	mov	x19, x0
	bl	_to_i915
	ldr	x21, [x0]
	cbz	x21, LBB0_7
; %bb.1:
	ldr	w8, [x22]
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_11
; %bb.2:
	mov	x23, x0
	ldr	w2, [x22, #52]
	mov	x0, x19
	mov	x1, x20
	bl	_drm_crtc_find
	cbz	x0, LBB0_8
; %bb.3:
	bl	_to_intel_crtc
	mov	x25, x0
	ldr	w1, [x22, #48]
	mov	x0, x20
	bl	_i915_gem_object_lookup
	cbz	x0, LBB0_8
; %bb.4:
	mov	x20, x0
	mov	x0, x19
	bl	_drm_modeset_lock_all
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x20
	bl	_i915_gem_object_is_tiled
	cbz	x0, LBB0_13
; %bb.5:
Lloh3:
	adrp	x0, l_.str.1@PAGE
Lloh4:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_DEBUG_KMS
LBB0_6:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_14
LBB0_7:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG
Lloh10:
	adrp	x8, _ENODEV@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh12:
	adrp	x8, _ENOENT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_10:
	mov	x0, x24
	b	LBB0_12
LBB0_11:
	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
LBB0_12:
	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_13:
	mov	x0, x21
	bl	_intel_overlay_recover_from_interrupt
	mov	x24, x0
	cbz	w0, LBB0_15
LBB0_14:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x19
	bl	_drm_modeset_unlock_all
	mov	x0, x20
	bl	_i915_gem_object_put
	b	LBB0_10
LBB0_15:
	ldr	x8, [x21, #8]
	cmp	x8, x25
	b.eq	LBB0_22
; %bb.16:
	mov	x0, x21
	bl	_intel_overlay_switch_off
	mov	x24, x0
	cbnz	w0, LBB0_14
; %bb.17:
	mov	x0, x21
	mov	x1, x25
	bl	_check_overlay_possible_on_crtc
	mov	x24, x0
	cbnz	w0, LBB0_14
; %bb.18:
	str	x25, [x21, #8]
	str	x21, [x25, #8]
	ldr	x8, [x25]
	ldr	w9, [x8]
	cmp	w9, #1025
	b.lt	LBB0_21
; %bb.19:
	ldr	w8, [x8, #4]
Lloh14:
	adrp	x9, _PFIT_ENABLE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _PFIT_ENABLE@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_21
; %bb.20:
	mov	w8, #1
	str	w8, [x21]
	mov	x0, x21
	bl	_update_pfit_vscale_ratio
	b	LBB0_22
LBB0_21:
	str	wzr, [x21]
LBB0_22:
	mov	x0, x21
	mov	x1, x22
	bl	_check_overlay_dst
	mov	x24, x0
	cbnz	w0, LBB0_14
; %bb.23:
	ldr	w8, [x21]
	cbz	w8, LBB0_25
; %bb.24:
	ldp	w8, w9, [x22, #4]
	lsl	w8, w8, #12
	ldr	w10, [x21, #4]
	lsl	w9, w9, #12
	sdiv	w9, w9, w10
	add	w9, w9, #1
	sdiv	w8, w8, w10
	stp	w8, w9, [x22, #4]
LBB0_25:
	ldp	x8, x9, [x22, #16]
	cmp	x8, x9
	b.gt	LBB0_6
; %bb.26:
	ldp	x8, x9, [x22, #32]
	cmp	x8, x9
	b.gt	LBB0_6
; %bb.27:
	mov	x0, x23
	mov	x1, x22
	mov	x2, x20
	bl	_check_overlay_src
	mov	x24, x0
	cbnz	w0, LBB0_14
; %bb.28:
	mov	x0, x22
	bl	_check_overlay_scaling
	mov	x24, x0
	cbnz	w0, LBB0_14
; %bb.29:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x22
	bl	_intel_overlay_do_put_image
	mov	x24, x0
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.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	_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	_PFIT_ENABLE,4,2                ; @PFIT_ENABLE
.subsections_via_symbols
