// File: /workspace/github_c_makefile_star2_O0/albertito[P]libjio/libjio/jiofsck.c
// Function: main
int main(int argc, char **argv)
{
	int i, do_cleanup;
	unsigned int flags;
	char *file, *jdir;
	struct jfsck_result res;
	enum jfsck_return rv;



	file = jdir = NULL;
	do_cleanup = 0;

	if (argc < 2) {
		usage();
		return 1;
	}

	for (i = 1; i < argc; i++) {
		if (strcmp("clean=1", argv[i]) == 0) {
			do_cleanup = 1;
		} else if (strncmp("dir=", argv[i], 4) == 0) {
			jdir = argv[i] + 4;
		} else {
			file = argv[i];
		}
	}

	memset(&res, 0, sizeof(res));

	flags = 0;
	if (do_cleanup)
		flags |= J_CLEANUP;

	printf("Checking journal: ");
	fflush(stdout);
	rv = jfsck(file, jdir, &res, flags);

	switch (rv) {
	case J_ESUCCESS:
		printf("done\n");
		break;
	case J_ENOENT:
		printf("No such file or directory\n");
		return 1;
	case J_ENOJOURNAL:
		printf("No journal associated to the file, "
				"or journal empty\n");
		return 1;
	case J_ENOMEM:
		printf("Not enough memory\n");
		return 1;
	case J_ECLEANUP:
		printf("Error cleaning up the journal directory\n");
		return 1;
	case J_EIO:
		printf("I/O error\n");
		perror("  additional information");
		return 1;
	default:
		printf("Unknown result, please report as a bug\n");
		return 1;
	}

	printf("Journal checking results\n");
	printf("------------------------\n\n");

	printf("Total:\t\t %d\n", res.total);
	printf("Invalid:\t %d\n", res.invalid);
	printf("In progress:\t %d\n", res.in_progress);
	printf("Broken:\t\t %d\n", res.broken);
	printf("Corrupt:\t %d\n", res.corrupt);
	printf("Reapplied:\t %d\n", res.reapplied);
	printf("\n");

	if (do_cleanup) {
		printf("The journal has been cleaned up.\n");
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x28(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0x2, -0x8(%rbp)
jge 0x2564
callq 0x27f0
movl $0x1, -0x4(%rbp)
jmp 0x27e0
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x25f7
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x3a92(%rip), %rdi      # 0x601c
callq 0x2210
cmpl $0x0, %eax
jne 0x259d
movl $0x1, -0x18(%rbp)
jmp 0x25e7
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x3a74(%rip), %rdi      # 0x6024
movl $0x4, %edx
callq 0x2070
cmpl $0x0, %eax
jne 0x25d5
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x4, %rax
movq %rax, -0x30(%rbp)
jmp 0x25e5
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
jmp 0x25e7
jmp 0x25e9
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x256b
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x21b0
movl $0x0, -0x1c(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x261d
movl -0x1c(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x1c(%rbp)
leaq 0x3a05(%rip), %rdi      # 0x6029
xorl %eax, %eax
callq 0x2120
movq 0x59a6(%rip), %rax      # 0x7fd8
movq (%rax), %rdi
callq 0x22b0
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl -0x1c(%rbp), %ecx
leaq -0x48(%rbp), %rdx
callq 0x2810
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
addl $0x5, %eax
movl %eax, %ecx
movq %rcx, -0x58(%rbp)
subl $0x5, %eax
ja 0x271b
movq -0x58(%rbp), %rax
leaq 0x3993(%rip), %rcx      # 0x6004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x39bb(%rip), %rdi      # 0x603c
movb $0x0, %al
callq 0x2120
jmp 0x2735
leaq 0x39ae(%rip), %rdi      # 0x6042
movb $0x0, %al
callq 0x2120
movl $0x1, -0x4(%rbp)
jmp 0x27e0
leaq 0x39af(%rip), %rdi      # 0x605d
movb $0x0, %al
callq 0x2120
movl $0x1, -0x4(%rbp)
jmp 0x27e0
leaq 0x39ca(%rip), %rdi      # 0x6092
movb $0x0, %al
callq 0x2120
movl $0x1, -0x4(%rbp)
jmp 0x27e0
leaq 0x39c3(%rip), %rdi      # 0x60a5
movb $0x0, %al
callq 0x2120
movl $0x1, -0x4(%rbp)
jmp 0x27e0
leaq 0x39d2(%rip), %rdi      # 0x60ce
movb $0x0, %al
callq 0x2120
leaq 0x39cf(%rip), %rdi      # 0x60d9
callq 0x2350
movl $0x1, -0x4(%rbp)
jmp 0x27e0
leaq 0x39d0(%rip), %rdi      # 0x60f2
movb $0x0, %al
callq 0x2120
movl $0x1, -0x4(%rbp)
jmp 0x27e0
leaq 0x39de(%rip), %rdi      # 0x611a
movb $0x0, %al
callq 0x2120
leaq 0x39ea(%rip), %rdi      # 0x6134
movb $0x0, %al
callq 0x2120
movl -0x48(%rbp), %esi
leaq 0x39f4(%rip), %rdi      # 0x614f
movb $0x0, %al
callq 0x2120
movl -0x44(%rbp), %esi
leaq 0x39f0(%rip), %rdi      # 0x615c
movb $0x0, %al
callq 0x2120
movl -0x40(%rbp), %esi
leaq 0x39ed(%rip), %rdi      # 0x616a
movb $0x0, %al
callq 0x2120
movl -0x3c(%rbp), %esi
leaq 0x39ee(%rip), %rdi      # 0x617c
movb $0x0, %al
callq 0x2120
movl -0x38(%rbp), %esi
leaq 0x39eb(%rip), %rdi      # 0x618a
movb $0x0, %al
callq 0x2120
movl -0x34(%rbp), %esi
leaq 0x39e8(%rip), %rdi      # 0x6198
movb $0x0, %al
callq 0x2120
leaq 0x398f(%rip), %rdi      # 0x614d
movb $0x0, %al
callq 0x2120
cmpl $0x0, -0x18(%rbp)
je 0x27d9
leaq 0x39d6(%rip), %rdi      # 0x61a8
movb $0x0, %al
callq 0x2120
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)