#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*/ call_initialize_varbprec_solution(char *, int *);
int initialize_varbprec_homotopy(int, int, char *, int, char *);
int /*<<< orphan*/ printf(char *, ...);
char *read_polynomials_from_file(int, char *, int *, int *, int *, int *);
int /*<<< orphan*/ scanf(char *, ...);
int strlen(char *);
int call_initialize_varbprec_homotopy(int *index) {
  int fail, nc, lentar, lensta, nq, nv, fix, i, idx;
  char name[80];
  char *target, *start;
  printf("\nGive the name of a file to read the target system : ");
  scanf("%s", name);
  nc = strlen(name);
  target = read_polynomials_from_file(nc, name, &lentar, &nq, &nv, &fail);
  if (fail != 0)
    printf("Some failure occurred.\n");
  else {
    printf("Read %d polynomials in %d variables : \n%s\n", nq, nv, target);
    printf("\nGive the name of a file to read the start system : ");
    scanf("%s", name);
    nc = strlen(name);
    start = read_polynomials_from_file(nc, name, &lensta, &nq, &nv, &fail);
    if (fail != 0)
      printf("Some failure occurred.\n");
    else {
      printf("Read %d polynomials in %d variables : \n%s\n", nq, nv, start);
      printf("Fixed gamma constant ? (1 = yes/0 = no) ");
      scanf("%d", &fix);
      fail = initialize_varbprec_homotopy(fix, lentar, target, lensta, start);
      if (fail == 0)
        call_initialize_varbprec_solution(name, &idx);
    }
  }
  return fail;
}


x86 assembly (clang, -O0):
<call_initialize_varbprec_homotopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x80(%rbp),%rsi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    -0x80(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
lea    -0x80(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
lea    -0x20(%rbp),%r8
lea    -0xc(%rbp),%r9
call   1060 <read_polynomials_from_file@plt>
mov    %rax,-0x88(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     11db <call_initialize_varbprec_homotopy+0x7b>
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    12dd <call_initialize_varbprec_homotopy+0x17d>
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x88(%rbp),%rcx
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x80(%rbp),%rsi
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    -0x80(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
lea    -0x80(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
lea    -0x20(%rbp),%r8
lea    -0xc(%rbp),%r9
call   1060 <read_polynomials_from_file@plt>
mov    %rax,-0x90(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1262 <call_initialize_varbprec_homotopy+0x102>
lea    0xde3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    12d8 <call_initialize_varbprec_homotopy+0x178>
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x90(%rbp),%rcx
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe48(%rip),%rdi
lea    -0x24(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    -0x24(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x88(%rbp),%rdx
mov    -0x18(%rbp),%ecx
mov    -0x90(%rbp),%r8
call   1080 <initialize_varbprec_homotopy@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    12d3 <call_initialize_varbprec_homotopy+0x173>
lea    -0x80(%rbp),%rdi
lea    -0x2c(%rbp),%rsi
call   1030 <call_initialize_varbprec_solution@plt>
jmp    12d8 <call_initialize_varbprec_homotopy+0x178>
jmp    12dd <call_initialize_varbprec_homotopy+0x17d>
mov    -0xc(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_initialize_varbprec_homotopy>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
lea    0xe80(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xea8(%rip),%rdi
lea    0x20(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0x18(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
lea    0x4(%rsp),%r9
mov    %eax,%edi
mov    %rbx,%rsi
call   1070 <read_polynomials_from_file@plt>
cmpl   $0x0,0x4(%rsp)
jne    1237 <call_initialize_varbprec_homotopy+0xc7>
mov    %rax,%r15
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xe5d(%rip),%rdi
mov    %rax,%rcx
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe77(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe3b(%rip),%rdi
lea    0x20(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0x14(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
lea    0x4(%rsp),%r9
mov    %eax,%edi
mov    %rbx,%rsi
call   1070 <read_polynomials_from_file@plt>
cmpl   $0x0,0x4(%rsp)
je     1251 <call_initialize_varbprec_homotopy+0xe1>
lea    0xe87(%rip),%rdi
call   1040 <puts@plt>
mov    0x4(%rsp),%eax
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %rax,%r14
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xdd6(%rip),%rdi
mov    %rax,%rcx
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe25(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe40(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    0x10(%rsp),%edi
mov    0x18(%rsp),%esi
mov    0x14(%rsp),%ecx
mov    %r15,%rdx
mov    %r14,%r8
call   1090 <initialize_varbprec_homotopy@plt>
mov    %eax,0x4(%rsp)
test   %eax,%eax
jne    1243 <call_initialize_varbprec_homotopy+0xd3>
lea    0x20(%rsp),%rdi
lea    0x1c(%rsp),%rsi
call   1030 <call_initialize_varbprec_solution@plt>
jmp    1243 <call_initialize_varbprec_homotopy+0xd3>

LLVM IR (-O0):
@.str = [54 x i8] c"\0AGive the name of a file to read the target system : \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [24 x i8] c"Some failure occurred.\0A\00"
@.str.3 = [43 x i8] c"Read %d polynomials in %d variables : \0A%s\0A\00"
@.str.4 = [53 x i8] c"\0AGive the name of a file to read the start system : \00"
@.str.5 = [41 x i8] c"Fixed gamma constant ? (1 = yes/0 = no) \00"
@.str.6 = [3 x i8] c"%d\00"
define i32 @call_initialize_varbprec_homotopy(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca [80 x i8]
%13 = alloca i8*
%14 = alloca i8*
store i32* %0, i32** %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%16 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%19 = call i32 @strlen(i8* %18)
store i32 %19, i32* %4
%20 = load i32, i32* %4
%21 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%22 = call i8* @read_polynomials_from_file(i32 %20, i8* %21, i32* %5, i32* %7, i32* %8, i32* %3)
store i8* %22, i8** %13
%23 = load i32, i32* %3
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %1
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %64
27: ; preds = %1
%28 = load i32, i32* %7
%29 = load i32, i32* %8
%30 = load i8*, i8** %13
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 %28, i32 %29, i8* %30)
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0))
%33 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%34 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %33)
%35 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%36 = call i32 @strlen(i8* %35)
store i32 %36, i32* %4
%37 = load i32, i32* %4
%38 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%39 = call i8* @read_polynomials_from_file(i32 %37, i8* %38, i32* %6, i32* %7, i32* %8, i32* %3)
store i8* %39, i8** %14
%40 = load i32, i32* %3
%41 = icmp ne i32 %40, 0
br i1 %41, label %42, label %44
42: ; preds = %27
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %63
44: ; preds = %27
%45 = load i32, i32* %7
%46 = load i32, i32* %8
%47 = load i8*, i8** %14
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 %45, i32 %46, i8* %47)
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0))
%50 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %9)
%51 = load i32, i32* %9
%52 = load i32, i32* %5
%53 = load i8*, i8** %13
%54 = load i32, i32* %6
%55 = load i8*, i8** %14
%56 = call i32 @initialize_varbprec_homotopy(i32 %51, i32 %52, i8* %53, i32 %54, i8* %55)
store i32 %56, i32* %3
%57 = load i32, i32* %3
%58 = icmp eq i32 %57, 0
br i1 %58, label %59, label %62
59: ; preds = %44
%60 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%61 = call i32 @call_initialize_varbprec_solution(i8* %60, i32* %11)
br label %62
62: ; preds = %59, %44
br label %63
63: ; preds = %62, %42
br label %64
64: ; preds = %63, %25
%65 = load i32, i32* %3
ret i32 %65
}

LLVM IR (-O2):
@.str = [54 x i8] c"\0AGive the name of a file to read the target system : \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.3 = [43 x i8] c"Read %d polynomials in %d variables : \0A%s\0A\00"
@.str.4 = [53 x i8] c"\0AGive the name of a file to read the start system : \00"
@.str.5 = [41 x i8] c"Fixed gamma constant ? (1 = yes/0 = no) \00"
@.str.6 = [3 x i8] c"%d\00"
@str.7 = [23 x i8] c"Some failure occurred.\00"
define i32 @call_initialize_varbprec_homotopy(i32* nocapture readnone %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [80 x i8]
%10 = bitcast i32* %2 to i8*
%11 = bitcast i32* %3 to i8*
%12 = bitcast i32* %4 to i8*
%13 = bitcast i32* %5 to i8*
%14 = bitcast i32* %6 to i8*
%15 = bitcast i32* %7 to i8*
%16 = bitcast i32* %8 to i8*
%17 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%20 = call i32 @strlen(i8* %17)
%21 = call i8* @read_polynomials_from_file(i32 %20, i8* %17, i32* %3, i32* %5, i32* %6, i32* %2)
%22 = load i32, i32* %2
%23 = icmp eq i32 %22, 0
br i1 %23, label %26, label %24
24: ; preds = %1
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.7, i64 0, i64 0))
br label %51
26: ; preds = %1
%27 = load i32, i32* %5
%28 = load i32, i32* %6
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 %27, i32 %28, i8* %21)
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0))
%31 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%32 = call i32 @strlen(i8* %17)
%33 = call i8* @read_polynomials_from_file(i32 %32, i8* %17, i32* %4, i32* %5, i32* %6, i32* %2)
%34 = load i32, i32* %2
%35 = icmp eq i32 %34, 0
br i1 %35, label %38, label %36
36: ; preds = %26
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.7, i64 0, i64 0))
br label %51
38: ; preds = %26
%39 = load i32, i32* %5
%40 = load i32, i32* %6
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 %39, i32 %40, i8* %33)
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0))
%43 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %7)
%44 = load i32, i32* %7
%45 = load i32, i32* %3
%46 = load i32, i32* %4
%47 = call i32 @initialize_varbprec_homotopy(i32 %44, i32 %45, i8* %21, i32 %46, i8* %33)
store i32 %47, i32* %2
%48 = icmp eq i32 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %38
%50 = call i32 @call_initialize_varbprec_solution(i8* %17, i32* %8)
br label %51
51: ; preds = %36, %49, %38, %24
%52 = load i32, i32* %2
ret i32 %52
}