	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rsa_encrypt                    ## -- Begin function rsa_encrypt
	.p2align	4, 0x90
_rsa_encrypt:                           ## @rsa_encrypt
	.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	$120, %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, %r13
	movl	%edx, %r14d
	movq	%rsi, -144(%rbp)                ## 8-byte Spill
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	L_.str(%rip), %rsi
	movl	$3, %edi
	movq	%rbx, %rdx
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_vkprintf
	movq	$0, (%r13)
	movl	$-1, (%r15)
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	%rax, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_PEM_read_RSAPrivateKey
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_fclose
	leaq	-80(%rbp), %rdi
	leaq	-112(%rbp), %rsi
	callq	_generate_aes_key
	movq	%rbx, %rdi
	callq	_RSA_size
                                        ## kill: def $eax killed $eax def $rax
	movl	%eax, -116(%rbp)
	movq	_AES_BLOCK_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	addl	%r14d, %eax
	leal	(%rcx,%rax), %edi
	addl	$36, %edi
	movl	%edi, (%r15)
	callq	_malloc
	movq	%rax, %r12
	movq	%rax, (%r13)
	xorl	%r13d, %r13d
	leaq	-116(%rbp), %rsi
	movq	%rax, %rdi
	movl	$4, %edx
	xorl	%eax, %eax
	callq	_memcpy
	addq	$4, %r12
	movq	_RSA_PKCS1_PADDING@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	$32, %edi
	leaq	-80(%rbp), %rsi
	movq	%r12, %rdx
	movq	%rbx, %rcx
	callq	_RSA_private_encrypt
	testl	%eax, %eax
	je	LBB0_4
## %bb.6:
	movslq	-116(%rbp), %rdi
	addq	%r12, %rdi
	leaq	-112(%rbp), %rsi
	movl	$32, %edx
	xorl	%eax, %eax
	callq	_memcpy
	movq	%rbx, -136(%rbp)                ## 8-byte Spill
	leaq	-148(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_EVP_CIPHER_CTX_init
	xorl	%eax, %eax
	callq	_EVP_aes_256_cbc
	leaq	-80(%rbp), %rcx
	movq	%rbx, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	leaq	-112(%rbp), %r8
	callq	_EVP_EncryptInit_ex
	movslq	-116(%rbp), %rax
	leaq	(%r12,%rax), %rsi
	addq	$32, %rsi
	leaq	-120(%rbp), %rdx
	movq	%rbx, %rdi
	movq	-144(%rbp), %rcx                ## 8-byte Reload
	movl	%r14d, %r8d
	callq	_EVP_EncryptUpdate
	movslq	-116(%rbp), %rax
	addq	%r12, %rax
	movslq	-120(%rbp), %rcx
	leaq	(%rcx,%rax), %rsi
	addq	$32, %rsi
	leaq	-124(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_EVP_EncryptFinal_ex
	movq	%rbx, %rdi
	callq	_EVP_CIPHER_CTX_cleanup
	movl	-120(%rbp), %edx
	movl	-116(%rbp), %eax
	addl	%edx, %eax
	movl	-124(%rbp), %ecx
	leal	(%rcx,%rax), %ebx
	addl	$36, %ebx
	leaq	L_.str.5(%rip), %rsi
	movl	$3, %edi
                                        ## kill: def $ecx killed $ecx killed $rcx
	xorl	%eax, %eax
	callq	_vkprintf
	xorl	%edi, %edi
	cmpl	(%r15), %ebx
	setle	%dil
	callq	_assert
	movl	%ebx, (%r15)
	movq	-136(%rbp), %rbx                ## 8-byte Reload
	jmp	LBB0_7
LBB0_1:
	leaq	L_.str.2(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_kprintf
	movl	$-1, %r13d
	jmp	LBB0_8
LBB0_5:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_kprintf
	movq	%r12, %rdi
	callq	_fclose
	movl	$-2, %r13d
	jmp	LBB0_8
LBB0_4:
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_kprintf
	movl	$-3, %r13d
LBB0_7:
	movq	%rbx, %rdi
	callq	_RSA_free
LBB0_8:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_10
## %bb.9:
	movl	%r13d, %eax
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rsa_encrypt (private_key_name = %s, ilen = %d)\n"

L_.str.1:                               ## @.str.1
	.asciz	"rb"

L_.str.2:                               ## @.str.2
	.asciz	"Couldn't open private key file: %s\n"

L_.str.3:                               ## @.str.3
	.asciz	"PEM_read_RSAPrivateKey returns NULL.\n"

	.comm	_AES_BLOCK_SIZE,4,2             ## @AES_BLOCK_SIZE
	.comm	_RSA_PKCS1_PADDING,4,2          ## @RSA_PKCS1_PADDING
L_.str.4:                               ## @.str.4
	.asciz	"RSA_private_encrypt fail.\n"

L_.str.5:                               ## @.str.5
	.asciz	"c_len = %d, f_len = %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rsa_encrypt                    ; -- Begin function rsa_encrypt
	.p2align	2
_rsa_encrypt:                           ; @rsa_encrypt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #192
	.cfi_def_cfa_offset 192
	stp	x26, x25, [sp, #112]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #128]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #144]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #160]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #176]            ; 16-byte Folded Spill
	add	x29, sp, #176
	.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
	mov	x19, x4
	mov	x23, x3
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	stp	x0, x21, [sp]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #3
	bl	_vkprintf
	str	xzr, [x23]
	mov	w8, #-1
	str	w8, [x19]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_fopen
	cbz	x0, LBB0_4
; %bb.1:
	mov	x24, x0
	mov	x1, #0
	mov	x2, #0
	mov	x3, #0
	bl	_PEM_read_RSAPrivateKey
	cbz	x0, LBB0_5
; %bb.2:
	mov	x20, x0
	mov	x0, x24
	bl	_fclose
	add	x25, sp, #40
	add	x0, sp, #72
	add	x1, sp, #40
	bl	_generate_aes_key
	mov	x0, x20
	bl	_RSA_size
Lloh7:
	adrp	x8, _AES_BLOCK_SIZE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _AES_BLOCK_SIZE@GOTPAGEOFF]
	str	w0, [sp, #36]
Lloh9:
	ldr	w8, [x8]
	add	w9, w21, w0
	add	w8, w9, w8
	add	w0, w8, #36
	str	w0, [x19]
	bl	_malloc
	mov	x24, x0
	str	x0, [x23]
	mov	w8, #4
	add	x9, sp, #36
	stp	x9, x8, [sp]
	bl	_memcpy
	add	x23, x24, #4
Lloh10:
	adrp	x8, _RSA_PKCS1_PADDING@GOTPAGE
Lloh11:
	ldr	x8, [x8, _RSA_PKCS1_PADDING@GOTPAGEOFF]
Lloh12:
	ldr	w4, [x8]
	add	x1, sp, #72
	mov	w0, #32
	mov	x2, x23
	mov	x3, x20
	bl	_RSA_private_encrypt
	cbz	w0, LBB0_6
; %bb.3:
	ldrsw	x8, [sp, #36]
	add	x0, x23, x8
	mov	w8, #32
	stp	x25, x8, [sp]
	bl	_memcpy
	add	x0, sp, #32
	bl	_EVP_CIPHER_CTX_init
	bl	_EVP_aes_256_cbc
	mov	x1, x0
	add	x0, sp, #32
	add	x3, sp, #72
	add	x4, sp, #40
	mov	x2, #0
	bl	_EVP_EncryptInit_ex
	ldrsw	x8, [sp, #36]
	add	x8, x23, x8
	add	x1, x8, #32
	add	x0, sp, #32
	add	x2, sp, #28
	mov	x3, x22
	mov	x4, x21
	bl	_EVP_EncryptUpdate
	ldrsw	x8, [sp, #36]
	ldrsw	x9, [sp, #28]
	add	x8, x23, x8
	add	x8, x8, x9
	add	x1, x8, #32
	add	x0, sp, #32
	add	x2, sp, #24
	bl	_EVP_EncryptFinal_ex
	add	x0, sp, #32
	bl	_EVP_CIPHER_CTX_cleanup
	ldr	w8, [sp, #36]
	ldp	w10, w9, [sp, #24]
	add	w8, w8, w9
	add	w8, w8, w10
	add	w22, w8, #36
	stp	x9, x10, [sp]
Lloh13:
	adrp	x1, l_.str.5@PAGE
Lloh14:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	w0, #3
	bl	_vkprintf
	ldr	w8, [x19]
	cmp	w22, w8
	cset	w0, le
	bl	_assert
	mov	w21, #0
	str	w22, [x19]
	b	LBB0_7
LBB0_4:
	str	x20, [sp]
Lloh15:
	adrp	x0, l_.str.2@PAGE
Lloh16:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_kprintf
	mov	w21, #-1
	b	LBB0_8
LBB0_5:
Lloh17:
	adrp	x0, l_.str.3@PAGE
Lloh18:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_kprintf
	mov	x0, x24
	bl	_fclose
	mov	w21, #-2
	b	LBB0_8
LBB0_6:
Lloh19:
	adrp	x0, l_.str.4@PAGE
Lloh20:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_kprintf
	mov	w21, #-3
LBB0_7:
	mov	x0, x20
	bl	_RSA_free
LBB0_8:
	ldur	x8, [x29, #-72]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.9:
	mov	x0, x21
	ldp	x29, x30, [sp, #176]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #160]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #144]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #128]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #112]            ; 16-byte Folded Reload
	add	sp, sp, #192
	ret
LBB0_10:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rsa_encrypt (private_key_name = %s, ilen = %d)\n"

l_.str.1:                               ; @.str.1
	.asciz	"rb"

l_.str.2:                               ; @.str.2
	.asciz	"Couldn't open private key file: %s\n"

l_.str.3:                               ; @.str.3
	.asciz	"PEM_read_RSAPrivateKey returns NULL.\n"

	.comm	_AES_BLOCK_SIZE,4,2             ; @AES_BLOCK_SIZE
	.comm	_RSA_PKCS1_PADDING,4,2          ; @RSA_PKCS1_PADDING
l_.str.4:                               ; @.str.4
	.asciz	"RSA_private_encrypt fail.\n"

l_.str.5:                               ; @.str.5
	.asciz	"c_len = %d, f_len = %d\n"

.subsections_via_symbols
