// File: /workspace/github_c_makefile_star2_O2/lh3[P]bgt/fmf.c
// Function: main_fmf
int main_fmf(int argc, char *argv[])
{
	kexpr_t *ke = 0;
	int i, c, err, in_mem = 0, name_only = 0;
	while ((c = getopt(argc, argv, "mn")) >= 0)
		if (c == 'm') in_mem = 1;
		else if (c == 'n') name_only = 1;
	if (argc == optind) {
		fprintf(stderr, "Usage: fmf [-mn] <in.fmf> [condition]\n");
		fprintf(stderr, "Options:\n");
		fprintf(stderr, "  -m   load the entire FMF into RAM\n");
		fprintf(stderr, "  -n   only output the row name (the 1st column)\n");
		return 1;
	}
	if (argc - optind >= 2) ke = ke_parse(argv[optind+1], &err);
	if (in_mem) {
		fmf_t *f;
		f = fmf_read(argv[optind]);
		for (i = 0; i < f->n_rows; ++i) {
			char *s;
			if (ke && !fmf_test(f, i, ke)) continue;
			if (!name_only) {
				s = fmf_write(f, i);
				puts(s);
				free(s);
			} else puts(f->rows[i].name);
		}
		fmf_destroy(f);
	} else {
		fms_t *f;
		const char *s;
		f = fms_open(argv[optind]);
		while ((s = fms_read(f, ke, name_only)) != 0)
			puts(s);
		fms_close(f);
	}
	if (ke) ke_destroy(ke);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebx
xorl %ebp, %ebp
movb $0x1, %al
movl %eax, (%rsp)
leaq 0xf9ba(%rip), %r15      # 0x190cd
pushq $0x1
popq %r13
xorl %r12d, %r12d
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x23e0
testl %eax, %eax
js 0x9746
cmpl $0x6d, %eax
je 0x9741
cmpl $0x6e, %eax
jne 0x971a
movl $0x0, (%rsp)
movl %r13d, %ebp
jmp 0x971a
movl %r13d, %r12d
jmp 0x971a
movq 0x1784b(%rip), %r15     # 0x20f98
movslq (%r15), %rax
cmpl %eax, %ebx
je 0x9841
subl %eax, %ebx
cmpl $0x2, %ebx
jl 0x9773
movq 0x8(%r14,%rax,8), %rdi
leaq 0x4(%rsp), %rsi
callq 0x1528c
movq %rax, %rbx
jmp 0x9775
xorl %ebx, %ebx
movslq (%r15), %rax
movq (%r14,%rax,8), %rdi
testl %r12d, %r12d
je 0x97f5
callq 0x8a70
movq %rax, %r14
movslq 0x20(%rax), %rbp
xorl %r13d, %r13d
xorl %r15d, %r15d
cmpq %rbp, %r15
jge 0x97eb
testq %rbx, %rbx
je 0x97af
movq %r14, %rdi
movl %r15d, %esi
movq %rbx, %rdx
callq 0x9339
testl %eax, %eax
je 0x97e2
testb $0x1, (%rsp)
je 0x97d5
movq %r14, %rdi
movl %r15d, %esi
callq 0x8fa8
movq %rax, %r12
movq %rax, %rdi
callq 0x20e0
movq %r12, %rdi
callq 0x2050
jmp 0x97e2
movq 0x28(%r14), %rax
movq (%rax,%r13), %rdi
callq 0x20e0
incq %r15
addq $0x18, %r13
jmp 0x9793
movq %r14, %rdi
callq 0x8efb
jmp 0x9821
callq 0x943a
movq %rax, %r14
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x94db
testq %rax, %rax
je 0x9819
movq %rax, %rdi
callq 0x20e0
jmp 0x97fd
movq %r14, %rdi
callq 0x94ae
xorl %ebp, %ebp
testq %rbx, %rbx
je 0x9830
movq %rbx, %rdi
callq 0x162c2
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x177b0(%rip), %r14     # 0x20ff8
movq (%r14), %rcx
leaq 0xf87e(%rip), %rdi      # 0x190d0
pushq $0x26
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x2410
movq (%r14), %rcx
leaq 0xe954(%rip), %rdi      # 0x181be
pushq $0x9
popq %rsi
movq %rbx, %rdx
callq 0x2410
movq (%r14), %rcx
leaq 0xf878(%rip), %rdi      # 0x190f7
pushq $0x24
popq %rsi
movq %rbx, %rdx
callq 0x2410
movq (%r14), %rcx
leaq 0xf888(%rip), %rdi      # 0x1911c
pushq $0x31
popq %rsi
movq %rbx, %rdx
callq 0x2410
pushq $0x1
popq %rbp
jmp 0x9830