#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 */
double atof(char *);
size_t atol(char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *);
char *read_line();
scalar_t__ strcmp(char *, char *);
void interactive_opt(size_t *nextractmin, size_t *ncondmax, size_t ncol,
                     char *autodim, double *mincov, double *maxerrperc,
                     double *validperc) {
  char *strtmp;
  printf("Insert the min number of condition ["
         "1"
         "]: ");
  strtmp = read_line();
  if (strcmp(strtmp, "\n"))
    *nextractmin = atol(strtmp);
  else
    *nextractmin = 1;
  free(strtmp);
  printf("Insert the max number of condition [auto]: ");
  strtmp = read_line();
  if (strcmp(strtmp, "\n")) {
    *ncondmax = atol(strtmp);
  } else {
    *ncondmax = ncol;
    *autodim = 1;
  }
  free(strtmp);
  printf("Insert the min covering in percentage ["
         "5"
         "]: ");
  strtmp = read_line();
  if (strcmp(strtmp, "\n"))
    *mincov = atof(strtmp);
  else
    *mincov = 5;
  free(strtmp);
  printf("Insert the max error in percentage: ["
         "0"
         "]: ");
  strtmp = read_line();
  if (strcmp(strtmp, "\n"))
    *maxerrperc = atof(strtmp);
  else
    maxerrperc = 0;
  free(strtmp);
  printf("Insert the percentage to use for validation: ["
         "0"
         "]: ");
  strtmp = read_line();
  if (strcmp(strtmp, "\n"))
    *validperc = atof(strtmp);
  else
    *validperc = 0;
  free(strtmp);
  return;
}


x86 assembly (clang, -O0):
<interactive_opt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
lea    0xe7d(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <read_line@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
lea    0xe8b(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     11cd <interactive_opt+0x6d>
mov    -0x38(%rbp),%rdi
call   1080 <atol@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    11d8 <interactive_opt+0x78>
mov    -0x8(%rbp),%rax
movq   $0x1,(%rax)
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
lea    0xe4b(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <read_line@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
lea    0xe2e(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     122a <interactive_opt+0xca>
mov    -0x38(%rbp),%rdi
call   1080 <atol@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    123c <interactive_opt+0xdc>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
movb   $0x1,(%rax)
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
lea    0xe13(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <read_line@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
lea    0xdca(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     128c <interactive_opt+0x12c>
mov    -0x38(%rbp),%rdi
call   1040 <atof@plt>
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    129c <interactive_opt+0x13c>
mov    -0x28(%rbp),%rax
movsd  0xd68(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
lea    0xddf(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <read_line@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
lea    0xd6a(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     12ec <interactive_opt+0x18c>
mov    -0x38(%rbp),%rdi
call   1040 <atof@plt>
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    12f4 <interactive_opt+0x194>
movq   $0x0,-0x30(%rbp)
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
lea    0xdb1(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <read_line@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
lea    0xd12(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     1344 <interactive_opt+0x1e4>
mov    -0x38(%rbp),%rdi
call   1040 <atof@plt>
mov    0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    134f <interactive_opt+0x1ef>
mov    0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interactive_opt>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,0x8(%rsp)
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    0x50(%rsp),%rax
mov    %rax,0x10(%rsp)
lea    0xe75(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <read_line@plt>
mov    %rax,%r14
lea    0xe88(%rip),%rsi
mov    %rax,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11c0 <interactive_opt+0x60>
mov    %r14,%rdi
call   1080 <atol@plt>
jmp    11c5 <interactive_opt+0x65>
mov    $0x1,%eax
mov    %rax,0x0(%rbp)
mov    %r14,%rdi
call   1030 <free@plt>
lea    0xe5b(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <read_line@plt>
mov    %rax,%rbp
lea    0xe43(%rip),%rsi
mov    %rax,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1208 <interactive_opt+0xa8>
mov    %rbp,%rdi
call   1080 <atol@plt>
mov    %rax,(%rbx)
jmp    1210 <interactive_opt+0xb0>
mov    %r13,(%rbx)
movb   $0x1,(%r12)
mov    %rbp,%rdi
call   1030 <free@plt>
lea    0xe40(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <read_line@plt>
mov    %rax,%rbx
lea    0xdfc(%rip),%rsi
mov    %rax,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     124c <interactive_opt+0xec>
mov    %rbx,%rdi
call   1040 <atof@plt>
jmp    1254 <interactive_opt+0xf4>
movsd  0xdac(%rip),%xmm0
movsd  %xmm0,(%r15)
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xe23(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <read_line@plt>
mov    %rax,%rbx
lea    0xdb3(%rip),%rsi
mov    %rax,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     129c <interactive_opt+0x13c>
mov    %rbx,%rdi
call   1040 <atof@plt>
mov    0x8(%rsp),%rax
movsd  %xmm0,(%rax)
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xe0a(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <read_line@plt>
mov    %rax,%rbx
lea    0xd70(%rip),%rsi
mov    %rax,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     12d8 <interactive_opt+0x178>
mov    %rbx,%rdi
call   1040 <atof@plt>
jmp    12db <interactive_opt+0x17b>
xorps  %xmm0,%xmm0
mov    0x10(%rsp),%rax
movsd  %xmm0,(%rax)
mov    %rbx,%rdi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Insert the min number of condition [1]: \00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [44 x i8] c"Insert the max number of condition [auto]: \00"
@.str.3 = [44 x i8] c"Insert the min covering in percentage [5]: \00"
@.str.4 = [42 x i8] c"Insert the max error in percentage: [0]: \00"
@.str.5 = [51 x i8] c"Insert the percentage to use for validation: [0]: \00"
define void @interactive_opt(i64* %0, i64* %1, i64 %2, i8* %3, double* %4, double* %5, double* %6) {
%8 = alloca i64*
%9 = alloca i64*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca i8*
store i64* %0, i64** %8
store i64* %1, i64** %9
store i64 %2, i64* %10
store i8* %3, i8** %11
store double* %4, double** %12
store double* %5, double** %13
store double* %6, double** %14
%16 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%17 = call i8* (...) @read_line()
store i8* %17, i8** %15
%18 = load i8*, i8** %15
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %7
%22 = load i8*, i8** %15
%23 = call i64 @atol(i8* %22)
%24 = load i64*, i64** %8
store i64 %23, i64* %24
br label %27
25: ; preds = %7
%26 = load i64*, i64** %8
store i64 1, i64* %26
br label %27
27: ; preds = %25, %21
%28 = load i8*, i8** %15
%29 = call i32 @free(i8* %28)
%30 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%31 = call i8* (...) @read_line()
store i8* %31, i8** %15
%32 = load i8*, i8** %15
%33 = call i64 @strcmp(i8* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %27
%36 = load i8*, i8** %15
%37 = call i64 @atol(i8* %36)
%38 = load i64*, i64** %9
store i64 %37, i64* %38
br label %43
39: ; preds = %27
%40 = load i64, i64* %10
%41 = load i64*, i64** %9
store i64 %40, i64* %41
%42 = load i8*, i8** %11
store i8 1, i8* %42
br label %43
43: ; preds = %39, %35
%44 = load i8*, i8** %15
%45 = call i32 @free(i8* %44)
%46 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
%47 = call i8* (...) @read_line()
store i8* %47, i8** %15
%48 = load i8*, i8** %15
%49 = call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %55
51: ; preds = %43
%52 = load i8*, i8** %15
%53 = call double @atof(i8* %52)
%54 = load double*, double** %12
store double %53, double* %54
br label %57
55: ; preds = %43
%56 = load double*, double** %12
store double 5.000000e+00, double* %56
br label %57
57: ; preds = %55, %51
%58 = load i8*, i8** %15
%59 = call i32 @free(i8* %58)
%60 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
%61 = call i8* (...) @read_line()
store i8* %61, i8** %15
%62 = load i8*, i8** %15
%63 = call i64 @strcmp(i8* %62, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%64 = icmp ne i64 %63, 0
br i1 %64, label %65, label %69
65: ; preds = %57
%66 = load i8*, i8** %15
%67 = call double @atof(i8* %66)
%68 = load double*, double** %13
store double %67, double* %68
br label %70
69: ; preds = %57
store double* null, double** %13
br label %70
70: ; preds = %69, %65
%71 = load i8*, i8** %15
%72 = call i32 @free(i8* %71)
%73 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0))
%74 = call i8* (...) @read_line()
store i8* %74, i8** %15
%75 = load i8*, i8** %15
%76 = call i64 @strcmp(i8* %75, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%77 = icmp ne i64 %76, 0
br i1 %77, label %78, label %82
78: ; preds = %70
%79 = load i8*, i8** %15
%80 = call double @atof(i8* %79)
%81 = load double*, double** %14
store double %80, double* %81
br label %84
82: ; preds = %70
%83 = load double*, double** %14
store double 0.000000e+00, double* %83
br label %84
84: ; preds = %82, %78
%85 = load i8*, i8** %15
%86 = call i32 @free(i8* %85)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"Insert the min number of condition [1]: \00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [44 x i8] c"Insert the max number of condition [auto]: \00"
@.str.3 = [44 x i8] c"Insert the min covering in percentage [5]: \00"
@.str.4 = [42 x i8] c"Insert the max error in percentage: [0]: \00"
@.str.5 = [51 x i8] c"Insert the percentage to use for validation: [0]: \00"
define void @interactive_opt(i64* nocapture writeonly %0, i64* nocapture writeonly %1, i64 %2, i8* nocapture writeonly %3, double* nocapture writeonly %4, double* nocapture writeonly %5, double* nocapture writeonly %6) {
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%9 = tail call i8* (...) @read_line()
%10 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %7
%13 = tail call i64 @atol(i8* %9)
br label %14
14: ; preds = %7, %12
%15 = phi i64 [ %13, %12 ], [ 1, %7 ]
store i64 %15, i64* %0
%16 = tail call i32 @free(i8* %9)
%17 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%18 = tail call i8* (...) @read_line()
%19 = tail call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %23, label %21
21: ; preds = %14
%22 = tail call i64 @atol(i8* %18)
store i64 %22, i64* %1
br label %24
23: ; preds = %14
store i64 %2, i64* %1
store i8 1, i8* %3
br label %24
24: ; preds = %23, %21
%25 = tail call i32 @free(i8* %18)
%26 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
%27 = tail call i8* (...) @read_line()
%28 = tail call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %24
%31 = tail call double @atof(i8* %27)
br label %32
32: ; preds = %24, %30
%33 = phi double [ %31, %30 ], [ 5.000000e+00, %24 ]
store double %33, double* %4
%34 = tail call i32 @free(i8* %27)
%35 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
%36 = tail call i8* (...) @read_line()
%37 = tail call i64 @strcmp(i8* %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %41, label %39
39: ; preds = %32
%40 = tail call double @atof(i8* %36)
store double %40, double* %5
br label %41
41: ; preds = %32, %39
%42 = tail call i32 @free(i8* %36)
%43 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0))
%44 = tail call i8* (...) @read_line()
%45 = tail call i64 @strcmp(i8* %44, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %49, label %47
47: ; preds = %41
%48 = tail call double @atof(i8* %44)
br label %49
49: ; preds = %41, %47
%50 = phi double [ %48, %47 ], [ 0.000000e+00, %41 ]
store double %50, double* %6
%51 = tail call i32 @free(i8* %44)
ret void
}