// File: /workspace/github_c_makefile_star2_O2/saltyJeff[P]uClibcpp/extra/config/conf.c
// Function: main
int main(int ac, char **av)
{
	const char *name;
	struct stat tmpstat;

	if (ac > 1 && av[1][0] == '-') {
		switch (av[1][1]) {
		case 'o':
			input_mode = ask_new;
			break;
		case 's':
			input_mode = ask_silent;
			valid_stdin = isatty(0) && isatty(1) && isatty(2);
			break;
		case 'd':
			input_mode = set_default;
			break;
		case 'n':
			input_mode = set_no;
			break;
		case 'm':
			input_mode = set_mod;
			break;
		case 'y':
			input_mode = set_yes;
			break;
		case 'r':
			input_mode = set_random;
			srandom(time(NULL));
			break;
		case 'h':
		case '?':
			printf("%s [-o|-s] config\n", av[0]);
			exit(0);
		}
		name = av[2];
	} else
		name = av[1];
	conf_parse(name);
	//zconfdump(stdout);
	switch (input_mode) {
	case set_default:
		name = conf_get_default_confname();
		if (conf_read(name)) {
			printf("***\n"
				"*** Can't find default configuration \"%s\"!\n"
				"***\n", name);
			exit(1);
		}
		break;
	case ask_silent:
		if (stat(".config", &tmpstat)) {
			printf("***\n"
				"*** You have not yet configured uClibc!\n"
				"***\n"
				"*** Please run some configurator (e.g. \"make config\" or\n"
				"*** \"make oldconfig\" or \"make menuconfig\").\n"
				"***\n");
			exit(1);
		}
	case ask_all:
	case ask_new:
		conf_read(NULL);
		break;
	default:
		break;
	}

	if (input_mode != ask_silent) {
		rootEntry = &rootmenu;
		conf(&rootmenu);
		if (input_mode == ask_all) {
			input_mode = ask_silent;
			valid_stdin = 1;
		}
	}
	do {
		conf_cnt = 0;
		check_conf(&rootmenu);
	} while (conf_cnt);
	conf_write(NULL);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq %rsi, %rbx
pushq $0x8
popq %r14
cmpl $0x2, %edi
jl 0x27b3
movq 0x8(%rbx), %rax
cmpb $0x2d, (%rax)
jne 0x27b3
movzbl 0x1(%rax), %eax
pushq $0x10
popq %r14
leal -0x64(%rax), %ecx
cmpl $0xf, %ecx
ja 0x2706
leaq 0x7926(%rip), %rax      # 0xa014
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl $0x3, 0x11cff(%rip)     # 0x14400
jmp 0x27b3
cmpl $0x79, %eax
je 0x27a9
cmpl $0x3f, %eax
jne 0x27b3
movq (%rbx), %rsi
leaq 0x7965(%rip), %rdi      # 0xa087
xorl %eax, %eax
callq 0x2100
xorl %edi, %edi
callq 0x22f0
movl $0x2, 0x11cc6(%rip)     # 0x14400
xorl %ebp, %ebp
xorl %edi, %edi
callq 0x20b0
testl %eax, %eax
je 0x2763
pushq $0x1
popq %rdi
callq 0x20b0
testl %eax, %eax
je 0x2763
pushq $0x2
popq %rdi
callq 0x20b0
xorl %ebp, %ebp
testl %eax, %eax
setne %bpl
movl %ebp, 0x11a87(%rip)     # 0x141f0
jmp 0x27b3
movl $0x1, 0x11c8b(%rip)     # 0x14400
jmp 0x27b3
movl $0x5, 0x11c7f(%rip)     # 0x14400
jmp 0x27b3
movl $0x6, 0x11c73(%rip)     # 0x14400
jmp 0x27b3
movl $0x7, 0x11c67(%rip)     # 0x14400
xorl %edi, %edi
callq 0x2200
movl %eax, %edi
callq 0x2070
jmp 0x27b3
movl $0x4, 0x11c4d(%rip)     # 0x14400
movq (%rbx,%r14), %rdi
callq 0x561d
movl 0x11c3e(%rip), %eax     # 0x14400
cmpl $0x2, %eax
jb 0x280b
je 0x27f8
cmpl $0x3, %eax
jne 0x281b
callq 0x6a35
movq %rax, %rbx
movq %rax, %rdi
callq 0x6b66
testl %eax, %eax
je 0x2812
leaq 0x78b1(%rip), %rdi      # 0xa09a
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2100
jmp 0x288b
leaq 0x78cf(%rip), %rdi      # 0xa0ce
movq %rsp, %rsi
callq 0x21c0
testl %eax, %eax
jne 0x287f
xorl %edi, %edi
callq 0x6b66
cmpl $0x2, 0x11be7(%rip)     # 0x14400
je 0x284b
leaq 0x11ca6(%rip), %rdi     # 0x144c8
movq %rdi, 0x11c67(%rip)     # 0x14490
callq 0x2893
cmpl $0x0, 0x11bcb(%rip)     # 0x14400
jne 0x284b
movl $0x2, 0x11bbf(%rip)     # 0x14400
movl $0x1, 0x119a5(%rip)     # 0x141f0
leaq 0x11c76(%rip), %rbx     # 0x144c8
andl $0x0, 0x11c3f(%rip)     # 0x14498
movq %rbx, %rdi
callq 0x2d3c
cmpl $0x0, 0x11c30(%rip)     # 0x14498
jne 0x2852
xorl %edi, %edi
callq 0x7658
xorl %eax, %eax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x78d9(%rip), %rdi      # 0xa15f
callq 0x20a0
pushq $0x1
popq %rdi
callq 0x22f0