	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stv0367ter_set_frontend
_stv0367ter_set_frontend:               ## @stv0367ter_set_frontend
	.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	%rdi, %r14
	movq	16(%rdi), %rbx
	movq	16(%rbx), %r13
	movabsq	$566935683203, %rax             ## imm = 0x8400000083
	movq	%rax, -48(%rbp)
	cmpq	$0, 8(%rbx)
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_stv0367ter_init
LBB0_2:
	movq	8(%r14), %rcx
	testq	%rcx, %rcx
	je	LBB0_9
## %bb.3:
	cmpq	$0, (%rbx)
	je	LBB0_6
## %bb.4:
	movq	(%r14), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	%r14, %rdi
	movl	$1, %esi
	callq	*%rax
	movq	8(%r14), %rcx
LBB0_6:
	movq	%r14, %rdi
	callq	*%rcx
	cmpq	$0, (%rbx)
	je	LBB0_9
## %bb.7:
	movq	(%r14), %rax
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	*%rax
LBB0_9:
	cmpl	$129, 24(%r14)
	jne	LBB0_10
## %bb.11:
	movq	_FE_TER_MODE_8K@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_10:
	movq	_FE_TER_MODE_2K@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %eax
	movl	%eax, 32(%r13)
	movl	28(%r14), %eax
	cmpl	$133, %eax
	movl	$136, %ecx
	cmovnel	%eax, %ecx
	movl	%ecx, (%r13)
	movl	32(%r14), %ecx
	cmpl	$7000000, %ecx                  ## imm = 0x6ACFC0
	jne	LBB0_13
## %bb.14:
	movq	_FE_TER_CHAN_BW_7M@GOTPCREL(%rip), %rax
	cmpl	$6000000, %ecx                  ## imm = 0x5B8D80
	je	LBB0_16
	jmp	LBB0_17
LBB0_13:
	movq	_FE_TER_CHAN_BW_8M@GOTPCREL(%rip), %rax
	cmpl	$6000000, %ecx                  ## imm = 0x5B8D80
	jne	LBB0_17
LBB0_16:
	movq	_FE_TER_CHAN_BW_6M@GOTPCREL(%rip), %rax
LBB0_17:
	movl	(%rax), %eax
	movl	%eax, 28(%r13)
	movq	_FE_TER_HIER_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r13)
	movl	$-131, %eax
	addl	36(%r14), %eax
	movl	$1, %r15d
	cmpl	$2, %eax
	jb	LBB0_19
## %bb.18:
	xorl	%r15d, %r15d
	cmpq	$1, 16(%r13)
	adcq	$1, %r15
LBB0_19:
	movq	_FE_TER_NOLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r13)
	movq	_FE_TER_LOCKOK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	$131, %ebx
	xorl	%r12d, %r12d
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_28:                                ##   in Loop: Header=BB0_20 Depth=1
	incq	%r12
	cmpq	%r12, %r15
	je	LBB0_29
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	cmpl	%ecx, %eax
	je	LBB0_29
## %bb.21:                              ##   in Loop: Header=BB0_20 Depth=1
	cmpq	$0, 16(%r13)
	jne	LBB0_24
## %bb.22:                              ##   in Loop: Header=BB0_20 Depth=1
	movl	36(%r14), %eax
	movq	_INVERSION_AUTO@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_20 Depth=1
	movl	-48(%rbp,%r12,4), %eax
	movl	%eax, 4(%r13)
	.p2align	4, 0x90
LBB0_24:                                ##   in Loop: Header=BB0_20 Depth=1
	movq	%r14, %rdi
	callq	_stv0367ter_algo
	movl	8(%r13), %eax
	movq	_FE_TER_LOCKOK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %eax
	jne	LBB0_28
## %bb.25:                              ##   in Loop: Header=BB0_20 Depth=1
	movl	36(%r14), %edx
	movq	_INVERSION_AUTO@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %edx
	jne	LBB0_28
## %bb.26:                              ##   in Loop: Header=BB0_20 Depth=1
	cmpq	$1, %r12
	jne	LBB0_28
## %bb.27:                              ##   in Loop: Header=BB0_20 Depth=1
	movl	%ebx, -44(%rbp)
	movl	%ebx, %edx
	incl	%edx
	shrl	$31, %edx
	addl	%ebx, %edx
	incl	%edx
	andl	$-2, %edx
	negl	%edx
	addl	%edx, %ebx
	incl	%ebx
	movl	%ebx, -48(%rbp)
	jmp	LBB0_28
LBB0_29:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FE_TER_MODE_2K,4,2             ## @FE_TER_MODE_2K
	.comm	_FE_TER_MODE_8K,4,2             ## @FE_TER_MODE_8K
	.comm	_FE_TER_CHAN_BW_6M,4,2          ## @FE_TER_CHAN_BW_6M
	.comm	_FE_TER_CHAN_BW_7M,4,2          ## @FE_TER_CHAN_BW_7M
	.comm	_FE_TER_CHAN_BW_8M,4,2          ## @FE_TER_CHAN_BW_8M
	.comm	_FE_TER_HIER_NONE,4,2           ## @FE_TER_HIER_NONE
	.comm	_FE_TER_NOLOCK,4,2              ## @FE_TER_NOLOCK
	.comm	_FE_TER_LOCKOK,4,2              ## @FE_TER_LOCKOK
	.comm	_INVERSION_AUTO,4,2             ## @INVERSION_AUTO
	.no_dead_strip	_stv0367ter_set_frontend
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stv0367ter_set_frontend
_stv0367ter_set_frontend:               ; @stv0367ter_set_frontend
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	ldr	x21, [x0, #16]
	mov	x8, #131
	movk	x8, #132, lsl #32
	str	x8, [sp, #8]
	ldp	x8, x20, [x21, #8]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_stv0367ter_init
LBB0_2:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_9
; %bb.3:
	ldr	x9, [x21]
	cbz	x9, LBB0_6
; %bb.4:
	ldr	x9, [x19]
	cbz	x9, LBB0_6
; %bb.5:
	mov	x0, x19
	mov	w1, #1
	blr	x9
	ldr	x8, [x19, #8]
LBB0_6:
	mov	x0, x19
	blr	x8
	ldr	x8, [x21]
	cbz	x8, LBB0_9
; %bb.7:
	ldr	x8, [x19]
	cbz	x8, LBB0_9
; %bb.8:
	mov	x0, x19
	mov	w1, #0
	blr	x8
LBB0_9:
	ldr	w8, [x19, #24]
Lloh0:
	adrp	x9, _FE_TER_MODE_8K@GOTPAGE
Lloh1:
	ldr	x9, [x9, _FE_TER_MODE_8K@GOTPAGEOFF]
Lloh2:
	adrp	x10, _FE_TER_MODE_2K@GOTPAGE
Lloh3:
	ldr	x10, [x10, _FE_TER_MODE_2K@GOTPAGEOFF]
	cmp	w8, #129
	csel	x8, x9, x10, eq
	ldr	w8, [x8]
	str	w8, [x20, #32]
	ldr	w8, [x19, #28]
	mov	w9, #136
	cmp	w8, #133
	csel	w8, w9, w8, eq
	str	w8, [x20]
Lloh4:
	adrp	x8, _FE_TER_CHAN_BW_6M@GOTPAGE
Lloh5:
	ldr	x8, [x8, _FE_TER_CHAN_BW_6M@GOTPAGEOFF]
Lloh6:
	adrp	x9, _FE_TER_CHAN_BW_7M@GOTPAGE
Lloh7:
	ldr	x9, [x9, _FE_TER_CHAN_BW_7M@GOTPAGEOFF]
	ldp	w10, w11, [x19, #32]
	sub	w12, w10, #1708, lsl #12        ; =6995968
	cmp	w12, #4032
Lloh8:
	adrp	x12, _FE_TER_CHAN_BW_8M@GOTPAGE
Lloh9:
	ldr	x12, [x12, _FE_TER_CHAN_BW_8M@GOTPAGEOFF]
	csel	x9, x9, x12, eq
	sub	w10, w10, #1464, lsl #12        ; =5996544
	cmp	w10, #3456
	csel	x8, x8, x9, eq
Lloh10:
	adrp	x9, _FE_TER_HIER_NONE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _FE_TER_HIER_NONE@GOTPAGEOFF]
	ldr	w8, [x8]
Lloh12:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #24]
	sub	w8, w11, #131
	cmp	w8, #2
	b.hs	LBB0_11
; %bb.10:
	mov	w21, #1
	b	LBB0_12
LBB0_11:
	ldr	x8, [x20, #16]
	cmp	x8, #0
	mov	w8, #1
	cinc	x21, x8, eq
LBB0_12:
	mov	x22, #0
Lloh13:
	adrp	x8, _FE_TER_NOLOCK@GOTPAGE
Lloh14:
	ldr	x8, [x8, _FE_TER_NOLOCK@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	adrp	x23, _FE_TER_LOCKOK@GOTPAGE
Lloh17:
	ldr	x23, [x23, _FE_TER_LOCKOK@GOTPAGEOFF]
	str	w8, [x20, #8]
	ldr	w9, [x23]
	mov	w24, #131
Lloh18:
	adrp	x25, _INVERSION_AUTO@GOTPAGE
Lloh19:
	ldr	x25, [x25, _INVERSION_AUTO@GOTPAGEOFF]
	add	x26, sp, #8
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	add	x22, x22, #1
	cmp	x21, x22
	b.eq	LBB0_21
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	cmp	w8, w9
	b.eq	LBB0_21
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	x8, [x20, #16]
	cbnz	x8, LBB0_18
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w8, [x19, #36]
	ldr	w9, [x25]
	cmp	w8, w9
	b.ne	LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w8, [x26, x22, lsl #2]
	str	w8, [x20, #4]
LBB0_18:                                ;   in Loop: Header=BB0_14 Depth=1
	mov	x0, x19
	bl	_stv0367ter_algo
	ldr	w8, [x20, #8]
	ldr	w9, [x23]
	cmp	w8, w9
	b.ne	LBB0_13
; %bb.19:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w10, [x19, #36]
	ldr	w11, [x25]
	cmp	w10, w11
	ccmp	x22, #1, #0, eq
	b.ne	LBB0_13
; %bb.20:                               ;   in Loop: Header=BB0_14 Depth=1
	str	w24, [sp, #12]
	add	w10, w24, #1
	and	w11, w10, #0x1
	cmp	w10, #0
	cneg	w24, w11, lt
	str	w24, [sp, #8]
	b	LBB0_13
LBB0_21:
	mov	w0, #0
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_FE_TER_MODE_2K,4,2             ; @FE_TER_MODE_2K
	.comm	_FE_TER_MODE_8K,4,2             ; @FE_TER_MODE_8K
	.comm	_FE_TER_CHAN_BW_6M,4,2          ; @FE_TER_CHAN_BW_6M
	.comm	_FE_TER_CHAN_BW_7M,4,2          ; @FE_TER_CHAN_BW_7M
	.comm	_FE_TER_CHAN_BW_8M,4,2          ; @FE_TER_CHAN_BW_8M
	.comm	_FE_TER_HIER_NONE,4,2           ; @FE_TER_HIER_NONE
	.comm	_FE_TER_NOLOCK,4,2              ; @FE_TER_NOLOCK
	.comm	_FE_TER_LOCKOK,4,2              ; @FE_TER_LOCKOK
	.comm	_INVERSION_AUTO,4,2             ; @INVERSION_AUTO
	.no_dead_strip	_stv0367ter_set_frontend
.subsections_via_symbols
