	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function zr36050_set_video
_zr36050_set_video:                     ## @zr36050_set_video
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	(%rdi), %r14
	movl	20(%r14), %edx
	movl	(%rsi), %r8d
	movl	4(%rsi), %ecx
	movl	20(%rbx), %r9d
	movl	16(%rbx), %r10d
	movl	(%rbx), %r11d
	movl	4(%rbx), %r15d
	movl	8(%rbx), %r12d
	movl	12(%rbx), %eax
	subq	$8, %rsp
	leaq	L_.str(%rip), %rsi
	movl	$2, %edi
	pushq	%rax
	pushq	%r12
	pushq	%r15
	pushq	%r11
	pushq	%r10
	callq	_dprintk
	addq	$48, %rsp
	movl	(%rbx), %eax
	movl	8(%rbx), %edx
	movzbl	%dl, %ecx
	movl	%edx, %esi
	cltd
	idivl	%ecx
	movl	%eax, %ecx
	movl	%eax, (%r14)
	movl	4(%rbx), %eax
	movl	%esi, %edx
	movzbl	%dh, %esi
	cltd
	idivl	%esi
	movl	%eax, 4(%r14)
	imull	%eax, %ecx
	imull	12(%rbx), %ecx
	shll	$4, %ecx
	movslq	%ecx, %rax
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$38, %rax
	addl	%ecx, %eax
	cmpl	$8193, %eax                     ## imm = 0x2001
	movl	$8192, %ecx                     ## imm = 0x2000
	cmovgel	%eax, %ecx
	movl	8(%r14), %eax
	movl	16(%r14), %edx
	leal	(,%rax,8), %esi
	subl	%eax, %esi
	cmpl	%esi, %ecx
	cmovll	%ecx, %esi
	sarl	$3, %esi
	movl	%esi, 12(%r14)
	movq	_ZR050_MBCV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_zr36050_write
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: set_video %d.%d, %d/%d-%dx%d (0x%x) q%d call\n"

	.comm	_ZR050_MBCV,4,2                 ## @ZR050_MBCV
	.no_dead_strip	_zr36050_set_video
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function zr36050_set_video
_zr36050_set_video:                     ; @zr36050_set_video
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x20, x2
	ldr	x19, [x0]
	ldr	w2, [x19, #20]
	ldp	w4, w3, [x1]
	ldp	w6, w5, [x20, #16]
	ldr	w7, [x20]
	ldur	x8, [x20, #4]
	ldr	w9, [x20, #12]
	str	w9, [sp, #8]
	str	x8, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #2
	bl	_dprintk
	ldp	w8, w9, [x20, #8]
	and	w10, w8, #0xff
	ldp	w11, w12, [x20]
	sdiv	w10, w11, w10
	ubfx	w8, w8, #8, #8
	sdiv	w8, w12, w8
	stp	w10, w8, [x19]
	mul	w8, w10, w8
	mul	w8, w8, w9
	lsl	w8, w8, #4
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w9
	mov	w9, #8192
	cmp	w8, #2, lsl #12                 ; =8192
	csel	w8, w8, w9, gt
	ldr	w9, [x19, #8]
	lsl	w10, w9, #3
	sub	w9, w10, w9
	cmp	w8, w9
	csel	w8, w8, w9, lt
	asr	w8, w8, #3
	str	w8, [x19, #12]
Lloh2:
	adrp	x8, _ZR050_MBCV@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ZR050_MBCV@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	ldr	w2, [x19, #16]
	mov	x0, x19
	bl	_zr36050_write
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: set_video %d.%d, %d/%d-%dx%d (0x%x) q%d call\n"

	.comm	_ZR050_MBCV,4,2                 ; @ZR050_MBCV
	.no_dead_strip	_zr36050_set_video
.subsections_via_symbols
