// File: sbingner[P]kerneldec/main.c
// Function: main
int main(int argc,char**argv)
{
    FILE *input=stdin, *output=stdout;
    char *kppfile = NULL;
    const char *infile = "stdin";
    const char *outfile = "stdout";
    bool quiet=false;

    int option_index = 0;
    int c;
    while ((c = getopt_long(argc, argv, "hdi:k:o:q", long_options, &option_index)) != -1) {
        switch (c) {
            case 'd':
                if (quiet) {
                    fprintf(stderr, "Can't have quiet debug output\n");
                    return -1;
                }
                g_debug++;
                break;
            case 'h':
                usage();
                exit(0);
                break;
            case 'i':
		infile = optarg;
		if (input != stdin)
		    fclose(input);
		input = fopen(infile, "r");
		break;
            case 'k':
		kppfile = optarg;
		break;
	    case 'o':
		outfile = optarg;
		if (output != stdin)
		    fclose(output);
		output = fopen(outfile, "w");
		break;
            case 'q':
                if (g_debug>0) {
                    fprintf(stderr, "Can't have quiet debug output\n");
                    return -1;
                }
                quiet=true;
                break;
	    default:
		usage();
		exit(1);
		break;
	}
    }

    if (!output || !input) {
	usage();
	return 1;
    }

    FILE *kppfh = NULL;
    if (kppfile != NULL) {
    }

    int rv = decompress_kernel(input, output, kppfh, quiet);

    if (output != stdout)
	fclose(output);

    if (input != stdout)
	fclose(input);

    if (kppfh) {
        fclose(kppfh);
    }

    return rv;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0x1086b(%rip), %rax     # 0x14fd8
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq 0x1083d(%rip), %rax     # 0x14fb8
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
leaq 0xbd48(%rip), %rax      # 0x104d9
movq %rax, -0x30(%rbp)
leaq 0xbd43(%rip), %rax      # 0x104df
movq %rax, -0x38(%rbp)
movb $0x0, -0x39(%rbp)
movl $0x0, -0x40(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0xbd2d(%rip), %rdx      # 0x104e6
leaq 0x10930(%rip), %rcx     # 0x150f0
leaq -0x40(%rbp), %r8
callq 0x3170
movl %eax, -0x44(%rbp)
cmpl $-0x1, %eax
je 0x4928
movl -0x44(%rbp), %eax
addl $-0x64, %eax
movl %eax, %ecx
movq %rcx, -0x60(%rbp)
subl $0xd, %eax
ja 0x4914
movq -0x60(%rbp), %rax
leaq 0xbb8b(%rip), %rcx      # 0x10380
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
testb $0x1, -0x39(%rbp)
je 0x4828
movq 0x107d5(%rip), %rax     # 0x14fe0
movq (%rax), %rdi
leaq 0xbcdb(%rip), %rsi      # 0x104f0
movb $0x0, %al
callq 0x3120
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x49b9
leaq 0x111b9(%rip), %rax     # 0x159e8
movl (%rax), %ecx
addl $0x1, %ecx
leaq 0x111ad(%rip), %rax     # 0x159e8
movl %ecx, (%rax)
jmp 0x4923
callq 0x4730
xorl %edi, %edi
callq 0x30f0
movq 0x10773(%rip), %rax     # 0x14fc8
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq 0x10771(%rip), %rcx     # 0x14fd8
cmpq (%rcx), %rax
je 0x4875
movq -0x18(%rbp), %rdi
callq 0x30b0
movq -0x30(%rbp), %rdi
leaq 0xbc8f(%rip), %rsi      # 0x1050f
callq 0x30d0
movq %rax, -0x18(%rbp)
jmp 0x4923
movq 0x10733(%rip), %rax     # 0x14fc8
movq (%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x4923
movq 0x10720(%rip), %rax     # 0x14fc8
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq 0x1071e(%rip), %rcx     # 0x14fd8
cmpq (%rcx), %rax
je 0x48c8
movq -0x20(%rbp), %rdi
callq 0x30b0
movq -0x38(%rbp), %rdi
leaq 0xbc3e(%rip), %rsi      # 0x10511
callq 0x30d0
movq %rax, -0x20(%rbp)
jmp 0x4923
leaq 0x11103(%rip), %rax     # 0x159e8
cmpl $0x0, (%rax)
jle 0x490e
movq 0x106ef(%rip), %rax     # 0x14fe0
movq (%rax), %rdi
leaq 0xbbf5(%rip), %rsi      # 0x104f0
movb $0x0, %al
callq 0x3120
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x49b9
movb $0x1, -0x39(%rbp)
jmp 0x4923
callq 0x4730
movl $0x1, %edi
callq 0x30f0
jmp 0x47ab
cmpq $0x0, -0x20(%rbp)
je 0x4936
cmpq $0x0, -0x18(%rbp)
jne 0x4944
callq 0x4730
movl $0x1, -0x4(%rbp)
jmp 0x49b9
movq $0x0, -0x50(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x4955
jmp 0x4955
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x50(%rbp), %rdx
movb -0x39(%rbp), %al
andb $0x1, %al
movzbl %al, %ecx
callq 0x3510
movl %eax, -0x54(%rbp)
movq -0x20(%rbp), %rax
movq 0x1063c(%rip), %rcx     # 0x14fb8
cmpq (%rcx), %rax
je 0x498a
movq -0x20(%rbp), %rdi
callq 0x30b0
movq -0x18(%rbp), %rax
movq 0x10623(%rip), %rcx     # 0x14fb8
cmpq (%rcx), %rax
je 0x49a3
movq -0x18(%rbp), %rdi
callq 0x30b0
cmpq $0x0, -0x50(%rbp)
je 0x49b3
movq -0x50(%rbp), %rdi
callq 0x30b0
movl -0x54(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)