	.file	"extr_crypto.c_hx509_crypto_set_random_key.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	hx509_crypto_set_random_key
	.type	hx509_crypto_set_random_key, @function
hx509_crypto_set_random_key:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	mov	rdi, QWORD PTR 8[rdi]
	test	rdi, rdi
	je	.L2
	call	free@PLT
	mov	QWORD PTR 0[rbp], 0
.L2:
	mov	edi, DWORD PTR 16[rbp]
	call	EVP_CIPHER_key_length@PLT
	mov	QWORD PTR 0[rbp], rax
	mov	rdi, rax
	mov	r12, rax
	call	malloc@PLT
	mov	QWORD PTR 8[rbp], rax
	mov	rdi, rax
	test	rax, rax
	je	.L12
	mov	rsi, r12
	call	RAND_bytes@PLT
	test	rax, rax
	jle	.L13
	test	r13, r13
	je	.L6
	mov	rsi, r13
	mov	rdi, rbp
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	jmp	der_copy_octet_string@PLT
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	xor	eax, eax
.L1:
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	mov	rdi, QWORD PTR 8[rbp]
	call	free@PLT
	mov	QWORD PTR 8[rbp], 0
	mov	eax, DWORD PTR HX509_CRYPTO_INTERNAL_ERROR[rip]
	mov	QWORD PTR 0[rbp], 0
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
.L12:
	.cfi_restore_state
	mov	QWORD PTR 0[rbp], 0
	mov	eax, DWORD PTR ENOMEM[rip]
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	hx509_crypto_set_random_key, .-hx509_crypto_set_random_key
	.comm	HX509_CRYPTO_INTERNAL_ERROR,4,4
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_crypto.c_hx509_crypto_set_random_key.c"
	.text
	.align	2
	.global	hx509_crypto_set_random_key
	.syntax unified
	.arm
	.fpu softvfp
	.type	hx509_crypto_set_random_key, %function
hx509_crypto_set_random_key:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r4, r0
	ldr	r0, [r0, #4]
	mov	r5, r1
	cmp	r0, #0
	beq	.L2
	bl	free
	mov	r3, #0
	str	r3, [r4]
.L2:
	ldr	r0, [r4, #8]
	bl	EVP_CIPHER_key_length
	str	r0, [r4]
	mov	r6, r0
	bl	malloc
	cmp	r0, #0
	str	r0, [r4, #4]
	beq	.L12
	mov	r1, r6
	bl	RAND_bytes
	cmp	r0, #0
	ble	.L13
	cmp	r5, #0
	beq	.L6
	mov	r1, r5
	mov	r0, r4
	pop	{r4, r5, r6, lr}
	b	der_copy_octet_string
.L6:
	mov	r0, r5
	pop	{r4, r5, r6, pc}
.L13:
	ldr	r0, [r4, #4]
	bl	free
	mov	r3, #0
	ldr	r2, .L14
	str	r3, [r4, #4]
	ldr	r0, [r2]
	str	r3, [r4]
	pop	{r4, r5, r6, pc}
.L12:
	ldr	r2, .L14+4
	str	r0, [r4]
	ldr	r0, [r2]
	pop	{r4, r5, r6, pc}
.L15:
	.align	2
.L14:
	.word	HX509_CRYPTO_INTERNAL_ERROR
	.word	ENOMEM
	.size	hx509_crypto_set_random_key, .-hx509_crypto_set_random_key
	.comm	HX509_CRYPTO_INTERNAL_ERROR,4,4
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
