// File: /workspace/github_c_makefile_star2_O0/xiaowenhuyuehu[P]remote_access/src/connectivity/ws_nopoll.c
// Function: ws_nopoll_listener
noPollConn *ws_nopoll_listener(const int debug_on, const char *host, const char *port, const int tls_on, const char *server_crt, const char *private_key)
{
    noPollCtx  *ctx = NULL;
	noPollConn *listener = NULL;
    nopoll_bool debug = (nopoll_bool)debug_on;

    if (NULL == host || NULL == port) {
        log_debug("host or port is NULL ");
        return NULL;
    }

    /* create context */
    ctx = nopoll_ctx_new ();
    nopoll_log_enable (ctx, debug);
    nopoll_log_color_enable (ctx, debug);

    if (1 == tls_on) {
    	/* now start a TLS version */
    	listener = nopoll_listener_tls_new (ctx, host, port);
    	if (!nopoll_conn_is_ok (listener)) {
    		log_debug("ERROR: Expected to find proper listener TLS connection status, but found.. ");
    		nopoll_ctx_unref(ctx);
    		return NULL;
    	}

    	/* configure certificates to be used by this listener */
    	if (!nopoll_listener_set_certificate (listener, server_crt, private_key, NULL)) {
    		log_debug("ERROR: unable to configure certificates for TLS websocket.. ");
            nopoll_conn_close (listener);
            nopoll_ctx_unref(ctx);
    		return NULL;
    	}

    	/* register certificates at context level */
    	if (! nopoll_ctx_set_certificate (ctx, NULL, server_crt, private_key, NULL)) {
    		log_debug("ERROR: unable to setup certificates at context level.. ");
            nopoll_conn_close (listener);
            nopoll_ctx_unref(ctx);
    		return NULL;
    	}
	} else {
        listener = nopoll_listener_new (ctx, host, port);
        if (!nopoll_conn_is_ok (listener)) {
            log_debug ("ERROR: Expected to find proper listener connection status, but found.. ");
    		nopoll_ctx_unref(ctx);
            return NULL;
        }
	}

    return listener;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x4c(%rbp)
xorl %eax, %eax
cmpq -0x18(%rbp), %rax
je 0x3254
xorl %eax, %eax
cmpq -0x20(%rbp), %rax
jne 0x3284
xorl %edi, %edi
leaq 0x7da7(%rip), %rsi      # 0xb004
leaq 0x7ddc(%rip), %rdx      # 0xb040
movl $0xa5, %ecx
leaq 0x7e39(%rip), %r8       # 0xb0a9
movb $0x0, %al
callq 0x4f90
movq $0x0, -0x8(%rbp)
jmp 0x342d
callq 0x24d0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movl -0x4c(%rbp), %esi
callq 0x22d0
movq -0x40(%rbp), %rdi
movl -0x4c(%rbp), %esi
callq 0x2370
movl $0x1, %eax
cmpl -0x24(%rbp), %eax
jne 0x33ca
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x25f0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
callq 0x2310
cmpl $0x0, %eax
jne 0x330f
xorl %edi, %edi
leaq 0x7d25(%rip), %rsi      # 0xb004
leaq 0x7d5a(%rip), %rdx      # 0xb040
movl $0xb2, %ecx
leaq 0x7ed5(%rip), %r8       # 0xb1c7
movb $0x0, %al
callq 0x4f90
movq -0x40(%rbp), %rdi
callq 0x25d0
movq $0x0, -0x8(%rbp)
jmp 0x342d
movq -0x48(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x2400
cmpl $0x0, %eax
jne 0x336b
xorl %edi, %edi
leaq 0x7cd2(%rip), %rsi      # 0xb004
leaq 0x7d07(%rip), %rdx      # 0xb040
movl $0xb9, %ecx
leaq 0x7ece(%rip), %r8       # 0xb213
movb $0x0, %al
callq 0x4f90
movq -0x48(%rbp), %rdi
callq 0x2060
movq -0x40(%rbp), %rdi
callq 0x25d0
movq $0x0, -0x8(%rbp)
jmp 0x342d
movq -0x40(%rbp), %rdi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
movq %r8, %rsi
callq 0x2210
cmpl $0x0, %eax
jne 0x33c8
xorl %edi, %edi
leaq 0x7c72(%rip), %rsi      # 0xb004
leaq 0x7ca7(%rip), %rdx      # 0xb040
movl $0xc1, %ecx
leaq 0x7eab(%rip), %r8       # 0xb250
movb $0x0, %al
callq 0x4f90
movq -0x48(%rbp), %rdi
callq 0x2060
movq -0x40(%rbp), %rdi
callq 0x25d0
movq $0x0, -0x8(%rbp)
jmp 0x342d
jmp 0x3425
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x2440
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
callq 0x2310
cmpl $0x0, %eax
jne 0x3423
xorl %edi, %edi
leaq 0x7c0e(%rip), %rsi      # 0xb004
leaq 0x7c43(%rip), %rdx      # 0xb040
movl $0xc9, %ecx
leaq 0x7e7f(%rip), %r8       # 0xb288
movb $0x0, %al
callq 0x4f90
movq -0x40(%rbp), %rdi
callq 0x25d0
movq $0x0, -0x8(%rbp)
jmp 0x342d
jmp 0x3425
movq -0x48(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)