	.file	"extr_phy.c_b43legacy_phy_set_antenna_diversity.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	b43legacy_phy_set_antenna_diversity
	.type	b43legacy_phy_set_antenna_diversity, @function
b43legacy_phy_set_antenna_diversity:
.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
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	ebp, DWORD PTR 8[rdi]
	mov	rbx, rdi
	cmp	ebp, 65535
	je	.L2
	xor	edi, edi
	cmp	ebp, 3
	setg	dil
	call	B43legacy_WARN_ON@PLT
	mov	edx, DWORD PTR B43legacy_UCODEFLAGS_OFFSET[rip]
	mov	esi, DWORD PTR B43legacy_SHM_SHARED[rip]
	mov	rdi, rbx
	call	b43legacy_shm_read32@PLT
	mov	ecx, DWORD PTR B43legacy_UCODEFLAG_AUTODIV[rip]
	mov	edx, DWORD PTR B43legacy_UCODEFLAGS_OFFSET[rip]
	mov	rdi, rbx
	mov	esi, DWORD PTR B43legacy_SHM_SHARED[rip]
	not	ecx
	and	ecx, eax
	call	b43legacy_shm_write32@PLT
	mov	eax, DWORD PTR 12[rbx]
	cmp	eax, 128
	je	.L3
.L21:
	cmp	eax, 129
	je	.L4
	mov	edi, 1
	call	B43legacy_WARN_ON@PLT
.L13:
	cmp	ebp, 1
	jg	.L17
.L10:
	mov	DWORD PTR 8[rbx], ebp
	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
.L3:
	.cfi_restore_state
	mov	esi, 1025
	mov	rdi, rbx
	cmp	ebp, 2
	jne	.L30
	call	b43legacy_phy_read@PLT
	mov	esi, 1025
	mov	rdi, rbx
	mov	r12d, 256
	and	eax, 32383
	mov	edx, eax
	or	edx, 384
	call	b43legacy_phy_write@PLT
.L20:
	mov	esi, 1067
	mov	rdi, rbx
	call	b43legacy_phy_read@PLT
	mov	esi, 1067
	mov	rdi, rbx
	and	eax, 65279
	mov	edx, eax
	or	edx, r12d
	call	b43legacy_phy_write@PLT
	cmp	DWORD PTR 12[rbx], 128
	je	.L31
.L8:
	cmp	DWORD PTR 16[rbx], 2
	jg	.L14
	mov	esi, 43
	mov	rdi, rbx
	call	b43legacy_phy_read@PLT
	mov	esi, 43
	mov	rdi, rbx
	movzx	edx, al
	or	edx, 36
	call	b43legacy_phy_write@PLT
	cmp	ebp, 1
	jle	.L10
.L17:
	mov	edx, DWORD PTR B43legacy_UCODEFLAGS_OFFSET[rip]
	mov	esi, DWORD PTR B43legacy_SHM_SHARED[rip]
	mov	rdi, rbx
	call	b43legacy_shm_read32@PLT
	mov	edx, DWORD PTR B43legacy_UCODEFLAGS_OFFSET[rip]
	or	eax, DWORD PTR B43legacy_UCODEFLAG_AUTODIV[rip]
	mov	rdi, rbx
	mov	esi, DWORD PTR B43legacy_SHM_SHARED[rip]
	mov	ecx, eax
	call	b43legacy_shm_write32@PLT
	mov	DWORD PTR 8[rbx], ebp
	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
.L2:
	.cfi_restore_state
	xor	edi, edi
	mov	ebp, 3
	call	B43legacy_WARN_ON@PLT
	mov	edx, DWORD PTR B43legacy_UCODEFLAGS_OFFSET[rip]
	mov	esi, DWORD PTR B43legacy_SHM_SHARED[rip]
	mov	rdi, rbx
	call	b43legacy_shm_read32@PLT
	mov	ecx, DWORD PTR B43legacy_UCODEFLAG_AUTODIV[rip]
	mov	edx, DWORD PTR B43legacy_UCODEFLAGS_OFFSET[rip]
	mov	rdi, rbx
	mov	esi, DWORD PTR B43legacy_SHM_SHARED[rip]
	not	ecx
	and	ecx, eax
	call	b43legacy_shm_write32@PLT
	mov	eax, DWORD PTR 12[rbx]
	cmp	eax, 128
	jne	.L21
	mov	esi, 1025
	mov	rdi, rbx
	call	b43legacy_phy_read@PLT
	mov	esi, 1025
	mov	rdi, rbx
	and	eax, 32383
	mov	edx, eax
	or	edx, 384
	call	b43legacy_phy_write@PLT
.L22:
	xor	r12d, r12d
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L4:
	mov	rax, QWORD PTR [rbx]
	mov	edx, ebp
	mov	rdi, rbx
	mov	esi, 994
	sal	edx, 7
	mov	r12d, 384
	cmp	DWORD PTR [rax], 2
	cmovne	r12d, edx
	call	b43legacy_phy_read@PLT
	mov	esi, 994
	mov	rdi, rbx
	and	eax, 65151
	mov	edx, eax
	or	edx, r12d
	call	b43legacy_phy_write@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L30:
	call	b43legacy_phy_read@PLT
	mov	edx, ebp
	mov	esi, 1025
	mov	rdi, rbx
	sal	edx, 7
	and	eax, 32383
	or	edx, eax
	call	b43legacy_phy_write@PLT
	cmp	ebp, 1
	jg	.L22
	cmp	DWORD PTR 12[rbx], 128
	jne	.L8
	mov	esi, 1164
	mov	rdi, rbx
	call	b43legacy_phy_read@PLT
	mov	esi, 1164
	mov	rdi, rbx
	and	ah, -33
	mov	edx, eax
	call	b43legacy_phy_write@PLT
	cmp	DWORD PTR 16[rbx], 1
	jle	.L10
.L9:
	mov	esi, 1121
	mov	rdi, rbx
	call	b43legacy_phy_read@PLT
	mov	esi, 1121
	mov	rdi, rbx
	or	eax, 16
	mov	edx, eax
	call	b43legacy_phy_write@PLT
	mov	esi, 1197
	mov	rdi, rbx
	call	b43legacy_phy_read@PLT
	mov	esi, 1197
	mov	rdi, rbx
	movzx	edx, al
	or	edx, 21
	call	b43legacy_phy_write@PLT
	cmp	DWORD PTR 16[rbx], 2
	je	.L32
	mov	rdi, rbx
	mov	esi, 1063
	call	b43legacy_phy_read@PLT
	mov	esi, 1063
	mov	rdi, rbx
	movzx	edx, al
	or	edx, 8
	call	b43legacy_phy_write@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L14:
	mov	esi, 97
	mov	rdi, rbx
	call	b43legacy_phy_read@PLT
	mov	esi, 97
	mov	rdi, rbx
	or	eax, 16
	mov	edx, eax
	call	b43legacy_phy_write@PLT
	cmp	DWORD PTR 16[rbx], 3
	je	.L33
	mov	edx, 58
	mov	rdi, rbx
	mov	esi, 147
	call	b43legacy_phy_write@PLT
	mov	rdi, rbx
	mov	esi, 39
	call	b43legacy_phy_read@PLT
	mov	esi, 39
	mov	rdi, rbx
	movzx	edx, al
	or	edx, 8
	call	b43legacy_phy_write@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L31:
	mov	esi, 1164
	mov	rdi, rbx
	call	b43legacy_phy_read@PLT
	mov	esi, 1164
	mov	rdi, rbx
	or	ah, 32
	mov	edx, eax
	call	b43legacy_phy_write@PLT
	cmp	DWORD PTR 16[rbx], 1
	jle	.L17
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L33:
	mov	rdi, rbx
	mov	edx, 29
	mov	esi, 147
	call	b43legacy_phy_write@PLT
	mov	edx, 8
	mov	esi, 39
	mov	rdi, rbx
	call	b43legacy_phy_write@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L32:
	mov	edx, 8
	mov	esi, 1063
	mov	rdi, rbx
	call	b43legacy_phy_write@PLT
	jmp	.L13
	.cfi_endproc
.LFE0:
	.size	b43legacy_phy_set_antenna_diversity, .-b43legacy_phy_set_antenna_diversity
	.comm	B43legacy_UCODEFLAG_AUTODIV,4,4
	.comm	B43legacy_UCODEFLAGS_OFFSET,4,4
	.comm	B43legacy_SHM_SHARED,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_phy.c_b43legacy_phy_set_antenna_diversity.c"
	.text
	.align	2
	.global	b43legacy_phy_set_antenna_diversity
	.syntax unified
	.arm
	.fpu softvfp
	.type	b43legacy_phy_set_antenna_diversity, %function
b43legacy_phy_set_antenna_diversity:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r3, .L35
	ldr	r5, [r0, #4]
	mov	r4, r0
	cmp	r5, r3
	ldr	r6, .L35+4
	ldr	r7, .L35+8
	beq	.L2
	cmp	r5, #3
	movle	r0, #0
	movgt	r0, #1
	bl	B43legacy_WARN_ON
	ldr	r2, [r6]
	ldr	r1, [r7]
	mov	r0, r4
	bl	b43legacy_shm_read32
	ldr	r8, .L35+12
	ldr	r2, [r6]
	ldr	r3, [r8]
	ldr	r1, [r7]
	bic	r3, r0, r3
	mov	r0, r4
	bl	b43legacy_shm_write32
	ldr	r3, [r4, #8]
	cmp	r3, #128
	beq	.L30
.L21:
	cmp	r3, #129
	beq	.L4
	mov	r0, #1
	bl	B43legacy_WARN_ON
.L13:
	cmp	r5, #1
	bgt	.L17
.L10:
	str	r5, [r4, #4]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L30:
	cmp	r5, #2
	mov	r0, r4
	ldr	r1, .L35+16
	bne	.L31
	bl	b43legacy_phy_read
	ldr	r2, .L35+20
	ldr	r1, .L35+16
	and	r2, r2, r0
	orr	r2, r2, #384
	mov	r0, r4
	bl	b43legacy_phy_write
	mov	r9, #256
.L20:
	ldr	r1, .L35+24
	mov	r0, r4
	bl	b43legacy_phy_read
	ldr	r2, .L35+28
	ldr	r1, .L35+24
	and	r2, r2, r0
	orr	r2, r2, r9
	mov	r0, r4
	bl	b43legacy_phy_write
	ldr	r3, [r4, #8]
	cmp	r3, #128
	beq	.L32
.L8:
	ldr	r3, [r4, #12]
	cmp	r3, #2
	bgt	.L14
	mov	r1, #43
	mov	r0, r4
	bl	b43legacy_phy_read
	and	r2, r0, #255
	mov	r1, #43
	mov	r0, r4
	orr	r2, r2, #36
	bl	b43legacy_phy_write
	cmp	r5, #1
	ble	.L10
.L17:
	ldr	r2, [r6]
	ldr	r1, [r7]
	mov	r0, r4
	bl	b43legacy_shm_read32
	ldr	r3, [r8]
	ldr	r2, [r6]
	orr	r3, r0, r3
	ldr	r1, [r7]
	mov	r0, r4
	bl	b43legacy_shm_write32
	str	r5, [r4, #4]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L2:
	mov	r0, #0
	bl	B43legacy_WARN_ON
	ldr	r2, [r6]
	ldr	r1, [r7]
	mov	r0, r4
	bl	b43legacy_shm_read32
	ldr	r8, .L35+12
	ldr	r2, [r6]
	ldr	r3, [r8]
	ldr	r1, [r7]
	bic	r3, r0, r3
	mov	r0, r4
	bl	b43legacy_shm_write32
	ldr	r3, [r4, #8]
	cmp	r3, #128
	movne	r5, #3
	bne	.L21
	ldr	r1, .L35+16
	mov	r0, r4
	bl	b43legacy_phy_read
	ldr	r2, .L35+20
	ldr	r1, .L35+16
	and	r2, r2, r0
	orr	r2, r2, #384
	mov	r0, r4
	bl	b43legacy_phy_write
	mov	r5, #3
.L22:
	mov	r9, #0
	b	.L20
.L4:
	ldr	r3, [r4]
	mov	r0, r4
	ldr	r3, [r3]
	ldr	r1, .L35+32
	cmp	r3, #2
	moveq	r9, #384
	lslne	r9, r5, #7
	bl	b43legacy_phy_read
	ldr	r2, .L35+36
	ldr	r1, .L35+32
	and	r2, r2, r0
	orr	r2, r2, r9
	mov	r0, r4
	bl	b43legacy_phy_write
	b	.L13
.L31:
	bl	b43legacy_phy_read
	ldr	r2, .L35+20
	ldr	r1, .L35+16
	and	r2, r2, r0
	orr	r2, r2, r5, lsl #7
	mov	r0, r4
	bl	b43legacy_phy_write
	cmp	r5, #1
	bgt	.L22
	ldr	r3, [r4, #8]
	cmp	r3, #128
	bne	.L8
	ldr	r1, .L35+40
	mov	r0, r4
	bl	b43legacy_phy_read
	ldr	r1, .L35+40
	bic	r2, r0, #8192
	mov	r0, r4
	bl	b43legacy_phy_write
	ldr	r3, [r4, #12]
	cmp	r3, #1
	ble	.L10
.L9:
	ldr	r1, .L35+44
	mov	r0, r4
	bl	b43legacy_phy_read
	ldr	r1, .L35+44
	orr	r2, r0, #16
	mov	r0, r4
	bl	b43legacy_phy_write
	ldr	r1, .L35+48
	mov	r0, r4
	bl	b43legacy_phy_read
	and	r2, r0, #255
	ldr	r1, .L35+48
	mov	r0, r4
	orr	r2, r2, #21
	bl	b43legacy_phy_write
	ldr	r3, [r4, #12]
	cmp	r3, #2
	beq	.L33
	mov	r0, r4
	ldr	r1, .L35+52
	bl	b43legacy_phy_read
	and	r2, r0, #255
	ldr	r1, .L35+52
	mov	r0, r4
	orr	r2, r2, #8
	bl	b43legacy_phy_write
	b	.L13
.L14:
	mov	r1, #97
	mov	r0, r4
	bl	b43legacy_phy_read
	mov	r1, #97
	orr	r2, r0, #16
	mov	r0, r4
	bl	b43legacy_phy_write
	ldr	r3, [r4, #12]
	cmp	r3, #3
	beq	.L34
	mov	r2, #58
	mov	r1, #147
	mov	r0, r4
	bl	b43legacy_phy_write
	mov	r1, #39
	mov	r0, r4
	bl	b43legacy_phy_read
	and	r2, r0, #255
	mov	r1, #39
	mov	r0, r4
	orr	r2, r2, #8
	bl	b43legacy_phy_write
	b	.L13
.L32:
	ldr	r1, .L35+40
	mov	r0, r4
	bl	b43legacy_phy_read
	ldr	r1, .L35+40
	orr	r2, r0, #8192
	mov	r0, r4
	bl	b43legacy_phy_write
	ldr	r3, [r4, #12]
	cmp	r3, #1
	ble	.L17
	b	.L9
.L34:
	mov	r2, #29
	mov	r1, #147
	mov	r0, r4
	bl	b43legacy_phy_write
	mov	r2, #8
	mov	r1, #39
	mov	r0, r4
	bl	b43legacy_phy_write
	b	.L13
.L33:
	mov	r2, #8
	mov	r0, r4
	ldr	r1, .L35+52
	bl	b43legacy_phy_write
	b	.L13
.L36:
	.align	2
.L35:
	.word	65535
	.word	B43legacy_UCODEFLAGS_OFFSET
	.word	B43legacy_SHM_SHARED
	.word	B43legacy_UCODEFLAG_AUTODIV
	.word	1025
	.word	32383
	.word	1067
	.word	65279
	.word	994
	.word	65151
	.word	1164
	.word	1121
	.word	1197
	.word	1063
	.size	b43legacy_phy_set_antenna_diversity, .-b43legacy_phy_set_antenna_diversity
	.comm	B43legacy_UCODEFLAG_AUTODIV,4,4
	.comm	B43legacy_UCODEFLAGS_OFFSET,4,4
	.comm	B43legacy_SHM_SHARED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
