#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
void ask_menu_selection(int *kind, int *monitor) {
  char ans;
  printf("\nMENU for type of start system and homotopy :\n");
  printf("  1. start system is based on total degree;\n");
  printf("  2. a linear-product start system will be given;\n");
  printf("  3. start system and start solutions are provided;\n");
  printf("  4. the homotopy is a cascade to go one level down;\n");
  printf("  5. diagonal homotopy to start a cascade;\n");
  printf("  6. compute witness set for a hypersurface;\n");
  printf("  7. collapse extrinsic diagonal of a witness set;\n");
  printf("  8. remove the last slack variable of a witness set;\n");
  printf("  9. test the crude path trackers.\n");
  printf("Type 1, 2, 3, 4, 5, 6, 7, 8, or 9 to select : ");
  scanf("%d", kind);
  if (*kind < 6) {
    printf("\nDo you want to monitor progress of solver on screen ? (y/n) ");
    scanf("%c", &ans);
    scanf("%c", &ans);
    if (ans = 'y')
      *monitor = 1;
    else
      *monitor = 0;
    scanf("%c", &ans);
  }
  if (*kind == 9)
    *monitor = 1;
}


x86 assembly (clang, -O0):
<ask_menu_selection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0d(%rip),%rdi
call   1030 <printf@plt>
lea    0xf34(%rip),%rdi
call   1030 <printf@plt>
lea    0xf5d(%rip),%rdi
call   1030 <printf@plt>
lea    0xf87(%rip),%rdi
call   1030 <printf@plt>
lea    0xfa7(%rip),%rdi
call   1030 <printf@plt>
lea    0xfc9(%rip),%rdi
call   1030 <printf@plt>
lea    0xff1(%rip),%rdi
call   1030 <printf@plt>
lea    0x101c(%rip),%rdi
call   1030 <printf@plt>
lea    0x1034(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0x1053(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x6,(%rax)
jge    1241 <ask_menu_selection+0x121>
lea    0x103b(%rip),%rdi
call   1030 <printf@plt>
lea    0x106d(%rip),%rdi
lea    -0x11(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0x105b(%rip),%rdi
lea    -0x11(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movb   $0x79,-0x11(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1216 <ask_menu_selection+0xf6>
jmp    1225 <ask_menu_selection+0x105>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
jmp    122f <ask_menu_selection+0x10f>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
lea    0x101d(%rip),%rdi
lea    -0x11(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x9,(%rax)
jne    1258 <ask_menu_selection+0x138>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ask_menu_selection>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xf2e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf50(%rip),%rdi
call   1030 <puts@plt>
lea    0xf70(%rip),%rdi
call   1030 <puts@plt>
lea    0xf96(%rip),%rdi
call   1030 <puts@plt>
lea    0xfbe(%rip),%rdi
call   1030 <puts@plt>
lea    0xfe7(%rip),%rdi
call   1030 <puts@plt>
lea    0x1006(%rip),%rdi
call   1030 <puts@plt>
lea    0x1027(%rip),%rdi
call   1030 <puts@plt>
lea    0x104e(%rip),%rdi
call   1030 <puts@plt>
lea    0x1078(%rip),%rdi
call   1030 <puts@plt>
lea    0xe43(%rip),%rdi
call   1040 <printf@plt>
lea    0xe66(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    (%rbx),%eax
cmp    $0x5,%eax
jg     1227 <ask_menu_selection+0xf7>
lea    0xe51(%rip),%rdi
call   1040 <printf@plt>
lea    0xe83(%rip),%r15
lea    0x7(%rsp),%r12
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movb   $0x79,0x7(%rsp)
movl   $0x1,(%r14)
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    (%rbx),%eax
cmp    $0x9,%eax
jne    1233 <ask_menu_selection+0x103>
movl   $0x1,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [47 x i8] c"\0AMENU for type of start system and homotopy :\0A\00"
@.str.1 = [45 x i8] c" 1. start system is based on total degree;\0A\00"
@.str.2 = [51 x i8] c" 2. a linear-product start system will be given;\0A\00"
@.str.3 = [53 x i8] c" 3. start system and start solutions are provided;\0A\00"
@.str.4 = [54 x i8] c" 4. the homotopy is a cascade to go one level down;\0A\00"
@.str.5 = [44 x i8] c" 5. diagonal homotopy to start a cascade;\0A\00"
@.str.6 = [46 x i8] c" 6. compute witness set for a hypersurface;\0A\00"
@.str.7 = [52 x i8] c" 7. collapse extrinsic diagonal of a witness set;\0A\00"
@.str.8 = [55 x i8] c" 8. remove the last slack variable of a witness set;\0A\00"
@.str.9 = [36 x i8] c" 9. test the crude path trackers.\0A\00"
@.str.10 = [47 x i8] c"Type 1, 2, 3, 4, 5, 6, 7, 8, or 9 to select : \00"
@.str.11 = [3 x i8] c"%d\00"
@.str.12 = [62 x i8] c"\0ADo you want to monitor progress of solver on screen ? (y/n) \00"
@.str.13 = [3 x i8] c"%c\00"
define void @ask_menu_selection(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i8
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.8, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0))
%17 = load i32*, i32** %3
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32* %17)
%19 = load i32*, i32** %3
%20 = load i32, i32* %19
%21 = icmp slt i32 %20, 6
br i1 %21, label %22, label %32
22: ; preds = %2
%23 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.12, i64 0, i64 0))
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* %5)
%25 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* %5)
store i8 121, i8* %5
br i1 true, label %26, label %28
26: ; preds = %22
%27 = load i32*, i32** %4
store i32 1, i32* %27
br label %30
28: ; preds = %22
%29 = load i32*, i32** %4
store i32 0, i32* %29
br label %30
30: ; preds = %28, %26
%31 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* %5)
br label %32
32: ; preds = %30, %2
%33 = load i32*, i32** %3
%34 = load i32, i32* %33
%35 = icmp eq i32 %34, 9
br i1 %35, label %36, label %38
36: ; preds = %32
%37 = load i32*, i32** %4
store i32 1, i32* %37
br label %38
38: ; preds = %36, %32
ret void
}

LLVM IR (-O2):
@.str.10 = [47 x i8] c"Type 1, 2, 3, 4, 5, 6, 7, 8, or 9 to select : \00"
@.str.11 = [3 x i8] c"%d\00"
@.str.12 = [62 x i8] c"\0ADo you want to monitor progress of solver on screen ? (y/n) \00"
@.str.13 = [3 x i8] c"%c\00"
@str = [46 x i8] c"\0AMENU for type of start system and homotopy :\00"
@str.14 = [44 x i8] c" 1. start system is based on total degree;\00"
@str.15 = [50 x i8] c" 2. a linear-product start system will be given;\00"
@str.16 = [52 x i8] c" 3. start system and start solutions are provided;\00"
@str.17 = [53 x i8] c" 4. the homotopy is a cascade to go one level down;\00"
@str.18 = [43 x i8] c" 5. diagonal homotopy to start a cascade;\00"
@str.19 = [45 x i8] c" 6. compute witness set for a hypersurface;\00"
@str.20 = [51 x i8] c" 7. collapse extrinsic diagonal of a witness set;\00"
@str.21 = [54 x i8] c" 8. remove the last slack variable of a witness set;\00"
@str.22 = [35 x i8] c" 9. test the crude path trackers.\00"
define void @ask_menu_selection(i32* %0, i32* nocapture writeonly %1) {
%3 = alloca i8
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.14, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.15, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.16, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.17, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.18, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.19, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.20, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.21, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.22, i64 0, i64 0))
%14 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0))
%15 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32* %0)
%16 = load i32, i32* %0
%17 = icmp slt i32 %16, 6
br i1 %17, label %18, label %24
18: ; preds = %2
%19 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.12, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* %3)
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* %3)
store i8 121, i8* %3
store i32 1, i32* %1
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* %3)
%23 = load i32, i32* %0
br label %24
24: ; preds = %18, %2
%25 = phi i32 [ %23, %18 ], [ %16, %2 ]
%26 = icmp eq i32 %25, 9
br i1 %26, label %27, label %28
27: ; preds = %24
store i32 1, i32* %1
br label %28
28: ; preds = %27, %24
ret void
}