	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ieee802_1x_mka_encode_dist_sak_body
_ieee802_1x_mka_encode_dist_sak_body:   ## @ieee802_1x_mka_encode_dist_sak_body
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	callq	_ieee802_1x_mka_get_dist_sak_length
	movl	%eax, %ebx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_wpabuf_put
	movq	%rax, %r12
	movq	_MKA_DISTRIBUTED_SAK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r12)
	movq	_MKA_HDR_LEN@GOTPCREL(%rip), %r14
	movl	%ebx, %esi
	subl	(%r14), %esi
	movq	%r12, %rdi
	callq	_set_mka_param_body_len
	cmpl	(%r14), %ebx
	jne	LBB0_2
## %bb.1:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%r12)
LBB0_11:
	xorl	%r14d, %r14d
	jmp	LBB0_12
LBB0_2:
	movq	16(%r15), %rbx
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.4:
	movups	8(%rbx), %xmm0
	movups	%xmm0, 16(%r12)
	movl	4(%rbx), %edi
	callq	_host_to_be32
	movl	%eax, 8(%r12)
	movq	8(%r15), %rax
	movl	(%rax), %r13d
	movq	_CS_TABLE_SIZE@GOTPCREL(%rip), %rax
	movl	$-1, %r14d
	cmpl	(%rax), %r13d
	jae	LBB0_12
## %bb.5:
	movq	_DEFAULT_CS_INDEX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jne	LBB0_7
## %bb.6:
	xorl	%r8d, %r8d
	jmp	LBB0_8
LBB0_3:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_wpa_printf
	movl	$-1, %r14d
	jmp	LBB0_12
LBB0_7:
	movq	_cipher_suite_tbl@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	4(%rax,%r13,8), %edi
	callq	_host_to_be64
	movl	%eax, -44(%rbp)
	movq	(%r12), %rdi
	movq	_CS_ID_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-44(%rbp), %rsi
	callq	_os_memcpy
	movq	_CS_ID_LEN@GOTPCREL(%rip), %rax
	movslq	(%rax), %r8
LBB0_8:
	movl	(%r15), %esi
	movl	4(%r15), %edi
	movq	_cipher_suite_tbl@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%r13,8), %eax
	leal	7(%rax), %edx
	testl	%eax, %eax
	cmovnsl	%eax, %edx
	sarl	$3, %edx
	movl	(%rbx), %ecx
	addq	(%r12), %r8
	callq	_aes_wrap
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	_MSG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_wpa_printf
LBB0_12:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	%r12, %rdi
	callq	_ieee802_1x_mka_dump_dist_sak_body
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_MKA_DISTRIBUTED_SAK,4,2        ## @MKA_DISTRIBUTED_SAK
	.comm	_MKA_HDR_LEN,4,2                ## @MKA_HDR_LEN
	.comm	_MSG_DEBUG,4,2                  ## @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"KaY: No SAK available to build Distributed SAK parameter set"

	.comm	_CS_TABLE_SIZE,4,2              ## @CS_TABLE_SIZE
	.comm	_DEFAULT_CS_INDEX,4,2           ## @DEFAULT_CS_INDEX
	.comm	_cipher_suite_tbl,8,3           ## @cipher_suite_tbl
	.comm	_CS_ID_LEN,4,2                  ## @CS_ID_LEN
	.comm	_MSG_ERROR,4,2                  ## @MSG_ERROR
L_.str.1:                               ## @.str.1
	.asciz	"KaY: AES wrap failed"

	.no_dead_strip	_ieee802_1x_mka_encode_dist_sak_body
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ieee802_1x_mka_encode_dist_sak_body
_ieee802_1x_mka_encode_dist_sak_body:   ; @ieee802_1x_mka_encode_dist_sak_body
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x1
	mov	x20, x0
	bl	_ieee802_1x_mka_get_dist_sak_length
	mov	x21, x0
	mov	x0, x19
	mov	x1, x21
	bl	_wpabuf_put
	mov	x19, x0
Lloh0:
	adrp	x8, _MKA_DISTRIBUTED_SAK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MKA_DISTRIBUTED_SAK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x0, #32]
Lloh3:
	adrp	x22, _MKA_HDR_LEN@GOTPAGE
Lloh4:
	ldr	x22, [x22, _MKA_HDR_LEN@GOTPAGEOFF]
	ldr	w8, [x22]
	sub	w1, w21, w8
	bl	_set_mka_param_body_len
	ldr	w8, [x22]
	cmp	w21, w8
	b.ne	LBB0_2
; %bb.1:
	mov	w0, #0
	stp	xzr, xzr, [x19, #16]
	b	LBB0_12
LBB0_2:
	ldr	x21, [x20, #16]
	cbz	x21, LBB0_6
; %bb.3:
	ldur	q0, [x21, #8]
	str	q0, [x19, #16]
	ldr	w0, [x21, #4]
	bl	_host_to_be32
	str	w0, [x19, #8]
	ldr	x8, [x20, #8]
	ldr	w22, [x8]
Lloh5:
	adrp	x8, _CS_TABLE_SIZE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CS_TABLE_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w22, w8
	b.hs	LBB0_11
; %bb.4:
Lloh8:
	adrp	x8, _DEFAULT_CS_INDEX@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DEFAULT_CS_INDEX@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x23, _cipher_suite_tbl@GOTPAGE
Lloh12:
	ldr	x23, [x23, _cipher_suite_tbl@GOTPAGEOFF]
	cmp	w22, w8
	b.ne	LBB0_7
; %bb.5:
	mov	x8, #0
	b	LBB0_8
LBB0_6:
Lloh13:
	adrp	x8, _MSG_DEBUG@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MSG_DEBUG@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_10
LBB0_7:
	ldr	x8, [x23]
	add	x8, x8, x22, lsl #3
	ldr	w0, [x8, #4]
	bl	_host_to_be64
	str	w0, [sp, #12]
	ldr	x0, [x19]
Lloh18:
	adrp	x24, _CS_ID_LEN@GOTPAGE
Lloh19:
	ldr	x24, [x24, _CS_ID_LEN@GOTPAGEOFF]
	ldr	w2, [x24]
	add	x1, sp, #12
	bl	_os_memcpy
	ldrsw	x8, [x24]
LBB0_8:
	ldp	w1, w0, [x20]
	ldr	x9, [x23]
	lsl	x10, x22, #3
	ldr	w9, [x9, x10]
	add	w10, w9, #7
	cmp	w9, #0
	csel	w9, w10, w9, lt
	asr	w2, w9, #3
	ldr	w3, [x21]
	ldr	x9, [x19]
	add	x4, x9, x8
	bl	_aes_wrap
	cbz	x0, LBB0_13
; %bb.9:
Lloh20:
	adrp	x8, _MSG_ERROR@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MSG_ERROR@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
Lloh23:
	adrp	x1, l_.str.1@PAGE
Lloh24:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_10:
	bl	_wpa_printf
LBB0_11:
	mov	w0, #-1
LBB0_12:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_13:
	mov	x0, x19
	bl	_ieee802_1x_mka_dump_dist_sak_body
	mov	w0, #0
	b	LBB0_12
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_MKA_DISTRIBUTED_SAK,4,2        ; @MKA_DISTRIBUTED_SAK
	.comm	_MKA_HDR_LEN,4,2                ; @MKA_HDR_LEN
	.comm	_MSG_DEBUG,4,2                  ; @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"KaY: No SAK available to build Distributed SAK parameter set"

	.comm	_CS_TABLE_SIZE,4,2              ; @CS_TABLE_SIZE
	.comm	_DEFAULT_CS_INDEX,4,2           ; @DEFAULT_CS_INDEX
	.comm	_cipher_suite_tbl,8,3           ; @cipher_suite_tbl
	.comm	_CS_ID_LEN,4,2                  ; @CS_ID_LEN
	.comm	_MSG_ERROR,4,2                  ; @MSG_ERROR
l_.str.1:                               ; @.str.1
	.asciz	"KaY: AES wrap failed"

	.no_dead_strip	_ieee802_1x_mka_encode_dist_sak_body
.subsections_via_symbols
