// File: /workspace/github_c_makefile_star2_O3/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
movl $0x8, %r14d
cmpl $0x2, %edi
jl 0x2c33
movq 0x8(%rbx), %rax
cmpb $0x2d, (%rax)
jne 0x2c33
movzbl 0x1(%rax), %eax
movl $0x10, %r14d
leal -0x64(%rax), %ecx
cmpl $0xf, %ecx
ja 0x2b82
leaq 0x84aa(%rip), %rax      # 0xb014
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl $0x3, 0x12873(%rip)     # 0x153f0
jmp 0x2c33
cmpl $0x79, %eax
je 0x2c29
cmpl $0x3f, %eax
jne 0x2c33
movq (%rbx), %rsi
leaq 0x84e9(%rip), %rdi      # 0xb087
xorl %eax, %eax
callq 0x2100
xorl %edi, %edi
callq 0x22e0
movl $0x2, 0x1283a(%rip)     # 0x153f0
xorl %ebp, %ebp
xorl %edi, %edi
callq 0x20b0
testl %eax, %eax
je 0x2be3
movl $0x1, %edi
callq 0x20b0
testl %eax, %eax
je 0x2be3
movl $0x2, %edi
callq 0x20b0
xorl %ebp, %ebp
testl %eax, %eax
setne %bpl
movl %ebp, 0x125f7(%rip)     # 0x151e0
jmp 0x2c33
movl $0x1, 0x127fb(%rip)     # 0x153f0
jmp 0x2c33
movl $0x5, 0x127ef(%rip)     # 0x153f0
jmp 0x2c33
movl $0x6, 0x127e3(%rip)     # 0x153f0
jmp 0x2c33
movl $0x7, 0x127d7(%rip)     # 0x153f0
xorl %edi, %edi
callq 0x2200
movl %eax, %edi
callq 0x2070
jmp 0x2c33
movl $0x4, 0x127bd(%rip)     # 0x153f0
movq (%rbx,%r14), %rdi
callq 0x5dc8
movl 0x127ae(%rip), %eax     # 0x153f0
cmpl $0x2, %eax
jb 0x2c8b
je 0x2c78
cmpl $0x3, %eax
jne 0x2c9b
callq 0x73cb
movq %rax, %rbx
movq %rax, %rdi
callq 0x7554
testl %eax, %eax
je 0x2c92
leaq 0x8431(%rip), %rdi      # 0xb09a
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2100
jmp 0x2d0e
leaq 0x844f(%rip), %rdi      # 0xb0ce
movq %rsp, %rsi
callq 0x21c0
testl %eax, %eax
jne 0x2d02
xorl %edi, %edi
callq 0x7554
cmpl $0x2, 0x12757(%rip)     # 0x153f0
je 0x2ccb
leaq 0x12816(%rip), %rdi     # 0x154b8
movq %rdi, 0x127d7(%rip)     # 0x15480
callq 0x2d18
cmpl $0x0, 0x1273b(%rip)     # 0x153f0
jne 0x2ccb
movl $0x2, 0x1272f(%rip)     # 0x153f0
movl $0x1, 0x12515(%rip)     # 0x151e0
leaq 0x127e6(%rip), %rbx     # 0x154b8
movl $0x0, 0x127ac(%rip)     # 0x15488
movq %rbx, %rdi
callq 0x31f4
cmpl $0x0, 0x1279d(%rip)     # 0x15488
jne 0x2cd2
xorl %edi, %edi
callq 0x810b
xorl %eax, %eax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x8456(%rip), %rdi      # 0xb15f
callq 0x20a0
movl $0x1, %edi
callq 0x22e0