	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_legacy_tv_adjust_crtc_reg ## -- Begin function radeon_legacy_tv_adjust_crtc_reg
	.p2align	4, 0x90
_radeon_legacy_tv_adjust_crtc_reg:      ## @radeon_legacy_tv_adjust_crtc_reg
	.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	%r8, %r15
	movq	%rcx, %r14
	movq	%rdx, %r12
	movq	%rsi, %rbx
	callq	_to_radeon_encoder
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_radeon_legacy_tv_get_std_mode
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	(%rax), %ecx
	leal	7(%rcx), %edx
	testl	%ecx, %ecx
	cmovnsl	%ecx, %edx
	movl	4(%rax), %esi
	sarl	$3, %edx
	decl	%edx
	movq	_RADEON_CRTC_H_DISP_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	leal	7(%rsi), %edi
	testl	%esi, %esi
	cmovnsl	%esi, %edi
	sarl	$3, %edi
	decl	%edi
	movq	_RADEON_CRTC_H_TOTAL_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edi
	orl	%edx, %edi
	movl	%edi, (%rbx)
	movq	_RADEON_CRTC_H_SYNC_STRT_PIX@GOTPCREL(%rip), %rcx
	movq	_RADEON_CRTC_H_SYNC_STRT_CHAR@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	notl	%edx
	andl	(%r12), %edx
	movl	8(%rax), %esi
	leal	7(%rsi), %edi
	testl	%esi, %esi
	cmovnsl	%esi, %edi
	sarl	$3, %edi
	decl	%edi
	movq	_RADEON_CRTC_H_SYNC_STRT_CHAR_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edi
	andl	$7, %esi
	orl	%edi, %esi
	orl	%edx, %esi
	movl	%esi, (%r12)
	movl	12(%rax), %edx
	decl	%edx
	movq	_RADEON_CRTC_V_DISP_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	movl	16(%rax), %esi
	decl	%esi
	movq	_RADEON_CRTC_V_TOTAL_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %esi
	orl	%edx, %esi
	movl	%esi, (%r14)
	movq	_RADEON_CRTC_V_SYNC_STRT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	notl	%edx
	movl	20(%rax), %eax
	decl	%eax
	movq	_RADEON_CRTC_V_SYNC_STRT_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	andl	(%r15), %edx
	orl	%edx, %eax
	movl	%eax, (%r15)
LBB0_2:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RADEON_CRTC_H_DISP_SHIFT,4,2   ## @RADEON_CRTC_H_DISP_SHIFT
	.comm	_RADEON_CRTC_H_TOTAL_SHIFT,4,2  ## @RADEON_CRTC_H_TOTAL_SHIFT
	.comm	_RADEON_CRTC_H_SYNC_STRT_PIX,4,2 ## @RADEON_CRTC_H_SYNC_STRT_PIX
	.comm	_RADEON_CRTC_H_SYNC_STRT_CHAR,4,2 ## @RADEON_CRTC_H_SYNC_STRT_CHAR
	.comm	_RADEON_CRTC_H_SYNC_STRT_CHAR_SHIFT,4,2 ## @RADEON_CRTC_H_SYNC_STRT_CHAR_SHIFT
	.comm	_RADEON_CRTC_V_DISP_SHIFT,4,2   ## @RADEON_CRTC_V_DISP_SHIFT
	.comm	_RADEON_CRTC_V_TOTAL_SHIFT,4,2  ## @RADEON_CRTC_V_TOTAL_SHIFT
	.comm	_RADEON_CRTC_V_SYNC_STRT,4,2    ## @RADEON_CRTC_V_SYNC_STRT
	.comm	_RADEON_CRTC_V_SYNC_STRT_SHIFT,4,2 ## @RADEON_CRTC_V_SYNC_STRT_SHIFT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_legacy_tv_adjust_crtc_reg ; -- Begin function radeon_legacy_tv_adjust_crtc_reg
	.p2align	2
_radeon_legacy_tv_adjust_crtc_reg:      ; @radeon_legacy_tv_adjust_crtc_reg
	.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	x19, x4
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	bl	_to_radeon_encoder
	mov	x1, #0
	bl	_radeon_legacy_tv_get_std_mode
	cbz	x0, LBB0_2
; %bb.1:
	ldp	w8, w9, [x0]
	add	w10, w8, #7
	cmp	w8, #0
	csel	w8, w10, w8, lt
	asr	w8, w8, #3
	sub	w8, w8, #1
Lloh0:
	adrp	x10, _RADEON_CRTC_H_DISP_SHIFT@GOTPAGE
Lloh1:
	ldr	x10, [x10, _RADEON_CRTC_H_DISP_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
	lsl	w8, w8, w10
	add	w10, w9, #7
	cmp	w9, #0
	csel	w9, w10, w9, lt
	asr	w9, w9, #3
	sub	w9, w9, #1
Lloh3:
	adrp	x10, _RADEON_CRTC_H_TOTAL_SHIFT@GOTPAGE
Lloh4:
	ldr	x10, [x10, _RADEON_CRTC_H_TOTAL_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w8, w9, w8
	str	w8, [x22]
Lloh6:
	adrp	x8, _RADEON_CRTC_H_SYNC_STRT_PIX@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RADEON_CRTC_H_SYNC_STRT_PIX@GOTPAGEOFF]
	ldr	w9, [x21]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x10, _RADEON_CRTC_H_SYNC_STRT_CHAR@GOTPAGE
Lloh10:
	ldr	x10, [x10, _RADEON_CRTC_H_SYNC_STRT_CHAR@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	orr	w8, w10, w8
	bic	w8, w9, w8
	ldr	w9, [x0, #8]
	add	w10, w9, #7
	cmp	w9, #0
	csel	w10, w10, w9, lt
	asr	w10, w10, #3
	sub	w10, w10, #1
Lloh12:
	adrp	x11, _RADEON_CRTC_H_SYNC_STRT_CHAR_SHIFT@GOTPAGE
Lloh13:
	ldr	x11, [x11, _RADEON_CRTC_H_SYNC_STRT_CHAR_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	w11, [x11]
	lsl	w10, w10, w11
	and	w9, w9, #0x7
	orr	w8, w8, w9
	orr	w8, w8, w10
	str	w8, [x21]
	ldp	w8, w9, [x0, #12]
	sub	w8, w8, #1
Lloh15:
	adrp	x10, _RADEON_CRTC_V_DISP_SHIFT@GOTPAGE
Lloh16:
	ldr	x10, [x10, _RADEON_CRTC_V_DISP_SHIFT@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
	lsl	w8, w8, w10
Lloh18:
	adrp	x10, _RADEON_CRTC_V_TOTAL_SHIFT@GOTPAGE
Lloh19:
	ldr	x10, [x10, _RADEON_CRTC_V_TOTAL_SHIFT@GOTPAGEOFF]
	sub	w9, w9, #1
Lloh20:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w8, w9, w8
	str	w8, [x20]
	ldr	w8, [x19]
Lloh21:
	adrp	x9, _RADEON_CRTC_V_SYNC_STRT@GOTPAGE
Lloh22:
	ldr	x9, [x9, _RADEON_CRTC_V_SYNC_STRT@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	bic	w8, w8, w9
	ldr	w9, [x0, #20]
	sub	w9, w9, #1
Lloh24:
	adrp	x10, _RADEON_CRTC_V_SYNC_STRT_SHIFT@GOTPAGE
Lloh25:
	ldr	x10, [x10, _RADEON_CRTC_V_SYNC_STRT_SHIFT@GOTPAGEOFF]
Lloh26:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_2:
	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
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_RADEON_CRTC_H_DISP_SHIFT,4,2   ; @RADEON_CRTC_H_DISP_SHIFT
	.comm	_RADEON_CRTC_H_TOTAL_SHIFT,4,2  ; @RADEON_CRTC_H_TOTAL_SHIFT
	.comm	_RADEON_CRTC_H_SYNC_STRT_PIX,4,2 ; @RADEON_CRTC_H_SYNC_STRT_PIX
	.comm	_RADEON_CRTC_H_SYNC_STRT_CHAR,4,2 ; @RADEON_CRTC_H_SYNC_STRT_CHAR
	.comm	_RADEON_CRTC_H_SYNC_STRT_CHAR_SHIFT,4,2 ; @RADEON_CRTC_H_SYNC_STRT_CHAR_SHIFT
	.comm	_RADEON_CRTC_V_DISP_SHIFT,4,2   ; @RADEON_CRTC_V_DISP_SHIFT
	.comm	_RADEON_CRTC_V_TOTAL_SHIFT,4,2  ; @RADEON_CRTC_V_TOTAL_SHIFT
	.comm	_RADEON_CRTC_V_SYNC_STRT,4,2    ; @RADEON_CRTC_V_SYNC_STRT
	.comm	_RADEON_CRTC_V_SYNC_STRT_SHIFT,4,2 ; @RADEON_CRTC_V_SYNC_STRT_SHIFT
.subsections_via_symbols
