// File: /workspace/github_c_makefile_star2_O3/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 0x12e7(%rip), %rdx      # 0x4270
leaq 0x3200(%rip), %r15      # 0x6190
leaq 0xc(%rsp), %r8
movq %r15, %rcx
callq 0x20e0
leaq 0x11a9(%rip), %rbx      # 0x414d
testl %eax, %eax
js 0x303f
movq $0x0, 0x10(%rsp)
leaq 0x12b4(%rip), %r13      # 0x4270
leaq 0xc(%rsp), %r12
cmpl $0x67, %eax
jg 0x2fdf
testl %eax, %eax
je 0x2ff9
cmpl $0x66, %eax
jne 0x31bc
movq 0x2ffe(%rip), %rax      # 0x5fd8
movq (%rax), %rbx
jmp 0x301a
cmpl $0x6c, %eax
jne 0x3194
movq 0x2fe9(%rip), %rax      # 0x5fd8
movq (%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0x301a
movslq 0xc(%rsp), %rax
shlq $0x5, %rax
movq (%rax,%r15), %rdi
leaq 0x1269(%rip), %rsi      # 0x4276
callq 0x2140
testl %eax, %eax
je 0x31a0
movl %ebp, %edi
movq %r14, %rsi
movq %r13, %rdx
movq %r15, %rcx
movq %r12, %r8
callq 0x20e0
testl %eax, %eax
jns 0x2fc1
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
jne 0x31e6
movq 0x2f8a(%rip), %rax      # 0x5fd0
movslq (%rax), %rax
cmpl %ebp, %eax
je 0x31d2
movq (%r14,%rax,8), %r15
movq %r15, 0x18(%rsp)
leaq 0x1323(%rip), %rsi      # 0x4384
leaq 0x1044(%rip), %rdx      # 0x40ac
movq %r15, %rdi
callq 0x2c00
movq %rax, %r14
testq %rax, %rax
jne 0x309e
callq 0x2050
movl (%rax), %edi
leaq 0x130a(%rip), %rsi      # 0x4390
leaq 0x125b(%rip), %rdx      # 0x42e8
leaq 0x1324(%rip), %rcx      # 0x43b8
movq %r15, %r8
xorl %eax, %eax
callq 0x25e8
leaq 0x20(%rsp), %rdx
leaq 0x131f(%rip), %rsi      # 0x43c9
movq %r14, %rdi
xorl %eax, %eax
callq 0x2060
cmpl $0x1, %eax
jne 0x316e
movq %r14, %rdi
callq 0x20b0
cmpl $0x0, 0x20(%rsp)
je 0x31d7
callq 0x2eec
movq 0x18(%rsp), %rdi
leaq 0x11c6(%rip), %rsi      # 0x42a7
leaq 0xfc4(%rip), %rdx       # 0x40ac
callq 0x2c00
movq %rax, %r14
testq %rax, %rax
jne 0x311d
callq 0x2050
movl (%rax), %edi
movq 0x18(%rsp), %r8
leaq 0x11ab(%rip), %rsi      # 0x42b3
leaq 0x11d9(%rip), %rdx      # 0x42e8
leaq 0x11e2(%rip), %rcx      # 0x42f8
xorl %eax, %eax
callq 0x25e8
movq 0x311c(%rip), %r15      # 0x6240
testq %r15, %r15
je 0x3189
movq (%r15), %r12
movq 0x8(%r12), %rdi
movq %rbx, %rsi
callq 0x2140
testl %eax, %eax
je 0x3143
movq 0x8(%r15), %r15
jmp 0x3124
leaq 0x18(%rsp), %rdi
movq %r14, %rsi
callq *0x10(%r12)
movq %r14, %rdi
callq 0x20b0
callq 0x2f26
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $-0x1, %eax
jne 0x31dc
movq %r14, %rdi
callq 0x2080
testl %eax, %eax
je 0x31e1
callq 0x2325
jmp 0x30bd
movq %r14, %rdi
movq %rbx, %rsi
callq 0x235a
cmpl $0x68, %eax
jne 0x31bc
xorl %edi, %edi
callq 0x31eb
leaq 0x10d7(%rip), %rdi      # 0x427e
leaq 0x10e2(%rip), %rsi      # 0x4290
xorl %eax, %eax
callq 0x20f0
xorl %edi, %edi
callq 0x2210
leaq 0x12a1(%rip), %rdi      # 0x4464
callq 0x2070
movl $0x1, %edi
callq 0x31eb
callq 0x23fa
callq 0x238b
callq 0x23d5
callq 0x23b0
callq 0x3253