	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wl18xx_set_key
_wl18xx_set_key:                        ## @wl18xx_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	%r8, %rbx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movl	%esi, %r13d
	movq	%rdi, %r12
	movq	(%rdi), %r15
	movq	_DEBUG_CRYPT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r15), %edx
	leaq	L_.str(%rip), %rsi
	callq	_wl1271_debug
	movq	(%rbx), %r14
	movq	_WL1271_CIPHER_SUITE_GEM@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_WLAN_CIPHER_SUITE_TKIP@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	movl	%r13d, %esi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movq	%rbx, %r8
	callq	_wlcore_set_key
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_14
## %bb.1:
	cmpq	-64(%rbp), %r14                 ## 8-byte Folded Reload
	je	LBB0_3
## %bb.2:
	cmpq	-56(%rbp), %r14                 ## 8-byte Folded Reload
	je	LBB0_3
## %bb.12:
	movq	_DEBUG_CRYPT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r15), %edx
	jmp	LBB0_13
LBB0_3:
	movq	_SET_KEY@GOTPCREL(%rip), %rax
	cmpl	%r13d, (%rax)
	movq	%r15, %rcx
	jne	LBB0_5
## %bb.4:
	movl	(%rcx), %r15d
	leal	1(%r15), %edx
	movl	%edx, (%rcx)
	movq	_DEBUG_CRYPT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%rcx, %r14
	callq	_wl1271_debug
	testl	%r15d, %r15d
	jne	LBB0_14
	jmp	LBB0_7
LBB0_5:
	movq	_DISABLE_KEY@GOTPCREL(%rip), %rax
	cmpl	%r13d, (%rax)
	jne	LBB0_11
## %bb.6:
	movl	(%rcx), %r15d
	leal	-1(%r15), %edx
	movl	%edx, (%rcx)
	movq	_DEBUG_CRYPT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%rcx, %r14
	callq	_wl1271_debug
	cmpl	$1, %r15d
	jne	LBB0_14
LBB0_7:
	cmpl	$0, (%r14)
	je	LBB0_10
## %bb.8:
	movq	_WL18XX_TX_HW_EXTRA_BLOCK_SPARE@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_11:
	movq	_DEBUG_CRYPT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%rcx), %edx
LBB0_13:
	leaq	L_.str.1(%rip), %rsi
	callq	_wl1271_debug
LBB0_14:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_WL18XX_TX_HW_BLOCK_SPARE@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %esi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_wl18xx_set_host_cfg_bitmap     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DEBUG_CRYPT,4,2                ## @DEBUG_CRYPT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"extra spare keys before: %d"

	.comm	_WL1271_CIPHER_SUITE_GEM,8,3    ## @WL1271_CIPHER_SUITE_GEM
	.comm	_WLAN_CIPHER_SUITE_TKIP,8,3     ## @WLAN_CIPHER_SUITE_TKIP
	.comm	_SET_KEY,4,2                    ## @SET_KEY
	.comm	_DISABLE_KEY,4,2                ## @DISABLE_KEY
L_.str.1:                               ## @.str.1
	.asciz	"extra spare keys after: %d"

	.comm	_WL18XX_TX_HW_EXTRA_BLOCK_SPARE,4,2 ## @WL18XX_TX_HW_EXTRA_BLOCK_SPARE
	.comm	_WL18XX_TX_HW_BLOCK_SPARE,4,2   ## @WL18XX_TX_HW_BLOCK_SPARE
	.no_dead_strip	_wl18xx_set_key
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wl18xx_set_key
_wl18xx_set_key:                        ; @wl18xx_set_key
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x4
	mov	x22, x3
	mov	x23, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x24, [x0]
Lloh0:
	adrp	x25, _DEBUG_CRYPT@GOTPAGE
Lloh1:
	ldr	x25, [x25, _DEBUG_CRYPT@GOTPAGEOFF]
	ldr	w0, [x25]
	ldr	w2, [x24]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_wl1271_debug
	ldr	x26, [x20]
Lloh4:
	adrp	x8, _WL1271_CIPHER_SUITE_GEM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _WL1271_CIPHER_SUITE_GEM@GOTPAGEOFF]
Lloh6:
	ldr	x27, [x8]
Lloh7:
	adrp	x8, _WLAN_CIPHER_SUITE_TKIP@GOTPAGE
Lloh8:
	ldr	x8, [x8, _WLAN_CIPHER_SUITE_TKIP@GOTPAGEOFF]
Lloh9:
	ldr	x28, [x8]
	mov	x0, x19
	mov	x1, x21
	mov	x2, x23
	mov	x3, x22
	mov	x4, x20
	bl	_wlcore_set_key
	mov	x20, x0
	tbnz	w0, #31, LBB0_9
; %bb.1:
	cmp	x26, x27
	ccmp	x26, x28, #4, ne
	b.ne	LBB0_8
; %bb.2:
Lloh10:
	adrp	x8, _SET_KEY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SET_KEY@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_4
; %bb.3:
	ldr	w21, [x24]
	add	w2, w21, #1
	str	w2, [x24]
	ldr	w0, [x25]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_wl1271_debug
	cbnz	w21, LBB0_9
	b	LBB0_6
LBB0_4:
Lloh15:
	adrp	x8, _DISABLE_KEY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DISABLE_KEY@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_8
; %bb.5:
	ldr	w21, [x24]
	subs	w2, w21, #1
	str	w2, [x24]
	ldr	w0, [x25]
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_wl1271_debug
	cmp	w21, #1
	b.ne	LBB0_9
LBB0_6:
	ldr	w8, [x24]
	cbz	w8, LBB0_10
; %bb.7:
Lloh20:
	adrp	x8, _WL18XX_TX_HW_EXTRA_BLOCK_SPARE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _WL18XX_TX_HW_EXTRA_BLOCK_SPARE@GOTPAGEOFF]
	b	LBB0_11
LBB0_8:
	ldr	w0, [x25]
	ldr	w2, [x24]
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_wl1271_debug
LBB0_9:
	mov	x0, x20
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_10:
Lloh24:
	adrp	x8, _WL18XX_TX_HW_BLOCK_SPARE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _WL18XX_TX_HW_BLOCK_SPARE@GOTPAGEOFF]
LBB0_11:
	ldr	w1, [x8]
	mov	x0, x19
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_wl18xx_set_host_cfg_bitmap
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_DEBUG_CRYPT,4,2                ; @DEBUG_CRYPT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"extra spare keys before: %d"

	.comm	_WL1271_CIPHER_SUITE_GEM,8,3    ; @WL1271_CIPHER_SUITE_GEM
	.comm	_WLAN_CIPHER_SUITE_TKIP,8,3     ; @WLAN_CIPHER_SUITE_TKIP
	.comm	_SET_KEY,4,2                    ; @SET_KEY
	.comm	_DISABLE_KEY,4,2                ; @DISABLE_KEY
l_.str.1:                               ; @.str.1
	.asciz	"extra spare keys after: %d"

	.comm	_WL18XX_TX_HW_EXTRA_BLOCK_SPARE,4,2 ; @WL18XX_TX_HW_EXTRA_BLOCK_SPARE
	.comm	_WL18XX_TX_HW_BLOCK_SPARE,4,2   ; @WL18XX_TX_HW_BLOCK_SPARE
	.no_dead_strip	_wl18xx_set_key
.subsections_via_symbols
