#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 hypersurface_witness_set(int, int, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
scalar_t__ strlen(char *);
int syscon_number_of_standard_polynomials(int *);
int syscon_read_standard_system();
int syscon_write_standard_system();
int witness_set_for_hypersurface(void) {
  int fail, k, n;
  char outfile[80];
  fail = syscon_read_standard_system();
  printf("\nReading the name of the output file...");
  printf("\nGive a string of characters : ");
  scanf("%s", outfile);
  printf("\nThe system in the container :\n");
  fail = syscon_write_standard_system();
  fail = syscon_number_of_standard_polynomials(&n);
  printf("Number of polynomials in container : %d\n", n);
  printf("Give the number of the equation : ");
  scanf("%d", &k);
  n = (int)strlen(outfile);
  fail = hypersurface_witness_set(k, n, outfile);
  return fail;
}


x86 assembly (clang, -O0):
<witness_set_for_hypersurface>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    $0x0,%al
call   1090 <syscon_read_standard_system@plt>
mov    %eax,-0x4(%rbp)
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <syscon_write_standard_system@plt>
mov    %eax,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
call   1080 <syscon_number_of_standard_polynomials@plt>
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    -0x60(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
lea    -0x60(%rbp),%rdx
call   1050 <hypersurface_witness_set@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<witness_set_for_hypersurface>:
push   %rbx
sub    $0x60,%rsp
xor    %eax,%eax
call   10a0 <syscon_read_standard_system@plt>
lea    0xe6d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe87(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe99(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <syscon_write_standard_system@plt>
lea    0x8(%rsp),%rdi
call   1090 <syscon_number_of_standard_polynomials@plt>
mov    0x8(%rsp),%esi
lea    0xe65(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe80(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe95(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %eax,0x8(%rsp)
mov    0xc(%rsp),%edi
mov    %eax,%esi
mov    %rbx,%rdx
call   1060 <hypersurface_witness_set@plt>
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"\0AReading the name of the output file...\00"
@.str.1 = [32 x i8] c"\0AGive a string of characters : \00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [32 x i8] c"\0AThe system in the container :\0A\00"
@.str.4 = [41 x i8] c"Number of polynomials in container : %d\0A\00"
@.str.5 = [35 x i8] c"Give the number of the equation : \00"
@.str.6 = [3 x i8] c"%d\00"
define i32 @witness_set_for_hypersurface() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [80 x i8]
%5 = call i32 (...) @syscon_read_standard_system()
store i32 %5, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 (...) @syscon_write_standard_system()
store i32 %11, i32* %1
%12 = call i32 @syscon_number_of_standard_polynomials(i32* %3)
store i32 %12, i32* %1
%13 = load i32, i32* %3
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), i32 %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %2)
%17 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%18 = call i64 @strlen(i8* %17)
%19 = trunc i64 %18 to i32
store i32 %19, i32* %3
%20 = load i32, i32* %2
%21 = load i32, i32* %3
%22 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%23 = call i32 @hypersurface_witness_set(i32 %20, i32 %21, i8* %22)
store i32 %23, i32* %1
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
@.str = [40 x i8] c"\0AReading the name of the output file...\00"
@.str.1 = [32 x i8] c"\0AGive a string of characters : \00"
@.str.2 = [3 x i8] c"%s\00"
@.str.4 = [41 x i8] c"Number of polynomials in container : %d\0A\00"
@.str.5 = [35 x i8] c"Give the number of the equation : \00"
@.str.6 = [3 x i8] c"%d\00"
@str = [31 x i8] c"\0AThe system in the container :\00"
define i32 @witness_set_for_hypersurface() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [80 x i8]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%7 = tail call i32 (...) @syscon_read_standard_system()
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%12 = call i32 (...) @syscon_write_standard_system()
%13 = call i32 @syscon_number_of_standard_polynomials(i32* %2)
%14 = load i32, i32* %2
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), i32 %14)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %1)
%18 = call i64 @strlen(i8* %6)
%19 = trunc i64 %18 to i32
store i32 %19, i32* %2
%20 = load i32, i32* %1
%21 = call i32 @hypersurface_witness_set(i32 %20, i32 %19, i8* %6)
ret i32 %21
}