// File: /workspace/github_c_makefile_star2_O3/martintopholm[P]xping/icmp-unpriv.c
// Function: probe_send
void
probe_send(struct probe *prb, int seq)
{
	int pair[2];
	pid_t pid;

	if (!prb->resolved) {
		target_mark(prb->owner, seq, '@');
		return;
	}

	/* Save most recent sequence number to close gap between
	 * probe_send returning (target_probe increasing npkts) and forked
	 * program outputting */
	prb->seqlast = seq;

	/* Clear ahead to avoid overwriting a result in case of small
	 * timing indiscrepancies */
	target_mark(prb->owner, seq+1, ' ');

	/* If we have a cached early mark, send it right away. */
	if (prb->early_mark != '\0') {
		target_mark(prb->owner, seq, prb->early_mark);
		prb->early_mark = '\0';
	}

	/* Check for existing ping process */
	if (prb->pid && kill(prb->pid, 0) == 0)
		return;

	/* Create ipc socket pair and fork ping process */
	if (evutil_socketpair(AF_UNIX, SOCK_STREAM, 0, pair) < 0) {
		target_mark(prb->owner, seq, '!'); /* transmit error */
		return;
	}
	prb->seqdelta = seq - 1; /* linux ping(8) begins icmp_seq=1 */
	evutil_make_socket_nonblocking(pair[0]);
	if (prb->fd >= 0)
		close(prb->fd);
	if (prb->ev_read != NULL)
		event_free(prb->ev_read);
	prb->ev_read = event_new(ev_base, pair[0], EV_READ|EV_PERSIST, readping, prb);
	event_add(prb->ev_read, NULL);
	switch (pid = fork()) {
	case -1:
		target_mark(prb->owner, seq, '!'); /* transmit error */
		return;
	case 0:
		evutil_closesocket(pair[0]);
		dup2(pair[1], 1);
		dup2(pair[1], 2);
		execping(prb);
		/* NEVER REACHED */
		break;
	default:
		evutil_closesocket(pair[1]);
		prb->pid = pid;
		prb->fd = pair[0];
		break;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x78, %rsp
movl %esi, %r14d
movq %rdi, %rbx
cmpl $0x0, 0x40(%rdi)
je 0x3398
movl %r14d, 0x6c(%rbx)
movq 0x90(%rbx), %rdi
leal 0x1(%r14), %esi
movl $0x20, %edx
callq 0x2604
movl 0x70(%rbx), %edx
testl %edx, %edx
je 0x32e5
movq 0x90(%rbx), %rdi
movl %r14d, %esi
callq 0x2604
movl $0x0, 0x70(%rbx)
movl 0x60(%rbx), %edi
testl %edi, %edi
je 0x32fb
xorl %esi, %esi
callq 0x22f0
testl %eax, %eax
je 0x33ca
leaq 0x8(%rsp), %rcx
movl $0x1, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x2370
testl %eax, %eax
js 0x33b6
leal -0x1(%r14), %eax
movl %eax, 0x68(%rbx)
movl 0x8(%rsp), %edi
callq 0x2300
movl 0x64(%rbx), %edi
testl %edi, %edi
js 0x3335
callq 0x23e0
movq 0x78(%rbx), %rdi
testq %rdi, %rdi
je 0x3343
callq 0x2390
leaq 0x3f26(%rip), %rax      # 0x7270
movq (%rax), %rdi
movl 0x8(%rsp), %esi
leaq 0x12f(%rip), %rcx       # 0x3487
movl $0x12, %edx
movq %rbx, %r8
callq 0x2190
movq %rax, 0x78(%rbx)
movq %rax, %rdi
xorl %esi, %esi
callq 0x20c0
callq 0x2060
cmpl $-0x1, %eax
je 0x33b6
movl %eax, %ebp
testl %eax, %eax
je 0x33d5
movl 0xc(%rsp), %edi
callq 0x2120
movl %ebp, 0x60(%rbx)
movl 0x8(%rsp), %eax
movl %eax, 0x64(%rbx)
jmp 0x33ca
movq 0x90(%rbx), %rdi
movl %r14d, %esi
movl $0x40, %edx
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2604
movq 0x90(%rbx), %rdi
movl %r14d, %esi
movl $0x21, %edx
callq 0x2604
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl 0x8(%rsp), %edi
callq 0x2120
movl 0xc(%rsp), %edi
movl $0x1, %esi
callq 0x21b0
movl 0xc(%rsp), %edi
movl $0x2, %esi
callq 0x21b0
leaq 0x3e0f(%rip), %rax      # 0x7210
cvtsi2sdl (%rax), %xmm0
divsd 0x1bfb(%rip), %xmm0     # 0x5008
leaq 0x1e42(%rip), %rdx      # 0x5256
leaq 0x10(%rsp), %r14
movl $0x18, %esi
movq %r14, %rdi
movb $0x1, %al
callq 0x2110
movzwl 0x44(%rbx), %edi
xorl %eax, %eax
cmpl $0xa, %edi
sete %al
leaq 0x1e1e(%rip), %rcx      # 0x5259
leaq 0x1c9c(%rip), %r15      # 0x50de
cmoveq %rcx, %r15
leaq (%rbx,%rax,4), %rsi
addq $0x48, %rsi
leaq 0x30(%rsp), %rbx
movl $0x40, %ecx
movq %rbx, %rdx
callq 0x23c0
leaq 0x1df8(%rip), %rdx      # 0x525f
movq %r15, %rdi
movq %r15, %rsi
movq %r14, %rcx
movq %rbx, %r8
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x2070
movl $0x1, %edi
callq 0x2230