// File: /workspace/github_c_makefile_star2_O2/uhlin[P]enhanced-duc/source/network-openssl.c
// Function: net_ssl_init
void
net_ssl_init(void)
{
	SSL_load_error_strings();
	(void) SSL_library_init();

	if (RAND_load_file("/dev/urandom", 1024) <= 0)
		log_warn(ENOSYS, "%s: error seeding the prng!", __func__);

#if OPENSSL_VERSION_NUMBER >= 0x10100000L
	create_ssl_context_obj();
#else
#pragma message("Consider updating your TLS/SSL library")
	create_ssl_context_obj_insecure();
#endif

	if (!SSL_CTX_set_default_verify_paths(ssl_ctx)) {
		log_warn(ENOSYS, "%s: error loading default ca file and/or "
		    "directory", __func__);
	}

	SSL_CTX_set_verify(ssl_ctx, SSL_VERIFY_PEER, verify_callback);
	SSL_CTX_set_verify_depth(ssl_ctx, 4);

	if (!SSL_CTX_set_cipher_list(ssl_ctx, cipher_list))
		log_warn(EINVAL, "%s: bogus cipher list", __func__);

	net_send = net_ssl_send;
	net_recv = net_ssl_recv;

	log_msg("TLS/SSL enabled");
}

// Assembly:
pushq %rbx
movl $0x200002, %edi         # imm = 0x200002
xorl %esi, %esi
callq 0x4390
xorl %edi, %edi
xorl %esi, %esi
callq 0x4390
leaq 0x378e(%rip), %rdi      # 0xa16c
movl $0x400, %esi            # imm = 0x400
callq 0x4480
testl %eax, %eax
jg 0x6a04
leaq 0x3786(%rip), %rsi      # 0xa179
leaq 0x379b(%rip), %rdx      # 0xa195
pushq $0x26
popq %rdi
xorl %eax, %eax
callq 0x57ea
callq 0x4210
movq %rax, %rdi
callq 0x4660
movq %rax, 0x7dd0(%rip)      # 0xe7e8
testq %rax, %rax
je 0x6b6a
pushq $0x21
popq %rbx
pushq $0x1
popq %rdx
movq %rax, %rdi
movl %ebx, %esi
xorl %ecx, %ecx
callq 0x43b0
movq 0x7dae(%rip), %rdi      # 0xe7e8
pushq $0x2
popq %rdx
movl %ebx, %esi
xorl %ecx, %ecx
callq 0x43b0
movq 0x7d9b(%rip), %rdi      # 0xe7e8
pushq $0x4
popq %rdx
movl %ebx, %esi
xorl %ecx, %ecx
callq 0x43b0
movq 0x7d88(%rip), %rdi      # 0xe7e8
pushq $0x10
popq %rdx
movl %ebx, %esi
xorl %ecx, %ecx
callq 0x43b0
movq 0x7d75(%rip), %rdi      # 0xe7e8
xorl %esi, %esi
callq 0x47b0
movq 0x7d67(%rip), %rdi      # 0xe7e8
movl $0x2000000, %esi        # imm = 0x2000000
callq 0x47b0
movq 0x7d56(%rip), %rdi      # 0xe7e8
pushq $0x7b
popq %rsi
movl $0x303, %edx            # imm = 0x303
xorl %ecx, %ecx
callq 0x43b0
testq %rax, %rax
jne 0x6abd
leaq 0x37de(%rip), %rsi      # 0xa28b
leaq 0x37c0(%rip), %rdx      # 0xa274
xorl %edi, %edi
xorl %eax, %eax
callq 0x57ea
movq 0x7d24(%rip), %rdi      # 0xe7e8
callq 0x44a0
testl %eax, %eax
jne 0x6ae5
leaq 0x36ce(%rip), %rsi      # 0xa1a2
leaq 0x36ba(%rip), %rdx      # 0xa195
pushq $0x26
popq %rdi
xorl %eax, %eax
callq 0x57ea
movq 0x7cfc(%rip), %rdi      # 0xe7e8
leaq 0x8f(%rip), %rdx        # 0x6b82
pushq $0x1
popq %rsi
callq 0x40e0
movq 0x7ce6(%rip), %rdi      # 0xe7e8
pushq $0x4
popq %rsi
callq 0x4330
movq 0x7cd7(%rip), %rdi      # 0xe7e8
leaq 0x3810(%rip), %rsi      # 0xa328
callq 0x43e0
testl %eax, %eax
jne 0x6b39
leaq 0x36ad(%rip), %rsi      # 0xa1d5
leaq 0x3666(%rip), %rdx      # 0xa195
pushq $0x16
popq %rdi
xorl %eax, %eax
callq 0x57ea
leaq -0x6d2(%rip), %rax      # 0x646e
leaq 0x78f9(%rip), %rcx      # 0xe440
movq %rax, (%rcx)
leaq -0x45a(%rip), %rax      # 0x66f7
leaq 0x78f0(%rip), %rcx      # 0xe448
movq %rax, (%rcx)
leaq 0x3689(%rip), %rdi      # 0xa1eb
xorl %eax, %eax
popq %rbx
jmp 0x5757
leaq 0x36d9(%rip), %rsi      # 0xa24a
leaq 0x36fc(%rip), %rdx      # 0xa274
pushq $0xc
popq %rdi
xorl %eax, %eax
callq 0x5513