	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_atombios_encoder_crtc_scratch_regs ## -- Begin function radeon_atombios_encoder_crtc_scratch_regs
	.p2align	4, 0x90
_radeon_atombios_encoder_crtc_scratch_regs: ## @radeon_atombios_encoder_crtc_scratch_regs
	.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
	movl	%esi, %r15d
	movq	(%rdi), %rax
	movq	(%rax), %r14
	callq	_to_radeon_encoder
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_ASIC_IS_DCE4
	testq	%rax, %rax
	je	LBB0_1
## %bb.24:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	(%r14), %rax
	movq	_CHIP_R600@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	jge	LBB0_2
## %bb.3:
	movq	_RADEON_BIOS_3_SCRATCH@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_2:
	movq	_R600_BIOS_3_SCRATCH@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %edi
	callq	_RREG32
	movl	(%rbx), %ecx
	movq	_ATOM_DEVICE_TV1_SUPPORT@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_6
## %bb.5:
	movq	_ATOM_S3_TV1_CRTC_ACTIVE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	notl	%edx
	andl	%edx, %eax
	movl	%r15d, %edx
	shll	$18, %edx
	orl	%edx, %eax
LBB0_6:
	movq	_ATOM_DEVICE_CV_SUPPORT@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_8
## %bb.7:
	movq	_ATOM_S3_CV_CRTC_ACTIVE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	notl	%edx
	andl	%edx, %eax
	movl	%r15d, %edx
	shll	$24, %edx
	orl	%edx, %eax
LBB0_8:
	movq	_ATOM_DEVICE_CRT1_SUPPORT@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_10
## %bb.9:
	movq	_ATOM_S3_CRT1_CRTC_ACTIVE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	notl	%edx
	andl	%edx, %eax
	movl	%r15d, %edx
	shll	$16, %edx
	orl	%edx, %eax
LBB0_10:
	movq	_ATOM_DEVICE_CRT2_SUPPORT@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_12
## %bb.11:
	movq	_ATOM_S3_CRT2_CRTC_ACTIVE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	notl	%edx
	andl	%edx, %eax
	movl	%r15d, %edx
	shll	$20, %edx
	orl	%edx, %eax
LBB0_12:
	movq	_ATOM_DEVICE_LCD1_SUPPORT@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_14
## %bb.13:
	movq	_ATOM_S3_LCD1_CRTC_ACTIVE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	notl	%edx
	andl	%edx, %eax
	movl	%r15d, %edx
	shll	$17, %edx
	orl	%edx, %eax
LBB0_14:
	movq	_ATOM_DEVICE_DFP1_SUPPORT@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_16
## %bb.15:
	movq	_ATOM_S3_DFP1_CRTC_ACTIVE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	notl	%edx
	andl	%edx, %eax
	movl	%r15d, %edx
	shll	$19, %edx
	orl	%edx, %eax
LBB0_16:
	movq	_ATOM_DEVICE_DFP2_SUPPORT@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_18
## %bb.17:
	movq	_ATOM_S3_DFP2_CRTC_ACTIVE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	notl	%edx
	andl	%edx, %eax
	movl	%r15d, %edx
	shll	$23, %edx
	orl	%edx, %eax
LBB0_18:
	movq	_ATOM_DEVICE_DFP3_SUPPORT@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_20
## %bb.19:
	movq	_ATOM_S3_DFP3_CRTC_ACTIVE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%ecx, %eax
	shll	$25, %r15d
	orl	%r15d, %eax
LBB0_20:
	movq	(%r14), %rcx
	cmpq	(%r12), %rcx
	jge	LBB0_21
## %bb.22:
	movq	_RADEON_BIOS_3_SCRATCH@GOTPCREL(%rip), %rcx
	jmp	LBB0_23
LBB0_21:
	movq	_R600_BIOS_3_SCRATCH@GOTPCREL(%rip), %rcx
LBB0_23:
	movl	(%rcx), %edi
	movl	%eax, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_WREG32                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_CHIP_R600,8,3                  ## @CHIP_R600
	.comm	_R600_BIOS_3_SCRATCH,4,2        ## @R600_BIOS_3_SCRATCH
	.comm	_RADEON_BIOS_3_SCRATCH,4,2      ## @RADEON_BIOS_3_SCRATCH
	.comm	_ATOM_DEVICE_TV1_SUPPORT,4,2    ## @ATOM_DEVICE_TV1_SUPPORT
	.comm	_ATOM_S3_TV1_CRTC_ACTIVE,4,2    ## @ATOM_S3_TV1_CRTC_ACTIVE
	.comm	_ATOM_DEVICE_CV_SUPPORT,4,2     ## @ATOM_DEVICE_CV_SUPPORT
	.comm	_ATOM_S3_CV_CRTC_ACTIVE,4,2     ## @ATOM_S3_CV_CRTC_ACTIVE
	.comm	_ATOM_DEVICE_CRT1_SUPPORT,4,2   ## @ATOM_DEVICE_CRT1_SUPPORT
	.comm	_ATOM_S3_CRT1_CRTC_ACTIVE,4,2   ## @ATOM_S3_CRT1_CRTC_ACTIVE
	.comm	_ATOM_DEVICE_CRT2_SUPPORT,4,2   ## @ATOM_DEVICE_CRT2_SUPPORT
	.comm	_ATOM_S3_CRT2_CRTC_ACTIVE,4,2   ## @ATOM_S3_CRT2_CRTC_ACTIVE
	.comm	_ATOM_DEVICE_LCD1_SUPPORT,4,2   ## @ATOM_DEVICE_LCD1_SUPPORT
	.comm	_ATOM_S3_LCD1_CRTC_ACTIVE,4,2   ## @ATOM_S3_LCD1_CRTC_ACTIVE
	.comm	_ATOM_DEVICE_DFP1_SUPPORT,4,2   ## @ATOM_DEVICE_DFP1_SUPPORT
	.comm	_ATOM_S3_DFP1_CRTC_ACTIVE,4,2   ## @ATOM_S3_DFP1_CRTC_ACTIVE
	.comm	_ATOM_DEVICE_DFP2_SUPPORT,4,2   ## @ATOM_DEVICE_DFP2_SUPPORT
	.comm	_ATOM_S3_DFP2_CRTC_ACTIVE,4,2   ## @ATOM_S3_DFP2_CRTC_ACTIVE
	.comm	_ATOM_DEVICE_DFP3_SUPPORT,4,2   ## @ATOM_DEVICE_DFP3_SUPPORT
	.comm	_ATOM_S3_DFP3_CRTC_ACTIVE,4,2   ## @ATOM_S3_DFP3_CRTC_ACTIVE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_atombios_encoder_crtc_scratch_regs ; -- Begin function radeon_atombios_encoder_crtc_scratch_regs
	.p2align	2
_radeon_atombios_encoder_crtc_scratch_regs: ; @radeon_atombios_encoder_crtc_scratch_regs
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	ldr	x8, [x0]
	ldr	x19, [x8]
	bl	_to_radeon_encoder
	mov	x21, x0
	mov	x0, x19
	bl	_ASIC_IS_DCE4
	cbz	x0, LBB0_2
; %bb.1:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_2:
	ldr	x8, [x19]
Lloh0:
	adrp	x22, _CHIP_R600@GOTPAGE
Lloh1:
	ldr	x22, [x22, _CHIP_R600@GOTPAGEOFF]
Lloh2:
	adrp	x23, _RADEON_BIOS_3_SCRATCH@GOTPAGE
Lloh3:
	ldr	x23, [x23, _RADEON_BIOS_3_SCRATCH@GOTPAGEOFF]
	ldr	x9, [x22]
Lloh4:
	adrp	x24, _R600_BIOS_3_SCRATCH@GOTPAGE
Lloh5:
	ldr	x24, [x24, _R600_BIOS_3_SCRATCH@GOTPAGEOFF]
	cmp	x8, x9
	csel	x8, x23, x24, lt
	ldr	w0, [x8]
	bl	_RREG32
	mov	x1, x0
	ldr	w8, [x21]
Lloh6:
	adrp	x9, _ATOM_DEVICE_TV1_SUPPORT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ATOM_DEVICE_TV1_SUPPORT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
Lloh9:
	adrp	x9, _ATOM_S3_TV1_CRTC_ACTIVE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _ATOM_S3_TV1_CRTC_ACTIVE@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	bic	w9, w1, w9
	orr	w1, w9, w20, lsl #18
LBB0_4:
Lloh12:
	adrp	x9, _ATOM_DEVICE_CV_SUPPORT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _ATOM_DEVICE_CV_SUPPORT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
Lloh15:
	adrp	x9, _ATOM_S3_CV_CRTC_ACTIVE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _ATOM_S3_CV_CRTC_ACTIVE@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	bic	w9, w1, w9
	orr	w1, w9, w20, lsl #24
LBB0_6:
Lloh18:
	adrp	x9, _ATOM_DEVICE_CRT1_SUPPORT@GOTPAGE
Lloh19:
	ldr	x9, [x9, _ATOM_DEVICE_CRT1_SUPPORT@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.7:
Lloh21:
	adrp	x9, _ATOM_S3_CRT1_CRTC_ACTIVE@GOTPAGE
Lloh22:
	ldr	x9, [x9, _ATOM_S3_CRT1_CRTC_ACTIVE@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	bic	w9, w1, w9
	orr	w1, w9, w20, lsl #16
LBB0_8:
Lloh24:
	adrp	x9, _ATOM_DEVICE_CRT2_SUPPORT@GOTPAGE
Lloh25:
	ldr	x9, [x9, _ATOM_DEVICE_CRT2_SUPPORT@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.9:
Lloh27:
	adrp	x9, _ATOM_S3_CRT2_CRTC_ACTIVE@GOTPAGE
Lloh28:
	ldr	x9, [x9, _ATOM_S3_CRT2_CRTC_ACTIVE@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	bic	w9, w1, w9
	orr	w1, w9, w20, lsl #20
LBB0_10:
Lloh30:
	adrp	x9, _ATOM_DEVICE_LCD1_SUPPORT@GOTPAGE
Lloh31:
	ldr	x9, [x9, _ATOM_DEVICE_LCD1_SUPPORT@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.11:
Lloh33:
	adrp	x9, _ATOM_S3_LCD1_CRTC_ACTIVE@GOTPAGE
Lloh34:
	ldr	x9, [x9, _ATOM_S3_LCD1_CRTC_ACTIVE@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	bic	w9, w1, w9
	orr	w1, w9, w20, lsl #17
LBB0_12:
Lloh36:
	adrp	x9, _ATOM_DEVICE_DFP1_SUPPORT@GOTPAGE
Lloh37:
	ldr	x9, [x9, _ATOM_DEVICE_DFP1_SUPPORT@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_14
; %bb.13:
Lloh39:
	adrp	x9, _ATOM_S3_DFP1_CRTC_ACTIVE@GOTPAGE
Lloh40:
	ldr	x9, [x9, _ATOM_S3_DFP1_CRTC_ACTIVE@GOTPAGEOFF]
Lloh41:
	ldr	w9, [x9]
	bic	w9, w1, w9
	orr	w1, w9, w20, lsl #19
LBB0_14:
Lloh42:
	adrp	x9, _ATOM_DEVICE_DFP2_SUPPORT@GOTPAGE
Lloh43:
	ldr	x9, [x9, _ATOM_DEVICE_DFP2_SUPPORT@GOTPAGEOFF]
Lloh44:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_16
; %bb.15:
Lloh45:
	adrp	x9, _ATOM_S3_DFP2_CRTC_ACTIVE@GOTPAGE
Lloh46:
	ldr	x9, [x9, _ATOM_S3_DFP2_CRTC_ACTIVE@GOTPAGEOFF]
Lloh47:
	ldr	w9, [x9]
	bic	w9, w1, w9
	orr	w1, w9, w20, lsl #23
LBB0_16:
Lloh48:
	adrp	x9, _ATOM_DEVICE_DFP3_SUPPORT@GOTPAGE
Lloh49:
	ldr	x9, [x9, _ATOM_DEVICE_DFP3_SUPPORT@GOTPAGEOFF]
Lloh50:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_18
; %bb.17:
Lloh51:
	adrp	x8, _ATOM_S3_DFP3_CRTC_ACTIVE@GOTPAGE
Lloh52:
	ldr	x8, [x8, _ATOM_S3_DFP3_CRTC_ACTIVE@GOTPAGEOFF]
Lloh53:
	ldr	w8, [x8]
	bic	w8, w1, w8
	orr	w1, w8, w20, lsl #25
LBB0_18:
	ldr	x8, [x19]
	ldr	x9, [x22]
	cmp	x8, x9
	csel	x8, x23, x24, lt
	ldr	w0, [x8]
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_WREG32
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.cfi_endproc
                                        ; -- End function
	.comm	_CHIP_R600,8,3                  ; @CHIP_R600
	.comm	_R600_BIOS_3_SCRATCH,4,2        ; @R600_BIOS_3_SCRATCH
	.comm	_RADEON_BIOS_3_SCRATCH,4,2      ; @RADEON_BIOS_3_SCRATCH
	.comm	_ATOM_DEVICE_TV1_SUPPORT,4,2    ; @ATOM_DEVICE_TV1_SUPPORT
	.comm	_ATOM_S3_TV1_CRTC_ACTIVE,4,2    ; @ATOM_S3_TV1_CRTC_ACTIVE
	.comm	_ATOM_DEVICE_CV_SUPPORT,4,2     ; @ATOM_DEVICE_CV_SUPPORT
	.comm	_ATOM_S3_CV_CRTC_ACTIVE,4,2     ; @ATOM_S3_CV_CRTC_ACTIVE
	.comm	_ATOM_DEVICE_CRT1_SUPPORT,4,2   ; @ATOM_DEVICE_CRT1_SUPPORT
	.comm	_ATOM_S3_CRT1_CRTC_ACTIVE,4,2   ; @ATOM_S3_CRT1_CRTC_ACTIVE
	.comm	_ATOM_DEVICE_CRT2_SUPPORT,4,2   ; @ATOM_DEVICE_CRT2_SUPPORT
	.comm	_ATOM_S3_CRT2_CRTC_ACTIVE,4,2   ; @ATOM_S3_CRT2_CRTC_ACTIVE
	.comm	_ATOM_DEVICE_LCD1_SUPPORT,4,2   ; @ATOM_DEVICE_LCD1_SUPPORT
	.comm	_ATOM_S3_LCD1_CRTC_ACTIVE,4,2   ; @ATOM_S3_LCD1_CRTC_ACTIVE
	.comm	_ATOM_DEVICE_DFP1_SUPPORT,4,2   ; @ATOM_DEVICE_DFP1_SUPPORT
	.comm	_ATOM_S3_DFP1_CRTC_ACTIVE,4,2   ; @ATOM_S3_DFP1_CRTC_ACTIVE
	.comm	_ATOM_DEVICE_DFP2_SUPPORT,4,2   ; @ATOM_DEVICE_DFP2_SUPPORT
	.comm	_ATOM_S3_DFP2_CRTC_ACTIVE,4,2   ; @ATOM_S3_DFP2_CRTC_ACTIVE
	.comm	_ATOM_DEVICE_DFP3_SUPPORT,4,2   ; @ATOM_DEVICE_DFP3_SUPPORT
	.comm	_ATOM_S3_DFP3_CRTC_ACTIVE,4,2   ; @ATOM_S3_DFP3_CRTC_ACTIVE
.subsections_via_symbols
