	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_msp34xxg_thread                ## -- Begin function msp34xxg_thread
	.p2align	4, 0x90
_msp34xxg_thread:                       ## @msp34xxg_thread
	.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
	callq	_i2c_get_clientdata
	movl	%eax, %edi
	callq	_to_state
	movq	%rax, %r15
	movq	_msp_debug@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	leaq	L_.str(%rip), %rcx
	movq	%r14, %rdi
	movl	$1, %esi
	xorl	%eax, %eax
	callq	_dev_dbg_lvl
	movq	_V4L2_STD_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%r15)
	xorl	%eax, %eax
	callq	_set_freezable
	leaq	L_.str.6(%rip), %r12
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_2 Depth 2
                                        ##       Child Loop BB0_9 Depth 3
                                        ##       Child Loop BB0_22 Depth 3
	movl	(%r13), %edx
	movq	%r14, %rdi
	movl	$2, %esi
	leaq	L_.str.1(%rip), %rcx
	xorl	%eax, %eax
	callq	_dev_dbg_lvl
	movq	%r15, %rdi
	movl	$-1, %esi
	callq	_msp_sleep
	movl	(%r13), %edx
	movq	%r14, %rdi
	movl	$2, %esi
	leaq	L_.str.2(%rip), %rcx
	xorl	%eax, %eax
	callq	_dev_dbg_lvl
LBB0_2:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_9 Depth 3
                                        ##       Child Loop BB0_22 Depth 3
	movl	(%r13), %edx
	movq	%r14, %rdi
	movl	$1, %esi
	leaq	L_.str.3(%rip), %rcx
	xorl	%eax, %eax
	callq	_dev_dbg_lvl
	movq	$0, 48(%r15)
	xorl	%eax, %eax
	callq	_kthread_should_stop
	testq	%rax, %rax
	jne	LBB0_24
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=2
	movq	(%r15), %rax
	movq	_MSP_MODE_EXTERN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=2
	movq	%r14, %rdi
	callq	_msp34xxg_reset
	movl	$64, %edx
	cmpq	$0, 32(%r15)
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=2
	movq	_msp_standard@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	movl	%eax, %edx
	movl	$32, %ecx
	cmovel	%ecx, %edx
	cmpq	$0, 24(%r15)
	cmovel	%eax, %edx
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=2
	movl	%edx, 8(%r15)
	movq	%r14, %rdi
	movl	$32, %esi
	callq	_msp_write_dem
	movl	8(%r15), %eax
	cmpl	$1, %eax
	jne	LBB0_16
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=2
	movl	(%r13), %edx
	movq	%r14, %rdi
	movl	$1, %esi
	leaq	L_.str.5(%rip), %rcx
	xorl	%eax, %eax
	callq	_dev_dbg_lvl
	movl	$10, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_1 Depth=1
                                        ##     Parent Loop BB0_2 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	%r15, %rdi
	movl	$100, %esi
	callq	_msp_sleep
	testq	%rax, %rax
	jne	LBB0_2
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=3
	movq	%r14, %rdi
	movl	$126, %esi
	callq	_msp_read_dem
	cmpl	$2046, %eax                     ## imm = 0x7FE
	jle	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=3
	movl	(%r13), %edx
	movq	%r14, %rdi
	movl	$2, %esi
	movq	%r12, %rcx
	xorl	%eax, %eax
	callq	_dev_dbg_lvl
	decl	%ebx
	jne	LBB0_9
## %bb.13:                              ##   in Loop: Header=BB0_2 Depth=2
	movl	8(%r15), %eax
	cmpl	$1, %eax
	jne	LBB0_16
	jmp	LBB0_15
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=2
	movl	%eax, 8(%r15)
	cmpl	$1, %eax
	je	LBB0_15
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_2 Depth=2
	movq	%r12, %rbx
	movl	(%r13), %r12d
	movl	%eax, %edi
	callq	_msp_standard_std_name
	movl	8(%r15), %r9d
	movq	%r14, %rdi
	movl	$1, %esi
	movl	%r12d, %edx
	leaq	L_.str.8(%rip), %rcx
	movl	%eax, %r8d
	xorl	%eax, %eax
	callq	_dev_dbg_lvl
	movl	8(%r15), %edi
	callq	_msp_standard_std
	movl	%eax, 20(%r15)
	cmpl	$9, 8(%r15)
	jne	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_2 Depth=2
	movq	%r14, %rdi
	movl	$14, %esi
	movl	$31744, %edx                    ## imm = 0x7C00
	callq	_msp_write_dsp
LBB0_18:                                ##   in Loop: Header=BB0_2 Depth=2
	movq	%r15, %rdi
	callq	_msp_update_volume
	movl	12(%r15), %edx
	movq	%r14, %rdi
	movl	$19, %esi
	callq	_msp_write_dsp
	testq	%rax, %rax
	jne	LBB0_19
## %bb.20:                              ##   in Loop: Header=BB0_2 Depth=2
	movq	%rbx, %r12
	cmpl	$32, 8(%r15)
	jne	LBB0_1
## %bb.21:                              ##   in Loop: Header=BB0_2 Depth=2
	movl	$1, 16(%r15)
	movq	%r14, %rdi
	callq	_watch_stereo
	.p2align	4, 0x90
LBB0_22:                                ##   Parent Loop BB0_1 Depth=1
                                        ##     Parent Loop BB0_2 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	cmpl	$0, 16(%r15)
	je	LBB0_1
## %bb.23:                              ##   in Loop: Header=BB0_22 Depth=3
	movq	%r14, %rdi
	callq	_watch_stereo
	movq	%r15, %rdi
	movl	$5000, %esi                     ## imm = 0x1388
	callq	_msp_sleep
	testq	%rax, %rax
	je	LBB0_22
	jmp	LBB0_2
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r13), %edx
	movq	%r14, %rdi
	movl	$1, %esi
	leaq	L_.str.4(%rip), %rcx
	xorl	%eax, %eax
	callq	_dev_dbg_lvl
	movq	$0, 40(%r15)
	movq	%r15, %rdi
	callq	_msp_update_volume
	jmp	LBB0_1
LBB0_15:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r13), %edx
	movq	%r14, %rdi
	movl	$1, %esi
	leaq	L_.str.7(%rip), %rcx
	xorl	%eax, %eax
	callq	_dev_dbg_lvl
	jmp	LBB0_1
LBB0_24:
	movl	(%r13), %edx
	leaq	L_.str.9(%rip), %rcx
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	movl	$1, %esi
	xorl	%eax, %eax
	callq	_dev_dbg_lvl
	jmp	LBB0_25
LBB0_19:
	movl	$-1, %ebx
LBB0_25:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_msp_debug,4,2                  ## @msp_debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"msp34xxg daemon started\n"

	.comm	_V4L2_STD_ALL,4,2               ## @V4L2_STD_ALL
L_.str.1:                               ## @.str.1
	.asciz	"msp34xxg thread: sleep\n"

L_.str.2:                               ## @.str.2
	.asciz	"msp34xxg thread: wakeup\n"

L_.str.3:                               ## @.str.3
	.asciz	"thread: restart scan\n"

	.comm	_MSP_MODE_EXTERN,8,3            ## @MSP_MODE_EXTERN
L_.str.4:                               ## @.str.4
	.asciz	"thread: no carrier scan\n"

	.comm	_msp_standard,4,2               ## @msp_standard
L_.str.5:                               ## @.str.5
	.asciz	"started autodetect, waiting for result\n"

L_.str.6:                               ## @.str.6
	.asciz	"detection still in progress\n"

L_.str.7:                               ## @.str.7
	.asciz	"detection still in progress after 10 tries. giving up.\n"

L_.str.8:                               ## @.str.8
	.asciz	"detected standard: %s (0x%04x)\n"

L_.str.9:                               ## @.str.9
	.asciz	"thread: exit\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_msp34xxg_thread                ; -- Begin function msp34xxg_thread
	.p2align	2
_msp34xxg_thread:                       ; @msp34xxg_thread
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	bl	_i2c_get_clientdata
	bl	_to_state
	mov	x20, x0
Lloh0:
	adrp	x24, _msp_debug@GOTPAGE
Lloh1:
	ldr	x24, [x24, _msp_debug@GOTPAGEOFF]
	ldr	w2, [x24]
Lloh2:
	adrp	x3, l_.str@PAGE
Lloh3:
	add	x3, x3, l_.str@PAGEOFF
	mov	w21, #1
	mov	x0, x19
	mov	w1, #1
	bl	_dev_dbg_lvl
Lloh4:
	adrp	x8, _V4L2_STD_ALL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _V4L2_STD_ALL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	str	w8, [x20, #20]
	bl	_set_freezable
Lloh7:
	adrp	x22, l_.str.2@PAGE
Lloh8:
	add	x22, x22, l_.str.2@PAGEOFF
Lloh9:
	adrp	x23, l_.str.3@PAGE
Lloh10:
	add	x23, x23, l_.str.3@PAGEOFF
Lloh11:
	adrp	x25, _MSP_MODE_EXTERN@GOTPAGE
Lloh12:
	ldr	x25, [x25, _MSP_MODE_EXTERN@GOTPAGEOFF]
Lloh13:
	adrp	x27, l_.str.6@PAGE
Lloh14:
	add	x27, x27, l_.str.6@PAGEOFF
Lloh15:
	adrp	x28, l_.str.8@PAGE
Lloh16:
	add	x28, x28, l_.str.8@PAGEOFF
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_2 Depth 2
                                        ;       Child Loop BB0_9 Depth 3
                                        ;       Child Loop BB0_19 Depth 3
	ldr	w2, [x24]
	mov	x0, x19
	mov	w1, #2
Lloh17:
	adrp	x3, l_.str.1@PAGE
Lloh18:
	add	x3, x3, l_.str.1@PAGEOFF
	bl	_dev_dbg_lvl
	mov	x0, x20
	mov	w1, #-1
	bl	_msp_sleep
	ldr	w2, [x24]
	mov	x0, x19
	mov	w1, #2
	mov	x3, x22
	bl	_dev_dbg_lvl
LBB0_2:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_9 Depth 3
                                        ;       Child Loop BB0_19 Depth 3
	ldr	w2, [x24]
	mov	x0, x19
	mov	w1, #1
	mov	x3, x23
	bl	_dev_dbg_lvl
	str	xzr, [x20, #48]
	bl	_kthread_should_stop
	cbnz	x0, LBB0_23
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=2
	ldr	x8, [x20]
	ldr	x9, [x25]
	cmp	x8, x9
	b.eq	LBB0_21
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=2
	mov	x0, x19
	bl	_msp34xxg_reset
	ldr	x8, [x20, #32]
	cbz	x8, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=2
	mov	w2, #64
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_2 Depth=2
	ldr	x8, [x20, #24]
Lloh19:
	adrp	x9, _msp_standard@GOTPAGE
Lloh20:
	ldr	x9, [x9, _msp_standard@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	cmp	w9, #1
	ccmp	x8, #0, #4, eq
	mov	w8, #32
	csel	w2, w8, w9, ne
LBB0_7:                                 ;   in Loop: Header=BB0_2 Depth=2
	str	w2, [x20, #8]
	mov	x0, x19
	mov	w1, #32
	bl	_msp_write_dem
	ldr	w0, [x20, #8]
	cmp	w0, #1
	b.ne	LBB0_14
; %bb.8:                                ;   in Loop: Header=BB0_2 Depth=2
	ldr	w2, [x24]
	mov	x0, x19
	mov	w1, #1
Lloh22:
	adrp	x3, l_.str.5@PAGE
Lloh23:
	add	x3, x3, l_.str.5@PAGEOFF
	bl	_dev_dbg_lvl
	mov	w26, #10
LBB0_9:                                 ;   Parent Loop BB0_1 Depth=1
                                        ;     Parent Loop BB0_2 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	mov	x0, x20
	mov	w1, #100
	bl	_msp_sleep
	cbnz	x0, LBB0_2
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=3
	mov	x0, x19
	mov	w1, #126
	bl	_msp_read_dem
	cmp	w0, #2046
	b.le	LBB0_13
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=3
	ldr	w2, [x24]
	mov	x0, x19
	mov	w1, #2
	mov	x3, x27
	bl	_dev_dbg_lvl
	subs	w26, w26, #1
	b.ne	LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_2 Depth=2
	ldr	w0, [x20, #8]
	cmp	w0, #1
	b.ne	LBB0_14
	b	LBB0_22
LBB0_13:                                ;   in Loop: Header=BB0_2 Depth=2
	str	w0, [x20, #8]
	cmp	w0, #1
	b.eq	LBB0_22
LBB0_14:                                ;   in Loop: Header=BB0_2 Depth=2
	ldr	w26, [x24]
	bl	_msp_standard_std_name
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	w8, [x20, #8]
	stp	x0, x8, [sp]
	mov	x0, x19
	mov	w1, #1
	mov	x2, x26
	mov	x3, x28
	bl	_dev_dbg_lvl
	ldr	w0, [x20, #8]
	bl	_msp_standard_std
	str	w0, [x20, #20]
	ldr	w8, [x20, #8]
	cmp	w8, #9
	b.ne	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_2 Depth=2
	mov	x0, x19
	mov	w1, #14
	mov	w2, #31744
	bl	_msp_write_dsp
LBB0_16:                                ;   in Loop: Header=BB0_2 Depth=2
	mov	x0, x20
	bl	_msp_update_volume
	ldr	w2, [x20, #12]
	mov	x0, x19
	mov	w1, #19
	bl	_msp_write_dsp
	cbnz	x0, LBB0_24
; %bb.17:                               ;   in Loop: Header=BB0_2 Depth=2
	ldr	w8, [x20, #8]
	cmp	w8, #32
	b.ne	LBB0_1
; %bb.18:                               ;   in Loop: Header=BB0_2 Depth=2
	str	w21, [x20, #16]
	mov	x0, x19
	bl	_watch_stereo
LBB0_19:                                ;   Parent Loop BB0_1 Depth=1
                                        ;     Parent Loop BB0_2 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	w8, [x20, #16]
	cbz	w8, LBB0_1
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=3
	mov	x0, x19
	bl	_watch_stereo
	mov	x0, x20
	mov	w1, #5000
	bl	_msp_sleep
	cbz	x0, LBB0_19
	b	LBB0_2
LBB0_21:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w2, [x24]
	mov	x0, x19
	mov	w1, #1
Lloh24:
	adrp	x3, l_.str.4@PAGE
Lloh25:
	add	x3, x3, l_.str.4@PAGEOFF
	bl	_dev_dbg_lvl
	str	xzr, [x20, #40]
	mov	x0, x20
	bl	_msp_update_volume
	b	LBB0_1
LBB0_22:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w2, [x24]
	mov	x0, x19
	mov	w1, #1
Lloh26:
	adrp	x3, l_.str.7@PAGE
Lloh27:
	add	x3, x3, l_.str.7@PAGEOFF
	bl	_dev_dbg_lvl
	b	LBB0_1
LBB0_23:
	ldr	w2, [x24]
Lloh28:
	adrp	x3, l_.str.9@PAGE
Lloh29:
	add	x3, x3, l_.str.9@PAGEOFF
	mov	x0, x19
	mov	w1, #1
	bl	_dev_dbg_lvl
	mov	w0, #0
	b	LBB0_25
LBB0_24:
	mov	w0, #-1
LBB0_25:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_msp_debug,4,2                  ; @msp_debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"msp34xxg daemon started\n"

	.comm	_V4L2_STD_ALL,4,2               ; @V4L2_STD_ALL
l_.str.1:                               ; @.str.1
	.asciz	"msp34xxg thread: sleep\n"

l_.str.2:                               ; @.str.2
	.asciz	"msp34xxg thread: wakeup\n"

l_.str.3:                               ; @.str.3
	.asciz	"thread: restart scan\n"

	.comm	_MSP_MODE_EXTERN,8,3            ; @MSP_MODE_EXTERN
l_.str.4:                               ; @.str.4
	.asciz	"thread: no carrier scan\n"

	.comm	_msp_standard,4,2               ; @msp_standard
l_.str.5:                               ; @.str.5
	.asciz	"started autodetect, waiting for result\n"

l_.str.6:                               ; @.str.6
	.asciz	"detection still in progress\n"

l_.str.7:                               ; @.str.7
	.asciz	"detection still in progress after 10 tries. giving up.\n"

l_.str.8:                               ; @.str.8
	.asciz	"detected standard: %s (0x%04x)\n"

l_.str.9:                               ; @.str.9
	.asciz	"thread: exit\n"

.subsections_via_symbols
