	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ch7xxx_mode_set
_ch7xxx_mode_set:                       ## @ch7xxx_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	cmpl	$65001, (%rsi)                  ## imm = 0xFDE9
	setge	%r12b
	movl	$35, %ecx
	movl	$45, %r14d
	cmovll	%ecx, %r14d
	setl	%al
	leal	(%rax,%rax), %r13d
	addl	$6, %r13d
	movl	%r12d, %ebx
	shll	$4, %ebx
	addl	$22, %ebx
	shll	$6, %r12d
	addl	$96, %r12d
	movq	_CH7xxx_TCTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_ch7xxx_writeb
	movq	_CH7xxx_TVCO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_ch7xxx_writeb
	movq	_CH7xxx_TPCP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r13d, %edx
	callq	_ch7xxx_writeb
	movq	_CH7xxx_TPD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_ch7xxx_writeb
	movq	_CH7xxx_TPVT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$48, %edx
	callq	_ch7xxx_writeb
	movq	_CH7xxx_TLPF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r12d, %edx
	callq	_ch7xxx_writeb
	movq	_CH7xxx_TCT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_ch7xxx_writeb
	movq	_CH7xxx_IDF@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	callq	_ch7xxx_readb
	movq	_CH7xxx_IDF_HSP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_CH7xxx_IDF_VSP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	%eax, %edx
	notl	%edx
	andl	-44(%rbp), %edx
	movl	%edx, -44(%rbp)
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	4(%rcx), %ecx
	movq	_DRM_MODE_FLAG_PHSYNC@GOTPCREL(%rip), %rsi
	testl	%ecx, (%rsi)
	je	LBB0_2
## %bb.1:
	orl	%eax, %edx
	movl	%edx, -44(%rbp)
LBB0_2:
	movq	_DRM_MODE_FLAG_PVSYNC@GOTPCREL(%rip), %rsi
	testl	%ecx, (%rsi)
	je	LBB0_4
## %bb.3:
	orl	%eax, %edx
	movl	%edx, -44(%rbp)
LBB0_4:
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_ch7xxx_writeb
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CH7xxx_TCTL,4,2                ## @CH7xxx_TCTL
	.comm	_CH7xxx_TVCO,4,2                ## @CH7xxx_TVCO
	.comm	_CH7xxx_TPCP,4,2                ## @CH7xxx_TPCP
	.comm	_CH7xxx_TPD,4,2                 ## @CH7xxx_TPD
	.comm	_CH7xxx_TPVT,4,2                ## @CH7xxx_TPVT
	.comm	_CH7xxx_TLPF,4,2                ## @CH7xxx_TLPF
	.comm	_CH7xxx_TCT,4,2                 ## @CH7xxx_TCT
	.comm	_CH7xxx_IDF,4,2                 ## @CH7xxx_IDF
	.comm	_CH7xxx_IDF_HSP,4,2             ## @CH7xxx_IDF_HSP
	.comm	_CH7xxx_IDF_VSP,4,2             ## @CH7xxx_IDF_VSP
	.comm	_DRM_MODE_FLAG_PHSYNC,4,2       ## @DRM_MODE_FLAG_PHSYNC
	.comm	_DRM_MODE_FLAG_PVSYNC,4,2       ## @DRM_MODE_FLAG_PVSYNC
	.no_dead_strip	_ch7xxx_mode_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ch7xxx_mode_set
_ch7xxx_mode_set:                       ; @ch7xxx_mode_set
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	ldr	w8, [x1]
	mov	w9, #65001
	mov	w10, #45
	mov	w11, #35
	cmp	w8, w9
	csel	w21, w11, w10, lt
	mov	w8, #6
	mov	w9, #8
	csel	w22, w9, w8, lt
	mov	w8, #38
	mov	w9, #22
	csel	w23, w9, w8, lt
	mov	w8, #160
	mov	w9, #96
	csel	w24, w9, w8, lt
Lloh0:
	adrp	x8, _CH7xxx_TCTL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CH7xxx_TCTL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_ch7xxx_writeb
Lloh3:
	adrp	x8, _CH7xxx_TVCO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CH7xxx_TVCO@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_ch7xxx_writeb
Lloh6:
	adrp	x8, _CH7xxx_TPCP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CH7xxx_TPCP@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x22
	bl	_ch7xxx_writeb
Lloh9:
	adrp	x8, _CH7xxx_TPD@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CH7xxx_TPD@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x23
	bl	_ch7xxx_writeb
Lloh12:
	adrp	x8, _CH7xxx_TPVT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CH7xxx_TPVT@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #48
	bl	_ch7xxx_writeb
Lloh15:
	adrp	x8, _CH7xxx_TLPF@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CH7xxx_TLPF@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x24
	bl	_ch7xxx_writeb
Lloh18:
	adrp	x8, _CH7xxx_TCT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _CH7xxx_TCT@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_ch7xxx_writeb
Lloh21:
	adrp	x21, _CH7xxx_IDF@GOTPAGE
Lloh22:
	ldr	x21, [x21, _CH7xxx_IDF@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_ch7xxx_readb
Lloh23:
	adrp	x8, _CH7xxx_IDF_HSP@GOTPAGE
Lloh24:
	ldr	x8, [x8, _CH7xxx_IDF_HSP@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
Lloh26:
	adrp	x9, _CH7xxx_IDF_VSP@GOTPAGE
Lloh27:
	ldr	x9, [x9, _CH7xxx_IDF_VSP@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	orr	w9, w9, w8
	ldr	w10, [sp, #12]
	bic	w2, w10, w9
	str	w2, [sp, #12]
	ldr	w9, [x20, #4]
Lloh29:
	adrp	x10, _DRM_MODE_FLAG_PHSYNC@GOTPAGE
Lloh30:
	ldr	x10, [x10, _DRM_MODE_FLAG_PHSYNC@GOTPAGEOFF]
Lloh31:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_2
; %bb.1:
	orr	w2, w2, w8
	str	w2, [sp, #12]
LBB0_2:
Lloh32:
	adrp	x10, _DRM_MODE_FLAG_PVSYNC@GOTPAGE
Lloh33:
	ldr	x10, [x10, _DRM_MODE_FLAG_PVSYNC@GOTPAGEOFF]
Lloh34:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_4
; %bb.3:
	orr	w2, w2, w8
	str	w2, [sp, #12]
LBB0_4:
	ldr	w1, [x21]
	mov	x0, x19
	bl	_ch7xxx_writeb
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh21, Lloh22
	.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
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_CH7xxx_TCTL,4,2                ; @CH7xxx_TCTL
	.comm	_CH7xxx_TVCO,4,2                ; @CH7xxx_TVCO
	.comm	_CH7xxx_TPCP,4,2                ; @CH7xxx_TPCP
	.comm	_CH7xxx_TPD,4,2                 ; @CH7xxx_TPD
	.comm	_CH7xxx_TPVT,4,2                ; @CH7xxx_TPVT
	.comm	_CH7xxx_TLPF,4,2                ; @CH7xxx_TLPF
	.comm	_CH7xxx_TCT,4,2                 ; @CH7xxx_TCT
	.comm	_CH7xxx_IDF,4,2                 ; @CH7xxx_IDF
	.comm	_CH7xxx_IDF_HSP,4,2             ; @CH7xxx_IDF_HSP
	.comm	_CH7xxx_IDF_VSP,4,2             ; @CH7xxx_IDF_VSP
	.comm	_DRM_MODE_FLAG_PHSYNC,4,2       ; @DRM_MODE_FLAG_PHSYNC
	.comm	_DRM_MODE_FLAG_PVSYNC,4,2       ; @DRM_MODE_FLAG_PVSYNC
	.no_dead_strip	_ch7xxx_mode_set
.subsections_via_symbols
