	.file	"extr_dst.c_dst_write_tuna.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"type_flags 0x%x\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"DST Communication initialization failed.\n"
	.section	.rodata.str1.1
.LC2:
	.string	"write not successful\n"
.LC3:
	.string	"DST PIO disable failed !\n"
.LC4:
	.string	"read verify not successful.\n"
	.section	.rodata.str1.8
	.align 8
.LC5:
	.string	"write not acknowledged 0x%02x\n"
	.text
	.p2align 4
	.type	dst_write_tuna, @function
dst_write_tuna:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	lea	rsi, .LC0[rip]
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	sub	rsp, 16
	.cfi_def_cfa_offset 48
	mov	rbp, QWORD PTR [rdi]
	mov	edi, 2
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	rdx, QWORD PTR 0[rbp]
	call	dprintk@PLT
	mov	rax, QWORD PTR DST_TYPE_IS_SAT[rip]
	mov	edx, DWORD PTR 16[rbp]
	mov	QWORD PTR 56[rbp], 0
	cmp	QWORD PTR 8[rbp], rax
	mov	QWORD PTR 32[rbp], 0
	mov	QWORD PTR 40[rbp], 0
	mov	QWORD PTR 48[rbp], 0
	je	.L2
.L3:
	mov	eax, DWORD PTR HAS_LOCK[rip]
	or	eax, DWORD PTR ATTEMPT_TUNE[rip]
	lea	r13, 20[rbp]
	not	eax
	mov	rdi, r13
	and	eax, edx
	mov	DWORD PTR 16[rbp], eax
	call	mutex_lock@PLT
	mov	rdi, rbp
	call	dst_comm_init@PLT
	test	rax, rax
	js	.L20
	mov	r12, QWORD PTR 24[rbp]
	movsx	rax, DWORD PTR DST_TYPE_HAS_VLF[rip]
	test	QWORD PTR 0[rbp], rax
	je	.L6
	mov	rax, QWORD PTR DST_TYPE_IS_ATSC[rip]
	cmp	QWORD PTR 8[rbp], rax
	jne	.L21
.L6:
	lea	rdi, 16[r12]
	mov	esi, 7
	call	dst_check_sum@PLT
	mov	edx, DWORD PTR FIXED_COMM[rip]
	mov	rdi, rbp
	mov	QWORD PTR 72[r12], rax
	mov	rax, QWORD PTR 24[rbp]
	lea	rsi, 16[rax]
	call	write_dst@PLT
	mov	rdi, rbp
	mov	r12d, eax
	test	r12d, r12d
	js	.L22
.L8:
	call	dst_pio_disable@PLT
	test	rax, rax
	js	.L23
	mov	edx, DWORD PTR GET_ACK[rip]
	mov	rsi, rsp
	mov	rdi, rbp
	call	read_dst@PLT
	test	rax, rax
	js	.L24
	mov	rdx, QWORD PTR [rsp]
	cmp	rdx, QWORD PTR ACK[rip]
	je	.L12
	lea	rsi, .LC5[rip]
	mov	edi, 3
	xor	eax, eax
	call	dprintk@PLT
.L5:
	mov	rdi, r13
	call	mutex_unlock@PLT
	mov	r12d, DWORD PTR EIO[rip]
	neg	r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L21:
	mov	rdi, r12
	mov	esi, 9
	call	dst_check_sum@PLT
	mov	rdi, rbp
	mov	edx, 10
	mov	QWORD PTR 72[r12], rax
	mov	rsi, QWORD PTR 24[rbp]
	call	write_dst@PLT
	mov	rdi, rbp
	mov	r12d, eax
	test	r12d, r12d
	jns	.L8
.L22:
	call	dst_pio_disable@PLT
	lea	rsi, .LC2[rip]
	mov	edi, 3
	xor	eax, eax
	call	dprintk@PLT
.L9:
	mov	rdi, r13
	call	mutex_unlock@PLT
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L25
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	test	DWORD PTR HAS_POWER[rip], edx
	jne	.L3
	mov	esi, DWORD PTR SEC_VOLTAGE_13[rip]
	mov	rdi, r12
	call	dst_set_voltage@PLT
	mov	edx, DWORD PTR 16[rbp]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L12:
	mov	eax, DWORD PTR ATTEMPT_TUNE[rip]
	or	DWORD PTR 16[rbp], eax
	mov	rdi, rbp
	call	dst_get_tuna@PLT
	mov	r12d, eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L23:
	lea	rsi, .LC3[rip]
	mov	edi, 3
	xor	eax, eax
	call	dprintk@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L20:
	lea	rsi, .LC1[rip]
	mov	edi, 3
	xor	eax, eax
	call	dprintk@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L24:
	lea	rsi, .LC4[rip]
	mov	edi, 3
	xor	eax, eax
	call	dprintk@PLT
	jmp	.L5
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	dst_write_tuna, .-dst_write_tuna
	.comm	SEC_VOLTAGE_13,4,4
	.comm	HAS_POWER,4,4
	.comm	HAS_LOCK,4,4
	.comm	GET_ACK,4,4
	.comm	FIXED_COMM,4,4
	.comm	EIO,4,4
	.comm	DST_TYPE_IS_SAT,8,8
	.comm	DST_TYPE_IS_ATSC,8,8
	.comm	DST_TYPE_HAS_VLF,4,4
	.comm	ATTEMPT_TUNE,4,4
	.comm	ACK,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_dst.c_dst_write_tuna.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"type_flags 0x%x\012\000"
	.align	2
.LC1:
	.ascii	"DST Communication initialization failed.\012\000"
	.align	2
.LC2:
	.ascii	"write not successful\012\000"
	.align	2
.LC3:
	.ascii	"DST PIO disable failed !\012\000"
	.align	2
.LC4:
	.ascii	"read verify not successful.\012\000"
	.align	2
.LC5:
	.ascii	"write not acknowledged 0x%02x\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	dst_write_tuna, %function
dst_write_tuna:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	ldr	r4, [r0]
	ldr	r3, .L27
	ldr	r1, .L27+4
	ldr	r2, [r4]
	sub	sp, sp, #12
	mov	r5, r0
	mov	r0, #2
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	bl	dprintk
	mov	r3, #0
	ldr	r2, .L27+8
	ldr	r1, [r4, #4]
	ldr	r2, [r2]
	str	r3, [r4, #32]
	cmp	r1, r2
	str	r3, [r4, #20]
	str	r3, [r4, #24]
	str	r3, [r4, #28]
	beq	.L2
.L19:
	ldr	r3, [r4, #8]
.L3:
	ldr	r2, .L27+12
	ldr	r7, .L27+16
	ldr	r2, [r2]
	ldr	r1, [r7]
	add	r6, r4, #12
	orr	r2, r2, r1
	bic	r3, r3, r2
	str	r3, [r4, #8]
	mov	r0, r6
	bl	mutex_lock
	mov	r0, r4
	bl	dst_comm_init
	cmp	r0, #0
	blt	.L21
	ldr	r3, .L27+20
	ldr	r2, [r4]
	ldr	r3, [r3]
	ldr	r5, [r4, #16]
	tst	r2, r3
	beq	.L6
	ldr	r3, .L27+24
	ldr	r2, [r4, #4]
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L22
.L6:
	mov	r1, #7
	add	r0, r5, #8
	bl	dst_check_sum
	str	r0, [r5, #36]
	ldr	r1, [r4, #16]
	ldr	r3, .L27+28
	mov	r0, r4
	ldr	r2, [r3]
	add	r1, r1, #8
	bl	write_dst
	mov	r5, r0
	cmp	r5, #0
	mov	r0, r4
	blt	.L23
.L8:
	bl	dst_pio_disable
	cmp	r0, #0
	blt	.L24
	ldr	r3, .L27+32
	mov	r1, sp
	mov	r0, r4
	ldr	r2, [r3]
	bl	read_dst
	cmp	r0, #0
	blt	.L25
	ldr	r3, .L27+36
	ldr	r2, [sp]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L12
	mov	r0, #3
	ldr	r1, .L27+40
	bl	dprintk
.L5:
	mov	r0, r6
	bl	mutex_unlock
	ldr	r3, .L27+44
	ldr	r5, [r3]
	rsb	r5, r5, #0
	b	.L1
.L22:
	mov	r1, #9
	mov	r0, r5
	bl	dst_check_sum
	str	r0, [r5, #36]
	mov	r2, #10
	mov	r0, r4
	ldr	r1, [r4, #16]
	bl	write_dst
	mov	r5, r0
	cmp	r5, #0
	mov	r0, r4
	bge	.L8
.L23:
	bl	dst_pio_disable
	mov	r0, #3
	ldr	r1, .L27+48
	bl	dprintk
.L9:
	mov	r0, r6
	bl	mutex_unlock
.L1:
	ldr	r3, .L27
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L26
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L2:
	ldr	r2, .L27+52
	ldr	r3, [r4, #8]
	ldr	r2, [r2]
	tst	r3, r2
	bne	.L3
	ldr	r3, .L27+56
	mov	r0, r5
	ldr	r1, [r3]
	bl	dst_set_voltage
	b	.L19
.L12:
	ldr	r3, [r4, #8]
	ldr	r2, [r7]
	mov	r0, r4
	orr	r3, r3, r2
	str	r3, [r4, #8]
	bl	dst_get_tuna
	mov	r5, r0
	b	.L9
.L24:
	ldr	r1, .L27+60
	mov	r0, #3
	bl	dprintk
	b	.L5
.L21:
	ldr	r1, .L27+64
	mov	r0, #3
	bl	dprintk
	b	.L5
.L25:
	ldr	r1, .L27+68
	mov	r0, #3
	bl	dprintk
	b	.L5
.L26:
	bl	__stack_chk_fail
.L28:
	.align	2
.L27:
	.word	.LC6
	.word	.LC0
	.word	DST_TYPE_IS_SAT
	.word	HAS_LOCK
	.word	ATTEMPT_TUNE
	.word	DST_TYPE_HAS_VLF
	.word	DST_TYPE_IS_ATSC
	.word	FIXED_COMM
	.word	GET_ACK
	.word	ACK
	.word	.LC5
	.word	EIO
	.word	.LC2
	.word	HAS_POWER
	.word	SEC_VOLTAGE_13
	.word	.LC3
	.word	.LC1
	.word	.LC4
	.size	dst_write_tuna, .-dst_write_tuna
	.comm	SEC_VOLTAGE_13,4,4
	.comm	HAS_POWER,4,4
	.comm	HAS_LOCK,4,4
	.comm	GET_ACK,4,4
	.comm	FIXED_COMM,4,4
	.comm	EIO,4,4
	.comm	DST_TYPE_IS_SAT,4,4
	.comm	DST_TYPE_IS_ATSC,4,4
	.comm	DST_TYPE_HAS_VLF,4,4
	.comm	ATTEMPT_TUNE,4,4
	.comm	ACK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
