	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt73usb_config_pairwise_key
_rt73usb_config_pairwise_key:           ## @rt73usb_config_pairwise_key
	.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
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	(%rsi), %rax
	movq	_SET_KEY@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	jne	LBB0_7
## %bb.1:
	movq	_SEC_CSR2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rt2x00usb_register_read
	cmpl	$-1, %eax
	jne	LBB0_3
## %bb.2:
	movl	$32, (%r15)
	movq	_SEC_CSR3@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rt2x00usb_register_read
	cmpl	$-1, %eax
	je	LBB0_16
LBB0_3:
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %edi
	callq	_ffz
	jmp	LBB0_6
LBB0_5:
	xorl	%eax, %eax
LBB0_6:
	addl	%eax, (%r15)
	movl	28(%r13), %esi
	movl	$8, %edx
	callq	_memcpy
	movl	24(%r13), %esi
	movl	$8, %edx
	callq	_memcpy
	movl	20(%r13), %esi
	movl	$8, %edx
	callq	_memcpy
	movl	(%r15), %edi
	callq	_PAIRWISE_KEY_ENTRY
	leaq	-104(%rbp), %rdx
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	$32, %ecx
	callq	_rt2x00usb_register_multiwrite
	leaq	-72(%rbp), %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movl	16(%r13), %esi
	movq	_ETH_ALEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_memcpy
	movl	12(%r13), %eax
	movl	%eax, -72(%rbp)
	movl	(%r15), %edi
	callq	_PAIRWISE_TA_ENTRY
	movq	%r14, %rdi
	movl	%eax, %esi
	movq	%r12, %rdx
	movl	$32, %ecx
	callq	_rt2x00usb_register_multiwrite
	movq	_SEC_CSR4@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_rt2x00usb_register_read
	movb	8(%r13), %cl
	btsl	%ecx, %eax
	movl	(%rbx), %esi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_rt2x00usb_register_write
	movq	_IEEE80211_KEY_FLAG_GENERATE_IV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 4(%r15)
	movq	_SET_KEY@GOTPCREL(%rip), %rbx
LBB0_7:
	movl	(%r15), %ecx
	movl	$1, %r12d
	cmpl	$31, %ecx
	jg	LBB0_11
## %bb.8:
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r12d
	movq	_SEC_CSR2@GOTPCREL(%rip), %r15
	jmp	LBB0_9
LBB0_11:
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r12d
	movq	_SEC_CSR3@GOTPCREL(%rip), %r15
LBB0_9:
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_rt2x00usb_register_read
	movq	(%r13), %rcx
	cmpq	(%rbx), %rcx
	jne	LBB0_12
## %bb.10:
	orl	%r12d, %eax
	jmp	LBB0_14
LBB0_12:
	movq	_DISABLE_KEY@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_14
## %bb.13:
	notl	%r12d
	andl	%r12d, %eax
LBB0_14:
	movl	(%r15), %esi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_rt2x00usb_register_write
	xorl	%eax, %eax
LBB0_15:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	_ENOSPC@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_SET_KEY,8,3                    ## @SET_KEY
	.comm	_SEC_CSR2,4,2                   ## @SEC_CSR2
	.comm	_SEC_CSR3,4,2                   ## @SEC_CSR3
	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.comm	_ETH_ALEN,4,2                   ## @ETH_ALEN
	.comm	_SEC_CSR4,4,2                   ## @SEC_CSR4
	.comm	_IEEE80211_KEY_FLAG_GENERATE_IV,4,2 ## @IEEE80211_KEY_FLAG_GENERATE_IV
	.comm	_DISABLE_KEY,8,3                ## @DISABLE_KEY
	.no_dead_strip	_rt73usb_config_pairwise_key
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt73usb_config_pairwise_key
_rt73usb_config_pairwise_key:           ; @rt73usb_config_pairwise_key
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x21, x2
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x1]
Lloh0:
	adrp	x22, _SET_KEY@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SET_KEY@GOTPAGEOFF]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.1:
Lloh2:
	adrp	x8, _SEC_CSR2@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SEC_CSR2@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00usb_register_read
	cmn	w0, #1
	b.ne	LBB0_3
; %bb.2:
	mov	w8, #32
	str	w8, [x21]
Lloh5:
	adrp	x8, _SEC_CSR3@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SEC_CSR3@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00usb_register_read
	cmn	w0, #1
	b.eq	LBB0_14
LBB0_3:
	cbz	w0, LBB0_5
; %bb.4:
	bl	_ffz
LBB0_5:
	ldr	w8, [x21]
	add	w8, w8, w0
	str	w8, [x21]
	ldr	w1, [x20, #28]
	mov	w2, #8
	bl	_memcpy
	ldr	w1, [x20, #24]
	mov	w2, #8
	bl	_memcpy
	ldr	w1, [x20, #20]
	mov	w2, #8
	bl	_memcpy
	ldr	w0, [x21]
	bl	_PAIRWISE_KEY_ENTRY
	mov	x1, x0
	mov	x2, sp
	mov	x0, x19
	mov	w3, #32
	bl	_rt2x00usb_register_multiwrite
	add	x0, sp, #32
	mov	w1, #0
	mov	w2, #32
	bl	_memset
	ldr	w1, [x20, #16]
Lloh8:
	adrp	x8, _ETH_ALEN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ETH_ALEN@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	add	x0, sp, #32
	bl	_memcpy
	ldr	w8, [x20, #12]
	str	w8, [sp, #32]
	ldr	w0, [x21]
	bl	_PAIRWISE_TA_ENTRY
	mov	x1, x0
	add	x2, sp, #32
	mov	x0, x19
	mov	w3, #32
	bl	_rt2x00usb_register_multiwrite
Lloh11:
	adrp	x23, _SEC_CSR4@GOTPAGE
Lloh12:
	ldr	x23, [x23, _SEC_CSR4@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_rt2x00usb_register_read
	ldr	w8, [x20, #8]
	mov	w9, #1
	lsl	w8, w9, w8
	orr	w2, w8, w0
	ldr	w1, [x23]
	mov	x0, x19
	bl	_rt2x00usb_register_write
Lloh13:
	adrp	x8, _IEEE80211_KEY_FLAG_GENERATE_IV@GOTPAGE
Lloh14:
	ldr	x8, [x8, _IEEE80211_KEY_FLAG_GENERATE_IV@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	ldr	w9, [x21, #4]
	orr	w8, w9, w8
	str	w8, [x21, #4]
LBB0_6:
	ldr	w8, [x21]
	mov	w9, #1
	lsl	w23, w9, w8
	cmp	w8, #31
	b.gt	LBB0_8
; %bb.7:
Lloh16:
	adrp	x21, _SEC_CSR2@GOTPAGE
Lloh17:
	ldr	x21, [x21, _SEC_CSR2@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh18:
	adrp	x21, _SEC_CSR3@GOTPAGE
Lloh19:
	ldr	x21, [x21, _SEC_CSR3@GOTPAGEOFF]
LBB0_9:
	ldr	w1, [x21]
	mov	x0, x19
	bl	_rt2x00usb_register_read
	ldr	x8, [x20]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.10:
	orr	w2, w0, w23
	b	LBB0_12
LBB0_11:
Lloh20:
	adrp	x9, _DISABLE_KEY@GOTPAGE
Lloh21:
	ldr	x9, [x9, _DISABLE_KEY@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x8, x9
	bic	w8, w0, w23
	csel	w2, w0, w8, ne
LBB0_12:
	ldr	w1, [x21]
	mov	x0, x19
	bl	_rt2x00usb_register_write
	mov	w0, #0
LBB0_13:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_14:
Lloh23:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_13
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_SET_KEY,8,3                    ; @SET_KEY
	.comm	_SEC_CSR2,4,2                   ; @SEC_CSR2
	.comm	_SEC_CSR3,4,2                   ; @SEC_CSR3
	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.comm	_ETH_ALEN,4,2                   ; @ETH_ALEN
	.comm	_SEC_CSR4,4,2                   ; @SEC_CSR4
	.comm	_IEEE80211_KEY_FLAG_GENERATE_IV,4,2 ; @IEEE80211_KEY_FLAG_GENERATE_IV
	.comm	_DISABLE_KEY,8,3                ; @DISABLE_KEY
	.no_dead_strip	_rt73usb_config_pairwise_key
.subsections_via_symbols
