	.file	"extr_unbound-control.c_setup_ssl.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"could not SSL_new"
.LC1:
	.string	"could not SSL_set_fd"
.LC2:
	.string	"SSL handshake failed"
.LC3:
	.string	"SSL verification failed"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC4:
	.string	"Server presented no peer certificate"
	.text
	.p2align 4
	.type	setup_ssl, @function
setup_ssl:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	test	rdi, rdi
	je	.L10
	mov	ebp, esi
	call	SSL_new@PLT
	mov	r12, rax
	test	rax, rax
	je	.L13
.L3:
	mov	rdi, r12
	call	SSL_set_connect_state@PLT
	mov	esi, DWORD PTR SSL_MODE_AUTO_RETRY[rip]
	mov	rdi, r12
	call	SSL_set_mode@PLT
	mov	esi, ebp
	mov	rdi, r12
	call	SSL_set_fd@PLT
	test	eax, eax
	je	.L14
.L4:
	lea	rbp, .LC2[rip]
	.p2align 4,,10
	.p2align 3
.L5:
	xor	eax, eax
	call	ERR_clear_error@PLT
	mov	rdi, r12
	call	SSL_do_handshake@PLT
	mov	rdi, r12
	mov	esi, eax
	cmp	eax, 1
	je	.L6
	call	SSL_get_error@PLT
	cmp	DWORD PTR SSL_ERROR_WANT_READ[rip], eax
	je	.L5
	cmp	DWORD PTR SSL_ERROR_WANT_WRITE[rip], eax
	je	.L5
	mov	rdi, rbp
	call	ssl_err@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	call	SSL_get_verify_result@PLT
	cmp	rax, QWORD PTR X509_V_OK[rip]
	jne	.L15
	mov	rdi, r12
	call	SSL_get_peer_certificate@PLT
	mov	rbp, rax
	test	rax, rax
	je	.L16
.L9:
	mov	rdi, rbp
	call	X509_free@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rax, r12
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	lea	rdi, .LC3[rip]
	call	ssl_err@PLT
	mov	rdi, r12
	call	SSL_get_peer_certificate@PLT
	mov	rbp, rax
	test	rax, rax
	jne	.L9
.L16:
	lea	rdi, .LC4[rip]
	call	ssl_err@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L14:
	lea	rdi, .LC1[rip]
	call	ssl_err@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L10:
	xor	r12d, r12d
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rax, r12
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	lea	rdi, .LC0[rip]
	call	ssl_err@PLT
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	setup_ssl, .-setup_ssl
	.comm	X509_V_OK,8,8
	.comm	SSL_MODE_AUTO_RETRY,4,4
	.comm	SSL_ERROR_WANT_WRITE,4,4
	.comm	SSL_ERROR_WANT_READ,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_unbound-control.c_setup_ssl.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"could not SSL_new\000"
	.align	2
.LC1:
	.ascii	"could not SSL_set_fd\000"
	.align	2
.LC2:
	.ascii	"SSL handshake failed\000"
	.align	2
.LC3:
	.ascii	"SSL verification failed\000"
	.align	2
.LC4:
	.ascii	"Server presented no peer certificate\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	setup_ssl, %function
setup_ssl:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	subs	r4, r0, #0
	beq	.L1
	mov	r5, r1
	bl	SSL_new
	subs	r4, r0, #0
	beq	.L13
.L3:
	mov	r0, r4
	bl	SSL_set_connect_state
	ldr	r3, .L16
	mov	r0, r4
	ldr	r1, [r3]
	bl	SSL_set_mode
	mov	r1, r5
	mov	r0, r4
	bl	SSL_set_fd
	cmp	r0, #0
	beq	.L14
.L4:
	ldr	r5, .L16+4
	ldr	r6, .L16+8
	ldr	r7, .L16+12
.L5:
	bl	ERR_clear_error
	mov	r0, r4
	bl	SSL_do_handshake
	mov	r1, r0
	cmp	r1, #1
	mov	r0, r4
	beq	.L6
	bl	SSL_get_error
	ldr	r3, [r5]
	cmp	r3, r0
	beq	.L5
	ldr	r3, [r6]
	cmp	r3, r0
	beq	.L5
	mov	r0, r7
	bl	ssl_err
	b	.L5
.L6:
	bl	SSL_get_verify_result
	ldr	r3, .L16+16
	ldr	r3, [r3]
	cmp	r0, r3
	beq	.L8
	ldr	r0, .L16+20
	bl	ssl_err
.L8:
	mov	r0, r4
	bl	SSL_get_peer_certificate
	subs	r5, r0, #0
	beq	.L15
.L9:
	mov	r0, r5
	bl	X509_free
.L1:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L14:
	ldr	r0, .L16+24
	bl	ssl_err
	b	.L4
.L13:
	ldr	r0, .L16+28
	bl	ssl_err
	b	.L3
.L15:
	ldr	r0, .L16+32
	bl	ssl_err
	b	.L9
.L17:
	.align	2
.L16:
	.word	SSL_MODE_AUTO_RETRY
	.word	SSL_ERROR_WANT_READ
	.word	SSL_ERROR_WANT_WRITE
	.word	.LC2
	.word	X509_V_OK
	.word	.LC3
	.word	.LC1
	.word	.LC0
	.word	.LC4
	.size	setup_ssl, .-setup_ssl
	.comm	X509_V_OK,4,4
	.comm	SSL_MODE_AUTO_RETRY,4,4
	.comm	SSL_ERROR_WANT_WRITE,4,4
	.comm	SSL_ERROR_WANT_READ,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
