	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_b43legacy_phy_set_antenna_diversity ## -- Begin function b43legacy_phy_set_antenna_diversity
	.p2align	4, 0x90
_b43legacy_phy_set_antenna_diversity:   ## @b43legacy_phy_set_antenna_diversity
	.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
	movq	%rdi, %r14
	movl	8(%rdi), %eax
	cmpl	$65535, %eax                    ## imm = 0xFFFF
	movl	$3, %r15d
	cmovnel	%eax, %r15d
	xorl	%edi, %edi
	cmpl	$4, %r15d
	setge	%dil
	callq	_B43legacy_WARN_ON
	movq	_B43legacy_SHM_SHARED@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_B43legacy_UCODEFLAGS_OFFSET@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	%r14, %rdi
	callq	_b43legacy_shm_read32
	movl	(%r12), %esi
	movl	(%r13), %edx
	movq	_B43legacy_UCODEFLAG_AUTODIV@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	notl	%ecx
	andl	%eax, %ecx
	movq	%r14, %rdi
	callq	_b43legacy_shm_write32
	movl	12(%r14), %eax
	cmpl	$129, %eax
	je	LBB0_5
## %bb.1:
	cmpl	$128, %eax
	jne	LBB0_6
## %bb.2:
	movl	%r15d, %eax
	shll	$7, %eax
	cmpl	$2, %r15d
	movl	$384, %ebx                      ## imm = 0x180
	cmovnel	%eax, %ebx
	movq	%r14, %rdi
	movl	$1025, %esi                     ## imm = 0x401
	callq	_b43legacy_phy_read
	andl	$32383, %eax                    ## imm = 0x7E7F
	orl	%eax, %ebx
	movq	%r14, %rdi
	movl	$1025, %esi                     ## imm = 0x401
	movl	%ebx, %edx
	callq	_b43legacy_phy_write
	cmpl	$2, %r15d
	jl	LBB0_7
## %bb.3:
	sete	%al
	movzbl	%al, %ebx
	shll	$8, %ebx
	movq	%r14, %rdi
	movl	$1067, %esi                     ## imm = 0x42B
	callq	_b43legacy_phy_read
	andl	$65279, %eax                    ## imm = 0xFEFF
	orl	%eax, %ebx
	movq	%r14, %rdi
	movl	$1067, %esi                     ## imm = 0x42B
	movl	%ebx, %edx
	callq	_b43legacy_phy_write
	cmpl	$128, 12(%r14)
	movq	_B43legacy_UCODEFLAG_AUTODIV@GOTPCREL(%rip), %rbx
	jne	LBB0_12
## %bb.4:
	movq	%r14, %rdi
	movl	$1164, %esi                     ## imm = 0x48C
	callq	_b43legacy_phy_read
	orl	$8192, %eax                     ## imm = 0x2000
	jmp	LBB0_9
LBB0_5:
	movq	(%r14), %rax
	movl	%r15d, %ecx
	shll	$7, %ecx
	cmpl	$2, (%rax)
	movq	%r12, %r13
	movq	%rbx, %r12
	movl	$384, %ebx                      ## imm = 0x180
	cmovnel	%ecx, %ebx
	movq	%r14, %rdi
	movl	$994, %esi                      ## imm = 0x3E2
	callq	_b43legacy_phy_read
	andl	$65151, %eax                    ## imm = 0xFE7F
	orl	%eax, %ebx
	movq	%r14, %rdi
	movl	$994, %esi                      ## imm = 0x3E2
	movl	%ebx, %edx
	movq	%r12, %rbx
	movq	%r13, %r12
	movq	_B43legacy_UCODEFLAGS_OFFSET@GOTPCREL(%rip), %r13
	jmp	LBB0_17
LBB0_6:
	movl	$1, %edi
	callq	_B43legacy_WARN_ON
	cmpl	$2, %r15d
	jge	LBB0_20
	jmp	LBB0_21
LBB0_7:
	cmpl	$128, 12(%r14)
	movq	_B43legacy_UCODEFLAG_AUTODIV@GOTPCREL(%rip), %rbx
	jne	LBB0_12
## %bb.8:
	movq	%r14, %rdi
	movl	$1164, %esi                     ## imm = 0x48C
	callq	_b43legacy_phy_read
	andl	$-8193, %eax                    ## imm = 0xDFFF
LBB0_9:
	movq	%r14, %rdi
	movl	$1164, %esi                     ## imm = 0x48C
	movl	%eax, %edx
	callq	_b43legacy_phy_write
	cmpl	$2, 16(%r14)
	jl	LBB0_19
## %bb.10:
	movq	%r14, %rdi
	movl	$1121, %esi                     ## imm = 0x461
	callq	_b43legacy_phy_read
	orl	$16, %eax
	movq	%r14, %rdi
	movl	$1121, %esi                     ## imm = 0x461
	movl	%eax, %edx
	callq	_b43legacy_phy_write
	movq	%r14, %rdi
	movl	$1197, %esi                     ## imm = 0x4AD
	callq	_b43legacy_phy_read
	orl	$21, %eax
	movzbl	%al, %edx
	movq	%r14, %rdi
	movl	$1197, %esi                     ## imm = 0x4AD
	callq	_b43legacy_phy_write
	cmpl	$2, 16(%r14)
	jne	LBB0_18
## %bb.11:
	movq	%r14, %rdi
	movl	$1063, %esi                     ## imm = 0x427
	jmp	LBB0_16
LBB0_12:
	cmpl	$2, 16(%r14)
	jg	LBB0_14
## %bb.13:
	movq	%r14, %rdi
	movl	$43, %esi
	callq	_b43legacy_phy_read
	orl	$36, %eax
	movzbl	%al, %edx
	movq	%r14, %rdi
	movl	$43, %esi
	jmp	LBB0_17
LBB0_14:
	movq	%r14, %rdi
	movl	$97, %esi
	callq	_b43legacy_phy_read
	orl	$16, %eax
	movq	%r14, %rdi
	movl	$97, %esi
	movl	%eax, %edx
	callq	_b43legacy_phy_write
	cmpl	$3, 16(%r14)
	jne	LBB0_22
## %bb.15:
	movq	%r14, %rdi
	movl	$147, %esi
	movl	$29, %edx
	callq	_b43legacy_phy_write
	movq	%r14, %rdi
	movl	$39, %esi
LBB0_16:
	movl	$8, %edx
	jmp	LBB0_17
LBB0_18:
	movq	%r14, %rdi
	movl	$1063, %esi                     ## imm = 0x427
	callq	_b43legacy_phy_read
	orl	$8, %eax
	movzbl	%al, %edx
	movq	%r14, %rdi
	movl	$1063, %esi                     ## imm = 0x427
	callq	_b43legacy_phy_write
LBB0_19:
	cmpl	$2, %r15d
	jl	LBB0_21
LBB0_20:
	movl	(%r12), %esi
	movl	(%r13), %edx
	movq	%r14, %rdi
	callq	_b43legacy_shm_read32
	movl	(%r12), %esi
	movl	(%r13), %edx
	orl	(%rbx), %eax
	movq	%r14, %rdi
	movl	%eax, %ecx
	callq	_b43legacy_shm_write32
LBB0_21:
	movl	%r15d, 8(%r14)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	movq	%r14, %rdi
	movl	$147, %esi
	movl	$58, %edx
	callq	_b43legacy_phy_write
	movq	%r14, %rdi
	movl	$39, %esi
	callq	_b43legacy_phy_read
	orl	$8, %eax
	movzbl	%al, %edx
	movq	%r14, %rdi
	movl	$39, %esi
LBB0_17:
	callq	_b43legacy_phy_write
	cmpl	$2, %r15d
	jge	LBB0_20
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_B43legacy_SHM_SHARED,4,2       ## @B43legacy_SHM_SHARED
	.comm	_B43legacy_UCODEFLAGS_OFFSET,4,2 ## @B43legacy_UCODEFLAGS_OFFSET
	.comm	_B43legacy_UCODEFLAG_AUTODIV,4,2 ## @B43legacy_UCODEFLAG_AUTODIV
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_b43legacy_phy_set_antenna_diversity ; -- Begin function b43legacy_phy_set_antenna_diversity
	.p2align	2
_b43legacy_phy_set_antenna_diversity:   ; @b43legacy_phy_set_antenna_diversity
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	w8, [x0, #8]
	mov	w9, #65535
	mov	w10, #3
	cmp	w8, w9
	csel	w20, w10, w8, eq
	cmp	w20, #3
	cset	w0, gt
	bl	_B43legacy_WARN_ON
Lloh0:
	adrp	x21, _B43legacy_SHM_SHARED@GOTPAGE
Lloh1:
	ldr	x21, [x21, _B43legacy_SHM_SHARED@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh2:
	adrp	x22, _B43legacy_UCODEFLAGS_OFFSET@GOTPAGE
Lloh3:
	ldr	x22, [x22, _B43legacy_UCODEFLAGS_OFFSET@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x19
	bl	_b43legacy_shm_read32
	ldr	w1, [x21]
	ldr	w2, [x22]
Lloh4:
	adrp	x23, _B43legacy_UCODEFLAG_AUTODIV@GOTPAGE
Lloh5:
	ldr	x23, [x23, _B43legacy_UCODEFLAG_AUTODIV@GOTPAGEOFF]
	ldr	w8, [x23]
	bic	w3, w0, w8
	mov	x0, x19
	bl	_b43legacy_shm_write32
	ldr	w8, [x19, #12]
	cmp	w8, #129
	b.eq	LBB0_5
; %bb.1:
	cmp	w8, #128
	b.ne	LBB0_6
; %bb.2:
	lsl	w8, w20, #7
	mov	w9, #384
	cmp	w20, #2
	csel	w24, w9, w8, eq
	mov	x0, x19
	mov	w1, #1025
	bl	_b43legacy_phy_read
	mov	w8, #32383
	and	w8, w0, w8
	orr	w2, w8, w24
	mov	x0, x19
	mov	w1, #1025
	bl	_b43legacy_phy_write
	cmp	w20, #2
	b.lt	LBB0_7
; %bb.3:
	cset	w24, eq
	mov	x0, x19
	mov	w1, #1067
	bl	_b43legacy_phy_read
	mov	w8, #65279
	and	w2, w0, w8
	bfi	w2, w24, #8, #1
	mov	x0, x19
	mov	w1, #1067
	bl	_b43legacy_phy_write
	ldr	w8, [x19, #12]
	cmp	w8, #128
	b.ne	LBB0_12
; %bb.4:
	mov	x0, x19
	mov	w1, #1164
	bl	_b43legacy_phy_read
	orr	w2, w0, #0x2000
	b	LBB0_9
LBB0_5:
	ldr	x8, [x19]
	ldr	w8, [x8]
	lsl	w9, w20, #7
	mov	w10, #384
	cmp	w8, #2
	csel	w24, w10, w9, eq
	mov	x0, x19
	mov	w1, #994
	bl	_b43legacy_phy_read
	mov	w8, #65151
	and	w8, w0, w8
	orr	w2, w8, w24
	mov	x0, x19
	mov	w1, #994
	b	LBB0_21
LBB0_6:
	mov	w0, #1
	bl	_B43legacy_WARN_ON
	cmp	w20, #2
	b.ge	LBB0_18
	b	LBB0_19
LBB0_7:
	ldr	w8, [x19, #12]
	cmp	w8, #128
	b.ne	LBB0_12
; %bb.8:
	mov	x0, x19
	mov	w1, #1164
	bl	_b43legacy_phy_read
	and	w2, w0, #0xffffdfff
LBB0_9:
	mov	x0, x19
	mov	w1, #1164
	bl	_b43legacy_phy_write
	ldr	w8, [x19, #16]
	cmp	w8, #2
	b.lt	LBB0_17
; %bb.10:
	mov	x0, x19
	mov	w1, #1121
	bl	_b43legacy_phy_read
	orr	w2, w0, #0x10
	mov	x0, x19
	mov	w1, #1121
	bl	_b43legacy_phy_write
	mov	x0, x19
	mov	w1, #1197
	bl	_b43legacy_phy_read
	and	w8, w0, #0xfe
	mov	w9, #21
	orr	w2, w8, w9
	mov	x0, x19
	mov	w1, #1197
	bl	_b43legacy_phy_write
	ldr	w8, [x19, #16]
	mov	x0, x19
	mov	w1, #1063
	cmp	w8, #2
	b.eq	LBB0_16
; %bb.11:
	bl	_b43legacy_phy_read
	and	w8, w0, #0xff
	orr	w2, w8, #0x8
	mov	x0, x19
	mov	w1, #1063
	b	LBB0_21
LBB0_12:
	ldr	w8, [x19, #16]
	mov	x0, x19
	cmp	w8, #2
	b.gt	LBB0_14
; %bb.13:
	mov	w1, #43
	bl	_b43legacy_phy_read
	and	w8, w0, #0xff
	mov	w9, #36
	orr	w2, w8, w9
	mov	x0, x19
	mov	w1, #43
	b	LBB0_21
LBB0_14:
	mov	w1, #97
	bl	_b43legacy_phy_read
	orr	w2, w0, #0x10
	mov	x0, x19
	mov	w1, #97
	bl	_b43legacy_phy_write
	ldr	w8, [x19, #16]
	mov	x0, x19
	mov	w1, #147
	cmp	w8, #3
	b.ne	LBB0_20
; %bb.15:
	mov	w2, #29
	bl	_b43legacy_phy_write
	mov	x0, x19
	mov	w1, #39
LBB0_16:
	mov	w2, #8
	bl	_b43legacy_phy_write
LBB0_17:
	cmp	w20, #2
	b.lt	LBB0_19
LBB0_18:
	ldr	w1, [x21]
	ldr	w2, [x22]
	mov	x0, x19
	bl	_b43legacy_shm_read32
	ldr	w1, [x21]
	ldr	w2, [x22]
	ldr	w8, [x23]
	orr	w3, w8, w0
	mov	x0, x19
	bl	_b43legacy_shm_write32
LBB0_19:
	str	w20, [x19, #8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_20:
	mov	w2, #58
	bl	_b43legacy_phy_write
	mov	x0, x19
	mov	w1, #39
	bl	_b43legacy_phy_read
	and	w8, w0, #0xff
	orr	w2, w8, #0x8
	mov	x0, x19
	mov	w1, #39
LBB0_21:
	bl	_b43legacy_phy_write
	cmp	w20, #2
	b.ge	LBB0_18
	b	LBB0_19
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_B43legacy_SHM_SHARED,4,2       ; @B43legacy_SHM_SHARED
	.comm	_B43legacy_UCODEFLAGS_OFFSET,4,2 ; @B43legacy_UCODEFLAGS_OFFSET
	.comm	_B43legacy_UCODEFLAG_AUTODIV,4,2 ; @B43legacy_UCODEFLAG_AUTODIV
.subsections_via_symbols
