// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x1984a(%rip), %rdx     # 0x2803d
callq 0x23e0
movl %eax, -0x20(%rbp)
cmpl $0x0, %eax
jl 0xe820
cmpl $0x6d, -0x20(%rbp)
jne 0xe80f
movl $0x1, -0x28(%rbp)
jmp 0xe81e
cmpl $0x6e, -0x20(%rbp)
jne 0xe81c
movl $0x1, -0x2c(%rbp)
jmp 0xe81e
jmp 0xe7e5
movl -0x8(%rbp), %eax
movq 0x1f76e(%rip), %rcx     # 0x2df98
cmpl (%rcx), %eax
jne 0xe89a
movq 0x1f7c3(%rip), %rax     # 0x2dff8
movq (%rax), %rdi
leaq 0x19801(%rip), %rsi     # 0x28040
movb $0x0, %al
callq 0x2260
movq 0x1f7ab(%rip), %rax     # 0x2dff8
movq (%rax), %rdi
leaq 0x18967(%rip), %rsi     # 0x271be
movb $0x0, %al
callq 0x2260
movq 0x1f793(%rip), %rax     # 0x2dff8
movq (%rax), %rdi
leaq 0x197f8(%rip), %rsi     # 0x28067
movb $0x0, %al
callq 0x2260
movq 0x1f77b(%rip), %rax     # 0x2dff8
movq (%rax), %rdi
leaq 0x19805(%rip), %rsi     # 0x2808c
movb $0x0, %al
callq 0x2260
movl $0x1, -0x4(%rbp)
jmp 0xe9e2
movl -0x8(%rbp), %eax
movq 0x1f6f4(%rip), %rcx     # 0x2df98
subl (%rcx), %eax
cmpl $0x2, %eax
jl 0xe8cf
movq -0x10(%rbp), %rax
movq 0x1f6e2(%rip), %rcx     # 0x2df98
movl (%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq -0x24(%rbp), %rsi
callq 0x22f50
movq %rax, -0x18(%rbp)
cmpl $0x0, -0x28(%rbp)
je 0xe982
movq -0x10(%rbp), %rax
movq 0x1f6b4(%rip), %rcx     # 0x2df98
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xd4c0
movq %rax, -0x38(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jge 0xe977
cmpq $0x0, -0x18(%rbp)
je 0xe925
movq -0x38(%rbp), %rdi
movl -0x1c(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0xe1d0
cmpl $0x0, %eax
jne 0xe925
jmp 0xe96c
cmpl $0x0, -0x2c(%rbp)
jne 0xe94f
movq -0x38(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0xdc90
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0x20e0
movq -0x40(%rbp), %rdi
callq 0x2040
jmp 0xe96a
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x20e0
jmp 0xe96c
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xe8fb
movq -0x38(%rbp), %rdi
callq 0xdb80
jmp 0xe9cb
movq -0x10(%rbp), %rax
movq 0x1f60b(%rip), %rcx     # 0x2df98
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xe380
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x2c(%rbp), %edx
callq 0xe490
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
je 0xe9c2
movq -0x50(%rbp), %rdi
callq 0x20e0
jmp 0xe99d
movq -0x48(%rbp), %rdi
callq 0xe440
cmpq $0x0, -0x18(%rbp)
je 0xe9db
movq -0x18(%rbp), %rdi
callq 0x23c00
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)