	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rdi), %rbx
	movq	(%rbx), %rdx
	leaq	L_.str(%rip), %rsi
	movl	$2, %edi
	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), %r12
	movl	(%r12), %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:
	leaq	L_.str.1(%rip), %rsi
	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	-40(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_read_dst
	testq	%rax, %rax
	js	LBB0_15
## %bb.16:
	movq	-40(%rbp), %rdx
	movq	_ACK@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	jne	LBB0_17
## %bb.19:
	movl	(%r12), %eax
	orl	%eax, 16(%rbx)
	movq	%rbx, %rdi
	callq	_dst_get_tuna
	movl	%eax, %r15d
	jmp	LBB0_20
LBB0_11:
	leaq	L_.str.2(%rip), %rsi
	movl	$3, %edi
	xorl	%eax, %eax
	callq	_dprintk
LBB0_20:
	movq	%r14, %rdi
	callq	_mutex_unlock
	jmp	LBB0_21
LBB0_13:
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_5
LBB0_15:
	leaq	L_.str.4(%rip), %rsi
LBB0_5:
	movl	$3, %edi
	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	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	leaq	L_.str.5(%rip), %rsi
	movl	$3, %edi
	xorl	%eax, %eax
	callq	_dprintk
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"type_flags 0x%x\n"

	.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
L_.str.1:                               ## @.str.1
	.asciz	"DST Communication initialization failed.\n"

	.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\n"

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

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

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

	.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, #64
	.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
	mov	x19, x0
	ldr	x20, [x0]
	ldr	x8, [x20]
	str	x8, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #2
	bl	_dprintk
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [x20, #32]
	ldr	x8, [x20, #8]
Lloh2:
	adrp	x9, _DST_TYPE_IS_SAT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _DST_TYPE_IS_SAT@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	ldr	w8, [x20, #16]
Lloh5:
	adrp	x9, _HAS_POWER@GOTPAGE
Lloh6:
	ldr	x9, [x9, _HAS_POWER@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_3
; %bb.2:
Lloh8:
	adrp	x8, _SEC_VOLTAGE_13@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SEC_VOLTAGE_13@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_dst_set_voltage
LBB0_3:
Lloh11:
	adrp	x8, _HAS_LOCK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _HAS_LOCK@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x22, _ATTEMPT_TUNE@GOTPAGE
Lloh15:
	ldr	x22, [x22, _ATTEMPT_TUNE@GOTPAGEOFF]
	ldr	w9, [x22]
	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]
Lloh16:
	adrp	x9, _DST_TYPE_HAS_VLF@GOTPAGE
Lloh17:
	ldr	x9, [x9, _DST_TYPE_HAS_VLF@GOTPAGEOFF]
Lloh18:
	ldrsw	x9, [x9]
	tst	x8, x9
	b.eq	LBB0_6
; %bb.5:
	ldr	x8, [x20, #8]
Lloh19:
	adrp	x9, _DST_TYPE_IS_ATSC@GOTPAGE
Lloh20:
	ldr	x9, [x9, _DST_TYPE_IS_ATSC@GOTPAGEOFF]
Lloh21:
	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
Lloh22:
	adrp	x8, _FIXED_COMM@GOTPAGE
Lloh23:
	ldr	x8, [x8, _FIXED_COMM@GOTPAGEOFF]
Lloh24:
	ldr	w2, [x8]
	mov	x0, x20
	b	LBB0_9
LBB0_7:
Lloh25:
	adrp	x1, l_.str.1@PAGE
Lloh26:
	add	x1, x1, 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:
Lloh27:
	adrp	x8, _GET_ACK@GOTPAGE
Lloh28:
	ldr	x8, [x8, _GET_ACK@GOTPAGEOFF]
Lloh29:
	ldr	w2, [x8]
	add	x1, sp, #8
	mov	x0, x20
	bl	_read_dst
	tbnz	x0, #63, LBB0_17
; %bb.12:
	ldr	x8, [sp, #8]
Lloh30:
	adrp	x9, _ACK@GOTPAGE
Lloh31:
	ldr	x9, [x9, _ACK@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_18
; %bb.13:
	ldr	w8, [x22]
	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:
Lloh33:
	adrp	x1, l_.str.2@PAGE
Lloh34:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #3
	bl	_dprintk
LBB0_15:
	mov	x0, x19
	bl	_mutex_unlock
	b	LBB0_20
LBB0_16:
Lloh35:
	adrp	x1, l_.str.3@PAGE
Lloh36:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_19
LBB0_17:
Lloh37:
	adrp	x1, l_.str.4@PAGE
Lloh38:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_19
LBB0_18:
	str	x8, [sp]
Lloh39:
	adrp	x1, l_.str.5@PAGE
Lloh40:
	add	x1, x1, l_.str.5@PAGEOFF
LBB0_19:
	mov	w0, #3
	bl	_dprintk
	mov	x0, x19
	bl	_mutex_unlock
Lloh41:
	adrp	x8, _EIO@GOTPAGE
Lloh42:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh43:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_20:
	mov	x0, x21
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"type_flags 0x%x\n"

	.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
l_.str.1:                               ; @.str.1
	.asciz	"DST Communication initialization failed.\n"

	.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\n"

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

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

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

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