	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv50_head_atomic_check_view
_nv50_head_atomic_check_view:           ## @nv50_head_atomic_check_view
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	32(%rdx), %rcx
	leaq	48(%rsi), %rax
	leaq	24(%rsi), %rdi
	movl	(%rdx), %r12d
	movq	(%rcx), %rcx
	testq	%rcx, %rcx
	je	LBB0_1
## %bb.2:
	movq	(%rcx), %r15
	jmp	LBB0_3
LBB0_1:
	xorl	%r15d, %r15d
LBB0_3:
	movq	_DRM_MODE_SCALE_NONE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r12d
	cmovneq	%rax, %rdi
	cmpl	$0, 24(%r14)
	je	LBB0_5
## %bb.4:
	movq	_DRM_MODE_SCALE_FULLSCREEN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r12d
	movq	%rax, %rdi
LBB0_5:
	movq	_DRM_MODE_FLAG_3D_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	andl	28(%rbx), %ecx
	movl	24(%rbx), %eax
	movq	_DRM_MODE_FLAG_3D_FRAME_PACKING@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_7
## %bb.6:
	addl	40(%rbx), %eax
LBB0_7:
	movl	32(%rbx), %ecx
	movl	%ecx, 4(%rbx)
	movl	%eax, 8(%rbx)
	leaq	-40(%rbp), %rsi
	leaq	-36(%rbp), %rdx
	callq	_drm_mode_get_hv_timing
	movl	-40(%rbp), %esi
	movl	%esi, 12(%rbx)
	movl	-36(%rbp), %ecx
	movl	%ecx, 16(%rbx)
	movq	8(%r14), %rax
	movq	_UNDERSCAN_ON@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	je	LBB0_11
## %bb.8:
	movq	_UNDERSCAN_AUTO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_19
## %bb.9:
	movq	%r15, %rdi
	callq	_drm_detect_hdmi_monitor
	testq	%rax, %rax
	je	LBB0_19
## %bb.10:
	movl	12(%rbx), %esi
	movl	16(%rbx), %ecx
LBB0_11:
	movl	16(%r14), %edi
	movl	20(%r14), %r8d
	movl	%ecx, %eax
	shll	$19, %eax
	cltd
	idivl	%esi
	testl	%edi, %edi
	je	LBB0_15
## %bb.12:
	addl	%edi, %edi
	subl	%edi, %esi
	movl	%esi, 12(%rbx)
	testl	%r8d, %r8d
	jne	LBB0_13
## %bb.14:
	imull	%eax, %esi
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	addl	%esi, %ecx
	jmp	LBB0_17
LBB0_15:
	movl	%esi, %edx
	sarl	$4, %edx
	negl	%edx
	addl	%esi, %edx
	addl	$-32, %edx
	movl	%edx, 12(%rbx)
	testl	%r8d, %r8d
	je	LBB0_16
LBB0_13:
	addl	%r8d, %r8d
	subl	%r8d, %ecx
	jmp	LBB0_18
LBB0_16:
	imull	%eax, %edx
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	addl	%edx, %ecx
LBB0_17:
	sarl	$19, %ecx
LBB0_18:
	movl	%ecx, 16(%rbx)
LBB0_19:
	cmpl	$129, %r12d
	je	LBB0_22
## %bb.20:
	cmpl	$128, %r12d
	jne	LBB0_25
## %bb.21:
	movl	4(%rbx), %edi
	movl	12(%rbx), %esi
	callq	_min
	movl	%eax, 12(%rbx)
	movl	8(%rbx), %edi
	movl	16(%rbx), %esi
	callq	_min
	movl	%eax, 16(%rbx)
	jmp	LBB0_25
LBB0_22:
	movl	12(%rbx), %r8d
	movl	4(%rbx), %ecx
	movl	8(%rbx), %esi
	movl	%esi, %eax
	imull	%r8d, %eax
	movl	16(%rbx), %edi
	movl	%edi, %edx
	imull	%ecx, %edx
	cmpl	%edx, %eax
	jle	LBB0_24
## %bb.23:
	shll	$19, %ecx
	movl	%ecx, %eax
	cltd
	idivl	%esi
	imull	%eax, %edi
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	addl	%edi, %ecx
	sarl	$19, %ecx
	movl	%ecx, 12(%rbx)
	jmp	LBB0_25
LBB0_24:
	shll	$19, %esi
	movl	%esi, %eax
	cltd
	idivl	%ecx
	imull	%eax, %r8d
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	addl	%r8d, %ecx
	sarl	$19, %ecx
	movl	%ecx, 16(%rbx)
LBB0_25:
	movl	$1, (%rbx)
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_MODE_SCALE_NONE,4,2        ## @DRM_MODE_SCALE_NONE
	.comm	_DRM_MODE_SCALE_FULLSCREEN,4,2  ## @DRM_MODE_SCALE_FULLSCREEN
	.comm	_DRM_MODE_FLAG_3D_MASK,4,2      ## @DRM_MODE_FLAG_3D_MASK
	.comm	_DRM_MODE_FLAG_3D_FRAME_PACKING,4,2 ## @DRM_MODE_FLAG_3D_FRAME_PACKING
	.comm	_UNDERSCAN_ON,8,3               ## @UNDERSCAN_ON
	.comm	_UNDERSCAN_AUTO,8,3             ## @UNDERSCAN_AUTO
	.no_dead_strip	_nv50_head_atomic_check_view
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv50_head_atomic_check_view
_nv50_head_atomic_check_view:           ; @nv50_head_atomic_check_view
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x2
	mov	x19, x1
	ldr	x11, [x2, #32]
	add	x8, x1, #48
	add	x9, x1, #24
	ldr	w10, [x2]
	ldr	x11, [x11]
	cbz	x11, LBB0_2
; %bb.1:
	ldr	x21, [x11]
	b	LBB0_3
LBB0_2:
	mov	x21, #0
LBB0_3:
	ldr	w11, [x20, #24]
Lloh0:
	adrp	x12, _DRM_MODE_SCALE_FULLSCREEN@GOTPAGE
Lloh1:
	ldr	x12, [x12, _DRM_MODE_SCALE_FULLSCREEN@GOTPAGEOFF]
Lloh2:
	ldr	w12, [x12]
Lloh3:
	adrp	x13, _DRM_MODE_SCALE_NONE@GOTPAGE
Lloh4:
	ldr	x13, [x13, _DRM_MODE_SCALE_NONE@GOTPAGEOFF]
Lloh5:
	ldr	w13, [x13]
	cmp	w11, #0
	csel	w22, w10, w12, eq
	cmp	w10, w13
	ccmp	w11, #0, #0, eq
	csel	x0, x9, x8, eq
	ldp	w8, w9, [x19, #24]
Lloh6:
	adrp	x10, _DRM_MODE_FLAG_3D_MASK@GOTPAGE
Lloh7:
	ldr	x10, [x10, _DRM_MODE_FLAG_3D_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	and	w9, w10, w9
Lloh9:
	adrp	x10, _DRM_MODE_FLAG_3D_FRAME_PACKING@GOTPAGE
Lloh10:
	ldr	x10, [x10, _DRM_MODE_FLAG_3D_FRAME_PACKING@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ne	LBB0_5
; %bb.4:
	ldr	w9, [x19, #40]
	add	w8, w8, w9
LBB0_5:
	ldr	w9, [x19, #32]
	stp	w9, w8, [x19, #4]
	add	x1, sp, #12
	add	x2, sp, #8
	bl	_drm_mode_get_hv_timing
	ldp	w8, w9, [sp, #8]
	stp	w9, w8, [x19, #12]
	ldr	x10, [x20, #8]
Lloh12:
	adrp	x11, _UNDERSCAN_ON@GOTPAGE
Lloh13:
	ldr	x11, [x11, _UNDERSCAN_ON@GOTPAGEOFF]
Lloh14:
	ldr	x11, [x11]
	cmp	x10, x11
	b.eq	LBB0_9
; %bb.6:
Lloh15:
	adrp	x8, _UNDERSCAN_AUTO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _UNDERSCAN_AUTO@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	cmp	x10, x8
	b.ne	LBB0_15
; %bb.7:
	mov	x0, x21
	bl	_drm_detect_hdmi_monitor
	cbz	x0, LBB0_15
; %bb.8:
	ldp	w9, w8, [x19, #12]
LBB0_9:
	ldp	w12, w11, [x20, #16]
	lsl	w10, w8, #19
	sdiv	w10, w10, w9
	cbz	w12, LBB0_12
; %bb.10:
	sub	w9, w9, w12, lsl #1
	str	w9, [x19, #12]
	cbz	w11, LBB0_13
LBB0_11:
	sub	w8, w8, w11, lsl #1
	b	LBB0_14
LBB0_12:
	sub	w9, w9, w9, asr #4
	sub	w9, w9, #32
	str	w9, [x19, #12]
	cbnz	w11, LBB0_11
LBB0_13:
	mul	w8, w9, w10
	cmp	w10, #0
	cinc	w9, w10, lt
	add	w8, w8, w9, asr #1
	asr	w8, w8, #19
LBB0_14:
	str	w8, [x19, #16]
LBB0_15:
	cmp	w22, #129
	b.eq	LBB0_18
; %bb.16:
	cmp	w22, #128
	b.ne	LBB0_21
; %bb.17:
	ldr	w0, [x19, #4]
	ldr	w1, [x19, #12]
	bl	_min
	str	w0, [x19, #12]
	ldr	w0, [x19, #8]
	ldr	w1, [x19, #16]
	bl	_min
	str	w0, [x19, #16]
	b	LBB0_21
LBB0_18:
	ldp	w9, w8, [x19, #4]
	ldp	w10, w11, [x19, #12]
	mul	w12, w8, w10
	mul	w13, w11, w9
	cmp	w12, w13
	b.le	LBB0_20
; %bb.19:
	lsl	w9, w9, #19
	sdiv	w8, w9, w8
	mul	w9, w8, w11
	cmp	w8, #0
	cinc	w8, w8, lt
	add	w8, w9, w8, asr #1
	asr	w8, w8, #19
	str	w8, [x19, #12]
	b	LBB0_21
LBB0_20:
	lsl	w8, w8, #19
	sdiv	w8, w8, w9
	mul	w9, w8, w10
	cmp	w8, #0
	cinc	w8, w8, lt
	add	w8, w9, w8, asr #1
	asr	w8, w8, #19
	str	w8, [x19, #16]
LBB0_21:
	mov	w8, #1
	str	w8, [x19]
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_MODE_SCALE_NONE,4,2        ; @DRM_MODE_SCALE_NONE
	.comm	_DRM_MODE_SCALE_FULLSCREEN,4,2  ; @DRM_MODE_SCALE_FULLSCREEN
	.comm	_DRM_MODE_FLAG_3D_MASK,4,2      ; @DRM_MODE_FLAG_3D_MASK
	.comm	_DRM_MODE_FLAG_3D_FRAME_PACKING,4,2 ; @DRM_MODE_FLAG_3D_FRAME_PACKING
	.comm	_UNDERSCAN_ON,8,3               ; @UNDERSCAN_ON
	.comm	_UNDERSCAN_AUTO,8,3             ; @UNDERSCAN_AUTO
	.no_dead_strip	_nv50_head_atomic_check_view
.subsections_via_symbols
