	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ath6kl_wmi_addkey_cmd          ## -- Begin function ath6kl_wmi_addkey_cmd
	.p2align	4, 0x90
_ath6kl_wmi_addkey_cmd:                 ## @ath6kl_wmi_addkey_cmd
	.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	%r9, %r14
	movq	%r8, %r12
	movl	%ecx, %r13d
	movq	%rdx, %rbx
	movq	%rsi, -96(%rbp)                 ## 8-byte Spill
	movq	%rdi, -88(%rbp)                 ## 8-byte Spill
	movl	56(%rbp), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	48(%rbp), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	40(%rbp), %r15
	movq	32(%rbp), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	24(%rbp), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	16(%rbp), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_ATH6KL_DBG_WMI@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, (%rsp)
	leaq	L_.str(%rip), %rsi
	callq	_ath6kl_dbg
	movq	_WMI_MAX_KEY_INDEX@GOTPCREL(%rip), %rax
	cmpq	%rbx, (%rax)
	jge	LBB0_1
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_5:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	cmpl	$8, -44(%rbp)                   ## 4-byte Folded Reload
	ja	LBB0_4
## %bb.2:
	cmpq	$0, -64(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_4
## %bb.3:
	movq	_WMI_MAX_KEY_LEN@GOTPCREL(%rip), %rax
	cmpq	%r14, (%rax)
	jl	LBB0_4
## %bb.6:
	cmpq	$0, -56(%rbp)                   ## 8-byte Folded Reload
	jne	LBB0_8
## %bb.7:
	movq	_WEP_CRYPT@GOTPCREL(%rip), %rax
	cmpl	%r13d, (%rax)
	jne	LBB0_4
LBB0_8:
	movl	$48, %edi
	callq	_ath6kl_wmi_get_new_buf
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	(%rax), %rax
	movq	%rbx, 40(%rax)
	movq	%rax, %rbx
	movl	%r13d, (%rax)
	movq	%r12, 32(%rax)
	movq	%r14, 24(%rax)
	movl	20(%rax), %edi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	%r14d, %edx
	callq	_memcpy
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	testq	%rsi, %rsi
	je	LBB0_12
## %bb.11:
	movl	16(%rbx), %edi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_memcpy
LBB0_12:
	movq	%r15, 8(%rbx)
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	testq	%rsi, %rsi
	je	LBB0_14
## %bb.13:
	movl	4(%rbx), %edi
	movq	_ETH_ALEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_memcpy
LBB0_14:
	movq	_WMI_ADD_CIPHER_KEY_CMDID@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movl	-48(%rbp), %r8d                 ## 4-byte Reload
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ath6kl_wmi_cmd_send            ## TAILCALL
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_ATH6KL_DBG_WMI,4,2             ## @ATH6KL_DBG_WMI
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"addkey cmd: key_index=%u key_type=%d key_usage=%d key_len=%d key_op_ctrl=%d\n"

	.comm	_WMI_MAX_KEY_INDEX,8,3          ## @WMI_MAX_KEY_INDEX
	.comm	_WMI_MAX_KEY_LEN,8,3            ## @WMI_MAX_KEY_LEN
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_WEP_CRYPT,4,2                  ## @WEP_CRYPT
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ETH_ALEN,4,2                   ## @ETH_ALEN
	.comm	_WMI_ADD_CIPHER_KEY_CMDID,4,2   ## @WMI_ADD_CIPHER_KEY_CMDID
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ath6kl_wmi_addkey_cmd          ; -- Begin function ath6kl_wmi_addkey_cmd
	.p2align	2
_ath6kl_wmi_addkey_cmd:                 ; @ath6kl_wmi_addkey_cmd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x23, x7
	mov	x24, x6
	mov	x26, x5
	mov	x27, x4
	mov	x28, x3
	mov	x20, x2
	stp	x0, x1, [sp, #16]               ; 16-byte Folded Spill
	ldr	w21, [x29, #40]
	ldp	x25, x22, [x29, #24]
	ldr	x19, [x29, #16]
Lloh0:
	adrp	x8, _ATH6KL_DBG_WMI@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATH6KL_DBG_WMI@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x6, x25
	bl	_ath6kl_dbg
Lloh5:
	adrp	x8, _WMI_MAX_KEY_INDEX@GOTPAGE
Lloh6:
	ldr	x8, [x8, _WMI_MAX_KEY_INDEX@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x8, x20
	b.ge	LBB0_3
LBB0_1:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w0, w8
	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
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_3:
	cmp	w23, #8
	b.hi	LBB0_1
; %bb.4:
	cbz	x19, LBB0_1
; %bb.5:
Lloh10:
	adrp	x8, _WMI_MAX_KEY_LEN@GOTPAGE
Lloh11:
	ldr	x8, [x8, _WMI_MAX_KEY_LEN@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	cmp	x8, x26
	b.lt	LBB0_1
; %bb.6:
	cbnz	x24, LBB0_8
; %bb.7:
Lloh13:
	adrp	x8, _WEP_CRYPT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _WEP_CRYPT@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	cmp	w8, w28
	b.ne	LBB0_1
LBB0_8:
	mov	w0, #48
	bl	_ath6kl_wmi_get_new_buf
	cbz	x0, LBB0_14
; %bb.9:
	str	w21, [sp, #12]                  ; 4-byte Folded Spill
	str	x0, [sp]                        ; 8-byte Folded Spill
	ldr	x21, [x0]
	stp	x27, x20, [x21, #32]
	str	w28, [x21]
	str	x26, [x21, #24]
	ldr	w0, [x21, #20]
	mov	x1, x19
	mov	x2, x26
	bl	_memcpy
	cbz	x24, LBB0_11
; %bb.10:
	ldr	w0, [x21, #16]
	mov	x1, x24
	mov	x2, x23
	bl	_memcpy
LBB0_11:
	str	x25, [x21, #8]
	cbz	x22, LBB0_13
; %bb.12:
	ldr	w0, [x21, #4]
Lloh16:
	adrp	x8, _ETH_ALEN@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ETH_ALEN@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mov	x1, x22
	bl	_memcpy
LBB0_13:
Lloh19:
	adrp	x8, _WMI_ADD_CIPHER_KEY_CMDID@GOTPAGE
Lloh20:
	ldr	x8, [x8, _WMI_ADD_CIPHER_KEY_CMDID@GOTPAGEOFF]
Lloh21:
	ldr	w3, [x8]
	ldp	x0, x1, [sp, #16]               ; 16-byte Folded Reload
	ldr	x2, [sp]                        ; 8-byte Folded Reload
	ldr	w4, [sp, #12]                   ; 4-byte Folded Reload
	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
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_ath6kl_wmi_cmd_send
LBB0_14:
Lloh22:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_ATH6KL_DBG_WMI,4,2             ; @ATH6KL_DBG_WMI
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"addkey cmd: key_index=%u key_type=%d key_usage=%d key_len=%d key_op_ctrl=%d\n"

	.comm	_WMI_MAX_KEY_INDEX,8,3          ; @WMI_MAX_KEY_INDEX
	.comm	_WMI_MAX_KEY_LEN,8,3            ; @WMI_MAX_KEY_LEN
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_WEP_CRYPT,4,2                  ; @WEP_CRYPT
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ETH_ALEN,4,2                   ; @ETH_ALEN
	.comm	_WMI_ADD_CIPHER_KEY_CMDID,4,2   ; @WMI_ADD_CIPHER_KEY_CMDID
.subsections_via_symbols
