	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dst_write_tuna
_dst_write_tuna:                        ## @dst_write_tuna
	.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	(%rdi), %rbx
	movq	_verbose@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movq	_DST_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%rbx), %r8
	leaq	L_.str(%rip), %rcx
	movl	$1, %edx
	xorl	%eax, %eax
	callq	_dprintk
	xorps	%xmm0, %xmm0
	movups	%xmm0, 32(%rbx)
	movups	%xmm0, 48(%rbx)
	movq	8(%rbx), %rax
	movq	_DST_TYPE_IS_SAT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.1:
	movq	_HAS_POWER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 16(%rbx)
	jne	LBB0_3
## %bb.2:
	movq	_SEC_VOLTAGE_13@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_dst_set_voltage
LBB0_3:
	movq	_HAS_LOCK@GOTPCREL(%rip), %rax
	movq	_ATTEMPT_TUNE@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	orl	(%rax), %ecx
	notl	%ecx
	andl	%ecx, 16(%rbx)
	leaq	20(%rbx), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	callq	_dst_comm_init
	testq	%rax, %rax
	js	LBB0_4
## %bb.6:
	movq	_DST_TYPE_HAS_VLF@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	testq	%rax, (%rbx)
	je	LBB0_9
## %bb.7:
	movq	8(%rbx), %rax
	movq	_DST_TYPE_IS_ATSC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
LBB0_9:
	movq	24(%rbx), %rdi
	addq	$16, %rdi
	movl	$7, %esi
	callq	_dst_check_sum
	movq	24(%rbx), %rcx
	movq	%rax, 72(%rcx)
	movq	24(%rbx), %rsi
	addq	$16, %rsi
	movq	_FIXED_COMM@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	jmp	LBB0_10
LBB0_4:
	movl	(%r12), %edi
	movq	_DST_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rcx
	jmp	LBB0_5
LBB0_8:
	movq	24(%rbx), %rdi
	movl	$9, %esi
	callq	_dst_check_sum
	movq	24(%rbx), %rcx
	movq	%rax, 72(%rcx)
	movq	24(%rbx), %rsi
	movq	%rbx, %rdi
	movl	$10, %edx
LBB0_10:
	callq	_write_dst
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_dst_pio_disable
	testl	%r15d, %r15d
	js	LBB0_11
## %bb.12:
	testq	%rax, %rax
	js	LBB0_13
## %bb.14:
	movq	_GET_ACK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_read_dst
	testq	%rax, %rax
	js	LBB0_15
## %bb.16:
	movq	-48(%rbp), %r8
	movq	_ACK@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r8
	jne	LBB0_17
## %bb.19:
	movl	(%r13), %eax
	orl	%eax, 16(%rbx)
	movq	%rbx, %rdi
	callq	_dst_get_tuna
	movl	%eax, %r15d
	jmp	LBB0_20
LBB0_11:
	movl	(%r12), %edi
	movq	_DST_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rcx
	movl	$1, %edx
	xorl	%eax, %eax
	callq	_dprintk
LBB0_20:
	movq	%r14, %rdi
	callq	_mutex_unlock
	jmp	LBB0_21
LBB0_13:
	movl	(%r12), %edi
	movq	_DST_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rcx
	jmp	LBB0_5
LBB0_15:
	movl	(%r12), %edi
	movq	_DST_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.4(%rip), %rcx
LBB0_5:
	movl	$1, %edx
	xorl	%eax, %eax
	callq	_dprintk
LBB0_18:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_21:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movl	(%r12), %edi
	movq	_DST_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.5(%rip), %rcx
	movl	$1, %edx
	xorl	%eax, %eax
	callq	_dprintk
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_verbose,4,2                    ## @verbose
	.comm	_DST_INFO,4,2                   ## @DST_INFO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"type_flags 0x%x "

	.comm	_DST_TYPE_IS_SAT,8,3            ## @DST_TYPE_IS_SAT
	.comm	_HAS_POWER,4,2                  ## @HAS_POWER
	.comm	_SEC_VOLTAGE_13,4,2             ## @SEC_VOLTAGE_13
	.comm	_HAS_LOCK,4,2                   ## @HAS_LOCK
	.comm	_ATTEMPT_TUNE,4,2               ## @ATTEMPT_TUNE
	.comm	_DST_DEBUG,4,2                  ## @DST_DEBUG
L_.str.1:                               ## @.str.1
	.asciz	"DST Communication initialization failed."

	.comm	_DST_TYPE_HAS_VLF,4,2           ## @DST_TYPE_HAS_VLF
	.comm	_DST_TYPE_IS_ATSC,8,3           ## @DST_TYPE_IS_ATSC
	.comm	_FIXED_COMM,4,2                 ## @FIXED_COMM
L_.str.2:                               ## @.str.2
	.asciz	"write not successful"

L_.str.3:                               ## @.str.3
	.asciz	"DST PIO disable failed !"

	.comm	_GET_ACK,4,2                    ## @GET_ACK
L_.str.4:                               ## @.str.4
	.asciz	"read verify not successful."

	.comm	_ACK,8,3                        ## @ACK
L_.str.5:                               ## @.str.5
	.asciz	"write not acknowledged 0x%02x "

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_dst_write_tuna
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dst_write_tuna
_dst_write_tuna:                        ; @dst_write_tuna
	.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	x19, x0
Lloh0:
	adrp	x22, _verbose@GOTPAGE
Lloh1:
	ldr	x22, [x22, _verbose@GOTPAGEOFF]
	ldr	x20, [x0]
	ldr	w0, [x22]
Lloh2:
	adrp	x8, _DST_INFO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DST_INFO@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	ldr	x8, [x20]
	str	x8, [sp]
Lloh5:
	adrp	x3, l_.str@PAGE
Lloh6:
	add	x3, x3, l_.str@PAGEOFF
	mov	w2, #1
	bl	_dprintk
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [x20, #32]
	ldr	x8, [x20, #8]
Lloh7:
	adrp	x9, _DST_TYPE_IS_SAT@GOTPAGE
Lloh8:
	ldr	x9, [x9, _DST_TYPE_IS_SAT@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	ldr	w8, [x20, #16]
Lloh10:
	adrp	x9, _HAS_POWER@GOTPAGE
Lloh11:
	ldr	x9, [x9, _HAS_POWER@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_3
; %bb.2:
Lloh13:
	adrp	x8, _SEC_VOLTAGE_13@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SEC_VOLTAGE_13@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_dst_set_voltage
LBB0_3:
Lloh16:
	adrp	x8, _HAS_LOCK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _HAS_LOCK@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
Lloh19:
	adrp	x23, _ATTEMPT_TUNE@GOTPAGE
Lloh20:
	ldr	x23, [x23, _ATTEMPT_TUNE@GOTPAGEOFF]
	ldr	w9, [x23]
	orr	w8, w9, w8
	ldr	w9, [x20, #16]
	bic	w8, w9, w8
	str	w8, [x20, #16]
	add	x19, x20, #20
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x20
	bl	_dst_comm_init
	tbnz	x0, #63, LBB0_7
; %bb.4:
	ldr	x8, [x20]
Lloh21:
	adrp	x9, _DST_TYPE_HAS_VLF@GOTPAGE
Lloh22:
	ldr	x9, [x9, _DST_TYPE_HAS_VLF@GOTPAGEOFF]
Lloh23:
	ldrsw	x9, [x9]
	tst	x8, x9
	b.eq	LBB0_6
; %bb.5:
	ldr	x8, [x20, #8]
Lloh24:
	adrp	x9, _DST_TYPE_IS_ATSC@GOTPAGE
Lloh25:
	ldr	x9, [x9, _DST_TYPE_IS_ATSC@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
LBB0_6:
	ldr	x8, [x20, #24]
	add	x0, x8, #16
	mov	w1, #7
	bl	_dst_check_sum
	ldr	x8, [x20, #24]
	str	x0, [x8, #72]
	ldr	x8, [x20, #24]
	add	x1, x8, #16
Lloh27:
	adrp	x8, _FIXED_COMM@GOTPAGE
Lloh28:
	ldr	x8, [x8, _FIXED_COMM@GOTPAGEOFF]
Lloh29:
	ldr	w2, [x8]
	mov	x0, x20
	b	LBB0_9
LBB0_7:
	ldr	w0, [x22]
Lloh30:
	adrp	x8, _DST_DEBUG@GOTPAGE
Lloh31:
	ldr	x8, [x8, _DST_DEBUG@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
Lloh33:
	adrp	x3, l_.str.1@PAGE
Lloh34:
	add	x3, x3, l_.str.1@PAGEOFF
	b	LBB0_19
LBB0_8:
	ldr	x0, [x20, #24]
	mov	w1, #9
	bl	_dst_check_sum
	ldr	x8, [x20, #24]
	str	x0, [x8, #72]
	ldr	x1, [x20, #24]
	mov	x0, x20
	mov	w2, #10
LBB0_9:
	bl	_write_dst
	mov	x21, x0
	mov	x0, x20
	bl	_dst_pio_disable
	tbnz	w21, #31, LBB0_14
; %bb.10:
	tbnz	x0, #63, LBB0_16
; %bb.11:
Lloh35:
	adrp	x8, _GET_ACK@GOTPAGE
Lloh36:
	ldr	x8, [x8, _GET_ACK@GOTPAGEOFF]
Lloh37:
	ldr	w2, [x8]
	add	x1, sp, #8
	mov	x0, x20
	bl	_read_dst
	tbnz	x0, #63, LBB0_17
; %bb.12:
	ldr	x8, [sp, #8]
Lloh38:
	adrp	x9, _ACK@GOTPAGE
Lloh39:
	ldr	x9, [x9, _ACK@GOTPAGEOFF]
Lloh40:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_18
; %bb.13:
	ldr	w8, [x23]
	ldr	w9, [x20, #16]
	orr	w8, w9, w8
	str	w8, [x20, #16]
	mov	x0, x20
	bl	_dst_get_tuna
	mov	x21, x0
	b	LBB0_15
LBB0_14:
	ldr	w0, [x22]
Lloh41:
	adrp	x8, _DST_DEBUG@GOTPAGE
Lloh42:
	ldr	x8, [x8, _DST_DEBUG@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x8]
Lloh44:
	adrp	x3, l_.str.2@PAGE
Lloh45:
	add	x3, x3, l_.str.2@PAGEOFF
	mov	w2, #1
	bl	_dprintk
LBB0_15:
	mov	x0, x19
	bl	_mutex_unlock
	b	LBB0_20
LBB0_16:
	ldr	w0, [x22]
Lloh46:
	adrp	x8, _DST_DEBUG@GOTPAGE
Lloh47:
	ldr	x8, [x8, _DST_DEBUG@GOTPAGEOFF]
Lloh48:
	ldr	w1, [x8]
Lloh49:
	adrp	x3, l_.str.3@PAGE
Lloh50:
	add	x3, x3, l_.str.3@PAGEOFF
	b	LBB0_19
LBB0_17:
	ldr	w0, [x22]
Lloh51:
	adrp	x8, _DST_DEBUG@GOTPAGE
Lloh52:
	ldr	x8, [x8, _DST_DEBUG@GOTPAGEOFF]
Lloh53:
	ldr	w1, [x8]
Lloh54:
	adrp	x3, l_.str.4@PAGE
Lloh55:
	add	x3, x3, l_.str.4@PAGEOFF
	b	LBB0_19
LBB0_18:
	ldr	w0, [x22]
Lloh56:
	adrp	x9, _DST_DEBUG@GOTPAGE
Lloh57:
	ldr	x9, [x9, _DST_DEBUG@GOTPAGEOFF]
Lloh58:
	ldr	w1, [x9]
	str	x8, [sp]
Lloh59:
	adrp	x3, l_.str.5@PAGE
Lloh60:
	add	x3, x3, l_.str.5@PAGEOFF
LBB0_19:
	mov	w2, #1
	bl	_dprintk
	mov	x0, x19
	bl	_mutex_unlock
Lloh61:
	adrp	x8, _EIO@GOTPAGE
Lloh62:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh63:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_20:
	mov	x0, x21
	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	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpAdd	Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpAdd	Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpAdd	Lloh59, Lloh60
	.loh AdrpLdrGotLdr	Lloh56, Lloh57, Lloh58
	.loh AdrpLdrGotLdr	Lloh61, Lloh62, Lloh63
	.cfi_endproc
                                        ; -- End function
	.comm	_verbose,4,2                    ; @verbose
	.comm	_DST_INFO,4,2                   ; @DST_INFO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"type_flags 0x%x "

	.comm	_DST_TYPE_IS_SAT,8,3            ; @DST_TYPE_IS_SAT
	.comm	_HAS_POWER,4,2                  ; @HAS_POWER
	.comm	_SEC_VOLTAGE_13,4,2             ; @SEC_VOLTAGE_13
	.comm	_HAS_LOCK,4,2                   ; @HAS_LOCK
	.comm	_ATTEMPT_TUNE,4,2               ; @ATTEMPT_TUNE
	.comm	_DST_DEBUG,4,2                  ; @DST_DEBUG
l_.str.1:                               ; @.str.1
	.asciz	"DST Communication initialization failed."

	.comm	_DST_TYPE_HAS_VLF,4,2           ; @DST_TYPE_HAS_VLF
	.comm	_DST_TYPE_IS_ATSC,8,3           ; @DST_TYPE_IS_ATSC
	.comm	_FIXED_COMM,4,2                 ; @FIXED_COMM
l_.str.2:                               ; @.str.2
	.asciz	"write not successful"

l_.str.3:                               ; @.str.3
	.asciz	"DST PIO disable failed !"

	.comm	_GET_ACK,4,2                    ; @GET_ACK
l_.str.4:                               ; @.str.4
	.asciz	"read verify not successful."

	.comm	_ACK,8,3                        ; @ACK
l_.str.5:                               ; @.str.5
	.asciz	"write not acknowledged 0x%02x "

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_dst_write_tuna
.subsections_via_symbols
