// File: hugosantos[P]dbeacon/dbeacon.cpp
// Function: process_param(param_tok const*, char const*)
static void process_param(const param_tok *tok, const char *arg) {
	switch (tok->name) {
	case NAME:
		beaconName = check_good_string("name", arg);
		break;
	case CONTACT:
		if (!strchr(arg, '@'))
			fatal("Not a valid email address.");

		adminContact = check_good_string("admin contact", arg);
		break;
	case INTERFACE:
		mcastInterface = if_nametoindex(arg);
		if (mcastInterface <= 0)
			fatal("Invalid interface name.");
		break;
	case BEACONADDR:
		probeAddrLiteral = arg;
		break;
	case SSMADDR:
		if (arg)
			probeSSMAddrLiteral = arg;
		useSSM = true;
		listenForSSM = true;
		break;
	case SSMSENDONLY:
		useSSM = true;
		listenForSSM = parse_bool("SSMSendOnly", arg, false);
		break;
	case BOOTSTRAP:
		add_bootstrap_address(arg);
		break;
	case ENABLESSMPING:
		useSSMPing = parse_bool("SSMPing", arg, true);
		break;
	case SOURCEADDR:
		parse_or_fail(&beaconUnicastAddr, arg, false, false);
		break;
	case DUMP:
		dumpFile = arg ? arg : defaultDumpFile;
		break;
	case DUMPINTERVAL:
		dumpInterval = parse_u32("Dump interval", arg);
		if (dumpInterval < 5)
			dumpInterval = 5;
		break;
	case DUMPEXEC:
		launchSomething = arg;
		break;
	case SPECWEBSITE:
		if (strncmp(arg, "lg$", 3) == 0) {
			webSites[T_WEBSITE_LG] =
				check_good_string("LG website", arg + 3);
		} else if (strncmp(arg, "matrix$", 7) == 0) {
			webSites[T_WEBSITE_MATRIX] =
				check_good_string("matrix url", arg + 7);
		} else {
			webSites[T_WEBSITE_GENERIC] =
				check_good_string("website", arg);
		}
		break;
	case SPECMATRIX:
		webSites[T_WEBSITE_MATRIX] =
			check_good_string("matrix url", arg);
		break;
	case SPECLG:
		webSites[T_WEBSITE_LG] =
			check_good_string("lg url", arg);
		break;
	case COUNTRY:
		if (strlen(arg) != 2)
			fatal("Bad country code.");
		twoLetterCC = check_good_string("country", arg);
		break;
	case SPECFLAG:
		if (!strcmp(arg, "ssmping")) {
			flags |= SSMPING_CAPABLE;
		} else {
			fprintf(stderr, "Unknown flag \"%s\"\n", arg);
		}
		break;
	case VERBOSE:
		if (arg)
			verbose = parse_u32("Verbose", arg);
		else
			verbose ++;
		break;
	case DUMPBW:
		dumpBwReport = parse_bool("DumpBandwidth", arg, true);
		break;
	case HELP:
		usage();
		break;
	case FORCEv4:
		forceFamily = AF_INET;
		break;
	case FORCEv6:
		forceFamily = AF_INET6;
		break;
	case SHOWVERSION:
		show_version();
		break;
	case DAEMON:
		daemonize = true;
		break;
	case PIDFILE:
		pidfile = check_good_string("pidfile", arg);
		break;
	case USE_SYSLOG:
		use_syslog = true;
		break;
	case CONFFILE:
		parse_config_file(arg);
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
subl $0x1a, %eax
ja 0x880c
movq -0x30(%rbp), %rax
leaq 0x12ce2(%rip), %rcx     # 0x1b094
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rsi
leaq 0x13817(%rip), %rdi     # 0x1bbdd
callq 0x8820
movq %rax, %rsi
leaq 0x210d3(%rip), %rdi     # 0x294a8
callq 0x45c0
jmp 0x880c
movq -0x10(%rbp), %rdi
movl $0x40, %esi
callq 0x4190
cmpq $0x0, %rax
jne 0x8401
leaq 0x13ccb(%rip), %rdi     # 0x1c0c5
movb $0x0, %al
callq 0x5250
movq -0x10(%rbp), %rsi
leaq 0x13cd4(%rip), %rdi     # 0x1c0e0
callq 0x8820
movq %rax, %rsi
leaq 0x210ad(%rip), %rdi     # 0x294c8
callq 0x45c0
jmp 0x880c
movq -0x10(%rbp), %rdi
callq 0x40e0
movl %eax, 0x211bc(%rip)     # 0x295f0
cmpl $0x0, 0x211b5(%rip)     # 0x295f0
jg 0x844b
leaq 0x13caa(%rip), %rdi     # 0x1c0ee
movb $0x0, %al
callq 0x5250
jmp 0x880c
movq -0x10(%rbp), %rsi
leaq 0x2121d(%rip), %rdi     # 0x29678
callq 0x45c0
jmp 0x880c
cmpq $0x0, -0x10(%rbp)
je 0x847c
movq -0x10(%rbp), %rsi
leaq 0x21221(%rip), %rdi     # 0x29698
callq 0x45c0
movb $0x1, 0x2147d(%rip)     # 0x29900
movb $0x1, 0x21477(%rip)     # 0x29901
jmp 0x880c
movb $0x1, 0x2146a(%rip)     # 0x29900
movq -0x10(%rbp), %rsi
leaq 0x13c65(%rip), %rdi     # 0x1c106
xorl %edx, %edx
callq 0x88a0
andb $0x1, %al
movb %al, 0x21451(%rip)      # 0x29901
jmp 0x880c
movq -0x10(%rbp), %rdi
callq 0x89a0
jmp 0x880c
movq -0x10(%rbp), %rsi
leaq 0x13c44(%rip), %rdi     # 0x1c112
movl $0x1, %edx
callq 0x88a0
andb $0x1, %al
movb %al, 0x2142c(%rip)      # 0x2990c
jmp 0x880c
movq -0x10(%rbp), %rsi
leaq 0x21078(%rip), %rdi     # 0x29568
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x89f0
jmp 0x880c
cmpq $0x0, -0x10(%rbp)
je 0x850f
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x851c
leaq 0x13c04(%rip), %rax     # 0x1c11a
movq %rax, -0x38(%rbp)
jmp 0x851c
movq -0x38(%rbp), %rsi
leaq 0x21231(%rip), %rdi     # 0x29758
callq 0x45c0
jmp 0x880c
movq -0x10(%rbp), %rsi
leaq 0x13be7(%rip), %rdi     # 0x1c123
callq 0x8a50
movl %eax, 0x20ef9(%rip)     # 0x29440
cmpl $0x5, 0x20ef2(%rip)     # 0x29440
jge 0x855a
movl $0x5, 0x20ee6(%rip)     # 0x29440
jmp 0x880c
movq -0x10(%rbp), %rsi
leaq 0x211ce(%rip), %rdi     # 0x29738
callq 0x45c0
jmp 0x880c
movq -0x10(%rbp), %rdi
leaq 0x13bb2(%rip), %rsi     # 0x1c131
movl $0x3, %edx
callq 0x4200
cmpl $0x0, %eax
jne 0x85ce
movq -0x10(%rbp), %rsi
addq $0x3, %rsi
leaq 0x13b98(%rip), %rdi     # 0x1c135
callq 0x8820
movq %rax, -0x40(%rbp)
movl $0x4c, -0x14(%rbp)
leaq 0x20f84(%rip), %rdi     # 0x29538
leaq -0x14(%rbp), %rsi
callq 0xde40
movq -0x40(%rbp), %rsi
movq %rax, %rdi
callq 0x45c0
jmp 0x865e
movq -0x10(%rbp), %rdi
leaq 0x13b67(%rip), %rsi     # 0x1c140
movl $0x7, %edx
callq 0x4200
cmpl $0x0, %eax
jne 0x8625
movq -0x10(%rbp), %rsi
addq $0x7, %rsi
leaq 0x13b51(%rip), %rdi     # 0x1c148
callq 0x8820
movq %rax, -0x48(%rbp)
movl $0x4d, -0x18(%rbp)
leaq 0x20f2a(%rip), %rdi     # 0x29538
leaq -0x18(%rbp), %rsi
callq 0xde40
movq -0x48(%rbp), %rsi
movq %rax, %rdi
callq 0x45c0
jmp 0x865c
movq -0x10(%rbp), %rsi
leaq 0x13b08(%rip), %rdi     # 0x1c138
callq 0x8820
movq %rax, -0x50(%rbp)
movl $0x47, -0x1c(%rbp)
leaq 0x20ef1(%rip), %rdi     # 0x29538
leaq -0x1c(%rbp), %rsi
callq 0xde40
movq -0x50(%rbp), %rsi
movq %rax, %rdi
callq 0x45c0
jmp 0x865e
jmp 0x880c
movq -0x10(%rbp), %rsi
leaq 0x13ada(%rip), %rdi     # 0x1c148
callq 0x8820
movq %rax, -0x58(%rbp)
movl $0x4d, -0x20(%rbp)
leaq 0x20eb3(%rip), %rdi     # 0x29538
leaq -0x20(%rbp), %rsi
callq 0xde40
movq -0x58(%rbp), %rsi
movq %rax, %rdi
callq 0x45c0
jmp 0x880c
movq -0x10(%rbp), %rsi
leaq 0x13aa9(%rip), %rdi     # 0x1c153
callq 0x8820
movq %rax, -0x60(%rbp)
movl $0x4c, -0x24(%rbp)
leaq 0x20e77(%rip), %rdi     # 0x29538
leaq -0x24(%rbp), %rsi
callq 0xde40
movq -0x60(%rbp), %rsi
movq %rax, %rdi
callq 0x45c0
jmp 0x880c
movq -0x10(%rbp), %rdi
callq 0x41d0
cmpq $0x2, %rax
je 0x86f8
leaq 0x13a69(%rip), %rdi     # 0x1c15a
movb $0x0, %al
callq 0x5250
movq -0x10(%rbp), %rsi
leaq 0x13a69(%rip), %rdi     # 0x1c16c
callq 0x8820
movq %rax, %rsi
leaq 0x20dd6(%rip), %rdi     # 0x294e8
callq 0x45c0
jmp 0x880c
movq -0x10(%rbp), %rdi
leaq 0x138c3(%rip), %rsi     # 0x1bfea
callq 0x45f0
cmpl $0x0, %eax
jne 0x8742
movl 0x20eb5(%rip), %eax     # 0x295ec
orl $0x2, %eax
movl %eax, 0x20eac(%rip)     # 0x295ec
jmp 0x875e
movq 0x20887(%rip), %rax     # 0x28fd0
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x13a1d(%rip), %rsi     # 0x1c174
movb $0x0, %al
callq 0x4600
jmp 0x880c
cmpq $0x0, -0x10(%rbp)
je 0x8782
movq -0x10(%rbp), %rsi
leaq 0x13a12(%rip), %rdi     # 0x1c187
callq 0x8a50
movl %eax, 0x20e68(%rip)     # 0x295e8
jmp 0x8791
movl 0x20e60(%rip), %eax     # 0x295e8
addl $0x1, %eax
movl %eax, 0x20e57(%rip)     # 0x295e8
jmp 0x880c
movq -0x10(%rbp), %rsi
leaq 0x139f1(%rip), %rdi     # 0x1c18f
movl $0x1, %edx
callq 0x88a0
andb $0x1, %al
movb %al, 0x2115d(%rip)      # 0x2990d
jmp 0x880c
callq 0x4d10
jmp 0x880c
movl $0x2, 0x2102d(%rip)     # 0x297f0
jmp 0x880c
movl $0xa, 0x21021(%rip)     # 0x297f0
jmp 0x880c
callq 0x6990
jmp 0x880c
movb $0x1, 0x21015(%rip)     # 0x297f4
jmp 0x880c
movq -0x10(%rbp), %rsi
leaq 0x1385a(%rip), %rdi     # 0x1c046
callq 0x8820
movq %rax, 0x21000(%rip)     # 0x297f8
jmp 0x880c
movb $0x1, 0x20ff4(%rip)     # 0x297f5
jmp 0x880c
movq -0x10(%rbp), %rdi
callq 0x8aa0
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)