// File: /workspace/github_c_makefile_star2_O3/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 %rax
movl $0x200002, %edi         # imm = 0x200002
xorl %esi, %esi
callq 0x4390
xorl %edi, %edi
xorl %esi, %esi
callq 0x4390
leaq 0x36c2(%rip), %rdi      # 0xa14c
movl $0x400, %esi            # imm = 0x400
callq 0x4480
testl %eax, %eax
jg 0x6ab2
leaq 0x36ba(%rip), %rsi      # 0xa159
leaq 0x36cf(%rip), %rdx      # 0xa175
movl $0x26, %edi
xorl %eax, %eax
callq 0x588f
callq 0x4210
movq %rax, %rdi
callq 0x4670
movq %rax, 0x7d22(%rip)      # 0xe7e8
testq %rax, %rax
je 0x6c33
movl $0x1, %edx
movq %rax, %rdi
movl $0x21, %esi
xorl %ecx, %ecx
callq 0x43b0
movq 0x7cfe(%rip), %rdi      # 0xe7e8
movl $0x2, %edx
movl $0x21, %esi
xorl %ecx, %ecx
callq 0x43b0
movq 0x7ce6(%rip), %rdi      # 0xe7e8
movl $0x4, %edx
movl $0x21, %esi
xorl %ecx, %ecx
callq 0x43b0
movq 0x7cce(%rip), %rdi      # 0xe7e8
movl $0x10, %edx
movl $0x21, %esi
xorl %ecx, %ecx
callq 0x43b0
movq 0x7cb6(%rip), %rdi      # 0xe7e8
xorl %esi, %esi
callq 0x47c0
movq 0x7ca8(%rip), %rdi      # 0xe7e8
movl $0x2000000, %esi        # imm = 0x2000000
callq 0x47c0
movq 0x7c97(%rip), %rdi      # 0xe7e8
movl $0x303, %edx            # imm = 0x303
movl $0x7b, %esi
xorl %ecx, %ecx
callq 0x43b0
testq %rax, %rax
jne 0x6b7e
leaq 0x36e2(%rip), %rsi      # 0xa250
leaq 0x36c4(%rip), %rdx      # 0xa239
xorl %edi, %edi
xorl %eax, %eax
callq 0x588f
movq 0x7c63(%rip), %rdi      # 0xe7e8
callq 0x44a0
testl %eax, %eax
jne 0x6ba8
leaq 0x35ed(%rip), %rsi      # 0xa182
leaq 0x35d9(%rip), %rdx      # 0xa175
movl $0x26, %edi
xorl %eax, %eax
callq 0x588f
movq 0x7c39(%rip), %rdi      # 0xe7e8
leaq 0x97(%rip), %rdx        # 0x6c4d
movl $0x1, %esi
callq 0x40e0
movq 0x7c21(%rip), %rdi      # 0xe7e8
movl $0x4, %esi
callq 0x4330
movq 0x7c10(%rip), %rdi      # 0xe7e8
leaq 0x370e(%rip), %rsi      # 0xa2ed
callq 0x43e0
testl %eax, %eax
jne 0x6c02
leaq 0x35c6(%rip), %rsi      # 0xa1b5
leaq 0x357f(%rip), %rdx      # 0xa175
movl $0x16, %edi
xorl %eax, %eax
callq 0x588f
leaq -0x729(%rip), %rax      # 0x64e0
leaq 0x7830(%rip), %rcx      # 0xe440
movq %rax, (%rcx)
leaq -0x4cf(%rip), %rax      # 0x674b
leaq 0x7827(%rip), %rcx      # 0xe448
movq %rax, (%rcx)
leaq 0x35a0(%rip), %rdi      # 0xa1cb
xorl %eax, %eax
popq %rcx
jmp 0x57fa
leaq 0x35d5(%rip), %rsi      # 0xa20f
leaq 0x35f8(%rip), %rdx      # 0xa239
movl $0xc, %edi
xorl %eax, %eax
callq 0x55ac