#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 close_output_file();
int copy_target_system_to_container();
int define_output_file_with_string(int, char *);
int print_system();
int /*<<< orphan*/ printf(char *, ...);
int read_standard_target_system();
int /*<<< orphan*/ scanf(char *, char *);
scalar_t__ strlen(char *);
int write_string_to_defined_output_file(int, char *);
int input_argument_free(void) {
  int fail, n;
  char outfile[80], ch;
  char somesys[22] = "\nTITLE : some system\n";
  printf("\nReading and writing a polynomial system ...\n");
  fail = read_standard_target_system();
  if (1 == 1)
    printf("-> read_target_system returns %d\n", fail);
  fail = copy_target_system_to_container();
  if (1 == 1)
    printf("-> copy_target_system_to_container returns %d\n", fail);
  printf("\nThe system read :\n");
  fail = print_system();
  if (1 == 1)
    printf("-> print_system returns %d\n", fail);
  printf("\nGive name of the output file : ");
  scanf("%s", outfile);
  n = (int)strlen(outfile);
  fail = define_output_file_with_string(n, outfile);
  if (1 == 1)
    printf("-> define_output_file_with_string returns %d\n", fail);
  fail = print_system();
  if (1 == 1)
    printf("-> print_system returns %d\n", fail);
  fail = write_string_to_defined_output_file(21, somesys);
  if (1 == 1)
    printf("-> write_string_to_defined_output_file returns %d\n", fail);
  fail = close_output_file();
  if (1 == 1)
    printf("-> close_output_file returns %d\n", fail);
  return 0;
}


x86 assembly (clang, -O0):
<input_argument_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0xe5e(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xe5b(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    0xe59(%rip),%eax
mov    %eax,-0x70(%rbp)
mov    0xe53(%rip),%ax
mov    %ax,-0x6c(%rbp)
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1030 <read_standard_target_system@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   10a0 <copy_target_system_to_container@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1040 <print_system@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xe9b(%rip),%rdi
call   1090 <scanf@plt>
lea    -0x60(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x60(%rbp),%rsi
call   1080 <define_output_file_with_string@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1040 <print_system@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x80(%rbp),%rsi
mov    $0x15,%edi
call   10b0 <write_string_to_defined_output_file@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1070 <close_output_file@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_argument_free>:
push   %r14
push   %rbx
sub    $0x78,%rsp
movaps 0xe52(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0xa6d6574737973,%rax
mov    %rax,0xe(%rsp)
lea    0xf61(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <read_standard_target_system@plt>
lea    0xe3b(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
call   10b0 <copy_target_system_to_container@plt>
lea    0xe46(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xf54(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <print_system@plt>
lea    0xe52(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe5b(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe6e(%rip),%rdi
lea    0x20(%rsp),%rbx
mov    %rbx,%rsi
call   10a0 <scanf@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1090 <define_output_file_with_string@plt>
lea    0xe4b(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
call   1050 <print_system@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rsp,%rsi
mov    $0x15,%edi
call   10c0 <write_string_to_defined_output_file@plt>
lea    0xe49(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
call   1080 <close_output_file@plt>
lea    0xe65(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.input_argument_free.somesys = [22 x i8] c"\0ATITLE : some system\0A\00"
@.str = [46 x i8] c"\0AReading and writing a polynomial system ...\0A\00"
@.str.1 = [34 x i8] c"-> read_target_system returns %d\0A\00"
@.str.2 = [47 x i8] c"-> copy_target_system_to_container returns %d\0A\00"
@.str.3 = [20 x i8] c"\0AThe system read :\0A\00"
@.str.4 = [28 x i8] c"-> print_system returns %d\0A\00"
@.str.5 = [33 x i8] c"\0AGive name of the output file : \00"
@.str.6 = [3 x i8] c"%s\00"
@.str.7 = [46 x i8] c"-> define_output_file_with_string returns %d\0A\00"
@.str.8 = [51 x i8] c"-> write_string_to_defined_output_file returns %d\0A\00"
@.str.9 = [33 x i8] c"-> close_output_file returns %d\0A\00"
define i32 @input_argument_free() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [80 x i8]
%4 = alloca i8
%5 = alloca [22 x i8]
%6 = bitcast [22 x i8]* %5 to i8*
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @read_standard_target_system()
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call i32 (...) @copy_target_system_to_container()
store i32 %11, i32* %1
%12 = load i32, i32* %1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 (...) @print_system()
store i32 %15, i32* %1
%16 = load i32, i32* %1
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i32 %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
%19 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %19)
%21 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%22 = call i64 @strlen(i8* %21)
%23 = trunc i64 %22 to i32
store i32 %23, i32* %2
%24 = load i32, i32* %2
%25 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%26 = call i32 @define_output_file_with_string(i32 %24, i8* %25)
store i32 %26, i32* %1
%27 = load i32, i32* %1
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.7, i64 0, i64 0), i32 %27)
%29 = call i32 (...) @print_system()
store i32 %29, i32* %1
%30 = load i32, i32* %1
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i32 %30)
%32 = getelementptr inbounds [22 x i8], [22 x i8]* %5, i64 0, i64 0
%33 = call i32 @write_string_to_defined_output_file(i32 21, i8* %32)
store i32 %33, i32* %1
%34 = load i32, i32* %1
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.8, i64 0, i64 0), i32 %34)
%36 = call i32 (...) @close_output_file()
store i32 %36, i32* %1
%37 = load i32, i32* %1
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0), i32 %37)
ret i32 0
}

LLVM IR (-O2):
@__const.input_argument_free.somesys = [22 x i8] c"\0ATITLE : some system\0A\00"
@.str.1 = [34 x i8] c"-> read_target_system returns %d\0A\00"
@.str.2 = [47 x i8] c"-> copy_target_system_to_container returns %d\0A\00"
@.str.4 = [28 x i8] c"-> print_system returns %d\0A\00"
@.str.5 = [33 x i8] c"\0AGive name of the output file : \00"
@.str.6 = [3 x i8] c"%s\00"
@.str.7 = [46 x i8] c"-> define_output_file_with_string returns %d\0A\00"
@.str.8 = [51 x i8] c"-> write_string_to_defined_output_file returns %d\0A\00"
@.str.9 = [33 x i8] c"-> close_output_file returns %d\0A\00"
@str = [45 x i8] c"\0AReading and writing a polynomial system ...\00"
@str.10 = [19 x i8] c"\0AThe system read :\00"
define i32 @input_argument_free() {
%1 = alloca [80 x i8]
%2 = alloca [22 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [22 x i8], [22 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (...) @read_standard_target_system()
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = tail call i32 (...) @copy_target_system_to_container()
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.10, i64 0, i64 0))
%11 = tail call i32 (...) @print_system()
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i32 %11)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %3)
%15 = call i64 @strlen(i8* %3)
%16 = trunc i64 %15 to i32
%17 = call i32 @define_output_file_with_string(i32 %16, i8* %3)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.7, i64 0, i64 0), i32 %17)
%19 = call i32 (...) @print_system()
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i32 %19)
%21 = call i32 @write_string_to_defined_output_file(i32 21, i8* %4)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.8, i64 0, i64 0), i32 %21)
%23 = call i32 (...) @close_output_file()
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0), i32 %23)
ret i32 0
}