// File: hugosantos[P]dbeacon/dbeacon.cpp
// Function: getSource(address const&, char const*, unsigned long, unsigned long, bool)
beaconSource &getSource(const address &baddr, const char *name, uint64_t now, uint64_t recvdts, bool rx_local) {
	Sources::iterator i = sources.find(baddr);
	if (i != sources.end()) {
		i->second.lastevent = now;
		if (rx_local)
			i->second.lastlocalevent = now;
		return i->second;
	}

	beaconSource &src = sources[baddr];

	if (verbose) {
		char tmp[64];

		if (name)
			info("Adding source %s [%s]", baddr.to_string(tmp, sizeof(tmp)), name);
		else
			info("Adding source %s", baddr.to_string(tmp, sizeof(tmp)));
	}

	if (name)
		src.setName(name);

	src.creation = now;
	src.lastevent = now;
	if (rx_local)
		src.lastlocalevent = now;

	if (IsSSMEnabled())
		CountSSMJoin(ssmProbeAddr, baddr);

	return src;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movb %r8b, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
andb $0x1, %al
movb %al, -0x29(%rbp)
movq -0x10(%rbp), %rsi
leaq 0x2339a(%rip), %rdi     # 0x29508
callq 0xb210
movq %rax, -0x38(%rbp)
leaq 0x2338a(%rip), %rdi     # 0x29508
callq 0xb270
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xb240
testb $0x1, %al
jne 0x619a
jmp 0x61fc
movq -0x20(%rbp), %rax
movq %rax, -0xd0(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xb2a0
movq -0xd0(%rbp), %rcx
movq %rcx, 0x110(%rax)
testb $0x1, -0x29(%rbp)
je 0x61e4
movq -0x20(%rbp), %rax
movq %rax, -0xd8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xb2a0
movq -0xd8(%rbp), %rcx
movq %rcx, 0x118(%rax)
leaq -0x38(%rbp), %rdi
callq 0xb2a0
addq $0x80, %rax
movq %rax, -0x8(%rbp)
jmp 0x6393
movq -0x10(%rbp), %rsi
leaq 0x23301(%rip), %rdi     # 0x29508
callq 0xb2c0
movq %rax, -0x48(%rbp)
cmpl $0x0, 0x233d1(%rip)     # 0x295e8
je 0x627e
cmpq $0x0, -0x18(%rbp)
je 0x6251
movq -0x10(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movl $0x40, %edx
movl $0x1, %ecx
callq 0x18100
movq %rax, %rsi
movq -0x18(%rbp), %rdx
leaq 0x15c07(%rip), %rdi     # 0x1be4f
movb $0x0, %al
callq 0x51b0
jmp 0x627c
movq -0x10(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movl $0x40, %edx
movl $0x1, %ecx
callq 0x18100
movq %rax, %rsi
leaq 0x15bf0(%rip), %rdi     # 0x1be65
movb $0x0, %al
callq 0x51b0
jmp 0x627e
cmpq $0x0, -0x18(%rbp)
je 0x633d
movq -0x48(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xe8(%rbp)
leaq -0xb1(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0x4710
movq -0xe8(%rbp), %rsi
movq -0xe0(%rbp), %rdx
leaq -0xb0(%rbp), %rdi
callq 0xb3a0
jmp 0x62ce
movq -0xf0(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x6d90
jmp 0x62e3
leaq -0xb0(%rbp), %rdi
callq 0x47a8
leaq -0xb1(%rbp), %rdi
callq 0x44c0
jmp 0x633d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
jmp 0x632f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x47a8
leaq -0xb1(%rbp), %rdi
callq 0x44c0
jmp 0x63a0
movq -0x20(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x80(%rax)
movq -0x20(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x90(%rax)
testb $0x1, -0x29(%rbp)
je 0x6370
movq -0x20(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x98(%rax)
callq 0x6120
testb $0x1, %al
jne 0x637b
jmp 0x638b
movq -0x10(%rbp), %rsi
leaq 0x23332(%rip), %rdi     # 0x296b8
callq 0x6dd0
movq -0x48(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xf0, %rsp
popq %rbp
retq
movq -0xc0(%rbp), %rdi
callq 0x46f0
nopl (%rax)