	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_af9005_write_tuner_registers   ## -- Begin function af9005_write_tuner_registers
	.p2align	4, 0x90
_af9005_write_tuner_registers:          ## @af9005_write_tuner_registers
	.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
	movl	%esi, %ebx
	movq	%rdi, %r15
	callq	_af9005_usb_write_tuner_registers
	testl	%eax, %eax
	jne	LBB0_12
## %bb.1:
	cmpl	$65535, %ebx                    ## imm = 0xFFFF
	jne	LBB0_2
LBB0_11:
	xorl	%eax, %eax
	jmp	LBB0_12
LBB0_2:
	movl	$200, %ebx
	leaq	-44(%rbp), %r14
	movq	_i2c_m_status_wdat_done_pos@GOTPCREL(%rip), %r12
	movq	_i2c_m_status_wdat_fail_pos@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	_xd_I2C_i2c_m_status_wdat_done@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_af9005_read_ofdm_register
	testl	%eax, %eax
	jne	LBB0_12
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	-44(%rbp), %edx
	movq	_regmask@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_i2c_m_status_wdat_done_len@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movl	-4(%rsi,%rax,4), %edi
	movl	(%r12), %ecx
	shll	%cl, %edi
	testl	%edx, %edi
	jne	LBB0_10
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_i2c_m_status_wdat_fail_len@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movl	-4(%rsi,%rax,4), %esi
	movl	(%r13), %ecx
	shll	%cl, %esi
	testl	%edx, %esi
	jne	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$50, %edi
	callq	_msleep
	decl	%ebx
	jne	LBB0_3
## %bb.7:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	jmp	LBB0_8
LBB0_10:
	movq	_xd_I2C_i2c_m_status_wdat_fail@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	movq	%r15, %rdi
	movl	%ecx, %edx
	movl	%eax, %ecx
	movl	$1, %r8d
	callq	_af9005_write_register_bits
	testl	%eax, %eax
	jne	LBB0_12
	jmp	LBB0_11
LBB0_9:
	movq	_xd_I2C_i2c_m_status_wdat_fail@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	movq	%r15, %rdi
	movl	%ecx, %edx
	movl	%eax, %ecx
	movl	$1, %r8d
	callq	_af9005_write_register_bits
	movq	_EIO@GOTPCREL(%rip), %rcx
LBB0_8:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_xd_I2C_i2c_m_status_wdat_done,4,2 ## @xd_I2C_i2c_m_status_wdat_done
	.comm	_regmask,8,3                    ## @regmask
	.comm	_i2c_m_status_wdat_done_len,4,2 ## @i2c_m_status_wdat_done_len
	.comm	_i2c_m_status_wdat_done_pos,4,2 ## @i2c_m_status_wdat_done_pos
	.comm	_i2c_m_status_wdat_fail_len,4,2 ## @i2c_m_status_wdat_fail_len
	.comm	_i2c_m_status_wdat_fail_pos,4,2 ## @i2c_m_status_wdat_fail_pos
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_xd_I2C_i2c_m_status_wdat_fail,4,2 ## @xd_I2C_i2c_m_status_wdat_fail
	.comm	_EIO,4,2                        ## @EIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_af9005_write_tuner_registers   ; -- Begin function af9005_write_tuner_registers
	.p2align	2
_af9005_write_tuner_registers:          ; @af9005_write_tuner_registers
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_af9005_usb_write_tuner_registers
	cbnz	w0, LBB0_12
; %bb.1:
	mov	w8, #65535
	cmp	w20, w8
	b.ne	LBB0_3
LBB0_2:
	mov	w0, #0
	b	LBB0_12
LBB0_3:
	mov	w20, #200
Lloh0:
	adrp	x21, _xd_I2C_i2c_m_status_wdat_done@GOTPAGE
Lloh1:
	ldr	x21, [x21, _xd_I2C_i2c_m_status_wdat_done@GOTPAGEOFF]
Lloh2:
	adrp	x22, _regmask@GOTPAGE
Lloh3:
	ldr	x22, [x22, _regmask@GOTPAGEOFF]
Lloh4:
	adrp	x23, _i2c_m_status_wdat_done_len@GOTPAGE
Lloh5:
	ldr	x23, [x23, _i2c_m_status_wdat_done_len@GOTPAGEOFF]
Lloh6:
	adrp	x24, _i2c_m_status_wdat_done_pos@GOTPAGE
Lloh7:
	ldr	x24, [x24, _i2c_m_status_wdat_done_pos@GOTPAGEOFF]
Lloh8:
	adrp	x25, _i2c_m_status_wdat_fail_len@GOTPAGE
Lloh9:
	ldr	x25, [x25, _i2c_m_status_wdat_fail_len@GOTPAGEOFF]
Lloh10:
	adrp	x26, _i2c_m_status_wdat_fail_pos@GOTPAGE
Lloh11:
	ldr	x26, [x26, _i2c_m_status_wdat_fail_pos@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_af9005_read_ofdm_register
	cbnz	w0, LBB0_12
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [sp, #12]
	ldr	x9, [x22]
	ldr	w3, [x23]
	sub	w10, w3, #1
	ldr	w10, [x9, w10, sxtw #2]
	ldr	w2, [x24]
	lsl	w10, w10, w2
	tst	w10, w8
	b.ne	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w3, [x25]
	sub	w10, w3, #1
	ldr	w9, [x9, w10, sxtw #2]
	ldr	w2, [x26]
	lsl	w9, w9, w2
	tst	w9, w8
	b.ne	LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #50
	bl	_msleep
	subs	w20, w20, #1
	b.ne	LBB0_4
; %bb.8:
Lloh12:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_11
LBB0_9:
Lloh14:
	adrp	x8, _xd_I2C_i2c_m_status_wdat_fail@GOTPAGE
Lloh15:
	ldr	x8, [x8, _xd_I2C_i2c_m_status_wdat_fail@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
                                        ; kill: def $w2 killed $w2 killed $x2
	mov	w4, #1
	bl	_af9005_write_register_bits
	cbnz	w0, LBB0_12
	b	LBB0_2
LBB0_10:
Lloh17:
	adrp	x8, _xd_I2C_i2c_m_status_wdat_fail@GOTPAGE
Lloh18:
	ldr	x8, [x8, _xd_I2C_i2c_m_status_wdat_fail@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x19
                                        ; kill: def $w2 killed $w2 killed $x2
	mov	w4, #1
	bl	_af9005_write_register_bits
Lloh20:
	adrp	x8, _EIO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_xd_I2C_i2c_m_status_wdat_done,4,2 ; @xd_I2C_i2c_m_status_wdat_done
	.comm	_regmask,8,3                    ; @regmask
	.comm	_i2c_m_status_wdat_done_len,4,2 ; @i2c_m_status_wdat_done_len
	.comm	_i2c_m_status_wdat_done_pos,4,2 ; @i2c_m_status_wdat_done_pos
	.comm	_i2c_m_status_wdat_fail_len,4,2 ; @i2c_m_status_wdat_fail_len
	.comm	_i2c_m_status_wdat_fail_pos,4,2 ; @i2c_m_status_wdat_fail_pos
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_xd_I2C_i2c_m_status_wdat_fail,4,2 ; @xd_I2C_i2c_m_status_wdat_fail
	.comm	_EIO,4,2                        ; @EIO
.subsections_via_symbols
