	.file	"extr_af9005.c_af9005_write_tuner_registers.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	af9005_write_tuner_registers
	.type	af9005_write_tuner_registers, @function
af9005_write_tuner_registers:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	ebx, esi
	sub	rsp, 16
	.cfi_def_cfa_offset 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	call	af9005_usb_write_tuner_registers@PLT
	test	eax, eax
	jne	.L1
	cmp	ebx, 65535
	je	.L1
	mov	ebx, 200
	lea	r12, 4[rsp]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L15:
	movsx	rax, DWORD PTR i2c_m_status_wdat_done_len[rip]
	mov	rsi, QWORD PTR regmask[rip]
	mov	r9d, DWORD PTR i2c_m_status_wdat_done_pos[rip]
	mov	edx, DWORD PTR 4[rsp]
	mov	r10, rax
	mov	eax, DWORD PTR -4[rsi+rax*4]
	mov	ecx, r9d
	sal	eax, cl
	test	eax, edx
	jne	.L3
	movsx	rax, DWORD PTR i2c_m_status_wdat_fail_len[rip]
	mov	r9d, DWORD PTR i2c_m_status_wdat_fail_pos[rip]
	mov	r10, rax
	mov	eax, DWORD PTR -4[rsi+rax*4]
	mov	ecx, r9d
	sal	eax, cl
	test	eax, edx
	jne	.L4
	mov	edi, 50
	call	msleep@PLT
	sub	ebx, 1
	je	.L14
.L5:
	mov	esi, DWORD PTR xd_I2C_i2c_m_status_wdat_done[rip]
	mov	rdx, r12
	mov	rdi, rbp
	call	af9005_read_ofdm_register@PLT
	test	eax, eax
	je	.L15
	.p2align 4,,10
	.p2align 3
.L1:
	mov	rbx, QWORD PTR 8[rsp]
	xor	rbx, QWORD PTR fs:40
	jne	.L16
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	mov	esi, DWORD PTR xd_I2C_i2c_m_status_wdat_fail[rip]
	mov	ecx, r10d
	mov	edx, r9d
	mov	rdi, rbp
	mov	r8d, 1
	call	af9005_write_register_bits@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L4:
	mov	esi, DWORD PTR xd_I2C_i2c_m_status_wdat_fail[rip]
	mov	ecx, r10d
	mov	edx, r9d
	mov	rdi, rbp
	mov	r8d, 1
	call	af9005_write_register_bits@PLT
	mov	eax, DWORD PTR EIO[rip]
	neg	eax
	jmp	.L1
.L14:
	mov	eax, DWORD PTR ETIMEDOUT[rip]
	neg	eax
	jmp	.L1
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	af9005_write_tuner_registers, .-af9005_write_tuner_registers
	.comm	xd_I2C_i2c_m_status_wdat_fail,4,4
	.comm	xd_I2C_i2c_m_status_wdat_done,4,4
	.comm	regmask,8,8
	.comm	i2c_m_status_wdat_fail_pos,4,4
	.comm	i2c_m_status_wdat_fail_len,4,4
	.comm	i2c_m_status_wdat_done_pos,4,4
	.comm	i2c_m_status_wdat_done_len,4,4
	.comm	ETIMEDOUT,4,4
	.comm	EIO,4,4
	.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_af9005.c_af9005_write_tuner_registers.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	af9005_write_tuner_registers
	.syntax unified
	.arm
	.fpu softvfp
	.type	af9005_write_tuner_registers, %function
af9005_write_tuner_registers:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	ip, .L14
	sub	sp, sp, #20
	ldr	ip, [ip]
	str	ip, [sp, #12]
	mov	ip,#0
	mov	r5, r0
	mov	r4, r1
	bl	af9005_usb_write_tuner_registers
	cmp	r0, #0
	bne	.L1
	ldr	r3, .L14+4
	cmp	r4, r3
	beq	.L1
	mov	r4, #200
	ldr	r6, .L14+8
	ldr	r9, .L14+12
	ldr	r8, .L14+16
	ldr	r7, .L14+20
	ldr	fp, .L14+24
	ldr	r10, .L14+28
	b	.L5
.L12:
	ldr	r3, [r8]
	ldr	r0, [r9]
	sub	r2, r3, #-1073741823
	ldr	ip, [r0, r2, lsl #2]
	ldr	r1, [sp, #8]
	ldr	r2, [r7]
	ands	ip, r1, ip, lsl r2
	bne	.L3
	ldr	r3, [fp]
	ldr	r2, [r10]
	sub	ip, r3, #-1073741823
	ldr	r0, [r0, ip, lsl #2]
	ands	r1, r1, r0, lsl r2
	bne	.L4
	mov	r0, #50
	bl	msleep
	subs	r4, r4, #1
	beq	.L11
.L5:
	mov	r0, r5
	ldr	r1, [r6]
	add	r2, sp, #8
	bl	af9005_read_ofdm_register
	cmp	r0, #0
	beq	.L12
.L1:
	ldr	r3, .L14
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L13
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L3:
	mov	ip, #1
	ldr	r1, .L14+32
	str	ip, [sp]
	mov	r0, r5
	ldr	r1, [r1]
	bl	af9005_write_register_bits
	b	.L1
.L4:
	mov	ip, #1
	ldr	r1, .L14+32
	str	ip, [sp]
	mov	r0, r5
	ldr	r1, [r1]
	bl	af9005_write_register_bits
	ldr	r3, .L14+36
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	.L1
.L11:
	ldr	r3, .L14+40
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	.L1
.L13:
	bl	__stack_chk_fail
.L15:
	.align	2
.L14:
	.word	.LC0
	.word	65535
	.word	xd_I2C_i2c_m_status_wdat_done
	.word	regmask
	.word	i2c_m_status_wdat_done_len
	.word	i2c_m_status_wdat_done_pos
	.word	i2c_m_status_wdat_fail_len
	.word	i2c_m_status_wdat_fail_pos
	.word	xd_I2C_i2c_m_status_wdat_fail
	.word	EIO
	.word	ETIMEDOUT
	.size	af9005_write_tuner_registers, .-af9005_write_tuner_registers
	.comm	xd_I2C_i2c_m_status_wdat_fail,4,4
	.comm	xd_I2C_i2c_m_status_wdat_done,4,4
	.comm	regmask,4,4
	.comm	i2c_m_status_wdat_fail_pos,4,4
	.comm	i2c_m_status_wdat_fail_len,4,4
	.comm	i2c_m_status_wdat_done_pos,4,4
	.comm	i2c_m_status_wdat_done_len,4,4
	.comm	ETIMEDOUT,4,4
	.comm	EIO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
