	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cms_kek_cipher
_cms_kek_cipher:                        ## @cms_kek_cipher
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -68(%rbp)                 ## 4-byte Spill
	movq	%r8, %r13
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_EVP_MAX_KEY_LENGTH@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movl	8(%r13), %edi
	callq	_EVP_CIPHER_CTX_key_length
	movq	%rax, -64(%rbp)
	movslq	(%rbx), %rcx
	xorl	%r14d, %r14d
	cmpq	%rcx, %rax
	ja	LBB0_10
## %bb.1:
	movq	(%r13), %rdi
	leaq	-64(%rbp), %rdx
	movq	%r15, %rsi
	callq	_EVP_PKEY_derive
	xorl	%r14d, %r14d
	testq	%rax, %rax
	jle	LBB0_2
## %bb.4:
	movq	%r12, %rbx
	movl	8(%r13), %edi
	xorl	%r12d, %r12d
	xorl	%esi, %esi
	xorl	%edx, %edx
	movq	%r15, %rcx
	xorl	%r8d, %r8d
	movl	-68(%rbp), %r9d                 ## 4-byte Reload
	callq	_EVP_CipherInit_ex
	testl	%eax, %eax
	je	LBB0_3
## %bb.5:
	movl	8(%r13), %edi
	xorl	%r12d, %r12d
	leaq	-52(%rbp), %rdx
	xorl	%esi, %esi
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movq	-88(%rbp), %r8                  ## 8-byte Reload
	callq	_EVP_CipherUpdate
	testl	%eax, %eax
	je	LBB0_3
## %bb.6:
	movl	-52(%rbp), %edi
	callq	_OPENSSL_malloc
	testq	%rax, %rax
	je	LBB0_2
## %bb.7:
	movq	%rax, %r12
	movl	8(%r13), %edi
	leaq	-52(%rbp), %rdx
	movq	%rax, %rsi
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movq	-88(%rbp), %r8                  ## 8-byte Reload
	callq	_EVP_CipherUpdate
	testl	%eax, %eax
	je	LBB0_3
## %bb.8:
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movq	%r12, (%rax)
	movslq	-52(%rbp), %rax
	movq	%rax, (%rbx)
	movq	-64(%rbp), %rsi
	movq	%r15, %rdi
	callq	_OPENSSL_cleanse
	movl	$1, %r14d
	jmp	LBB0_9
LBB0_2:
	xorl	%r12d, %r12d
LBB0_3:
	movq	-64(%rbp), %rsi
	movq	%r15, %rdi
	callq	_OPENSSL_cleanse
	movq	%r12, %rdi
	callq	_OPENSSL_free
LBB0_9:
	movl	8(%r13), %edi
	callq	_EVP_CIPHER_CTX_reset
	movq	(%r13), %rdi
	callq	_EVP_PKEY_CTX_free
	movq	$0, (%r13)
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	movl	%r14d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EVP_MAX_KEY_LENGTH,4,2         ## @EVP_MAX_KEY_LENGTH
	.no_dead_strip	_cms_kek_cipher
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cms_kek_cipher
_cms_kek_cipher:                        ; @cms_kek_cipher
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	sub	sp, sp, #32
	mov	x25, x5
	mov	x19, x4
	mov	x23, x3
	mov	x24, x2
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh3:
	adrp	x26, _EVP_MAX_KEY_LENGTH@GOTPAGE
Lloh4:
	ldr	x26, [x26, _EVP_MAX_KEY_LENGTH@GOTPAGEOFF]
	ldr	w8, [x26]
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x20, x9, x8
	mov	sp, x20
	ldr	w0, [x4, #8]
	bl	_EVP_CIPHER_CTX_key_length
	stur	x0, [x29, #-80]
	ldrsw	x8, [x26]
	cmp	x0, x8
	b.ls	LBB0_2
; %bb.1:
	mov	w20, #0
	b	LBB0_11
LBB0_2:
	ldr	x0, [x19]
	sub	x2, x29, #80
	mov	x1, x20
	bl	_EVP_PKEY_derive
	cmp	x0, #1
	b.lt	LBB0_8
; %bb.3:
	ldr	w0, [x19, #8]
	mov	x1, #0
	mov	x2, #0
	mov	x3, x20
	mov	x4, #0
	mov	x5, x25
	bl	_EVP_CipherInit_ex
	cbz	w0, LBB0_8
; %bb.4:
	ldr	w0, [x19, #8]
	sub	x2, x29, #84
	mov	x1, #0
	mov	x3, x24
	mov	x4, x23
	bl	_EVP_CipherUpdate
	cbz	w0, LBB0_8
; %bb.5:
	ldur	w0, [x29, #-84]
	bl	_OPENSSL_malloc
	mov	x25, x0
	cbz	x0, LBB0_9
; %bb.6:
	ldr	w0, [x19, #8]
	sub	x2, x29, #84
	mov	x1, x25
	mov	x3, x24
	mov	x4, x23
	bl	_EVP_CipherUpdate
	cbz	w0, LBB0_9
; %bb.7:
	str	x25, [x22]
	ldursw	x8, [x29, #-84]
	str	x8, [x21]
	ldur	x1, [x29, #-80]
	mov	x0, x20
	bl	_OPENSSL_cleanse
	mov	w20, #1
	b	LBB0_10
LBB0_8:
	mov	x25, #0
LBB0_9:
	ldur	x1, [x29, #-80]
	mov	x0, x20
	bl	_OPENSSL_cleanse
	mov	x0, x25
	bl	_OPENSSL_free
	mov	w20, #0
LBB0_10:
	ldr	w0, [x19, #8]
	bl	_EVP_CIPHER_CTX_reset
	ldr	x0, [x19]
	bl	_EVP_PKEY_CTX_free
	str	xzr, [x19]
LBB0_11:
	ldur	x8, [x29, #-72]
Lloh7:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh8:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.12:
	mov	x0, x20
	sub	sp, x29, #64
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_EVP_MAX_KEY_LENGTH,4,2         ; @EVP_MAX_KEY_LENGTH
	.no_dead_strip	_cms_kek_cipher
.subsections_via_symbols
