// File: /workspace/github_c_makefile_star2_O3/martintopholm[P]xping/http.c
// Function: probe_send
void probe_send(struct probe *prb, int seq)
{
	struct session *session;
	char buf[512];
	int salen;

	if (!prb->resolved) {
		target_mark(prb->owner, seq, '@');
		return;
	}
	session = calloc(1, sizeof(*session));
	if (session == NULL) {
		target_mark(prb->owner, seq, '!');
		return;
	}
	session->prb = prb;
	session->seq = seq;
	LL_APPEND(prb->sessions, session);
#ifdef WITH_SSL
	if (prb->ssl_ctx != NULL) {
		session->ssl = SSL_new(prb->ssl_ctx);
		if (session->ssl == NULL) {
			target_mark(prb->owner, seq, '!');
			session_free(session);
			return;
		}
		session->bev = bufferevent_openssl_socket_new(ev_base, -1,
		    session->ssl, BUFFEREVENT_SSL_CONNECTING,
		    BEV_OPT_DEFER_CALLBACKS | BEV_OPT_CLOSE_ON_FREE);
	} else {
		session->bev = bufferevent_socket_new(ev_base, -1,
		    BEV_OPT_CLOSE_ON_FREE);
	}
#else /* !WITH_SSL */
	session->bev = bufferevent_socket_new(ev_base, -1,
	    BEV_OPT_CLOSE_ON_FREE);
#endif
	if (session->bev == NULL) {
		target_mark(prb->owner, seq, '!');
		session_free(session);
		return;
	}
	bufferevent_setcb(session->bev, session_readcb_status, NULL,
	    session_eventcb, session);
	evutil_inet_ntop(AF_INET, &sin(prb)->sin_addr, buf, sizeof(buf));
	bufferevent_enable(session->bev, EV_READ);
	salen = sa(prb)->sa_family == AF_INET6 ? sizeof(struct sockaddr_in6) :
	    sizeof(struct sockaddr_in);
	if (bufferevent_socket_connect(session->bev, sa(prb), salen) < 0) {
		target_mark(prb->owner, seq, '!');
		return;
	}
	bufferevent_setwatermark(session->bev, EV_READ, 0, 4096);

	session->ev_timeout = event_new(ev_base, -1, 0, session_timeout,
	    session);
	if (session->ev_timeout == NULL) {
		target_mark(prb->owner, seq, '!');
		session_free(session);
		return;
	}
	event_add(session->ev_timeout, &tv_timeout);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movl %esi, %ebx
movq %rdi, %r15
cmpl $0x0, 0x40(%rdi)
je 0x3471
movl $0x1, %edi
movl $0x38, %esi
callq 0x2120
testq %rax, %rax
je 0x3481
movq %rax, %r14
movq %r15, (%rax)
movl %ebx, 0x8(%rax)
movq 0xa0(%r15), %rcx
testq %rcx, %rcx
je 0x34a4
movq %rcx, %rax
movq 0x30(%rcx), %rcx
testq %rcx, %rcx
jne 0x345f
addq $0x30, %rax
jmp 0x34ab
movq 0xb0(%r15), %rdi
movl %ebx, %esi
movl $0x40, %edx
jmp 0x348f
movq 0xb0(%r15), %rdi
movl %ebx, %esi
movl $0x21, %edx
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x25f4
leaq 0xa0(%r15), %rax
movq %r14, (%rax)
leaq 0x3dc3(%rip), %r13      # 0x7278
movq (%r13), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x1, %edx
callq 0x2390
movq %rax, 0x10(%r14)
testq %rax, %rax
je 0x3584
leaq 0x114(%rip), %rsi       # 0x35f0
leaq 0x205(%rip), %rcx       # 0x36e8
movq %rax, %rdi
xorl %edx, %edx
movq %r14, %r8
callq 0x21a0
leaq 0x44(%r15), %r12
leaq 0x48(%r15), %rsi
movq %rsp, %rdx
movl $0x200, %ecx            # imm = 0x200
movl $0x2, %edi
callq 0x23c0
movq 0x10(%r14), %rdi
movl $0x2, %esi
callq 0x23d0
cmpw $0xa, 0x44(%r15)
movl $0x1c, %eax
movl $0x10, %edx
cmovel %eax, %edx
movq 0x10(%r14), %rdi
movq %r12, %rsi
callq 0x2210
testl %eax, %eax
js 0x35af
movq 0x10(%r14), %rdi
movl $0x1000, %ecx           # imm = 0x1000
movl $0x2, %esi
xorl %edx, %edx
callq 0x2050
movq (%r13), %rdi
leaq 0x24b(%rip), %rcx       # 0x37a6
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
movq %r14, %r8
callq 0x2180
movq %rax, 0x18(%r14)
testq %rax, %rax
je 0x35c4
leaq 0x3d2e(%rip), %rsi      # 0x72a8
movq %rax, %rdi
callq 0x20b0
jmp 0x35df
movq 0xb0(%r15), %rdi
movl %ebx, %esi
movl $0x21, %edx
callq 0x25f4
movq %r14, %rdi
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x339b
movq 0xb0(%r15), %rdi
movl %ebx, %esi
movl $0x21, %edx
callq 0x25f4
jmp 0x35df
movq 0xb0(%r15), %rdi
movl %ebx, %esi
movl $0x21, %edx
callq 0x25f4
movq %r14, %rdi
callq 0x339b
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq