	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lib80211_tkip_set_key
_lib80211_tkip_set_key:                 ## @lib80211_tkip_set_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %rbx
	movq	%rdx, %r15
	movl	%esi, %r12d
	movq	%rdi, %r13
	movups	40(%rcx), %xmm0
	movaps	%xmm0, -80(%rbp)                ## 16-byte Spill
	movups	24(%rcx), %xmm0
	movaps	%xmm0, -64(%rbp)                ## 16-byte Spill
	movl	(%rcx), %r14d
	movq	%rcx, %rdi
	xorl	%esi, %esi
	movl	$56, %edx
	callq	_memset
	movl	%r14d, (%rbx)
	movaps	-80(%rbp), %xmm0                ## 16-byte Reload
	movups	%xmm0, 40(%rbx)
	movaps	-64(%rbp), %xmm0                ## 16-byte Reload
	movups	%xmm0, 24(%rbx)
	movq	_TKIP_KEY_LEN@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_3
## %bb.1:
	movl	20(%rbx), %edi
	movq	%r13, %rsi
	movl	%r12d, %edx
	callq	_memcpy
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, 4(%rbx)
	testq	%r15, %r15
	je	LBB0_5
## %bb.2:
	movl	20(%r15), %eax
	shll	$24, %eax
	movl	12(%r15), %ecx
	movl	16(%r15), %edx
	shll	$16, %edx
	orl	%eax, %edx
	shll	$8, %ecx
	orl	%edx, %ecx
	orl	8(%r15), %ecx
	movl	%ecx, 12(%rbx)
	movl	4(%r15), %eax
	shll	$8, %eax
	orl	(%r15), %eax
	movl	%eax, 16(%rbx)
	jmp	LBB0_5
LBB0_3:
	movl	$-1, %eax
	testl	%r12d, %r12d
	jne	LBB0_6
## %bb.4:
	movl	$0, 4(%rbx)
LBB0_5:
	xorl	%eax, %eax
LBB0_6:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TKIP_KEY_LEN,4,2               ## @TKIP_KEY_LEN
	.no_dead_strip	_lib80211_tkip_set_key
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lib80211_tkip_set_key
_lib80211_tkip_set_key:                 ; @lib80211_tkip_set_key
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	ldp	x24, x23, [x3, #40]
	ldur	q0, [x3, #24]
	str	q0, [sp]                        ; 16-byte Folded Spill
	ldr	w25, [x3]
	mov	x0, x3
	mov	w1, #0
	mov	w2, #56
	bl	_memset
	str	w25, [x19]
	stp	x24, x23, [x19, #40]
	ldr	q0, [sp]                        ; 16-byte Folded Reload
	stur	q0, [x19, #24]
Lloh0:
	adrp	x8, _TKIP_KEY_LEN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TKIP_KEY_LEN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_3
; %bb.1:
	ldr	w0, [x19, #20]
	mov	x1, x22
	mov	x2, x21
	bl	_memcpy
	movi.2s	v0, #1
	stur	d0, [x19, #4]
	mov	w0, #0
	cbz	x20, LBB0_6
; %bb.2:
	ldp	w9, w8, [x20, #16]
	lsl	w9, w9, #16
	orr	w8, w9, w8, lsl #24
	ldp	w10, w9, [x20, #8]
	orr	w8, w8, w9, lsl #8
	orr	w8, w8, w10
	str	w8, [x19, #12]
	ldp	w9, w8, [x20]
	orr	w8, w9, w8, lsl #8
	str	w8, [x19, #16]
	b	LBB0_6
LBB0_3:
	cbz	w21, LBB0_5
; %bb.4:
	mov	w0, #-1
	b	LBB0_6
LBB0_5:
	mov	w0, #0
	str	wzr, [x19, #4]
LBB0_6:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_TKIP_KEY_LEN,4,2               ; @TKIP_KEY_LEN
	.no_dead_strip	_lib80211_tkip_set_key
.subsections_via_symbols
