// File: /workspace/github_c_makefile_star2_O1/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 0x35f1(%rip), %rdi      # 0xa14c
movl $0x400, %esi            # imm = 0x400
callq 0x4480
testl %eax, %eax
jg 0x6b83
leaq 0x35e9(%rip), %rsi      # 0xa159
leaq 0x35fe(%rip), %rdx      # 0xa175
movl $0x26, %edi
xorl %eax, %eax
callq 0x591f
callq 0x4210
movq %rax, %rdi
callq 0x4670
movq %rax, 0x7c51(%rip)      # 0xe7e8
testq %rax, %rax
je 0x6d04
movl $0x1, %edx
movq %rax, %rdi
movl $0x21, %esi
xorl %ecx, %ecx
callq 0x43b0
movq 0x7c2d(%rip), %rdi      # 0xe7e8
movl $0x2, %edx
movl $0x21, %esi
xorl %ecx, %ecx
callq 0x43b0
movq 0x7c15(%rip), %rdi      # 0xe7e8
movl $0x4, %edx
movl $0x21, %esi
xorl %ecx, %ecx
callq 0x43b0
movq 0x7bfd(%rip), %rdi      # 0xe7e8
movl $0x10, %edx
movl $0x21, %esi
xorl %ecx, %ecx
callq 0x43b0
movq 0x7be5(%rip), %rdi      # 0xe7e8
xorl %esi, %esi
callq 0x47c0
movq 0x7bd7(%rip), %rdi      # 0xe7e8
movl $0x2000000, %esi        # imm = 0x2000000
callq 0x47c0
movq 0x7bc6(%rip), %rdi      # 0xe7e8
movl $0x303, %edx            # imm = 0x303
movl $0x7b, %esi
xorl %ecx, %ecx
callq 0x43b0
testq %rax, %rax
jne 0x6c4f
leaq 0x3611(%rip), %rsi      # 0xa250
leaq 0x35f3(%rip), %rdx      # 0xa239
xorl %edi, %edi
xorl %eax, %eax
callq 0x591f
movq 0x7b92(%rip), %rdi      # 0xe7e8
callq 0x44a0
testl %eax, %eax
jne 0x6c79
leaq 0x351c(%rip), %rsi      # 0xa182
leaq 0x3508(%rip), %rdx      # 0xa175
movl $0x26, %edi
xorl %eax, %eax
callq 0x591f
movq 0x7b68(%rip), %rdi      # 0xe7e8
leaq 0x97(%rip), %rdx        # 0x6d1e
movl $0x1, %esi
callq 0x40e0
movq 0x7b50(%rip), %rdi      # 0xe7e8
movl $0x4, %esi
callq 0x4330
movq 0x7b3f(%rip), %rdi      # 0xe7e8
leaq 0x363d(%rip), %rsi      # 0xa2ed
callq 0x43e0
testl %eax, %eax
jne 0x6cd3
leaq 0x34f5(%rip), %rsi      # 0xa1b5
leaq 0x34ae(%rip), %rdx      # 0xa175
movl $0x16, %edi
xorl %eax, %eax
callq 0x591f
leaq -0x74a(%rip), %rax      # 0x6590
leaq 0x775f(%rip), %rcx      # 0xe440
movq %rax, (%rcx)
leaq -0x4cf(%rip), %rax      # 0x681c
leaq 0x7756(%rip), %rcx      # 0xe448
movq %rax, (%rcx)
leaq 0x34cf(%rip), %rdi      # 0xa1cb
xorl %eax, %eax
popq %rcx
jmp 0x588a
leaq 0x3504(%rip), %rsi      # 0xa20f
leaq 0x3527(%rip), %rdx      # 0xa239
movl $0xc, %edi
xorl %eax, %eax
callq 0x563c