	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kek_unwrap_key
_kek_unwrap_key:                        ## @kek_unwrap_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r15
	movq	%rcx, %rbx
	movq	%rdx, %r12
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	%r8, %rdi
	callq	_EVP_CIPHER_CTX_block_size
	movq	%rbx, %rsi
	leaq	(%rax,%rax), %rdi
	xorl	%ecx, %ecx
	cmpq	%rbx, %rdi
	ja	LBB0_19
## %bb.1:
	movq	%rax, %rbx
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movq	%r13, -88(%rbp)                 ## 8-byte Spill
	movq	%r14, -96(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rax
	orq	%rbx, %rax
	shrq	$32, %rax
	je	LBB0_2
## %bb.3:
	movq	%rsi, %rax
	xorl	%edx, %edx
	divq	%rbx
	jmp	LBB0_4
LBB0_2:
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	%ebx
                                        ## kill: def $edx killed $edx def $rdx
LBB0_4:
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	testq	%rdx, %rdx
	jne	LBB0_19
## %bb.5:
	movq	%rdi, %r13
	movq	%rsi, %r14
	movq	%rsi, %rdi
	callq	_OPENSSL_malloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	leaq	(%rax,%r14), %rsi
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movq	%r13, %r8
	subq	%r13, %rsi
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	leaq	(%r12,%r14), %rcx
	subq	%r13, %rcx
	leaq	-44(%rbp), %rdx
	movq	%rax, %r13
	movq	%r15, %r14
	movq	%r15, %rdi
	callq	_EVP_DecryptUpdate
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	xorl	%eax, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	subq	%rbx, %rcx
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	movq	%r13, %rsi
	movq	%rbx, %r8
	callq	_EVP_DecryptUpdate
	testl	%eax, %eax
	je	LBB0_10
## %bb.11:
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	subq	%rbx, %r8
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	movq	%r13, %r15
	movq	%r13, %rsi
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	callq	_EVP_DecryptUpdate
	testl	%eax, %eax
	je	LBB0_18
## %bb.12:
	xorl	%eax, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_EVP_DecryptInit_ex
	testl	%eax, %eax
	je	LBB0_18
## %bb.13:
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	movq	%r15, %r14
	movq	%r15, %rsi
	movq	%r15, %rcx
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	callq	_EVP_DecryptUpdate
	testl	%eax, %eax
	je	LBB0_18
## %bb.14:
	movb	4(%r14), %al
	xorb	1(%r14), %al
	movzwl	5(%r14), %ecx
	xorw	2(%r14), %cx
	movl	%ecx, %edx
	andb	%al, %dl
	shrl	$8, %ecx
	andb	%dl, %cl
	cmpb	$-1, %cl
	jne	LBB0_18
## %bb.15:
	movzbl	(%r14), %edx
	leaq	-4(%rdx), %rax
	cmpq	-64(%rbp), %rax                 ## 8-byte Folded Reload
	ja	LBB0_18
## %bb.16:
	movq	%r15, %rsi
	addq	$4, %rsi
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	%rdx, (%rax)
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	callq	_memcpy
	movl	$1, %eax
	jmp	LBB0_17
LBB0_6:
	movq	_CMS_F_KEK_UNWRAP_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ERR_R_MALLOC_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_CMSerr
	xorl	%ecx, %ecx
	jmp	LBB0_19
LBB0_8:
	movq	%r13, %r15
	xorl	%eax, %eax
LBB0_17:
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_18
LBB0_10:
	movq	%r13, %r15
LBB0_18:
	movq	%r15, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_OPENSSL_clear_free
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
LBB0_19:
	movl	%ecx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CMS_F_KEK_UNWRAP_KEY,4,2       ## @CMS_F_KEK_UNWRAP_KEY
	.comm	_ERR_R_MALLOC_FAILURE,4,2       ## @ERR_R_MALLOC_FAILURE
	.no_dead_strip	_kek_unwrap_key
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kek_unwrap_key
_kek_unwrap_key:                        ; @kek_unwrap_key
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x23, x4
	mov	x19, x3
	mov	x24, x2
	mov	x22, x1
	mov	x21, x0
	mov	x0, x4
	bl	_EVP_CIPHER_CTX_block_size
	lsl	x26, x0, #1
	cmp	x26, x19
	b.hi	LBB0_2
; %bb.1:
	mov	x25, x0
	udiv	x8, x19, x0
	msub	x8, x8, x0, x19
	cbz	x8, LBB0_4
LBB0_2:
	mov	w21, #0
LBB0_3:
	mov	x0, x21
	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
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_4:
	mov	x0, x19
	bl	_OPENSSL_malloc
	cbz	x0, LBB0_14
; %bb.5:
	mov	x20, x0
	add	x27, x0, x19
	sub	x1, x27, x26
	add	x8, x24, x19
	sub	x3, x8, x26
	add	x2, sp, #12
	mov	x0, x23
	mov	x4, x26
	bl	_EVP_DecryptUpdate
	cbz	w0, LBB0_12
; %bb.6:
	sub	x3, x27, x25
	add	x2, sp, #12
	mov	x0, x23
	mov	x1, x20
	mov	x4, x25
	bl	_EVP_DecryptUpdate
	cbz	w0, LBB0_12
; %bb.7:
	sub	x4, x19, x25
	add	x2, sp, #12
	mov	x0, x23
	mov	x1, x20
	mov	x3, x24
	bl	_EVP_DecryptUpdate
	cbz	w0, LBB0_12
; %bb.8:
	mov	x0, x23
	mov	x1, #0
	mov	x2, #0
	mov	x3, #0
	mov	x4, #0
	bl	_EVP_DecryptInit_ex
	cbz	w0, LBB0_12
; %bb.9:
	add	x2, sp, #12
	mov	x0, x23
	mov	x1, x20
	mov	x3, x20
	mov	x4, x19
	bl	_EVP_DecryptUpdate
	cbz	w0, LBB0_12
; %bb.10:
	mov	x1, x20
	ldrb	w8, [x1, #4]!
	ldurb	w9, [x1, #-3]
	eor	w8, w8, w9
	ldurb	w9, [x1, #-2]
	ldrb	w10, [x1, #1]
	eor	w9, w10, w9
	and	w8, w9, w8
	ldurb	w9, [x1, #-1]
	ldrb	w10, [x1, #2]
	eor	w9, w10, w9
	and	w8, w8, w9
	cmp	w8, #255
	b.ne	LBB0_12
; %bb.11:
	ldrb	w2, [x20]
	sub	x8, x2, #4
	cmp	x8, x19
	b.ls	LBB0_15
LBB0_12:
	mov	w21, #0
LBB0_13:
	mov	x0, x20
	mov	x1, x19
	bl	_OPENSSL_clear_free
	b	LBB0_3
LBB0_14:
Lloh0:
	adrp	x8, _CMS_F_KEK_UNWRAP_KEY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CMS_F_KEK_UNWRAP_KEY@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _ERR_R_MALLOC_FAILURE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ERR_R_MALLOC_FAILURE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_CMSerr
	mov	w21, #0
	b	LBB0_3
LBB0_15:
	str	x2, [x22]
	mov	x0, x21
	bl	_memcpy
	mov	w21, #1
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_CMS_F_KEK_UNWRAP_KEY,4,2       ; @CMS_F_KEK_UNWRAP_KEY
	.comm	_ERR_R_MALLOC_FAILURE,4,2       ; @ERR_R_MALLOC_FAILURE
	.no_dead_strip	_kek_unwrap_key
.subsections_via_symbols
