// File: /workspace/github_c_makefile_star2_O1/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 0x2ce0
movq 0x8(%rbx), %rax
cmpb $0x2d, (%rax)
jne 0x2ce0
movzbl 0x1(%rax), %eax
movl $0x10, %r14d
leal -0x64(%rax), %ecx
cmpl $0xf, %ecx
ja 0x2c2f
leaq 0x93fd(%rip), %rax      # 0xc014
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl $0x3, 0x137c6(%rip)     # 0x163f0
jmp 0x2ce0
cmpl $0x79, %eax
je 0x2cd6
cmpl $0x3f, %eax
jne 0x2ce0
movq (%rbx), %rsi
leaq 0x9448(%rip), %rdi      # 0xc093
xorl %eax, %eax
callq 0x2100
xorl %edi, %edi
callq 0x22d0
movl $0x2, 0x1378d(%rip)     # 0x163f0
xorl %ebp, %ebp
xorl %edi, %edi
callq 0x20b0
testl %eax, %eax
je 0x2c90
movl $0x1, %edi
callq 0x20b0
testl %eax, %eax
je 0x2c90
movl $0x2, %edi
callq 0x20b0
xorl %ebp, %ebp
testl %eax, %eax
setne %bpl
movl %ebp, 0x1354a(%rip)     # 0x161e0
jmp 0x2ce0
movl $0x1, 0x1374e(%rip)     # 0x163f0
jmp 0x2ce0
movl $0x5, 0x13742(%rip)     # 0x163f0
jmp 0x2ce0
movl $0x6, 0x13736(%rip)     # 0x163f0
jmp 0x2ce0
movl $0x7, 0x1372a(%rip)     # 0x163f0
xorl %edi, %edi
callq 0x21f0
movl %eax, %edi
callq 0x2070
jmp 0x2ce0
movl $0x4, 0x13710(%rip)     # 0x163f0
movq (%rbx,%r14), %rdi
callq 0x6444
movl 0x13701(%rip), %eax     # 0x163f0
cmpl $0x2, %eax
jb 0x2d38
je 0x2d25
cmpl $0x3, %eax
jne 0x2d3f
callq 0x7a72
movq %rax, %rbx
movq %rax, %rdi
callq 0x7bfe
testl %eax, %eax
je 0x2d3f
leaq 0x9390(%rip), %rdi      # 0xc0a6
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2100
jmp 0x2dbb
leaq 0x93ae(%rip), %rdi      # 0xc0da
movq %rsp, %rsi
callq 0x21b0
testl %eax, %eax
jne 0x2daf
xorl %edi, %edi
callq 0x7bfe
cmpl $0x2, 0x136aa(%rip)     # 0x163f0
je 0x2d78
leaq 0x13769(%rip), %rdi     # 0x164b8
movq %rdi, 0x1372a(%rip)     # 0x16480
callq 0x2dc5
cmpl $0x0, 0x1368e(%rip)     # 0x163f0
jne 0x2d78
movl $0x2, 0x13682(%rip)     # 0x163f0
movl $0x1, 0x13468(%rip)     # 0x161e0
leaq 0x13739(%rip), %rbx     # 0x164b8
movl $0x0, 0x136ff(%rip)     # 0x16488
movq %rbx, %rdi
callq 0x32a1
cmpl $0x0, 0x136f0(%rip)     # 0x16488
jne 0x2d7f
xorl %edi, %edi
callq 0x8754
xorl %eax, %eax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x93b5(%rip), %rdi      # 0xc16b
callq 0x20a0
movl $0x1, %edi
callq 0x22d0