// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0xba7(%rip), %rax       # 0x4214
movq %rax, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0xc97(%rip), %rdx       # 0x431e
leaq 0x2b02(%rip), %rcx      # 0x6190
leaq -0x20(%rbp), %r8
callq 0x20d0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jge 0x36a5
jmp 0x3757
movl -0x1c(%rbp), %eax
movl %eax, -0x54(%rbp)
testl %eax, %eax
je 0x36cf
jmp 0x36b1
movl -0x54(%rbp), %eax
subl $0x66, %eax
je 0x371a
jmp 0x36bb
movl -0x54(%rbp), %eax
subl $0x68, %eax
je 0x3713
jmp 0x36c5
movl -0x54(%rbp), %eax
subl $0x6c, %eax
je 0x372a
jmp 0x373a
movslq -0x20(%rbp), %rcx
leaq 0x2ab6(%rip), %rax      # 0x6190
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rdi
leaq 0xc39(%rip), %rsi       # 0x4324
callq 0x2140
cmpl $0x0, %eax
jne 0x3711
leaq 0xc30(%rip), %rdi       # 0x432c
leaq 0xc3b(%rip), %rsi       # 0x433e
movb $0x0, %al
callq 0x20e0
xorl %edi, %edi
callq 0x2210
jmp 0x3752
xorl %edi, %edi
callq 0x38b0
movq 0x28b7(%rip), %rax      # 0x5fd8
movq (%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x3752
movq 0x28a7(%rip), %rax      # 0x5fd8
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x3752
leaq 0xc01(%rip), %rdi       # 0x4342
movb $0x0, %al
callq 0x20e0
movl $0x1, %edi
callq 0x38b0
jmp 0x3679
cmpq $0x0, -0x30(%rbp)
je 0x376e
movq -0x30(%rbp), %rdi
callq 0x3940
xorl %edi, %edi
callq 0x2210
movq 0x285b(%rip), %rax      # 0x5fd0
movl (%rax), %eax
cmpl -0x8(%rbp), %eax
jne 0x379e
movq 0x2875(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
leaq 0xbc5(%rip), %rsi       # 0x4352
movb $0x0, %al
callq 0x2150
movl $0x1, %edi
callq 0x38b0
movq -0x10(%rbp), %rax
movq 0x2827(%rip), %rcx      # 0x5fd0
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x3b30
callq 0x3520
movq -0x40(%rbp), %rdi
leaq 0xb98(%rip), %rsi       # 0x4365
leaq 0x99f(%rip), %rdx       # 0x4173
callq 0x30a0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x380f
jmp 0x37e6
callq 0x2040
movl (%rax), %edi
movq -0x40(%rbp), %r8
leaq 0xb79(%rip), %rsi       # 0x4371
leaq 0xba7(%rip), %rdx       # 0x43a6
leaq 0xbb0(%rip), %rcx       # 0x43b6
movb $0x0, %al
callq 0x2670
jmp 0x380f
movq 0x2a2a(%rip), %rax      # 0x6240
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x3866
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x2140
cmpl $0x0, %eax
je 0x3844
jmp 0x3858
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq *%rax
jmp 0x3866
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x381a
movq -0x18(%rbp), %rdi
callq 0x20a0
callq 0x35a0
cmpq $0x0, -0x48(%rbp)
jne 0x38a1
movq 0x2776(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
movq -0x28(%rbp), %rdx
leaq 0xb2b(%rip), %rsi       # 0x43bb
movb $0x0, %al
callq 0x2150
movl $0x1, %edi
callq 0x2210
xorl %eax, %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)