	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wmi_add_cipher_key             ## -- Begin function wmi_add_cipher_key
	.p2align	4, 0x90
_wmi_add_cipher_key:                    ## @wmi_add_cipher_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
	movl	%r9d, %r14d
	movq	%r8, %r12
	movl	%ecx, %ebx
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movl	%esi, %r15d
	movq	%rdi, %r13
	callq	_vif_to_wil
	movl	%r14d, -72(%rbp)
	movl	%ebx, -68(%rbp)
	movq	$0, -64(%rbp)
	movl	%r15d, -56(%rbp)
	cmpl	$5, %ebx
	jae	LBB0_1
## %bb.2:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	testl	%ebx, %ebx
	setne	%dl
	testq	%r12, %r12
	setne	%cl
	testb	%cl, %dl
	jne	LBB0_4
## %bb.3:
	movq	_WMI_KEY_USE_APPLY_PTK@GOTPCREL(%rip), %rcx
	cmpl	%r14d, (%rcx)
	je	LBB0_4
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
LBB0_4:
	movq	%rax, %r14
	testq	%r12, %r12
	je	LBB0_6
## %bb.5:
	xorl	%edi, %edi
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	_memcpy
LBB0_6:
	testq	%r15, %r15
	je	LBB0_8
## %bb.7:
	movq	%r15, %rsi
	movq	_WMI_MAC_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%edi, %edi
	callq	_memcpy
LBB0_8:
	movq	_WMI_ADD_CIPHER_KEY_CMDID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r13), %edx
	leaq	-72(%rbp), %rcx
	movq	%r14, %rdi
	movl	$20, %r8d
	callq	_wmi_send
LBB0_9:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_WMI_KEY_USE_APPLY_PTK,4,2      ## @WMI_KEY_USE_APPLY_PTK
	.comm	_WMI_MAC_LEN,4,2                ## @WMI_MAC_LEN
	.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	_wmi_add_cipher_key             ; -- Begin function wmi_add_cipher_key
	.p2align	2
_wmi_add_cipher_key:                    ; @wmi_add_cipher_key
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x24, x5
	mov	x23, x4
	mov	x22, x3
	mov	x21, x2
	mov	x25, x1
	mov	x20, x0
	bl	_vif_to_wil
	stp	w24, w22, [sp, #8]
	str	xzr, [sp, #16]
	str	w25, [sp, #24]
	cmp	w22, #5
	b.hs	LBB0_3
; %bb.1:
	mov	x19, x0
	cmp	x23, #0
	ccmp	w22, #0, #4, ne
	b.ne	LBB0_4
; %bb.2:
Lloh0:
	adrp	x8, _WMI_KEY_USE_APPLY_PTK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WMI_KEY_USE_APPLY_PTK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w24
	b.eq	LBB0_4
LBB0_3:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_4:
	cbz	x23, LBB0_6
; %bb.5:
	mov	w0, #0
	mov	x1, x23
	mov	x2, x22
	bl	_memcpy
LBB0_6:
	cbz	x21, LBB0_8
; %bb.7:
Lloh6:
	adrp	x8, _WMI_MAC_LEN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _WMI_MAC_LEN@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	w0, #0
	mov	x1, x21
	bl	_memcpy
LBB0_8:
Lloh9:
	adrp	x8, _WMI_ADD_CIPHER_KEY_CMDID@GOTPAGE
Lloh10:
	ldr	x8, [x8, _WMI_ADD_CIPHER_KEY_CMDID@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	ldr	w2, [x20]
	add	x3, sp, #8
	mov	x0, x19
	mov	w4, #20
	bl	_wmi_send
LBB0_9:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_WMI_KEY_USE_APPLY_PTK,4,2      ; @WMI_KEY_USE_APPLY_PTK
	.comm	_WMI_MAC_LEN,4,2                ; @WMI_MAC_LEN
	.comm	_WMI_ADD_CIPHER_KEY_CMDID,4,2   ; @WMI_ADD_CIPHER_KEY_CMDID
.subsections_via_symbols
