	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mesh_rsn_protect_frame         ## -- Begin function mesh_rsn_protect_frame
	.p2align	4, 0x90
_mesh_rsn_protect_frame:                ## @mesh_rsn_protect_frame
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rdx, %r13
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%rcx, %rdi
	callq	_wpabuf_head_u8
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_wpabuf_len
	cltq
	leaq	(%r15,%rax,8), %rax
	movq	16(%r12), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, -80(%rbp)
	movq	%rbx, -136(%rbp)                ## 8-byte Spill
	movq	(%rbx), %rcx
	movq	%rcx, -72(%rbp)
	movq	%r13, -64(%rbp)
	movq	_ETH_ALEN@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	movq	%rcx, -112(%rbp)
	movq	%rcx, -104(%rbp)
	subq	%r13, %rax
	sarq	$3, %rax
	movq	%rax, -96(%rbp)
	movq	8(%r13), %rax
	movq	_PLINK_OPEN@GOTPCREL(%rip), %rcx
	movl	$24, %r15d
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	32(%r12), %rax
	movq	_WPA_KEY_RSC_LEN@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	leaq	(%rax,%rcx), %r15
	addq	$28, %r15
LBB0_2:
	movq	_AES_BLOCK_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(%r15,%rax), %rbx
	addq	$4, %rbx
	movq	%r14, %rdi
	callq	_wpabuf_tailroom
	cmpq	%rax, %rbx
	jbe	LBB0_5
## %bb.3:
	movq	_MSG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_wpa_printf
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_5:
	movq	%r12, -120(%rbp)                ## 8-byte Spill
	leaq	2(%r15), %rdi
	movq	%rdi, -128(%rbp)                ## 8-byte Spill
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_os_zalloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %r12
	movq	_WLAN_EID_AMPE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r12)
	movq	%r15, 8(%r12)
	movl	32(%r12), %edi
	movq	_RSN_CIPHER_SUITE_CCMP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_RSN_SELECTOR_PUT
	movq	16(%r12), %rdi
	movq	-136(%rbp), %r15                ## 8-byte Reload
	movl	16(%r15), %esi
	movq	_WPA_NONCE_LEN@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdx
	callq	_os_memcpy
	movq	24(%r12), %rdi
	movl	12(%r15), %esi
	movq	(%rbx), %rdx
	callq	_os_memcpy
	movq	8(%r13), %rax
	movq	_PLINK_OPEN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.8:
	leaq	40(%r12), %rdi
	movq	-120(%rbp), %rbx                ## 8-byte Reload
	movl	40(%rbx), %esi
	movq	32(%rbx), %rdx
	callq	_os_memcpy
	movq	32(%rbx), %rax
	leaq	(%r12,%rax,8), %r13
	addq	$40, %r13
	movq	16(%rbx), %rdi
	movl	24(%rbx), %edx
	xorl	%esi, %esi
	movq	%r13, %rcx
	callq	_wpa_drv_get_seqnum
	movq	_WPA_KEY_RSC_LEN@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(,%rax,8), %rdi
	addq	%r13, %rdi
	movl	$-1, %esi
	callq	_WPA_PUT_LE32
LBB0_9:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdx
	movq	-128(%rbp), %rbx                ## 8-byte Reload
	movl	%ebx, %ecx
	callq	_wpa_hexdump_key
	movq	_WLAN_EID_MIC@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r14, %rdi
	callq	_wpabuf_put_u8
	movq	_AES_BLOCK_SIZE@GOTPCREL(%rip), %r13
	movq	(%r13), %rsi
	movq	%r14, %rdi
	callq	_wpabuf_put_u8
	movq	%rbx, %rsi
	addq	(%r13), %rsi
	movq	%r14, %rdi
	callq	_wpabuf_put
	movl	8(%r15), %edi
	leaq	-112(%rbp), %r10
	leaq	-80(%rbp), %r9
	movl	$4, %esi
	movq	%r12, %rdx
	movl	%ebx, %ecx
	movl	$3, %r8d
	pushq	%rax
	pushq	%r10
	callq	_aes_siv_encrypt
	addq	$16, %rsp
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:
	movq	_MSG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_wpa_printf
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_6:
	movq	_MSG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_wpa_printf
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_10:
	xorl	%ebx, %ebx
LBB0_12:
	movq	%r12, %rdi
	callq	_os_free
LBB0_13:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	movl	%ebx, %eax
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_ETH_ALEN,4,2                   ## @ETH_ALEN
	.comm	_PLINK_OPEN,8,3                 ## @PLINK_OPEN
	.comm	_WPA_KEY_RSC_LEN,8,3            ## @WPA_KEY_RSC_LEN
	.comm	_AES_BLOCK_SIZE,8,3             ## @AES_BLOCK_SIZE
	.comm	_MSG_ERROR,4,2                  ## @MSG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"protect frame: buffer too small"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"protect frame: out of memory"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_WLAN_EID_AMPE,8,3              ## @WLAN_EID_AMPE
	.comm	_RSN_CIPHER_SUITE_CCMP,4,2      ## @RSN_CIPHER_SUITE_CCMP
	.comm	_WPA_NONCE_LEN,8,3              ## @WPA_NONCE_LEN
	.comm	_MSG_DEBUG,4,2                  ## @MSG_DEBUG
L_.str.2:                               ## @.str.2
	.asciz	"mesh: Plaintext AMPE element"

	.comm	_WLAN_EID_MIC,8,3               ## @WLAN_EID_MIC
L_.str.3:                               ## @.str.3
	.asciz	"protect frame: failed to encrypt"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mesh_rsn_protect_frame         ; -- Begin function mesh_rsn_protect_frame
	.p2align	2
_mesh_rsn_protect_frame:                ; @mesh_rsn_protect_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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, x3
	mov	x24, x2
	mov	x19, x1
	mov	x23, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #56]
	mov	x0, x3
	bl	_wpabuf_head_u8
	mov	x21, x0
	mov	x0, x20
	bl	_wpabuf_len
	add	x8, x21, w0, sxtw #3
	ldr	x9, [x23, #16]
	ldr	x9, [x9]
	ldr	x10, [x19]
	stp	x9, x10, [sp, #32]
Lloh3:
	adrp	x9, _ETH_ALEN@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ETH_ALEN@GOTPAGEOFF]
	str	x24, [sp, #48]
Lloh5:
	ldrsw	x9, [x9]
	stp	x9, x9, [sp, #8]
	sub	x8, x8, x24
	asr	x8, x8, #3
	str	x8, [sp, #24]
	ldr	x8, [x24, #8]
Lloh6:
	adrp	x26, _PLINK_OPEN@GOTPAGE
Lloh7:
	ldr	x26, [x26, _PLINK_OPEN@GOTPAGEOFF]
	ldr	x9, [x26]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldr	x8, [x23, #32]
Lloh8:
	adrp	x9, _WPA_KEY_RSC_LEN@GOTPAGE
Lloh9:
	ldr	x9, [x9, _WPA_KEY_RSC_LEN@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	add	x8, x8, x9
	add	x27, x8, #28
	b	LBB0_3
LBB0_2:
	mov	w27, #24
LBB0_3:
Lloh11:
	adrp	x25, _AES_BLOCK_SIZE@GOTPAGE
Lloh12:
	ldr	x25, [x25, _AES_BLOCK_SIZE@GOTPAGEOFF]
	ldr	x8, [x25]
	add	x8, x27, x8
	add	x21, x8, #4
	mov	x0, x20
	bl	_wpabuf_tailroom
	cmp	x21, x0
	b.ls	LBB0_5
; %bb.4:
Lloh13:
	adrp	x8, _MSG_ERROR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MSG_ERROR@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	bl	_wpa_printf
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_11
LBB0_5:
	add	x22, x27, #2
	mov	x0, x22
	bl	_os_zalloc
	cbz	x0, LBB0_10
; %bb.6:
	mov	x21, x0
Lloh20:
	adrp	x8, _WLAN_EID_AMPE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _WLAN_EID_AMPE@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	stp	x8, x27, [x0]
	ldr	w0, [x0, #32]
Lloh23:
	adrp	x8, _RSN_CIPHER_SUITE_CCMP@GOTPAGE
Lloh24:
	ldr	x8, [x8, _RSN_CIPHER_SUITE_CCMP@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	bl	_RSN_SELECTOR_PUT
	ldr	x0, [x21, #16]
	ldr	w1, [x19, #16]
Lloh26:
	adrp	x27, _WPA_NONCE_LEN@GOTPAGE
Lloh27:
	ldr	x27, [x27, _WPA_NONCE_LEN@GOTPAGEOFF]
	ldr	x2, [x27]
	bl	_os_memcpy
	ldr	x0, [x21, #24]
	ldr	w1, [x19, #12]
	ldr	x2, [x27]
	bl	_os_memcpy
	ldr	x8, [x24, #8]
	ldr	x9, [x26]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.7:
	add	x24, x21, #40
	ldr	w1, [x23, #40]
	ldr	x2, [x23, #32]
	mov	x0, x24
	bl	_os_memcpy
	ldr	x8, [x23, #32]
	add	x24, x24, x8, lsl #3
	ldr	x0, [x23, #16]
	ldr	w2, [x23, #24]
	mov	x1, #0
	mov	x3, x24
	bl	_wpa_drv_get_seqnum
Lloh28:
	adrp	x8, _WPA_KEY_RSC_LEN@GOTPAGE
Lloh29:
	ldr	x8, [x8, _WPA_KEY_RSC_LEN@GOTPAGEOFF]
Lloh30:
	ldr	x8, [x8]
	add	x0, x24, x8, lsl #3
	mov	w1, #-1
	bl	_WPA_PUT_LE32
LBB0_8:
Lloh31:
	adrp	x8, _MSG_DEBUG@GOTPAGE
Lloh32:
	ldr	x8, [x8, _MSG_DEBUG@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
Lloh34:
	adrp	x1, l_.str.2@PAGE
Lloh35:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x21
	mov	x3, x22
	bl	_wpa_hexdump_key
Lloh36:
	adrp	x8, _WLAN_EID_MIC@GOTPAGE
Lloh37:
	ldr	x8, [x8, _WLAN_EID_MIC@GOTPAGEOFF]
Lloh38:
	ldr	x1, [x8]
	mov	x0, x20
	bl	_wpabuf_put_u8
	ldr	x1, [x25]
	mov	x0, x20
	bl	_wpabuf_put_u8
	ldr	x8, [x25]
	add	x1, x8, x22
	mov	x0, x20
	bl	_wpabuf_put
	mov	x7, x0
	ldr	w0, [x19, #8]
	add	x5, sp, #32
	add	x6, sp, #8
	mov	w1, #4
	mov	x2, x21
	mov	x3, x22
	mov	w4, #3
	bl	_aes_siv_encrypt
	cbz	x0, LBB0_12
; %bb.9:
Lloh39:
	adrp	x8, _MSG_ERROR@GOTPAGE
Lloh40:
	ldr	x8, [x8, _MSG_ERROR@GOTPAGEOFF]
Lloh41:
	ldr	w0, [x8]
Lloh42:
	adrp	x1, l_.str.3@PAGE
Lloh43:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_wpa_printf
Lloh44:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh45:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh46:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_13
LBB0_10:
Lloh47:
	adrp	x8, _MSG_ERROR@GOTPAGE
Lloh48:
	ldr	x8, [x8, _MSG_ERROR@GOTPAGEOFF]
Lloh49:
	ldr	w0, [x8]
Lloh50:
	adrp	x1, l_.str.1@PAGE
Lloh51:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_wpa_printf
Lloh52:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh53:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_14
LBB0_12:
	mov	w19, #0
LBB0_13:
	mov	x0, x21
	bl	_os_free
LBB0_14:
	ldr	x8, [sp, #56]
Lloh54:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh55:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh56:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.15:
	mov	x0, x19
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh52, Lloh53
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.cfi_endproc
                                        ; -- End function
	.comm	_ETH_ALEN,4,2                   ; @ETH_ALEN
	.comm	_PLINK_OPEN,8,3                 ; @PLINK_OPEN
	.comm	_WPA_KEY_RSC_LEN,8,3            ; @WPA_KEY_RSC_LEN
	.comm	_AES_BLOCK_SIZE,8,3             ; @AES_BLOCK_SIZE
	.comm	_MSG_ERROR,4,2                  ; @MSG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"protect frame: buffer too small"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"protect frame: out of memory"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_WLAN_EID_AMPE,8,3              ; @WLAN_EID_AMPE
	.comm	_RSN_CIPHER_SUITE_CCMP,4,2      ; @RSN_CIPHER_SUITE_CCMP
	.comm	_WPA_NONCE_LEN,8,3              ; @WPA_NONCE_LEN
	.comm	_MSG_DEBUG,4,2                  ; @MSG_DEBUG
l_.str.2:                               ; @.str.2
	.asciz	"mesh: Plaintext AMPE element"

	.comm	_WLAN_EID_MIC,8,3               ; @WLAN_EID_MIC
l_.str.3:                               ; @.str.3
	.asciz	"protect frame: failed to encrypt"

.subsections_via_symbols
