	.file	"extr_ssl_rsa.c_use_certificate_chain_file.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	use_certificate_chain_file, @function
use_certificate_chain_file:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xor	eax, eax
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	call	ERR_clear_error@PLT
	test	rbx, rbx
	je	.L2
	mov	r14, QWORD PTR 8[rbx]
	mov	r15, QWORD PTR [rbx]
.L3:
	xor	eax, eax
	call	BIO_s_file@PLT
	mov	edi, eax
	call	BIO_new@PLT
	mov	rbp, rax
	test	rax, rax
	je	.L34
	mov	rsi, r12
	mov	rdi, rax
	call	BIO_read_filename@PLT
	test	rax, rax
	jle	.L35
	mov	rcx, r15
	mov	rdx, r14
	xor	esi, esi
	mov	rdi, rbp
	call	PEM_read_bio_X509_AUX@PLT
	mov	r12, rax
	test	rax, rax
	je	.L36
	mov	rsi, rax
	test	rbx, rbx
	je	.L8
	mov	rdi, rbx
	call	SSL_CTX_use_certificate@PLT
	mov	DWORD PTR 12[rsp], eax
	xor	eax, eax
	call	ERR_peek_error@PLT
	test	rax, rax
	jne	.L21
	mov	edx, DWORD PTR 12[rsp]
	test	edx, edx
	jne	.L9
.L21:
	xor	r8d, r8d
.L5:
	mov	rdi, r12
	mov	DWORD PTR [rsp], r8d
	call	X509_free@PLT
	mov	rdi, rbp
	call	BIO_free@PLT
	mov	r8d, DWORD PTR [rsp]
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	mov	eax, r8d
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	r14, QWORD PTR 8[r13]
	mov	r15, QWORD PTR 0[r13]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L35:
	mov	esi, DWORD PTR ERR_R_SYS_LIB[rip]
	mov	edi, DWORD PTR SSL_F_USE_CERTIFICATE_CHAIN_FILE[rip]
	xor	r12d, r12d
	call	SSLerr@PLT
	xor	r8d, r8d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rdi, r13
	call	SSL_use_certificate@PLT
	mov	DWORD PTR 12[rsp], eax
	xor	eax, eax
	call	ERR_peek_error@PLT
	test	rax, rax
	jne	.L21
	mov	eax, DWORD PTR 12[rsp]
	test	eax, eax
	je	.L21
	mov	rdi, r13
	call	SSL_clear_chain_certs@PLT
	mov	r8d, eax
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L9:
	mov	rdi, rbx
	call	SSL_CTX_clear_chain_certs@PLT
	mov	r8d, eax
.L13:
	test	r8d, r8d
	jne	.L14
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L39:
	mov	rdi, rbx
	call	SSL_CTX_add0_chain_cert@PLT
	mov	r9, QWORD PTR [rsp]
	mov	r8d, eax
.L16:
	test	r8d, r8d
	je	.L37
.L14:
	mov	rcx, r15
	mov	rdx, r14
	xor	esi, esi
	mov	rdi, rbp
	call	PEM_read_bio_X509@PLT
	mov	r9, rax
	test	rax, rax
	je	.L38
	mov	QWORD PTR [rsp], r9
	mov	rsi, r9
	test	rbx, rbx
	jne	.L39
	mov	rdi, r13
	call	SSL_add0_chain_cert@PLT
	mov	r9, QWORD PTR [rsp]
	mov	r8d, eax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L34:
	mov	esi, DWORD PTR ERR_R_BUF_LIB[rip]
	mov	edi, DWORD PTR SSL_F_USE_CERTIFICATE_CHAIN_FILE[rip]
	xor	r12d, r12d
	call	SSLerr@PLT
	xor	r8d, r8d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L36:
	mov	esi, DWORD PTR ERR_R_PEM_LIB[rip]
	mov	edi, DWORD PTR SSL_F_USE_CERTIFICATE_CHAIN_FILE[rip]
	call	SSLerr@PLT
	xor	r8d, r8d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L38:
	xor	eax, eax
	call	ERR_peek_last_error@PLT
	mov	rdi, rax
	mov	r13, rax
	call	ERR_GET_LIB@PLT
	xor	r8d, r8d
	cmp	rax, QWORD PTR ERR_LIB_PEM[rip]
	jne	.L5
	mov	rdi, r13
	mov	DWORD PTR [rsp], r8d
	call	ERR_GET_REASON@PLT
	cmp	rax, QWORD PTR PEM_R_NO_START_LINE[rip]
	mov	r8d, DWORD PTR [rsp]
	jne	.L5
	xor	eax, eax
	call	ERR_clear_error@PLT
	mov	r8d, DWORD PTR 12[rsp]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L37:
	mov	rdi, r9
	mov	DWORD PTR [rsp], r8d
	call	X509_free@PLT
	mov	r8d, DWORD PTR [rsp]
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	use_certificate_chain_file, .-use_certificate_chain_file
	.comm	SSL_F_USE_CERTIFICATE_CHAIN_FILE,4,4
	.comm	PEM_R_NO_START_LINE,8,8
	.comm	ERR_R_SYS_LIB,4,4
	.comm	ERR_R_PEM_LIB,4,4
	.comm	ERR_R_BUF_LIB,4,4
	.comm	ERR_LIB_PEM,8,8
	.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_ssl_rsa.c_use_certificate_chain_file.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	use_certificate_chain_file, %function
use_certificate_chain_file:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r0
	mov	r8, r1
	sub	sp, sp, #12
	mov	r5, r2
	bl	ERR_clear_error
	cmp	r4, #0
	ldrne	r9, [r4, #4]
	ldrne	r10, [r4]
	ldreq	r9, [r8, #4]
	ldreq	r10, [r8]
	bl	BIO_s_file
	bl	BIO_new
	subs	r6, r0, #0
	beq	.L25
	mov	r1, r5
	bl	BIO_read_filename
	cmp	r0, #0
	ble	.L26
	mov	r3, r10
	mov	r2, r9
	mov	r1, #0
	mov	r0, r6
	bl	PEM_read_bio_X509_AUX
	subs	r7, r0, #0
	beq	.L27
	cmp	r4, #0
	mov	r1, r7
	beq	.L8
	mov	r0, r4
	bl	SSL_CTX_use_certificate
	mov	r5, r0
	str	r0, [sp, #4]
	bl	ERR_peek_error
	subs	r5, r5, #0
	movne	r5, #1
	cmp	r0, #0
	moveq	r0, r5
	movne	r0, #0
	cmp	r0, #0
	moveq	r5, r0
	bne	.L28
.L5:
	mov	r0, r7
	bl	X509_free
	mov	r0, r6
	bl	BIO_free
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L26:
	mov	r7, #0
	ldr	r2, .L33
.L23:
	ldr	r3, .L33+4
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	SSLerr
	mov	r5, r7
	b	.L5
.L8:
	mov	r0, r8
	bl	SSL_use_certificate
	mov	r5, r0
	str	r0, [sp, #4]
	bl	ERR_peek_error
	subs	r3, r5, #0
	movne	r3, #1
	cmp	r0, #0
	movne	r3, #0
	cmp	r3, #0
	moveq	r5, r4
	beq	.L5
	mov	r0, r8
	bl	SSL_clear_chain_certs
	mov	r5, r0
	b	.L11
.L25:
	ldr	r2, .L33+8
	ldr	r3, .L33+4
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	SSLerr
	mov	r7, r6
	mov	r5, r6
	b	.L5
.L28:
	mov	r0, r4
	bl	SSL_CTX_clear_chain_certs
	mov	r5, r0
.L11:
	cmp	r5, #0
	bne	.L12
	b	.L5
.L31:
	mov	r0, r4
	bl	SSL_CTX_add0_chain_cert
	mov	r5, r0
.L14:
	cmp	r5, #0
	beq	.L29
.L12:
	mov	r3, r10
	mov	r2, r9
	mov	r1, #0
	mov	r0, r6
	bl	PEM_read_bio_X509
	subs	fp, r0, #0
	beq	.L30
	cmp	r4, #0
	mov	r1, fp
	bne	.L31
	mov	r0, r8
	bl	SSL_add0_chain_cert
	mov	r5, r0
	b	.L14
.L27:
	ldr	r2, .L33+12
	b	.L23
.L30:
	bl	ERR_peek_last_error
	mov	r4, r0
	bl	ERR_GET_LIB
	ldr	r3, .L33+16
	ldr	r3, [r3]
	cmp	r0, r3
	beq	.L32
.L17:
	mov	r5, fp
	b	.L5
.L29:
	mov	r0, fp
	bl	X509_free
	b	.L5
.L32:
	mov	r0, r4
	bl	ERR_GET_REASON
	ldr	r3, .L33+20
	ldr	r3, [r3]
	cmp	r0, r3
	bne	.L17
	bl	ERR_clear_error
	ldr	r5, [sp, #4]
	b	.L5
.L34:
	.align	2
.L33:
	.word	ERR_R_SYS_LIB
	.word	SSL_F_USE_CERTIFICATE_CHAIN_FILE
	.word	ERR_R_BUF_LIB
	.word	ERR_R_PEM_LIB
	.word	ERR_LIB_PEM
	.word	PEM_R_NO_START_LINE
	.size	use_certificate_chain_file, .-use_certificate_chain_file
	.comm	SSL_F_USE_CERTIFICATE_CHAIN_FILE,4,4
	.comm	PEM_R_NO_START_LINE,4,4
	.comm	ERR_R_SYS_LIB,4,4
	.comm	ERR_R_PEM_LIB,4,4
	.comm	ERR_R_BUF_LIB,4,4
	.comm	ERR_LIB_PEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
