	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function ch7006_encoder_init
LCPI0_0:
	.long	1                               ## 0x1
	.long	50                              ## 0x32
	.long	50                              ## 0x32
	.long	50                              ## 0x32
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_ch7006_encoder_init:                   ## @ch7006_encoder_init
	.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	%rdx, %r15
	movq	%rdi, %r14
	leaq	L_.str(%rip), %rsi
	callq	_ch7006_dbg
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$44, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r13
	movq	%rax, 8(%r15)
	movq	_ch7006_encoder_funcs@GOTPCREL(%rip), %rax
	movq	%rax, (%r15)
	movq	_TV_NORM_PAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r13)
	movq	_DRM_MODE_SUBCONNECTOR_Automatic@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%r13)
	movq	_DRM_MODE_SUBCONNECTOR_Unknown@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%r13)
	movaps	LCPI0_0(%rip), %xmm0            ## xmm0 = [1,50,50,50]
	movups	%xmm0, 4(%r13)
	movabsq	$214748364850, %rax             ## imm = 0x3200000032
	movq	%rax, 20(%r13)
	movl	$-1, 28(%r13)
	movq	_CH7006_VERSION_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_ch7006_read
	movl	%eax, 32(%r13)
	movq	_ch7006_tv_norm@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	testl	%esi, %esi
	je	LBB0_14
## %bb.3:
	movq	_NUM_TV_NORMS@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_4
## %bb.5:
	movq	_ch7006_tv_norm_names@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movl	(%rax), %edi
	callq	_strcmp
	testl	%eax, %eax
	je	LBB0_6
## %bb.8:
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	leaq	1(%rcx), %rbx
	movslq	(%r12), %rax
	cmpq	%rax, %rbx
	jge	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_ch7006_tv_norm@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r15), %rax
	movl	4(%rax,%rcx,4), %edi
	callq	_strcmp
	movq	%rbx, %rcx
	testl	%eax, %eax
	jne	LBB0_9
	jmp	LBB0_7
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_18
LBB0_4:
	xorl	%ebx, %ebx
	cmpl	%eax, %ebx
	je	LBB0_13
	jmp	LBB0_14
LBB0_6:
	xorl	%ebx, %ebx
LBB0_7:
	movl	%ebx, (%r13)
	movl	(%r12), %eax
	cmpl	%eax, %ebx
	jne	LBB0_14
LBB0_13:
	movq	_ch7006_tv_norm@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_ch7006_err
LBB0_14:
	movq	_ch7006_scale@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	cmpl	$2, %edx
	ja	LBB0_16
## %bb.15:
	movl	%edx, 4(%r13)
	jmp	LBB0_17
LBB0_16:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_ch7006_err
LBB0_17:
	xorl	%eax, %eax
LBB0_18:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	incl	%ecx
	movl	%ecx, %ebx
	cmpl	%eax, %ebx
	je	LBB0_13
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ch7006_encoder_funcs,4,2       ## @ch7006_encoder_funcs
	.comm	_TV_NORM_PAL,4,2                ## @TV_NORM_PAL
	.comm	_DRM_MODE_SUBCONNECTOR_Automatic,4,2 ## @DRM_MODE_SUBCONNECTOR_Automatic
	.comm	_DRM_MODE_SUBCONNECTOR_Unknown,4,2 ## @DRM_MODE_SUBCONNECTOR_Unknown
	.comm	_CH7006_VERSION_ID,4,2          ## @CH7006_VERSION_ID
	.comm	_ch7006_tv_norm,4,2             ## @ch7006_tv_norm
	.comm	_NUM_TV_NORMS,4,2               ## @NUM_TV_NORMS
	.comm	_ch7006_tv_norm_names,8,3       ## @ch7006_tv_norm_names
L_.str.1:                               ## @.str.1
	.asciz	"Invalid TV norm setting \"%s\".\n"

	.comm	_ch7006_scale,4,2               ## @ch7006_scale
L_.str.2:                               ## @.str.2
	.asciz	"Invalid scale setting \"%d\".\n"

	.no_dead_strip	_ch7006_encoder_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; -- Begin function ch7006_encoder_init
lCPI0_0:
	.long	1                               ; 0x1
	.long	50                              ; 0x32
	.long	50                              ; 0x32
	.long	50                              ; 0x32
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_ch7006_encoder_init:                   ; @ch7006_encoder_init
	.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, x2
	mov	x19, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_ch7006_dbg
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w0, #44
	bl	_kzalloc
	cbz	x0, LBB0_7
; %bb.1:
	mov	x20, x0
Lloh5:
	adrp	x8, _ch7006_encoder_funcs@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ch7006_encoder_funcs@GOTPAGEOFF]
	stp	x8, x0, [x21]
Lloh7:
	adrp	x8, _TV_NORM_PAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _TV_NORM_PAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	str	w8, [x0]
Lloh10:
	adrp	x8, _DRM_MODE_SUBCONNECTOR_Automatic@GOTPAGE
Lloh11:
	ldr	x8, [x8, _DRM_MODE_SUBCONNECTOR_Automatic@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _DRM_MODE_SUBCONNECTOR_Unknown@GOTPAGE
Lloh14:
	ldr	x9, [x9, _DRM_MODE_SUBCONNECTOR_Unknown@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	stp	w9, w8, [x0, #36]
Lloh16:
	adrp	x8, lCPI0_0@PAGE
Lloh17:
	ldr	q0, [x8, lCPI0_0@PAGEOFF]
	stur	q0, [x0, #4]
	movi.2s	v0, #50
	stur	d0, [x0, #20]
	mov	w8, #-1
	str	w8, [x0, #28]
Lloh18:
	adrp	x8, _CH7006_VERSION_ID@GOTPAGE
Lloh19:
	ldr	x8, [x8, _CH7006_VERSION_ID@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ch7006_read
	str	w0, [x20, #32]
Lloh21:
	adrp	x21, _ch7006_tv_norm@GOTPAGE
Lloh22:
	ldr	x21, [x21, _ch7006_tv_norm@GOTPAGEOFF]
	ldr	w1, [x21]
	cbz	w1, LBB0_12
; %bb.2:
Lloh23:
	adrp	x22, _NUM_TV_NORMS@GOTPAGE
Lloh24:
	ldr	x22, [x22, _NUM_TV_NORMS@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.3:
Lloh25:
	adrp	x24, _ch7006_tv_norm_names@GOTPAGE
Lloh26:
	ldr	x24, [x24, _ch7006_tv_norm_names@GOTPAGEOFF]
	ldr	x8, [x24]
	ldr	w0, [x8]
	bl	_strcmp
	cbz	w0, LBB0_9
; %bb.4:
	mov	x9, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	add	x23, x9, #1
	ldrsw	x8, [x22]
	cmp	x23, x8
	b.ge	LBB0_16
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w1, [x21]
	ldr	x8, [x24]
	add	x8, x8, x9, lsl #2
	ldr	w0, [x8, #4]
	bl	_strcmp
	mov	x9, x23
	cbnz	w0, LBB0_5
	b	LBB0_10
LBB0_7:
Lloh27:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_15
LBB0_8:
	mov	w23, #0
	cmp	w23, w8
	b.eq	LBB0_11
	b	LBB0_12
LBB0_9:
	mov	w23, #0
LBB0_10:
	str	w23, [x20]
	ldr	w8, [x22]
	cmp	w23, w8
	b.ne	LBB0_12
LBB0_11:
	ldr	w2, [x21]
Lloh30:
	adrp	x1, l_.str.1@PAGE
Lloh31:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_ch7006_err
LBB0_12:
Lloh32:
	adrp	x8, _ch7006_scale@GOTPAGE
Lloh33:
	ldr	x8, [x8, _ch7006_scale@GOTPAGEOFF]
Lloh34:
	ldr	w2, [x8]
	cmp	w2, #2
	b.hi	LBB0_14
; %bb.13:
	mov	w0, #0
	str	w2, [x20, #4]
	b	LBB0_15
LBB0_14:
Lloh35:
	adrp	x1, l_.str.2@PAGE
Lloh36:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_ch7006_err
	mov	w0, #0
LBB0_15:
	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_16:
	add	w23, w9, #1
	cmp	w23, w8
	b.eq	LBB0_11
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdr	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ch7006_encoder_funcs,4,2       ; @ch7006_encoder_funcs
	.comm	_TV_NORM_PAL,4,2                ; @TV_NORM_PAL
	.comm	_DRM_MODE_SUBCONNECTOR_Automatic,4,2 ; @DRM_MODE_SUBCONNECTOR_Automatic
	.comm	_DRM_MODE_SUBCONNECTOR_Unknown,4,2 ; @DRM_MODE_SUBCONNECTOR_Unknown
	.comm	_CH7006_VERSION_ID,4,2          ; @CH7006_VERSION_ID
	.comm	_ch7006_tv_norm,4,2             ; @ch7006_tv_norm
	.comm	_NUM_TV_NORMS,4,2               ; @NUM_TV_NORMS
	.comm	_ch7006_tv_norm_names,8,3       ; @ch7006_tv_norm_names
l_.str.1:                               ; @.str.1
	.asciz	"Invalid TV norm setting \"%s\".\n"

	.comm	_ch7006_scale,4,2               ; @ch7006_scale
l_.str.2:                               ; @.str.2
	.asciz	"Invalid scale setting \"%d\".\n"

	.no_dead_strip	_ch7006_encoder_init
.subsections_via_symbols
