	.file	"extr_ar5008_phy.c_ar5008_hw_init_chain_masks.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ar5008_hw_init_chain_masks, @function
ar5008_hw_init_chain_masks:
.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	r12d, DWORD PTR [rdi]
	mov	ebx, DWORD PTR 4[rdi]
	cmp	r12d, 5
	je	.L2
	jg	.L3
	cmp	r12d, 2
	jle	.L19
	cmp	r12d, 3
	jne	.L6
	mov	eax, DWORD PTR AR_SREV_REVISION_5416_10[rip]
	cmp	DWORD PTR 8[rbp], eax
	je	.L20
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rdi, rbp
	call	ENABLE_REGWRITE_BUFFER@PLT
	mov	esi, DWORD PTR AR_PHY_RX_CHAINMASK[rip]
	mov	edx, r12d
	mov	rdi, rbp
	call	REG_WRITE@PLT
	mov	esi, DWORD PTR AR_PHY_CAL_CHAINMASK[rip]
	mov	edx, r12d
	mov	rdi, rbp
	call	REG_WRITE@PLT
.L8:
	mov	esi, DWORD PTR AR_SELFGEN_MASK[rip]
	mov	rdi, rbp
	mov	edx, ebx
	call	REG_WRITE@PLT
	mov	rdi, rbp
	call	REGWRITE_BUFFER_FLUSH@PLT
	cmp	ebx, 5
	je	.L21
.L9:
	mov	rdi, rbp
	call	AR_SREV_9100@PLT
	test	rax, rax
	jne	.L22
	pop	rbx
	.cfi_remember_state
	.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
.L19:
	.cfi_restore_state
	test	r12d, r12d
	jg	.L5
.L6:
	mov	rdi, rbp
	call	ENABLE_REGWRITE_BUFFER@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L3:
	cmp	r12d, 7
	je	.L5
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L22:
	mov	esi, DWORD PTR AR_PHY_ANALOG_SWAP[rip]
	mov	rdi, rbp
	call	REG_READ@PLT
	mov	esi, DWORD PTR AR_PHY_ANALOG_SWAP[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rdi, rbp
	or	eax, 1
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	mov	edx, eax
	jmp	REG_WRITE@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	edx, DWORD PTR AR_PHY_SWAP_ALT_CHAIN[rip]
	mov	esi, DWORD PTR AR_PHY_ANALOG_SWAP[rip]
	call	REG_SET_BIT@PLT
	mov	eax, DWORD PTR AR_SREV_REVISION_5416_10[rip]
	cmp	DWORD PTR 8[rbp], eax
	jne	.L5
.L20:
	mov	esi, DWORD PTR AR_PHY_RX_CHAINMASK[rip]
	mov	rdi, rbp
	mov	edx, 7
	call	REG_WRITE@PLT
	mov	esi, DWORD PTR AR_PHY_CAL_CHAINMASK[rip]
	mov	edx, 7
	mov	rdi, rbp
	call	REG_WRITE@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L21:
	mov	edx, DWORD PTR AR_PHY_SWAP_ALT_CHAIN[rip]
	mov	esi, DWORD PTR AR_PHY_ANALOG_SWAP[rip]
	mov	rdi, rbp
	call	REG_SET_BIT@PLT
	jmp	.L9
	.cfi_endproc
.LFE0:
	.size	ar5008_hw_init_chain_masks, .-ar5008_hw_init_chain_masks
	.comm	AR_SREV_REVISION_5416_10,4,4
	.comm	AR_SELFGEN_MASK,4,4
	.comm	AR_PHY_SWAP_ALT_CHAIN,4,4
	.comm	AR_PHY_RX_CHAINMASK,4,4
	.comm	AR_PHY_CAL_CHAINMASK,4,4
	.comm	AR_PHY_ANALOG_SWAP,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_ar5008_phy.c_ar5008_hw_init_chain_masks.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ar5008_hw_init_chain_masks, %function
ar5008_hw_init_chain_masks:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldm	r0, {r5, r6}
	sub	r3, r5, #1
	mov	r4, r0
	cmp	r3, #6
	ldrls	pc, [pc, r3, asl #2]
	b	.L2
.L4:
	.word	.L3
	.word	.L3
	.word	.L6
	.word	.L2
	.word	.L5
	.word	.L2
	.word	.L3
.L5:
	ldr	r2, .L14
	ldr	r3, .L14+4
	ldr	r2, [r2]
	ldr	r1, [r3]
	bl	REG_SET_BIT
.L6:
	ldr	r3, .L14+8
	ldr	r2, [r4, #8]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L12
.L3:
	mov	r0, r4
	bl	ENABLE_REGWRITE_BUFFER
	ldr	r3, .L14+12
	mov	r2, r5
	ldr	r1, [r3]
	mov	r0, r4
	bl	REG_WRITE
	ldr	r3, .L14+16
	mov	r2, r5
	mov	r0, r4
	ldr	r1, [r3]
	bl	REG_WRITE
.L7:
	ldr	r3, .L14+20
	mov	r2, r6
	ldr	r1, [r3]
	mov	r0, r4
	bl	REG_WRITE
	mov	r0, r4
	bl	REGWRITE_BUFFER_FLUSH
	cmp	r6, #5
	beq	.L13
.L8:
	mov	r0, r4
	bl	AR_SREV_9100
	cmp	r0, #0
	popeq	{r4, r5, r6, pc}
	ldr	r3, .L14+4
	mov	r0, r4
	ldr	r5, [r3]
	mov	r1, r5
	bl	REG_READ
	mov	r1, r5
	orr	r2, r0, #1
	mov	r0, r4
	pop	{r4, r5, r6, lr}
	b	REG_WRITE
.L2:
	bl	ENABLE_REGWRITE_BUFFER
	b	.L7
.L13:
	ldr	r3, .L14+4
	ldr	r2, .L14
	mov	r0, r4
	ldr	r2, [r2]
	ldr	r1, [r3]
	bl	REG_SET_BIT
	b	.L8
.L12:
	ldr	r3, .L14+12
	mov	r2, #7
	ldr	r1, [r3]
	mov	r0, r4
	bl	REG_WRITE
	ldr	r3, .L14+16
	mov	r2, #7
	mov	r0, r4
	ldr	r1, [r3]
	bl	REG_WRITE
	b	.L7
.L15:
	.align	2
.L14:
	.word	AR_PHY_SWAP_ALT_CHAIN
	.word	AR_PHY_ANALOG_SWAP
	.word	AR_SREV_REVISION_5416_10
	.word	AR_PHY_RX_CHAINMASK
	.word	AR_PHY_CAL_CHAINMASK
	.word	AR_SELFGEN_MASK
	.size	ar5008_hw_init_chain_masks, .-ar5008_hw_init_chain_masks
	.comm	AR_SREV_REVISION_5416_10,4,4
	.comm	AR_SELFGEN_MASK,4,4
	.comm	AR_PHY_SWAP_ALT_CHAIN,4,4
	.comm	AR_PHY_RX_CHAINMASK,4,4
	.comm	AR_PHY_CAL_CHAINMASK,4,4
	.comm	AR_PHY_ANALOG_SWAP,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
