	.file	"extr_ar9300_phy.c_ar9300_get_tpc_tables.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"\n TPC Register method in use\n"
	.text
	.p2align 4
	.globl	ar9300_get_tpc_tables
	.type	ar9300_get_tpc_tables, @function
ar9300_get_tpc_tables:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	call	AH9300@PLT
	mov	rdi, rbp
	mov	r12, rax
	call	AH_PRIVATE@PLT
	mov	rdi, rbp
	mov	rsi, QWORD PTR [rax]
	call	ath_hal_get_curmode@PLT
	mov	ecx, DWORD PTR 0[rbp]
	test	ecx, ecx
	je	.L33
	mov	esi, eax
	mov	rdi, rbp
	call	ar9300_get_rate_table@PLT
	xor	edi, edi
	test	rax, rax
	mov	r14, rax
	setne	dil
	call	HALASSERT@PLT
	mov	eax, DWORD PTR [r14]
	lea	edi, [rax+rax*2]
	sal	edi, 4
	add	edi, 1
	call	ath_hal_malloc@PLT
	mov	QWORD PTR 24[rsp], 0
	mov	r15, rax
	test	rax, rax
	je	.L1
	mov	QWORD PTR 24[rsp], rax
	mov	eax, DWORD PTR [r14]
	mov	rdi, r15
	xor	ebp, ebp
	lea	esi, [rax+rax*2]
	sal	esi, 4
	add	esi, 1
	call	OS_MEMZERO@PLT
	mov	eax, DWORD PTR [r14]
	mov	DWORD PTR [r15], eax
	.p2align 4,,10
	.p2align 3
.L4:
	mov	edi, DWORD PTR 8[r12]
	mov	ebx, ebp
	mov	r13d, ebp
	call	ar9300_get_ntxchains@PLT
	cmp	eax, ebp
	jle	.L26
	mov	edx, DWORD PTR [r14]
	test	edx, edx
	jle	.L18
	mov	rdi, QWORD PTR 8[r14]
	lea	r11, 0[0+rbp*4]
	xor	edx, edx
	xor	ecx, ecx
	lea	rax, 4[r15]
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L35:
	test	ebx, ebx
	je	.L34
	test	r13d, r13d
	jne	.L11
	mov	esi, DWORD PTR 8[rax]
.L8:
	test	esi, esi
	je	.L12
.L10:
	mov	rsi, QWORD PTR 16[r12]
	mov	rsi, QWORD PTR [rsi+rdx]
	mov	r10d, DWORD PTR [rsi+r11]
	mov	rsi, QWORD PTR 32[rax]
	mov	DWORD PTR [rsi+r11], r10d
.L12:
	add	ecx, 1
	add	rax, 48
	add	rdx, 8
	cmp	DWORD PTR [r14], ecx
	jle	.L18
.L15:
	mov	DWORD PTR [rax], ecx
	mov	esi, DWORD PTR [rdi+rdx]
	mov	DWORD PTR 4[rax], esi
	mov	r10d, DWORD PTR 4[rdi+rdx]
	mov	DWORD PTR 40[rax], r10d
	cmp	rbp, 1
	je	.L5
	cmp	ebx, 2
	jne	.L35
	mov	DWORD PTR 16[rax], 1
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L34:
	cmp	esi, 135
	setle	sil
	movzx	esi, sil
	mov	DWORD PTR 8[rax], esi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L5:
	cmp	esi, 143
	setle	sil
	movzx	esi, sil
	mov	DWORD PTR 12[rax], esi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L18:
	add	rbp, 1
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L11:
	cmp	r13d, 1
	je	.L36
	cmp	r13d, 2
	jne	.L12
	cmp	DWORD PTR 16[rax], 0
	jne	.L10
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L33:
	lea	rsi, .LC0[rip]
	mov	rdi, rbp
	call	ath_hal_printf@PLT
	mov	QWORD PTR 24[rsp], 0
.L1:
	mov	rax, QWORD PTR 24[rsp]
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	.cfi_restore_state
	mov	QWORD PTR 16[rsp], 0
	lea	rax, 4[r15]
	mov	QWORD PTR 8[rsp], rax
	.p2align 4,,10
	.p2align 3
.L16:
	mov	rbx, QWORD PTR 16[rsp]
	mov	edi, DWORD PTR 8[r12]
	mov	r15d, ebx
	call	ar9300_get_ntxchains@PLT
	cmp	eax, ebx
	jle	.L1
	mov	eax, DWORD PTR [r14]
	lea	r13, 0[0+rbx*4]
	xor	ebx, ebx
	test	eax, eax
	jle	.L24
	.p2align 4,,10
	.p2align 3
.L22:
	mov	rax, QWORD PTR 8[r14]
	lea	rbp, 0[0+rbx*8]
	movsx	rsi, DWORD PTR [rax+rbx*8]
	cmp	rsi, QWORD PTR AR9300_MCS0_RATE_CODE[rip]
	jl	.L20
	cmp	rsi, QWORD PTR AR9300_MCS23_RATE_CODE[rip]
	jg	.L20
	mov	edi, r15d
	call	ar9300_invalid_stbc_cfg@PLT
	cmp	rax, QWORD PTR AH_TRUE[rip]
	je	.L20
	mov	rcx, QWORD PTR [r12]
	lea	rax, [rbx+rbx*2]
	sal	rax, 4
	add	rax, QWORD PTR 8[rsp]
	mov	rdx, QWORD PTR [rcx+rbp]
	mov	DWORD PTR 20[rax], 1
	mov	rax, QWORD PTR 24[rax]
	mov	edx, DWORD PTR [rdx+r13]
	mov	DWORD PTR [rax+r13], edx
.L20:
	add	rbx, 1
	cmp	DWORD PTR [r14], ebx
	jg	.L22
.L24:
	add	QWORD PTR 16[rsp], 1
	jmp	.L16
.L36:
	mov	esi, DWORD PTR 12[rax]
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	ar9300_get_tpc_tables, .-ar9300_get_tpc_tables
	.comm	AR9300_MCS23_RATE_CODE,8,8
	.comm	AR9300_MCS0_RATE_CODE,8,8
	.comm	AH_TRUE,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_ar9300_phy.c_ar9300_get_tpc_tables.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"\012 TPC Register method in use\012\000"
	.text
	.align	2
	.global	ar9300_get_tpc_tables
	.syntax unified
	.arm
	.fpu softvfp
	.type	ar9300_get_tpc_tables, %function
ar9300_get_tpc_tables:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #12
	mov	r4, r0
	bl	AH9300
	mov	r6, r0
	mov	r0, r4
	bl	AH_PRIVATE
	mov	r3, r0
	mov	r0, r4
	ldr	r1, [r3]
	bl	ath_hal_get_curmode
	ldr	r8, [r4]
	cmp	r8, #0
	beq	.L29
	mov	r1, r0
	mov	r0, r4
	bl	ar9300_get_rate_table
	mov	r5, r0
	subs	r0, r0, #0
	movne	r0, #1
	bl	HALASSERT
	ldr	r3, [r5]
	add	r3, r3, r3, lsl #3
	lsl	r0, r3, #2
	add	r0, r0, #1
	bl	ath_hal_malloc
	subs	r9, r0, #0
	streq	r9, [sp, #4]
	beq	.L1
	ldr	r3, [r5]
	str	r9, [sp, #4]
	add	r3, r3, r3, lsl #3
	lsl	r1, r3, #2
	add	r1, r1, #1
	bl	OS_MEMZERO
	ldr	r3, [r5]
	mov	r4, #0
	str	r3, [r9]
	ldr	r0, [r6, #4]
	bl	ar9300_get_ntxchains
	cmp	r0, r4
	mov	r7, #1
	ble	.L21
.L32:
	ldr	r0, [r5]
	cmp	r0, #0
	ble	.L13
	ldr	lr, [r5, #4]
	mov	r2, #0
	lsl	fp, r4, #2
	add	r10, lr, #4
	add	r3, r9, #4
	b	.L10
.L31:
	cmp	r4, #0
	beq	.L30
.L9:
	add	r2, r2, #1
	cmp	r0, r2
	add	r3, r3, #36
	ble	.L13
.L10:
	str	r2, [r3]
	ldr	r1, [lr, r2, lsl #3]
	cmp	r4, #1
	str	r1, [r3, #4]
	ldr	ip, [r10, r2, lsl #3]
	str	ip, [r3, #32]
	beq	.L5
	cmp	r4, #2
	bne	.L31
	str	r7, [r3, #16]
.L8:
	ldr	r0, [r6, #8]
	ldr	r1, [r3, #28]
	ldr	r0, [r0, r2, lsl #2]
	add	r2, r2, #1
	ldr	r0, [r0, fp]
	add	r3, r3, #36
	str	r0, [r1, fp]
	ldr	r0, [r5]
	cmp	r0, r2
	bgt	.L10
.L13:
	ldr	r0, [r6, #4]
	bl	ar9300_get_ntxchains
	add	r4, r4, #1
	cmp	r0, r4
	bgt	.L32
.L21:
	add	r3, r9, #4
	ldr	r0, [r6, #4]
	mov	r10, #0
	str	r3, [sp]
	bl	ar9300_get_ntxchains
	cmp	r0, r10
	ldr	r7, .L34
	ldr	r8, .L34+4
	ldr	fp, .L34+8
	ble	.L1
.L33:
	ldr	r0, [r5]
	cmp	r0, #0
	movgt	r4, #0
	lslgt	r9, r10, #2
	ble	.L19
.L17:
	ldr	r1, [r5, #4]
	ldr	ip, [r7]
	ldr	r1, [r1, r4, lsl #3]
	cmp	r1, ip
	blt	.L15
	ldr	ip, [r8]
	cmp	r1, ip
	bgt	.L15
	mov	r0, r10
	bl	ar9300_invalid_stbc_cfg
	ldr	ip, [fp]
	add	r1, r4, r4, lsl #3
	cmp	r0, ip
	movne	ip, #1
	ldrne	r0, [r6]
	ldrne	r3, [sp]
	ldrne	r0, [r0, r4, lsl #2]
	addne	r1, r3, r1, lsl #2
	strne	ip, [r1, #20]
	ldrne	r0, [r0, r9]
	ldrne	r1, [r1, #24]
	strne	r0, [r1, r9]
	ldr	r0, [r5]
.L15:
	add	r4, r4, #1
	cmp	r0, r4
	bgt	.L17
.L19:
	ldr	r0, [r6, #4]
	bl	ar9300_get_ntxchains
	add	r10, r10, #1
	cmp	r0, r10
	bgt	.L33
.L1:
	ldr	r0, [sp, #4]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L30:
	cmp	r1, #135
	movle	r1, #1
	movgt	r1, #0
	str	r1, [r3, #8]
	ble	.L8
	b	.L9
.L5:
	cmp	r1, #143
	movle	r1, #1
	movgt	r1, #0
	str	r1, [r3, #12]
	ble	.L8
	b	.L9
.L29:
	mov	r0, r4
	ldr	r1, .L34+12
	str	r8, [sp, #4]
	bl	ath_hal_printf
	ldr	r0, [sp, #4]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L35:
	.align	2
.L34:
	.word	AR9300_MCS0_RATE_CODE
	.word	AR9300_MCS23_RATE_CODE
	.word	AH_TRUE
	.word	.LC0
	.size	ar9300_get_tpc_tables, .-ar9300_get_tpc_tables
	.comm	AR9300_MCS23_RATE_CODE,4,4
	.comm	AR9300_MCS0_RATE_CODE,4,4
	.comm	AH_TRUE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
