	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rt2800_sta_add                 ## -- Begin function rt2800_sta_add
	.p2align	4, 0x90
_rt2800_sta_add:                        ## @rt2800_sta_add
	.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	%rdx, %r12
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %r15
	movq	(%r15), %r14
	movq	%rdx, %rdi
	callq	_sta_to_rt2x00_sta
	movq	%rax, %r13
	cmpq	$0, 16(%r12)
	je	LBB0_2
## %bb.1:
	movq	16(%r14), %rax
	movl	8(%r12), %ecx
	andl	$3, %ecx
	incl	(%rax,%rcx,4)
	movq	%r15, %rdi
	callq	_rt2800_set_max_psdu_len
LBB0_2:
	movl	8(%r14), %edi
	movq	_STA_IDS_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_find_first_zero_bit
	movq	_WCID_START@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %rcx
	movslq	%eax, %rbx
	addq	%rcx, %rbx
	movl	%ebx, (%r13)
	movq	_WCID_END@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jg	LBB0_4
## %bb.3:
	movl	%ebx, %edi
	subl	(%rdx), %edi
	movl	8(%r14), %esi
	movq	%rdx, %r13
	callq	___set_bit
	movq	(%r14), %rax
	movslq	(%r13), %rcx
	movq	%rbx, %rdx
	subq	%rcx, %rdx
	movq	%r12, (%rax,%rdx,8)
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_rt2800_delete_wcid_attr
	movl	(%r12), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_rt2800_config_wcid
	movq	%r15, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_rt2x00lib_get_bssidx
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_rt2800_config_wcid_attr_bssidx
LBB0_4:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STA_IDS_SIZE,4,2               ## @STA_IDS_SIZE
	.comm	_WCID_START,4,2                 ## @WCID_START
	.comm	_WCID_END,4,2                   ## @WCID_END
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rt2800_sta_add                 ; -- Begin function rt2800_sta_add
	.p2align	2
_rt2800_sta_add:                        ; @rt2800_sta_add
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x2
	mov	x20, x1
	ldr	x19, [x0]
	ldr	x24, [x19]
	mov	x0, x2
	bl	_sta_to_rt2x00_sta
	mov	x23, x0
	ldr	x8, [x21, #16]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	x8, [x24, #16]
	ldr	w9, [x21, #8]
	and	x9, x9, #0x3
	lsl	x9, x9, #2
	ldr	w10, [x8, x9]
	add	w10, w10, #1
	str	w10, [x8, x9]
	mov	x0, x19
	bl	_rt2800_set_max_psdu_len
LBB0_2:
	ldr	w0, [x24, #8]
Lloh0:
	adrp	x8, _STA_IDS_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STA_IDS_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_find_first_zero_bit
Lloh3:
	adrp	x25, _WCID_START@GOTPAGE
Lloh4:
	ldr	x25, [x25, _WCID_START@GOTPAGEOFF]
	ldr	w8, [x25]
	add	w22, w8, w0
	str	w22, [x23]
Lloh5:
	adrp	x8, _WCID_END@GOTPAGE
Lloh6:
	ldr	x8, [x8, _WCID_END@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w22, w8
	b.gt	LBB0_4
; %bb.3:
	ldr	w8, [x25]
	sub	w0, w22, w8
	ldr	w1, [x24, #8]
	bl	___set_bit
	ldr	x8, [x24]
	ldr	w9, [x25]
	sub	w9, w22, w9
	str	x21, [x8, w9, sxtw #3]
	mov	x0, x19
	mov	x1, x22
	bl	_rt2800_delete_wcid_attr
	ldr	w1, [x21]
	mov	x0, x19
	mov	x2, x22
	bl	_rt2800_config_wcid
	mov	x0, x19
	mov	x1, x20
	bl	_rt2x00lib_get_bssidx
	mov	x2, x0
	mov	x0, x19
	mov	x1, x22
	bl	_rt2800_config_wcid_attr_bssidx
LBB0_4:
	mov	w0, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_STA_IDS_SIZE,4,2               ; @STA_IDS_SIZE
	.comm	_WCID_START,4,2                 ; @WCID_START
	.comm	_WCID_END,4,2                   ; @WCID_END
.subsections_via_symbols
