// File: /workspace/github_c_makefile_star2_O2/igaw[P]jitterdebugger/jittersamples.c
// Function: main
int main(int argc, char *argv[])
{
	FILE *input;
	int c, long_idx;
	char *format = "csv";
	char *port = NULL;
	struct jd_samples_info info;
	struct jd_slist *list;

	while (1) {
		c = getopt_long(argc, argv, "hf:l:", long_options, &long_idx);
		if (c < 0)
			break;

		switch (c) {
		case 0:
			if (!strcmp(long_options[long_idx].name, "version")) {
				printf("jittersamples %s\n",
					JD_VERSION);
				exit(0);
			}
			break;
		case 'h':
			usage(0);
		case 'f':
			format = optarg;
			break;
		case 'l':
			port = optarg;
			break;
		default:
			printf("unknown option\n");
			usage(1);
		}
	}

	if (port) {
		dump_samples(port);
		exit(0);
	}

	if (optind == argc) {
		fprintf(stderr, "Missing input DIR\n");
		usage(1);
	}
	info.dir = argv[optind];

	read_online_cpus(&info);

	__jd_plugin_init();

	input = jd_fopen(info.dir, "samples.raw", "r");
	if (!input)
		err_handler(errno, "Could not open '%s/samples.raw' for reading", info.dir);

	for (list = jd_samples_plugins.next; list; list = list->next) {
		struct jd_samples_ops *plugin = list->data;

		if (strcmp(plugin->format, format))
			continue;

		plugin->output(&info, input);
		break;
	}

	fclose(input);

	__jd_plugin_cleanup();

	if (!list) {
		fprintf(stderr, "Unsupported file format \"%s\"\n", format);
		exit(1);
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movl %edi, %ebp
leaq 0x1388(%rip), %rax      # 0x414d
movq %rax, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
leaq 0x1496(%rip), %r12      # 0x4270
leaq 0x33af(%rip), %r13      # 0x6190
leaq 0x4(%rsp), %r15
leaq 0x1489(%rip), %rbx      # 0x4276
movl %ebp, %edi
movq %r14, %rsi
movq %r12, %rdx
movq %r13, %rcx
movq %r15, %r8
callq 0x20e0
testl %eax, %eax
js 0x2e54
jne 0x2e24
movslq 0x4(%rsp), %rax
shlq $0x5, %rax
movq (%rax,%r13), %rdi
movq %rbx, %rsi
callq 0x2140
testl %eax, %eax
jne 0x2ded
jmp 0x3036
cmpl $0x66, %eax
je 0x2e43
cmpl $0x6c, %eax
jne 0x2fe6
movq 0x319f(%rip), %rax      # 0x5fd8
movq (%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0x2ded
movq 0x318e(%rip), %rax      # 0x5fd8
movq (%rax), %rax
movq %rax, 0x8(%rsp)
jmp 0x2ded
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
jne 0x3052
movq 0x3167(%rip), %rax      # 0x5fd0
movslq (%rax), %rax
cmpl %ebp, %eax
je 0x3057
movq (%r14,%rax,8), %rbx
movq %rbx, 0x18(%rsp)
leaq 0x1500(%rip), %rsi      # 0x4384
leaq 0x1221(%rip), %rdx      # 0x40ac
movq %rbx, %rdi
callq 0x2a19
movq %rax, %r14
testq %rax, %rax
movq 0x8(%rsp), %r12
jne 0x2ec6
callq 0x2050
movl (%rax), %edi
leaq 0x14e2(%rip), %rsi      # 0x4390
leaq 0x1433(%rip), %rdx      # 0x42e8
leaq 0x14fc(%rip), %rcx      # 0x43b8
movq %rbx, %r8
xorl %eax, %eax
callq 0x2449
leaq 0x20(%rsp), %rdx
leaq 0x14f7(%rip), %rsi      # 0x43c9
movq %r14, %rdi
xorl %eax, %eax
callq 0x2060
cmpl $0x1, %eax
jne 0x2f99
movq %r14, %rdi
callq 0x20b0
cmpl $0x0, 0x20(%rsp)
je 0x3075
callq 0x2d23
movq 0x18(%rsp), %rdi
leaq 0x139e(%rip), %rsi      # 0x42a7
leaq 0x119c(%rip), %rdx      # 0x40ac
callq 0x2a19
movq %rax, %r14
testq %rax, %rax
jne 0x2f45
callq 0x2050
movl (%rax), %edi
movq 0x18(%rsp), %r8
leaq 0x1383(%rip), %rsi      # 0x42b3
leaq 0x13b1(%rip), %rdx      # 0x42e8
leaq 0x13ba(%rip), %rcx      # 0x42f8
xorl %eax, %eax
callq 0x2449
leaq 0x32f4(%rip), %rbx      # 0x6240
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x2ff2
movq (%rbx), %r15
movq 0x8(%r15), %rdi
movq %r12, %rsi
callq 0x2140
addq $0x8, %rbx
testl %eax, %eax
jne 0x2f4c
leaq 0x18(%rsp), %rdi
movq %r14, %rsi
callq *0x10(%r15)
movq %r14, %rdi
callq 0x20b0
callq 0x2d6d
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $-0x1, %eax
jne 0x308a
movq %r14, %rdi
callq 0x2080
testl %eax, %eax
je 0x309f
callq 0x2050
movl (%rax), %edi
leaq 0x140d(%rip), %rsi      # 0x43cd
leaq 0x1321(%rip), %rdx      # 0x42e8
leaq 0x13ea(%rip), %rcx      # 0x43b8
xorl %eax, %eax
callq 0x2449
leaq 0x1403(%rip), %rdi      # 0x43df
callq 0x21e0
jmp 0x2ee5
cmpl $0x68, %eax
jne 0x3022
xorl %edi, %edi
callq 0x30c0
movq %r14, %rdi
callq 0x20b0
callq 0x2d6d
movq 0x2ff2(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
leaq 0x12ed(%rip), %rsi      # 0x42fd
movq %r12, %rdx
xorl %eax, %eax
callq 0x2150
pushq $0x1
popq %rdi
callq 0x2210
leaq 0x143b(%rip), %rdi      # 0x4464
callq 0x2070
pushq $0x1
popq %rdi
callq 0x30c0
leaq 0x1241(%rip), %rdi      # 0x427e
leaq 0x124c(%rip), %rsi      # 0x4290
xorl %eax, %eax
callq 0x20f0
xorl %edi, %edi
callq 0x2210
callq 0x3126
movq 0x2f9a(%rip), %rax      # 0x5ff8
movq (%rax), %rcx
leaq 0x122c(%rip), %rdi      # 0x4294
pushq $0x12
popq %rsi
pushq $0x1
popq %rdx
callq 0x2220
jmp 0x302e
movq 0x2f7c(%rip), %rax      # 0x5ff8
movq (%rax), %rcx
leaq 0x13be(%rip), %rdi      # 0x4444
pushq $0x1f
jmp 0x30b2
movq 0x2f67(%rip), %rax      # 0x5ff8
movq (%rax), %rcx
leaq 0x1385(%rip), %rdi      # 0x4420
pushq $0x23
jmp 0x30b2
movq 0x2f52(%rip), %rax      # 0x5ff8
movq (%rax), %rcx
leaq 0x1336(%rip), %rdi      # 0x43e6
pushq $0x39
popq %rsi
pushq $0x1
popq %rdx
callq 0x2220
jmp 0x301a