#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 create_cascade_homotopy();
int define_output_file();
int /*<<< orphan*/ printf(char *);
int read_named_start_without_solutions(int, char *);
int /*<<< orphan*/ remove_last_slack_variable();
int /*<<< orphan*/ scanf(char *, char *);
int solcon_scan_solution_banner();
scalar_t__ strlen(char *);
int syscon_remove_symbol_from_table(int);
int write_standard_start_system();
int write_standard_target_system();
int prepare_for_next_level_down(int dimension) {
  char start[80], ch;
  int n, fail;
  printf("\nremoving last slack variable first ...\n");
  remove_last_slack_variable();
  fail = syscon_remove_symbol_from_table(dimension);
  printf("\nnow ready for the next level down ...\n");
  printf("\nReading the name of the file for the start system...");
  printf("\nGive a string of characters : ");
  scanf("%s", start);
  scanf("%c", &ch);
  fail = define_output_file();
  n = (int)strlen(start);
  fail = read_named_start_without_solutions(n, start);
  fail = solcon_scan_solution_banner();
  printf("\ncreating the cascade homotopy ...\n\n");
  fail = create_cascade_homotopy();
  fail = write_standard_target_system();
  fail = write_standard_start_system();
}


x86 assembly (clang, -O0):
<prepare_for_next_level_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x8(%rbp)
lea    0xe3e(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   10d0 <remove_last_slack_variable@plt>
mov    -0x8(%rbp),%edi
call   1070 <syscon_remove_symbol_from_table@plt>
mov    %eax,-0x6c(%rbp)
lea    0xe49(%rip),%rdi
call   1040 <printf@plt>
lea    0xe65(%rip),%rdi
call   1040 <printf@plt>
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   10a0 <scanf@plt>
lea    0xe96(%rip),%rdi
lea    -0x61(%rbp),%rsi
call   10a0 <scanf@plt>
mov    $0x0,%al
call   1060 <define_output_file@plt>
mov    %eax,-0x6c(%rbp)
lea    -0x60(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x68(%rbp)
mov    -0x68(%rbp),%edi
lea    -0x60(%rbp),%rsi
call   10c0 <read_named_start_without_solutions@plt>
mov    %eax,-0x6c(%rbp)
mov    $0x0,%al
call   1050 <solcon_scan_solution_banner@plt>
mov    %eax,-0x6c(%rbp)
lea    0xe5a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1080 <create_cascade_homotopy@plt>
mov    %eax,-0x6c(%rbp)
mov    $0x0,%al
call   1090 <write_standard_target_system@plt>
mov    %eax,-0x6c(%rbp)
mov    $0x0,%al
call   10b0 <write_standard_start_system@plt>
mov    %eax,-0x6c(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prepare_for_next_level_down>:
push   %rbx
sub    $0x60,%rsp
mov    %edi,%ebx
lea    0xe8e(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   10e0 <remove_last_slack_variable@plt>
mov    %ebx,%edi
call   1080 <syscon_remove_symbol_from_table@plt>
lea    0xe9c(%rip),%rdi
call   1030 <puts@plt>
lea    0xe0c(%rip),%rdi
call   1050 <printf@plt>
lea    0xe36(%rip),%rdi
call   1050 <printf@plt>
lea    0xe4a(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   10b0 <scanf@plt>
lea    0xe39(%rip),%rdi
lea    0xf(%rsp),%rsi
call   10b0 <scanf@plt>
xor    %eax,%eax
call   1070 <define_output_file@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   10d0 <read_named_start_without_solutions@plt>
xor    %eax,%eax
call   1060 <solcon_scan_solution_banner@plt>
lea    0xe5a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1090 <create_cascade_homotopy@plt>
xor    %eax,%eax
call   10a0 <write_standard_target_system@plt>
xor    %eax,%eax
call   10c0 <write_standard_start_system@plt>
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"\0Aremoving last slack variable first ...\0A\00"
@.str.1 = [40 x i8] c"\0Anow ready for the next level down ...\0A\00"
@.str.2 = [54 x i8] c"\0AReading the name of the file for the start system...\00"
@.str.3 = [32 x i8] c"\0AGive a string of characters : \00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [3 x i8] c"%c\00"
@.str.6 = [37 x i8] c"\0Acreating the cascade homotopy ...\0A\0A\00"
define i32 @prepare_for_next_level_down(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [80 x i8]
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (...) @remove_last_slack_variable()
%10 = load i32, i32* %3
%11 = call i32 @syscon_remove_symbol_from_table(i32 %10)
store i32 %11, i32* %7
%12 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%15 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %15)
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %5)
%18 = call i32 (...) @define_output_file()
store i32 %18, i32* %7
%19 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%20 = call i64 @strlen(i8* %19)
%21 = trunc i64 %20 to i32
store i32 %21, i32* %6
%22 = load i32, i32* %6
%23 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%24 = call i32 @read_named_start_without_solutions(i32 %22, i8* %23)
store i32 %24, i32* %7
%25 = call i32 (...) @solcon_scan_solution_banner()
store i32 %25, i32* %7
%26 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0))
%27 = call i32 (...) @create_cascade_homotopy()
store i32 %27, i32* %7
%28 = call i32 (...) @write_standard_target_system()
store i32 %28, i32* %7
%29 = call i32 (...) @write_standard_start_system()
store i32 %29, i32* %7
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
@.str.2 = [54 x i8] c"\0AReading the name of the file for the start system...\00"
@.str.3 = [32 x i8] c"\0AGive a string of characters : \00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [3 x i8] c"%c\00"
@str = [40 x i8] c"\0Aremoving last slack variable first ...\00"
@str.7 = [39 x i8] c"\0Anow ready for the next level down ...\00"
@str.8 = [36 x i8] c"\0Acreating the cascade homotopy ...\0A\00"
define i32 @prepare_for_next_level_down(i32 %0) {
%2 = alloca [80 x i8]
%3 = alloca i8
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (...) @remove_last_slack_variable()
%7 = tail call i32 @syscon_remove_symbol_from_table(i32 %0)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.7, i64 0, i64 0))
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %4)
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%13 = call i32 (...) @define_output_file()
%14 = call i64 @strlen(i8* %4)
%15 = trunc i64 %14 to i32
%16 = call i32 @read_named_start_without_solutions(i32 %15, i8* %4)
%17 = call i32 (...) @solcon_scan_solution_banner()
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.8, i64 0, i64 0))
%19 = call i32 (...) @create_cascade_homotopy()
%20 = call i32 (...) @write_standard_target_system()
%21 = call i32 (...) @write_standard_start_system()
ret i32 undef
}