// File: /workspace/github_c_makefile_star2_O0/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:
subq $0xb8, %rsp
movl $0x0, 0xb4(%rsp)
movl %edi, 0xb0(%rsp)
movq %rsi, 0xa8(%rsp)
cmpl $0x1, 0xb0(%rsp)
jle 0x29ca
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x29ca
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
movsbl 0x1(%rax), %eax
addl $-0x3f, %eax
movl %eax, %ecx
movq %rcx, 0x8(%rsp)
subl $0x3a, %eax
ja 0x29b4
movq 0x8(%rsp), %rax
leaq 0xd73e(%rip), %rcx      # 0x10014
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x1, 0x16b07(%rip)     # 0x193f0
jmp 0x29b4
movl $0x2, 0x16af8(%rip)     # 0x193f0
xorl %edi, %edi
callq 0x20a0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0x7(%rsp)
je 0x2937
movl $0x1, %edi
callq 0x20a0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0x7(%rsp)
je 0x2937
movl $0x2, %edi
callq 0x20a0
cmpl $0x0, %eax
setne %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x1689a(%rip)     # 0x191e0
jmp 0x29b4
movl $0x3, 0x16a9e(%rip)     # 0x193f0
jmp 0x29b4
movl $0x6, 0x16a92(%rip)     # 0x193f0
jmp 0x29b4
movl $0x5, 0x16a86(%rip)     # 0x193f0
jmp 0x29b4
movl $0x4, 0x16a7a(%rip)     # 0x193f0
jmp 0x29b4
movl $0x7, 0x16a6e(%rip)     # 0x193f0
xorl %eax, %eax
movl %eax, %edi
callq 0x21f0
movl %eax, %edi
callq 0x2070
jmp 0x29b4
movq 0xa8(%rsp), %rax
movq (%rax), %rsi
leaq 0xd78d(%rip), %rdi      # 0x10133
movb $0x0, %al
callq 0x20f0
xorl %edi, %edi
callq 0x22d0
movq 0xa8(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0xa0(%rsp)
jmp 0x29de
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rdi
callq 0x6a10
movl 0x169ff(%rip), %eax     # 0x193f0
movl %eax, (%rsp)
subl $0x2, %eax
jb 0x2a84
jmp 0x29ff
movl (%rsp), %eax
subl $0x2, %eax
je 0x2a54
jmp 0x2a09
movl (%rsp), %eax
subl $0x3, %eax
jne 0x2a8f
jmp 0x2a13
callq 0x9650
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rdi
callq 0x9880
cmpl $0x0, %eax
je 0x2a52
movq 0xa0(%rsp), %rsi
leaq 0xd705(%rip), %rdi      # 0x10146
movb $0x0, %al
callq 0x20f0
movl $0x1, %edi
callq 0x22d0
jmp 0x2a91
leaq 0xd71f(%rip), %rdi      # 0x1017a
leaq 0x10(%rsp), %rsi
callq 0x21b0
cmpl $0x0, %eax
je 0x2a82
leaq 0xd711(%rip), %rdi      # 0x10182
movb $0x0, %al
callq 0x20f0
movl $0x1, %edi
callq 0x22d0
jmp 0x2a84
xorl %eax, %eax
movl %eax, %edi
callq 0x9880
jmp 0x2a91
jmp 0x2a91
cmpl $0x2, 0x16958(%rip)     # 0x193f0
je 0x2ad3
leaq 0x16a17(%rip), %rax     # 0x194b8
movq %rax, 0x169d8(%rip)     # 0x19480
leaq 0x16a09(%rip), %rdi     # 0x194b8
callq 0x2b10
cmpl $0x0, 0x16935(%rip)     # 0x193f0
jne 0x2ad1
movl $0x2, 0x16929(%rip)     # 0x193f0
movl $0x1, 0x1670f(%rip)     # 0x191e0
jmp 0x2ad3
jmp 0x2ad5
movl $0x0, 0x169a9(%rip)     # 0x19488
leaq 0x169d2(%rip), %rdi     # 0x194b8
callq 0x2cc0
cmpl $0x0, 0x16996(%rip)     # 0x19488
jne 0x2ad5
xorl %eax, %eax
movl %eax, %edi
callq 0xacb0
xorl %eax, %eax
addq $0xb8, %rsp
retq
nopw (%rax,%rax)