	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function psb_intel_sdvo_mode_set
_psb_intel_sdvo_mode_set:               ## @psb_intel_sdvo_mode_set
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	movq	8(%rbx), %r15
	callq	_to_gma_crtc
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_to_psb_intel_sdvo
	movq	%rax, %rbx
	movq	%r13, %rdi
	callq	_psb_intel_mode_get_pixel_multiplier
	movl	%eax, %r12d
	movq	%r15, %rdi
	callq	_IS_MRST
	testq	%r14, %r14
	je	LBB0_34
## %bb.1:
	movq	%rax, %r15
	movl	32(%rbx), %eax
	movl	%eax, -64(%rbp)
	movq	$0, -72(%rbp)
	movq	_SDVO_CMD_SET_IN_OUT_MAP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-72(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$16, %ecx
	callq	_psb_intel_sdvo_set_value
	movl	32(%rbx), %esi
	movq	%rbx, %rdi
	callq	_psb_intel_sdvo_set_target_output
	testl	%eax, %eax
	je	LBB0_34
## %bb.2:
	cmpq	$0, 16(%rbx)
	jne	LBB0_4
## %bb.3:
	cmpq	$0, 40(%rbx)
	je	LBB0_5
LBB0_4:
	movl	36(%rbx), %eax
	movl	%eax, -48(%rbp)
LBB0_7:
	movq	%rbx, %rdi
	callq	_psb_intel_sdvo_set_target_input
	testl	%eax, %eax
	je	LBB0_34
## %bb.8:
	cmpq	$0, 24(%rbx)
	je	LBB0_10
## %bb.9:
	movq	_SDVO_ENCODE_HDMI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_psb_intel_sdvo_set_encode
	movq	_SDVO_COLORIMETRY_RGB256@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_psb_intel_sdvo_set_colorimetry
	movq	%rbx, %rdi
	callq	_psb_intel_sdvo_set_avi_infoframe
	cmpq	$0, 16(%rbx)
	jne	LBB0_12
	jmp	LBB0_13
LBB0_10:
	movq	_SDVO_ENCODE_DVI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_psb_intel_sdvo_set_encode
	cmpq	$0, 16(%rbx)
	je	LBB0_13
LBB0_12:
	movq	%rbx, %rdi
	callq	_psb_intel_sdvo_set_tv_format
	testl	%eax, %eax
	je	LBB0_34
LBB0_13:
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_psb_intel_sdvo_set_input_timing
	cmpl	$2, %r12d
	jne	LBB0_14
## %bb.15:
	movq	_SDVO_CLOCK_RATE_MULT_2X@GOTPCREL(%rip), %rax
	cmpl	$4, %r12d
	je	LBB0_17
	jmp	LBB0_18
LBB0_14:
	movq	_SDVO_CLOCK_RATE_MULT_1X@GOTPCREL(%rip), %rax
	cmpl	$4, %r12d
	jne	LBB0_18
LBB0_17:
	movq	_SDVO_CLOCK_RATE_MULT_4X@GOTPCREL(%rip), %rax
LBB0_18:
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_psb_intel_sdvo_set_clock_rate_mult
	testl	%eax, %eax
	je	LBB0_34
## %bb.19:
	movl	(%rbx), %edi
	testq	%r15, %r15
	je	LBB0_21
## %bb.20:
	callq	_REG_READ_AUX
	jmp	LBB0_22
LBB0_5:
	movl	32(%rbx), %esi
	movq	%rbx, %rdi
	callq	_psb_intel_sdvo_set_target_output
	testl	%eax, %eax
	je	LBB0_34
## %bb.6:
	leaq	-48(%rbp), %r14
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_psb_intel_sdvo_get_dtd_from_mode
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_psb_intel_sdvo_set_output_timing
	jmp	LBB0_7
LBB0_21:
	callq	_REG_READ
LBB0_22:
	movl	(%rbx), %ecx
	cmpl	$128, %ecx
	je	LBB0_25
## %bb.23:
	cmpl	$129, %ecx
	jne	LBB0_27
## %bb.24:
	movq	_SDVOB_PRESERVE_MASK@GOTPCREL(%rip), %rcx
	jmp	LBB0_26
LBB0_25:
	movq	_SDVOC_PRESERVE_MASK@GOTPCREL(%rip), %rcx
LBB0_26:
	andl	(%rcx), %eax
LBB0_27:
	xorl	%ecx, %ecx
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	cmpl	$1, (%rdx)
	movl	$0, %esi
	jne	LBB0_29
## %bb.28:
	movq	_SDVO_PIPE_B_SELECT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
LBB0_29:
	cmpq	$0, 8(%rbx)
	je	LBB0_31
## %bb.30:
	movq	_SDVO_AUDIO_ENABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_31:
	movq	_SDVO_BORDER_ENABLE@GOTPCREL(%rip), %rdi
	movq	_SDVO_NEED_TO_STALL@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	andl	-48(%rbp), %edx
	je	LBB0_33
## %bb.32:
	movq	_SDVO_STALL_SELECT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
LBB0_33:
	orl	(%rdi), %eax
	orl	%ecx, %eax
	orl	%eax, %esi
	orl	%edx, %esi
	orl	$4718592, %esi                  ## imm = 0x480000
	movq	%rbx, %rdi
	callq	_psb_intel_sdvo_write_sdvox
LBB0_34:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SDVO_CMD_SET_IN_OUT_MAP,4,2    ## @SDVO_CMD_SET_IN_OUT_MAP
	.comm	_SDVO_ENCODE_HDMI,4,2           ## @SDVO_ENCODE_HDMI
	.comm	_SDVO_COLORIMETRY_RGB256,4,2    ## @SDVO_COLORIMETRY_RGB256
	.comm	_SDVO_ENCODE_DVI,4,2            ## @SDVO_ENCODE_DVI
	.comm	_SDVO_CLOCK_RATE_MULT_1X,4,2    ## @SDVO_CLOCK_RATE_MULT_1X
	.comm	_SDVO_CLOCK_RATE_MULT_2X,4,2    ## @SDVO_CLOCK_RATE_MULT_2X
	.comm	_SDVO_CLOCK_RATE_MULT_4X,4,2    ## @SDVO_CLOCK_RATE_MULT_4X
	.comm	_SDVOB_PRESERVE_MASK,4,2        ## @SDVOB_PRESERVE_MASK
	.comm	_SDVOC_PRESERVE_MASK,4,2        ## @SDVOC_PRESERVE_MASK
	.comm	_SDVO_BORDER_ENABLE,4,2         ## @SDVO_BORDER_ENABLE
	.comm	_SDVO_PIPE_B_SELECT,4,2         ## @SDVO_PIPE_B_SELECT
	.comm	_SDVO_AUDIO_ENABLE,4,2          ## @SDVO_AUDIO_ENABLE
	.comm	_SDVO_NEED_TO_STALL,4,2         ## @SDVO_NEED_TO_STALL
	.comm	_SDVO_STALL_SELECT,4,2          ## @SDVO_STALL_SELECT
	.no_dead_strip	_psb_intel_sdvo_mode_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function psb_intel_sdvo_mode_set
_psb_intel_sdvo_mode_set:               ; @psb_intel_sdvo_mode_set
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x23, x2
	mov	x24, x1
	mov	x19, x0
	ldp	x0, x21, [x0]
	bl	_to_gma_crtc
	mov	x20, x0
	mov	x0, x19
	bl	_to_psb_intel_sdvo
	mov	x19, x0
	mov	x0, x23
	bl	_psb_intel_mode_get_pixel_multiplier
	mov	x22, x0
	mov	x0, x21
	bl	_IS_MRST
	cbz	x24, LBB0_22
; %bb.1:
	mov	x21, x0
	ldr	w8, [x19, #32]
	str	w8, [sp, #24]
	str	xzr, [sp, #16]
Lloh0:
	adrp	x8, _SDVO_CMD_SET_IN_OUT_MAP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SDVO_CMD_SET_IN_OUT_MAP@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #16
	mov	x0, x19
	mov	w3, #16
	bl	_psb_intel_sdvo_set_value
	ldr	w1, [x19, #32]
	mov	x0, x19
	bl	_psb_intel_sdvo_set_target_output
	cbz	w0, LBB0_22
; %bb.2:
	ldr	x8, [x19, #16]
	cbnz	x8, LBB0_4
; %bb.3:
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_13
LBB0_4:
	ldr	w8, [x19, #36]
	str	w8, [sp, #8]
LBB0_5:
	mov	x0, x19
	bl	_psb_intel_sdvo_set_target_input
	cbz	w0, LBB0_22
; %bb.6:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_8
; %bb.7:
Lloh3:
	adrp	x8, _SDVO_ENCODE_HDMI@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SDVO_ENCODE_HDMI@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_psb_intel_sdvo_set_encode
Lloh6:
	adrp	x8, _SDVO_COLORIMETRY_RGB256@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SDVO_COLORIMETRY_RGB256@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_psb_intel_sdvo_set_colorimetry
	mov	x0, x19
	bl	_psb_intel_sdvo_set_avi_infoframe
	ldr	x8, [x19, #16]
	cbnz	x8, LBB0_9
	b	LBB0_10
LBB0_8:
Lloh9:
	adrp	x8, _SDVO_ENCODE_DVI@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SDVO_ENCODE_DVI@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_psb_intel_sdvo_set_encode
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_10
LBB0_9:
	mov	x0, x19
	bl	_psb_intel_sdvo_set_tv_format
	cbz	w0, LBB0_22
LBB0_10:
	add	x1, sp, #8
	mov	x0, x19
	bl	_psb_intel_sdvo_set_input_timing
Lloh12:
	adrp	x8, _SDVO_CLOCK_RATE_MULT_4X@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SDVO_CLOCK_RATE_MULT_4X@GOTPAGEOFF]
Lloh14:
	adrp	x9, _SDVO_CLOCK_RATE_MULT_2X@GOTPAGE
Lloh15:
	ldr	x9, [x9, _SDVO_CLOCK_RATE_MULT_2X@GOTPAGEOFF]
Lloh16:
	adrp	x10, _SDVO_CLOCK_RATE_MULT_1X@GOTPAGE
Lloh17:
	ldr	x10, [x10, _SDVO_CLOCK_RATE_MULT_1X@GOTPAGEOFF]
	cmp	w22, #2
	csel	x9, x9, x10, eq
	cmp	w22, #4
	csel	x8, x8, x9, eq
	ldr	w1, [x8]
	mov	x0, x19
	bl	_psb_intel_sdvo_set_clock_rate_mult
	cbz	w0, LBB0_22
; %bb.11:
	ldr	w0, [x19]
	cbz	x21, LBB0_15
; %bb.12:
	bl	_REG_READ_AUX
	b	LBB0_16
LBB0_13:
	ldr	w1, [x19, #32]
	mov	x0, x19
	bl	_psb_intel_sdvo_set_target_output
	cbz	w0, LBB0_22
; %bb.14:
	add	x0, sp, #8
	mov	x1, x23
	bl	_psb_intel_sdvo_get_dtd_from_mode
	add	x1, sp, #8
	mov	x0, x19
	bl	_psb_intel_sdvo_set_output_timing
	b	LBB0_5
LBB0_15:
	bl	_REG_READ
LBB0_16:
	ldr	w8, [x19]
	cmp	w8, #128
	b.eq	LBB0_19
; %bb.17:
	cmp	w8, #129
	b.ne	LBB0_21
; %bb.18:
Lloh18:
	adrp	x8, _SDVOB_PRESERVE_MASK@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SDVOB_PRESERVE_MASK@GOTPAGEOFF]
	b	LBB0_20
LBB0_19:
Lloh20:
	adrp	x8, _SDVOC_PRESERVE_MASK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SDVOC_PRESERVE_MASK@GOTPAGEOFF]
LBB0_20:
	ldr	w8, [x8]
	and	w0, w8, w0
LBB0_21:
Lloh22:
	adrp	x8, _SDVO_BORDER_ENABLE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SDVO_BORDER_ENABLE@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	ldr	w9, [x20]
Lloh25:
	adrp	x10, _SDVO_PIPE_B_SELECT@GOTPAGE
Lloh26:
	ldr	x10, [x10, _SDVO_PIPE_B_SELECT@GOTPAGEOFF]
Lloh27:
	ldr	w10, [x10]
	cmp	w9, #1
	csel	w9, w10, wzr, eq
	ldr	x10, [x19, #8]
Lloh28:
	adrp	x11, _SDVO_AUDIO_ENABLE@GOTPAGE
Lloh29:
	ldr	x11, [x11, _SDVO_AUDIO_ENABLE@GOTPAGEOFF]
Lloh30:
	ldr	w11, [x11]
	cmp	x10, #0
	csel	w10, wzr, w11, eq
	ldr	w11, [sp, #8]
Lloh31:
	adrp	x12, _SDVO_NEED_TO_STALL@GOTPAGE
Lloh32:
	ldr	x12, [x12, _SDVO_NEED_TO_STALL@GOTPAGEOFF]
Lloh33:
	ldr	w12, [x12]
Lloh34:
	adrp	x13, _SDVO_STALL_SELECT@GOTPAGE
Lloh35:
	ldr	x13, [x13, _SDVO_STALL_SELECT@GOTPAGEOFF]
Lloh36:
	ldr	w13, [x13]
	tst	w12, w11
	csel	w11, wzr, w13, eq
	orr	w8, w0, w8
	orr	w8, w8, w9
	orr	w8, w8, w10
	orr	w8, w8, w11
	mov	w9, #4718592
	orr	w1, w8, w9
	mov	x0, x19
	bl	_psb_intel_sdvo_write_sdvox
LBB0_22:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_SDVO_CMD_SET_IN_OUT_MAP,4,2    ; @SDVO_CMD_SET_IN_OUT_MAP
	.comm	_SDVO_ENCODE_HDMI,4,2           ; @SDVO_ENCODE_HDMI
	.comm	_SDVO_COLORIMETRY_RGB256,4,2    ; @SDVO_COLORIMETRY_RGB256
	.comm	_SDVO_ENCODE_DVI,4,2            ; @SDVO_ENCODE_DVI
	.comm	_SDVO_CLOCK_RATE_MULT_1X,4,2    ; @SDVO_CLOCK_RATE_MULT_1X
	.comm	_SDVO_CLOCK_RATE_MULT_2X,4,2    ; @SDVO_CLOCK_RATE_MULT_2X
	.comm	_SDVO_CLOCK_RATE_MULT_4X,4,2    ; @SDVO_CLOCK_RATE_MULT_4X
	.comm	_SDVOB_PRESERVE_MASK,4,2        ; @SDVOB_PRESERVE_MASK
	.comm	_SDVOC_PRESERVE_MASK,4,2        ; @SDVOC_PRESERVE_MASK
	.comm	_SDVO_BORDER_ENABLE,4,2         ; @SDVO_BORDER_ENABLE
	.comm	_SDVO_PIPE_B_SELECT,4,2         ; @SDVO_PIPE_B_SELECT
	.comm	_SDVO_AUDIO_ENABLE,4,2          ; @SDVO_AUDIO_ENABLE
	.comm	_SDVO_NEED_TO_STALL,4,2         ; @SDVO_NEED_TO_STALL
	.comm	_SDVO_STALL_SELECT,4,2          ; @SDVO_STALL_SELECT
	.no_dead_strip	_psb_intel_sdvo_mode_set
.subsections_via_symbols
