// File: /workspace/github_c_makefile_star2_O0/saltyJeff[P]uClibcpp/extra/config/conf.c
// Function: conf_choice
static int conf_choice(struct menu *menu)
{
	struct symbol *sym, *def_sym;
	struct menu *child;
	int type;
	bool is_new;

	sym = menu->sym;
	type = sym_get_type(sym);
	is_new = !sym_has_value(sym);
	if (sym_is_changable(sym)) {
		conf_sym(menu);
		sym_calc_value(sym);
		switch (sym_get_tristate_value(sym)) {
		case no:
			return 1;
		case mod:
			return 0;
		case yes:
			break;
		}
	} else {
		switch (sym_get_tristate_value(sym)) {
		case no:
			return 1;
		case mod:
			printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu));
			return 0;
		case yes:
			break;
		}
	}

	while (1) {
		int cnt, def;

		printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu));
		def_sym = sym_get_choice_value(sym);
		cnt = def = 0;
		line[0] = '0';
		line[1] = 0;
		for (child = menu->list; child; child = child->next) {
			if (!menu_is_visible(child))
				continue;
			if (!child->sym) {
				printf("%*c %s\n", indent, '*', menu_get_prompt(child));
				continue;
			}
			cnt++;
			if (child->sym == def_sym) {
				def = cnt;
				printf("%*c", indent, '>');
			} else
				printf("%*c", indent, ' ');
			printf(" %d. %s", cnt, menu_get_prompt(child));
			if (child->sym->name)
				printf(" (%s)", child->sym->name);
			if (!sym_has_value(child->sym))
				printf(" (NEW)");
			printf("\n");
		}
		printf("%*schoice", indent - 1, "");
		if (cnt == 1) {
			printf("[1]: 1\n");
			goto conf_childs;
		}
		printf("[1-%d", cnt);
		if (sym->help)
			printf("?");
		printf("]: ");
		switch (input_mode) {
		case ask_new:
		case ask_silent:
			if (!is_new) {
				cnt = def;
				printf("%d\n", cnt);
				break;
			}
			check_stdin();
		case ask_all:
			fflush(stdout);
			fgets(line, 128, stdin);
			strip(line);
			if (line[0] == '?') {
				printf("\n%s\n", menu->sym->help ?
					menu->sym->help : nohelp_text);
				continue;
			}
			if (!line[0])
				cnt = def;
			else if (isdigit(line[0]))
				cnt = atoi(line);
			else
				continue;
			break;
		case set_random:
			def = (random() % cnt) + 1;
		case set_default:
		case set_yes:
		case set_mod:
		case set_no:
			cnt = def;
			printf("%d\n", cnt);
			break;
		}

	conf_childs:
		for (child = menu->list; child; child = child->next) {
			if (!child->sym || !menu_is_visible(child))
				continue;
			if (!--cnt)
				break;
		}
		if (!child)
			continue;
		if (line[strlen(line) - 1] == '?') {
			printf("\n%s\n", child->sym->help ?
				child->sym->help : nohelp_text);
			continue;
		}
		sym_set_choice_value(sym, child->sym);
		if (child->list) {
			indent += 2;
			conf(child->list);
			indent -= 2;
		}
		return 1;
	}
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq 0x58(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rdi
callq 0xea00
movl %eax, 0x3c(%rsp)
movq 0x50(%rsp), %rdi
callq 0x2db0
xorb $-0x1, %al
andb $0x1, %al
movb %al, 0x3b(%rsp)
movq 0x50(%rsp), %rdi
callq 0xf3e0
testb $0x1, %al
jne 0x2ea7
jmp 0x2f05
movq 0x58(%rsp), %rdi
callq 0x3440
movq 0x50(%rsp), %rdi
callq 0xa4f0
movq 0x50(%rsp), %rdi
callq 0x3730
movl %eax, %ecx
movl %ecx, 0x2c(%rsp)
testl %eax, %eax
je 0x2ee7
jmp 0x2ed1
movl 0x2c(%rsp), %eax
subl $0x1, %eax
je 0x2ef4
jmp 0x2edc
movl 0x2c(%rsp), %eax
subl $0x2, %eax
je 0x2f01
jmp 0x2f03
movl $0x1, 0x64(%rsp)
jmp 0x342e
movl $0x0, 0x64(%rsp)
jmp 0x342e
jmp 0x2f03
jmp 0x2f82
movq 0x50(%rsp), %rdi
callq 0x3730
movl %eax, %ecx
movl %ecx, 0x28(%rsp)
testl %eax, %eax
je 0x2f31
jmp 0x2f1b
movl 0x28(%rsp), %eax
subl $0x1, %eax
je 0x2f3e
jmp 0x2f26
movl 0x28(%rsp), %eax
subl $0x2, %eax
je 0x2f7e
jmp 0x2f80
movl $0x1, 0x64(%rsp)
jmp 0x342e
movl 0x1625c(%rip), %eax     # 0x191a0
subl $0x1, %eax
movl %eax, 0x24(%rsp)
movq 0x58(%rsp), %rdi
callq 0xb750
movl 0x24(%rsp), %esi
movq %rax, %rcx
leaq 0xd32f(%rip), %rdi      # 0x10292
leaq 0xd2c2(%rip), %rdx      # 0x1022c
movb $0x0, %al
callq 0x20f0
movl $0x0, 0x64(%rsp)
jmp 0x342e
jmp 0x2f80
jmp 0x2f82
jmp 0x2f84
movl 0x16216(%rip), %eax     # 0x191a0
subl $0x1, %eax
movl %eax, 0x20(%rsp)
movq 0x58(%rsp), %rdi
callq 0xb750
movl 0x20(%rsp), %esi
movq %rax, %rcx
leaq 0xd2e9(%rip), %rdi      # 0x10292
leaq 0xd27c(%rip), %rdx      # 0x1022c
movb $0x0, %al
callq 0x20f0
movq 0x50(%rsp), %rdi
callq 0x3740
movq %rax, 0x48(%rsp)
movl $0x0, 0x30(%rsp)
movl $0x0, 0x34(%rsp)
movb $0x30, 0x16423(%rip)    # 0x19400
movb $0x0, 0x1641d(%rip)     # 0x19401
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x40(%rsp)
cmpq $0x0, 0x40(%rsp)
je 0x3139
movq 0x40(%rsp), %rdi
callq 0xb650
testb $0x1, %al
jne 0x3011
jmp 0x3127
movq 0x40(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x3050
movl 0x1617d(%rip), %eax     # 0x191a0
movl %eax, 0x1c(%rsp)
movq 0x40(%rsp), %rdi
callq 0xb750
movl 0x1c(%rsp), %esi
movq %rax, %rcx
leaq 0xd25a(%rip), %rdi      # 0x10299
movl $0x2a, %edx
movb $0x0, %al
callq 0x20f0
jmp 0x3127
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
cmpq 0x48(%rsp), %rax
jne 0x308e
movl 0x34(%rsp), %eax
movl %eax, 0x30(%rsp)
movl 0x16127(%rip), %esi     # 0x191a0
leaq 0xd221(%rip), %rdi      # 0x102a1
movl $0x3e, %edx
movb $0x0, %al
callq 0x20f0
jmp 0x30a7
movl 0x1610c(%rip), %esi     # 0x191a0
leaq 0xd206(%rip), %rdi      # 0x102a1
movl $0x20, %edx
movb $0x0, %al
callq 0x20f0
movl 0x34(%rsp), %eax
movl %eax, 0x18(%rsp)
movq 0x40(%rsp), %rdi
callq 0xb750
movl 0x18(%rsp), %esi
movq %rax, %rdx
leaq 0xd1de(%rip), %rdi      # 0x102a5
movb $0x0, %al
callq 0x20f0
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
cmpq $0x0, 0x8(%rax)
je 0x30f9
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rsi
leaq 0xd1bb(%rip), %rdi      # 0x102ad
movb $0x0, %al
callq 0x20f0
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x2db0
testb $0x1, %al
jne 0x3119
leaq 0xd1a1(%rip), %rdi      # 0x102b3
movb $0x0, %al
callq 0x20f0
leaq 0xd10b(%rip), %rdi      # 0x1022b
movb $0x0, %al
callq 0x20f0
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x40(%rsp)
jmp 0x2ff2
movl 0x16061(%rip), %esi     # 0x191a0
subl $0x1, %esi
leaq 0xd171(%rip), %rdi      # 0x102ba
leaq 0xd0dc(%rip), %rdx      # 0x1022c
movb $0x0, %al
callq 0x20f0
cmpl $0x1, 0x34(%rsp)
jne 0x3171
leaq 0xd15f(%rip), %rdi      # 0x102c4
movb $0x0, %al
callq 0x20f0
jmp 0x330f
movl 0x34(%rsp), %esi
leaq 0xd150(%rip), %rdi      # 0x102cc
movb $0x0, %al
callq 0x20f0
movq 0x50(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x319d
leaq 0xd14a(%rip), %rdi      # 0x102e0
movb $0x0, %al
callq 0x20f0
leaq 0xd12e(%rip), %rdi      # 0x102d2
xorl %eax, %eax
callq 0x20f0
movl 0x1623f(%rip), %eax     # 0x193f0
movq %rax, 0x10(%rsp)
subq $0x7, %rax
ja 0x330d
movq 0x10(%rsp), %rax
leaq 0xcf34(%rip), %rcx      # 0x10100
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
testb $0x1, 0x3b(%rsp)
jne 0x31fb
movl 0x30(%rsp), %eax
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %esi
leaq 0x12af4(%rip), %rdi     # 0x15ce3
movb $0x0, %al
callq 0x20f0
jmp 0x330d
callq 0x2de0
movq 0x15dc9(%rip), %rax     # 0x18fd0
movq (%rax), %rdi
callq 0x2230
movq 0x15dc2(%rip), %rax     # 0x18fd8
movq (%rax), %rdx
leaq 0x161e0(%rip), %rdi     # 0x19400
movl $0x80, %esi
callq 0x2170
leaq 0x161cf(%rip), %rdi     # 0x19400
callq 0x3750
movsbl 0x161c3(%rip), %eax     # 0x19400
cmpl $0x3f, %eax
jne 0x328c
movq 0x58(%rsp), %rax
movq 0x18(%rax), %rax
cmpq $0x0, 0x10(%rax)
je 0x3266
movq 0x58(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, 0x8(%rsp)
jmp 0x3274
leaq 0x15f43(%rip), %rax     # 0x191b0
movq %rax, 0x8(%rsp)
jmp 0x3274
movq 0x8(%rsp), %rsi
leaq 0x125db(%rip), %rdi     # 0x1585b
movb $0x0, %al
callq 0x20f0
jmp 0x2f84
cmpb $0x0, 0x1616d(%rip)     # 0x19400
jne 0x329f
movl 0x30(%rsp), %eax
movl %eax, 0x34(%rsp)
jmp 0x32d8
callq 0x2300
movq (%rax), %rax
movsbl 0x16152(%rip), %ecx     # 0x19400
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x32d1
leaq 0x1613a(%rip), %rdi     # 0x19400
callq 0x22a0
movl %eax, 0x34(%rsp)
jmp 0x32d6
jmp 0x2f84
jmp 0x32d8
jmp 0x330d
callq 0x2210
movslq 0x34(%rsp), %rcx
cqto
idivq %rcx
addq $0x1, %rdx
movl %edx, %eax
movl %eax, 0x30(%rsp)
movl 0x30(%rsp), %eax
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %esi
leaq 0x129dd(%rip), %rdi     # 0x15ce3
movb $0x0, %al
callq 0x20f0
jmp 0x330f
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x40(%rsp)
cmpq $0x0, 0x40(%rsp)
je 0x3364
movq 0x40(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x333f
movq 0x40(%rsp), %rdi
callq 0xb650
testb $0x1, %al
jne 0x3341
jmp 0x3355
movl 0x34(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x34(%rsp)
cmpl $0x0, %eax
jne 0x3353
jmp 0x3364
jmp 0x3355
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x40(%rsp)
jmp 0x331d
cmpq $0x0, 0x40(%rsp)
jne 0x3371
jmp 0x2f84
leaq 0x16088(%rip), %rdi     # 0x19400
callq 0x20d0
movq %rax, %rcx
subq $0x1, %rcx
leaq 0x16075(%rip), %rax     # 0x19400
movsbl (%rax,%rcx), %eax
cmpl $0x3f, %eax
jne 0x33db
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
cmpq $0x0, 0x10(%rax)
je 0x33b7
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, (%rsp)
jmp 0x33c4
leaq 0x15df2(%rip), %rax     # 0x191b0
movq %rax, (%rsp)
jmp 0x33c4
movq (%rsp), %rsi
leaq 0x1248c(%rip), %rdi     # 0x1585b
movb $0x0, %al
callq 0x20f0
jmp 0x2f84
movq 0x50(%rsp), %rdi
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rsi
callq 0x3830
movq 0x40(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x3426
movl 0x15da0(%rip), %eax     # 0x191a0
addl $0x2, %eax
movl %eax, 0x15d97(%rip)     # 0x191a0
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x2b10
movl 0x15d83(%rip), %eax     # 0x191a0
subl $0x2, %eax
movl %eax, 0x15d7a(%rip)     # 0x191a0
movl $0x1, 0x64(%rsp)
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
nopw (%rax,%rax)