	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function safexcel_aead_ccm_setkey
_safexcel_aead_ccm_setkey:              ## @safexcel_aead_ccm_setkey
	.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
	movl	%edx, %r14d
	movq	%rsi, %r12
	movq	%rdi, %r15
	callq	_crypto_aead_tfm
	movq	%rax, %rdi
	callq	_crypto_tfm_ctx
	movq	%rax, %r13
	movq	48(%rax), %rbx
	leaq	-48(%rbp), %rdi
	movq	%r12, %rsi
	movl	%r14d, %edx
	callq	_aes_expandkey
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r12d
	movq	_CRYPTO_TFM_RES_BAD_KEY_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_crypto_aead_set_flags
	jmp	LBB0_18
LBB0_2:
	movq	_EIP197_TRC_CACHE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_9
## %bb.3:
	cmpq	$0, 40(%r13)
	je	LBB0_9
## %bb.4:
	cmpl	$4, %r14d
	jb	LBB0_12
## %bb.5:
	movl	%r14d, %r15d
	shrl	$2, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rax
	movq	(%rax,%rbx,8), %r12
	movq	-48(%rbp), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_cpu_to_le32
	cmpq	%rax, %r12
	jne	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_7 Depth=1
	incq	%rbx
	cmpq	%rbx, %r15
	jne	LBB0_7
	jmp	LBB0_9
LBB0_8:
	movl	$1, 32(%r13)
LBB0_9:
	cmpl	$4, %r14d
	jb	LBB0_12
## %bb.10:
	movl	%r14d, %r15d
	shrl	$2, %r15d
	xorl	%ebx, %ebx
	movq	_AES_BLOCK_SIZE@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_cpu_to_le32
	movq	(%r13), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movq	-48(%rbp), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_cpu_to_be32
	movq	24(%r13), %rcx
	movslq	(%r12), %rdx
	shrq	%rdx
	addq	%rbx, %rdx
	movl	%eax, (%rcx,%rdx,4)
	incq	%rbx
	cmpq	%rbx, %r15
	jne	LBB0_11
LBB0_12:
	movl	%r14d, 8(%r13)
	movq	_AES_BLOCK_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	(%r14,%rax,2), %eax
	movl	%eax, 12(%r13)
	movq	_AES_KEYSIZE_192@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_AES_KEYSIZE_256@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_13
## %bb.14:
	movq	_CONTEXT_CONTROL_CRYPTO_ALG_XCBC256@GOTPCREL(%rip), %rax
	cmpl	%r14d, %ecx
	je	LBB0_16
	jmp	LBB0_17
LBB0_13:
	movq	_CONTEXT_CONTROL_CRYPTO_ALG_XCBC128@GOTPCREL(%rip), %rax
	cmpl	%r14d, %ecx
	jne	LBB0_17
LBB0_16:
	movq	_CONTEXT_CONTROL_CRYPTO_ALG_XCBC192@GOTPCREL(%rip), %rax
LBB0_17:
	movl	(%rax), %eax
	movl	%eax, 16(%r13)
	xorl	%r12d, %r12d
LBB0_18:
	leaq	-48(%rbp), %rdi
	movl	$8, %esi
	callq	_memzero_explicit
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CRYPTO_TFM_RES_BAD_KEY_LEN,4,2 ## @CRYPTO_TFM_RES_BAD_KEY_LEN
	.comm	_EIP197_TRC_CACHE,4,2           ## @EIP197_TRC_CACHE
	.comm	_AES_BLOCK_SIZE,4,2             ## @AES_BLOCK_SIZE
	.comm	_AES_KEYSIZE_192,4,2            ## @AES_KEYSIZE_192
	.comm	_CONTEXT_CONTROL_CRYPTO_ALG_XCBC192,4,2 ## @CONTEXT_CONTROL_CRYPTO_ALG_XCBC192
	.comm	_AES_KEYSIZE_256,4,2            ## @AES_KEYSIZE_256
	.comm	_CONTEXT_CONTROL_CRYPTO_ALG_XCBC256,4,2 ## @CONTEXT_CONTROL_CRYPTO_ALG_XCBC256
	.comm	_CONTEXT_CONTROL_CRYPTO_ALG_XCBC128,4,2 ## @CONTEXT_CONTROL_CRYPTO_ALG_XCBC128
	.no_dead_strip	_safexcel_aead_ccm_setkey
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function safexcel_aead_ccm_setkey
_safexcel_aead_ccm_setkey:              ; @safexcel_aead_ccm_setkey
	.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, x2
	mov	x21, x1
	mov	x22, x0
	bl	_crypto_aead_tfm
	bl	_crypto_tfm_ctx
	mov	x20, x0
	ldr	x23, [x0, #48]
	add	x0, sp, #8
	mov	x1, x21
	mov	x2, x19
	bl	_aes_expandkey
	cbz	w0, LBB0_2
; %bb.1:
	mov	x21, x0
Lloh0:
	adrp	x8, _CRYPTO_TFM_RES_BAD_KEY_LEN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CRYPTO_TFM_RES_BAD_KEY_LEN@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_crypto_aead_set_flags
	b	LBB0_13
LBB0_2:
	ldr	w8, [x23]
Lloh3:
	adrp	x9, _EIP197_TRC_CACHE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EIP197_TRC_CACHE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x22, _AES_BLOCK_SIZE@GOTPAGE
Lloh7:
	ldr	x22, [x22, _AES_BLOCK_SIZE@GOTPAGEOFF]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.3:
	ldr	x8, [x20, #40]
	cbz	x8, LBB0_9
; %bb.4:
	cmp	w19, #4
	b.lo	LBB0_12
; %bb.5:
	mov	x21, #0
	lsr	w23, w19, #2
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	ldr	x24, [x8, x21, lsl #3]
	ldr	x8, [sp, #8]
	ldr	w0, [x8, x21, lsl #2]
	bl	_cpu_to_le32
	cmp	x24, x0
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x21, x21, #1
	cmp	x23, x21
	b.ne	LBB0_6
	b	LBB0_9
LBB0_8:
	mov	w8, #1
	str	w8, [x20, #32]
LBB0_9:
	cmp	w19, #4
	b.lo	LBB0_12
; %bb.10:
	mov	x21, #0
	lsr	w23, w19, #2
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [sp, #8]
	lsl	x24, x21, #2
	ldr	w0, [x8, x24]
	bl	_cpu_to_le32
	ldr	x8, [x20]
	str	x0, [x8, x21, lsl #3]
	ldr	x8, [sp, #8]
	ldr	w0, [x8, x24]
	bl	_cpu_to_be32
	ldr	x8, [x20, #24]
	ldrsw	x9, [x22]
	add	x9, x21, x9, lsr #1
	str	w0, [x8, x9, lsl #2]
	add	x21, x21, #1
	cmp	x23, x21
	b.ne	LBB0_11
LBB0_12:
	mov	w21, #0
	ldr	w8, [x22]
	add	w8, w19, w8, lsl #1
	stp	w19, w8, [x20, #8]
Lloh8:
	adrp	x8, _AES_KEYSIZE_192@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AES_KEYSIZE_192@GOTPAGEOFF]
Lloh10:
	adrp	x9, _AES_KEYSIZE_256@GOTPAGE
Lloh11:
	ldr	x9, [x9, _AES_KEYSIZE_256@GOTPAGEOFF]
Lloh12:
	adrp	x10, _CONTEXT_CONTROL_CRYPTO_ALG_XCBC192@GOTPAGE
Lloh13:
	ldr	x10, [x10, _CONTEXT_CONTROL_CRYPTO_ALG_XCBC192@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
Lloh15:
	adrp	x11, _CONTEXT_CONTROL_CRYPTO_ALG_XCBC256@GOTPAGE
Lloh16:
	ldr	x11, [x11, _CONTEXT_CONTROL_CRYPTO_ALG_XCBC256@GOTPAGEOFF]
	cmp	w9, w19
Lloh17:
	adrp	x9, _CONTEXT_CONTROL_CRYPTO_ALG_XCBC128@GOTPAGE
Lloh18:
	ldr	x9, [x9, _CONTEXT_CONTROL_CRYPTO_ALG_XCBC128@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	csel	x9, x11, x9, eq
	cmp	w8, w19
	csel	x8, x10, x9, eq
	ldr	w8, [x8]
	str	w8, [x20, #16]
LBB0_13:
	add	x0, sp, #8
	mov	w1, #8
	bl	_memzero_explicit
	mov	x0, x21
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh14
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_CRYPTO_TFM_RES_BAD_KEY_LEN,4,2 ; @CRYPTO_TFM_RES_BAD_KEY_LEN
	.comm	_EIP197_TRC_CACHE,4,2           ; @EIP197_TRC_CACHE
	.comm	_AES_BLOCK_SIZE,4,2             ; @AES_BLOCK_SIZE
	.comm	_AES_KEYSIZE_192,4,2            ; @AES_KEYSIZE_192
	.comm	_CONTEXT_CONTROL_CRYPTO_ALG_XCBC192,4,2 ; @CONTEXT_CONTROL_CRYPTO_ALG_XCBC192
	.comm	_AES_KEYSIZE_256,4,2            ; @AES_KEYSIZE_256
	.comm	_CONTEXT_CONTROL_CRYPTO_ALG_XCBC256,4,2 ; @CONTEXT_CONTROL_CRYPTO_ALG_XCBC256
	.comm	_CONTEXT_CONTROL_CRYPTO_ALG_XCBC128,4,2 ; @CONTEXT_CONTROL_CRYPTO_ALG_XCBC128
	.no_dead_strip	_safexcel_aead_ccm_setkey
.subsections_via_symbols
