// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movl %esi, %ebx
movq %rdi, %r15
cmpl $0x0, 0x40(%rdi)
je 0x31fd
pushq $0x1
popq %rdi
pushq $0x38
popq %rsi
callq 0x2120
testq %rax, %rax
je 0x3208
movq %rax, %r14
movq %r15, (%rax)
movl %ebx, 0x8(%rax)
movq 0xa0(%r15), %rcx
testq %rcx, %rcx
je 0x322a
movq %rcx, %rax
movq 0x30(%rcx), %rcx
testq %rcx, %rcx
jne 0x31eb
addq $0x30, %rax
jmp 0x3231
movq 0xb0(%r15), %rdi
pushq $0x40
jmp 0x3211
movq 0xb0(%r15), %rdi
pushq $0x21
popq %rdx
movl %ebx, %esi
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2530
leaq 0xa0(%r15), %rax
movq %r14, (%rax)
leaq 0x503d(%rip), %r13      # 0x8278
movq (%r13), %rdi
pushq $-0x1
popq %rsi
pushq $0x1
popq %rdx
callq 0x2390
movq %rax, 0x10(%r14)
testq %rax, %rax
je 0x32fb
leaq 0x105(%rip), %rsi       # 0x3363
leaq 0x1dc(%rip), %rcx       # 0x3441
movq %rax, %rdi
xorl %edx, %edx
movq %r14, %r8
callq 0x21a0
leaq 0x44(%r15), %r12
leaq 0x48(%r15), %rsi
pushq $0x2
popq %rbp
movq %rsp, %rdx
movl $0x200, %ecx            # imm = 0x200
movl %ebp, %edi
callq 0x23c0
movq 0x10(%r14), %rdi
movl %ebp, %esi
callq 0x23d0
cmpw $0xa, 0x44(%r15)
pushq $0x1c
popq %rax
pushq $0x10
popq %rdx
cmovel %eax, %edx
movq 0x10(%r14), %rdi
movq %r12, %rsi
callq 0x2210
testl %eax, %eax
js 0x3325
movq 0x10(%r14), %rdi
pushq $0x2
popq %rsi
movl $0x1000, %ecx           # imm = 0x1000
xorl %edx, %edx
callq 0x2050
movq (%r13), %rdi
leaq 0x21c(%rip), %rcx       # 0x34f0
pushq $-0x1
popq %rsi
xorl %edx, %edx
movq %r14, %r8
callq 0x2180
movq %rax, 0x18(%r14)
testq %rax, %rax
je 0x3338
leaq 0x4fb7(%rip), %rsi      # 0x82a8
movq %rax, %rdi
callq 0x20b0
jmp 0x3351
movq 0xb0(%r15), %rdi
pushq $0x21
popq %rdx
movl %ebx, %esi
callq 0x2530
movq %r14, %rdi
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3131
movq 0xb0(%r15), %rdi
pushq $0x21
popq %rdx
movl %ebx, %esi
callq 0x2530
jmp 0x3351
movq 0xb0(%r15), %rdi
pushq $0x21
popq %rdx
movl %ebx, %esi
callq 0x2530
movq %r14, %rdi
callq 0x3131
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq