	.file	"extr_rt2860.c_rt3090_set_chan.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	rt3090_set_chan, @function
rt3090_set_chan:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movsx	rsi, esi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	lea	eax, -1[rsi]
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	xor	edi, edi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rsi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	cmp	eax, 13
	setbe	dil
	call	KASSERT@PLT
	mov	rcx, QWORD PTR rt2860_rf2850[rip]
	cmp	ebx, DWORD PTR [rcx]
	je	.L8
	mov	eax, 1
	.p2align 4,,10
	.p2align 3
.L3:
	lea	rdx, 0[0+rax*4]
	mov	rsi, rax
	add	rax, 1
	cmp	DWORD PTR -4[rcx+rax*4], ebx
	jne	.L3
	lea	r13, [rsi+rsi*2]
	sal	r13, 2
.L2:
	mov	rax, QWORD PTR 0[rbp]
	mov	esi, 2
	mov	rdi, rbp
	mov	r12d, DWORD PTR [rax+rdx]
	mov	rax, QWORD PTR 8[rbp]
	mov	ebx, DWORD PTR [rax+rdx]
	mov	rax, QWORD PTR rt3090_freqs[rip]
	mov	edx, DWORD PTR [rax+r13]
	call	rt3090_rf_write@PLT
	mov	esi, 3
	mov	rdi, rbp
	call	rt3090_rf_read@PLT
	mov	esi, 3
	mov	rdi, rbp
	and	eax, -16
	mov	edx, eax
	mov	rax, QWORD PTR rt3090_freqs[rip]
	or	edx, DWORD PTR 4[rax+r13]
	call	rt3090_rf_write@PLT
	mov	esi, 6
	mov	rdi, rbp
	call	rt3090_rf_read@PLT
	mov	esi, 6
	mov	rdi, rbp
	and	eax, -4
	mov	edx, eax
	mov	rax, QWORD PTR rt3090_freqs[rip]
	or	edx, DWORD PTR 8[rax+r13]
	call	rt3090_rf_write@PLT
	mov	esi, 12
	mov	rdi, rbp
	call	rt3090_rf_read@PLT
	mov	esi, 12
	mov	rdi, rbp
	and	eax, -32
	mov	edx, eax
	or	edx, r12d
	call	rt3090_rf_write@PLT
	mov	esi, 13
	mov	rdi, rbp
	call	rt3090_rf_read@PLT
	mov	esi, 13
	mov	rdi, rbp
	and	eax, -32
	mov	edx, eax
	or	edx, ebx
	call	rt3090_rf_write@PLT
	mov	esi, 1
	mov	rdi, rbp
	call	rt3090_rf_read@PLT
	and	al, 3
	mov	edx, eax
	mov	eax, DWORD PTR 16[rbp]
	cmp	eax, 1
	je	.L12
	cmp	eax, 2
	je	.L13
.L5:
	mov	eax, DWORD PTR 20[rbp]
	cmp	eax, 1
	je	.L14
.L6:
	cmp	eax, 2
	je	.L15
.L7:
	mov	rdi, rbp
	mov	esi, 1
	call	rt3090_rf_write@PLT
	mov	rdi, rbp
	mov	esi, 23
	call	rt3090_rf_read@PLT
	mov	edx, DWORD PTR 24[rbp]
	mov	rdi, rbp
	mov	esi, 23
	and	eax, -128
	or	edx, eax
	call	rt3090_rf_write@PLT
	mov	rdi, rbp
	mov	esi, 24
	call	rt3090_rf_read@PLT
	mov	edx, DWORD PTR 28[rbp]
	mov	rdi, rbp
	mov	esi, 24
	and	eax, -64
	or	edx, eax
	call	rt3090_rf_write@PLT
	mov	rdi, rbp
	mov	esi, 31
	call	rt3090_rf_read@PLT
	mov	edx, DWORD PTR 28[rbp]
	mov	rdi, rbp
	mov	esi, 31
	and	eax, -64
	or	edx, eax
	call	rt3090_rf_write@PLT
	mov	rdi, rbp
	mov	esi, 7
	call	rt3090_rf_read@PLT
	or	eax, DWORD PTR RT3070_TUNE[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rdi, rbp
	pop	rbx
	.cfi_def_cfa_offset 32
	mov	edx, eax
	pop	rbp
	.cfi_def_cfa_offset 24
	mov	esi, 7
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	jmp	rt3090_rf_write@PLT
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	or	edx, DWORD PTR RT3070_RX2_PD[rip]
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L13:
	mov	eax, DWORD PTR 20[rbp]
	or	edx, DWORD PTR RT3070_TX2_PD[rip]
	cmp	eax, 1
	jne	.L6
.L14:
	mov	eax, DWORD PTR RT3070_RX1_PD[rip]
	or	eax, DWORD PTR RT3070_RX2_PD[rip]
	or	edx, eax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L12:
	mov	eax, DWORD PTR RT3070_TX1_PD[rip]
	or	eax, DWORD PTR RT3070_TX2_PD[rip]
	or	edx, eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L8:
	xor	r13d, r13d
	xor	edx, edx
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	rt3090_set_chan, .-rt3090_set_chan
	.comm	rt3090_freqs,8,8
	.comm	rt2860_rf2850,8,8
	.comm	RT3070_TX2_PD,4,4
	.comm	RT3070_TX1_PD,4,4
	.comm	RT3070_TUNE,4,4
	.comm	RT3070_RX2_PD,4,4
	.comm	RT3070_RX1_PD,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_rt2860.c_rt3090_set_chan.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	rt3090_set_chan, %function
rt3090_set_chan:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r1
	mov	r5, r0
	sub	r0, r1, #1
	cmp	r0, #13
	movhi	r0, #0
	movls	r0, #1
	bl	KASSERT
	ldr	r3, .L14
	ldr	r2, [r3]
	ldr	r3, [r2]
	cmp	r4, r3
	beq	.L8
	mov	r3, #0
.L3:
	ldr	r0, [r2, #4]!
	add	r3, r3, #1
	cmp	r0, r4
	lsl	ip, r3, #2
	bne	.L3
	add	r3, r3, r3, lsl #1
	lsl	r4, r3, #2
.L2:
	ldr	r8, .L14+4
	ldr	lr, [r5]
	ldr	r2, [r8]
	ldr	r3, [r5, #4]
	ldr	r2, [r2, r4]
	mov	r1, #2
	mov	r0, r5
	ldr	r6, [r3, ip]
	ldr	r7, [lr, ip]
	bl	rt3090_rf_write
	mov	r1, #3
	mov	r0, r5
	bl	rt3090_rf_read
	ldr	r3, [r8]
	bic	r0, r0, #15
	add	r3, r3, r4
	ldr	r2, [r3, #4]
	mov	r1, #3
	orr	r2, r0, r2
	mov	r0, r5
	bl	rt3090_rf_write
	mov	r1, #6
	mov	r0, r5
	bl	rt3090_rf_read
	ldr	r3, [r8]
	bic	r0, r0, #3
	add	r3, r3, r4
	ldr	r2, [r3, #8]
	mov	r1, #6
	orr	r2, r0, r2
	mov	r0, r5
	bl	rt3090_rf_write
	mov	r1, #12
	mov	r0, r5
	bl	rt3090_rf_read
	bic	r2, r0, #31
	orr	r2, r2, r7
	mov	r1, #12
	mov	r0, r5
	bl	rt3090_rf_write
	mov	r1, #13
	mov	r0, r5
	bl	rt3090_rf_read
	bic	r2, r0, #31
	orr	r2, r2, r6
	mov	r1, #13
	mov	r0, r5
	bl	rt3090_rf_write
	mov	r1, #1
	mov	r0, r5
	bl	rt3090_rf_read
	ldr	r3, [r5, #8]
	bic	r2, r0, #252
	cmp	r3, #1
	beq	.L12
	cmp	r3, #2
	ldreq	r3, .L14+8
	ldreq	r3, [r3]
	orreq	r2, r2, r3
	ldr	r3, [r5, #12]
	cmp	r3, #1
	beq	.L13
.L6:
	cmp	r3, #2
	ldreq	r3, .L14+12
	ldreq	r3, [r3]
	orreq	r2, r2, r3
.L7:
	mov	r1, #1
	mov	r0, r5
	bl	rt3090_rf_write
	mov	r1, #23
	mov	r0, r5
	bl	rt3090_rf_read
	ldr	r2, [r5, #16]
	bic	r0, r0, #127
	orr	r2, r0, r2
	mov	r1, #23
	mov	r0, r5
	bl	rt3090_rf_write
	mov	r1, #24
	mov	r0, r5
	bl	rt3090_rf_read
	ldr	r2, [r5, #20]
	bic	r0, r0, #63
	orr	r2, r0, r2
	mov	r1, #24
	mov	r0, r5
	bl	rt3090_rf_write
	mov	r1, #31
	mov	r0, r5
	bl	rt3090_rf_read
	ldr	r2, [r5, #20]
	bic	r0, r0, #63
	orr	r2, r0, r2
	mov	r1, #31
	mov	r0, r5
	bl	rt3090_rf_write
	mov	r1, #7
	mov	r0, r5
	bl	rt3090_rf_read
	mov	r2, r0
	ldr	r3, .L14+16
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, lr}
	ldr	r3, [r3]
	mov	r1, #7
	orr	r2, r2, r3
	b	rt3090_rf_write
.L12:
	ldr	r3, .L14+20
	ldr	r1, .L14+8
	ldr	r3, [r3]
	ldr	r1, [r1]
	orr	r3, r3, r1
	orr	r2, r2, r3
	ldr	r3, [r5, #12]
	cmp	r3, #1
	bne	.L6
.L13:
	ldr	r3, .L14+24
	ldr	r1, .L14+12
	ldr	r3, [r3]
	ldr	r1, [r1]
	orr	r3, r3, r1
	orr	r2, r2, r3
	b	.L7
.L8:
	mov	r4, #0
	mov	ip, r4
	b	.L2
.L15:
	.align	2
.L14:
	.word	rt2860_rf2850
	.word	rt3090_freqs
	.word	RT3070_TX2_PD
	.word	RT3070_RX2_PD
	.word	RT3070_TUNE
	.word	RT3070_TX1_PD
	.word	RT3070_RX1_PD
	.size	rt3090_set_chan, .-rt3090_set_chan
	.comm	rt3090_freqs,4,4
	.comm	rt2860_rf2850,4,4
	.comm	RT3070_TX2_PD,4,4
	.comm	RT3070_TX1_PD,4,4
	.comm	RT3070_TUNE,4,4
	.comm	RT3070_RX2_PD,4,4
	.comm	RT3070_RX1_PD,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
