	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun8i_r40_tcon_tv_set_mux
_sun8i_r40_tcon_tv_set_mux:             ## @sun8i_r40_tcon_tv_set_mux
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	8(%rdi), %rax
	movl	(%rax), %edi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_of_graph_get_port_by_id
	testq	%rax, %rax
	je	LBB0_9
## %bb.1:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_sun4i_tcon_of_get_id_from_port
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_of_node_put
	movq	8(%r12), %rax
	movl	(%rax), %edi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	movl	$-1, %edx
	callq	_of_graph_get_remote_node
	testq	%rax, %rax
	je	LBB0_9
## %bb.2:
	movq	%rax, %rbx
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movq	%rax, %rdi
	callq	_of_find_device_by_node
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_of_node_put
	testq	%r13, %r13
	je	LBB0_12
## %bb.3:
	movq	_CONFIG_DRM_SUN8I_TCON_TOP@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_IS_ENABLED
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movq	(%r15), %rax
	movq	_DRM_MODE_ENCODER_TMDS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	movq	%r13, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_sun8i_tcon_top_set_hdmi_src
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_11
LBB0_6:
	movl	(%rbx), %edi
	callq	_IS_ENABLED
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movl	(%r12), %esi
	movq	%r13, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_sun8i_tcon_top_de_config
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_11
LBB0_8:
	xorl	%r14d, %r14d
	jmp	LBB0_11
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_10:
	subl	(%rax), %r14d
LBB0_11:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CONFIG_DRM_SUN8I_TCON_TOP,4,2  ## @CONFIG_DRM_SUN8I_TCON_TOP
	.comm	_DRM_MODE_ENCODER_TMDS,8,3      ## @DRM_MODE_ENCODER_TMDS
	.no_dead_strip	_sun8i_r40_tcon_tv_set_mux
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sun8i_r40_tcon_tv_set_mux
_sun8i_r40_tcon_tv_set_mux:             ; @sun8i_r40_tcon_tv_set_mux
	.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	x21, x1
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	w0, [x8]
	mov	w1, #0
	bl	_of_graph_get_port_by_id
	cbz	x0, LBB0_9
; %bb.1:
	mov	x22, x0
	bl	_sun4i_tcon_of_get_id_from_port
	mov	x20, x0
	mov	x0, x22
	bl	_of_node_put
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	mov	w1, #0
	mov	w2, #-1
	bl	_of_graph_get_remote_node
	cbz	x0, LBB0_9
; %bb.2:
	mov	x23, x0
	bl	_of_find_device_by_node
	mov	x22, x0
	mov	x0, x23
	bl	_of_node_put
	cbz	x22, LBB0_9
; %bb.3:
Lloh0:
	adrp	x23, _CONFIG_DRM_SUN8I_TCON_TOP@GOTPAGE
Lloh1:
	ldr	x23, [x23, _CONFIG_DRM_SUN8I_TCON_TOP@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_IS_ENABLED
	cbz	x0, LBB0_6
; %bb.4:
	ldr	x8, [x21]
Lloh2:
	adrp	x9, _DRM_MODE_ENCODER_TMDS@GOTPAGE
Lloh3:
	ldr	x9, [x9, _DRM_MODE_ENCODER_TMDS@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
	mov	x0, x22
	mov	x1, x20
	bl	_sun8i_tcon_top_set_hdmi_src
	cbnz	w0, LBB0_10
LBB0_6:
	ldr	w0, [x23]
	bl	_IS_ENABLED
	cbz	x0, LBB0_8
; %bb.7:
	ldr	w1, [x19]
	mov	x0, x22
	mov	x2, x20
	bl	_sun8i_tcon_top_de_config
	cbnz	w0, LBB0_10
LBB0_8:
	mov	w0, #0
	b	LBB0_10
LBB0_9:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CONFIG_DRM_SUN8I_TCON_TOP,4,2  ; @CONFIG_DRM_SUN8I_TCON_TOP
	.comm	_DRM_MODE_ENCODER_TMDS,8,3      ; @DRM_MODE_ENCODER_TMDS
	.no_dead_strip	_sun8i_r40_tcon_tv_set_mux
.subsections_via_symbols
