#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int solcon_write_standard_solutions();
int solve_with_standard_doubles(int, double const, int *);
int syscon_read_standard_system();
int syscon_write_standard_system();
void standard_test(void) {
  int fail, max, nit;
  const double eps = 1.0e-12;
  fail = syscon_read_standard_system();
  fail = syscon_write_standard_system();
  printf("\nGive the maximum number of iterations : ");
  scanf("%d", &max);
  fail = solve_with_standard_doubles(max, eps, &nit);
  printf("\nNumber of iterations : %d\n", nit);
  fail = solcon_write_standard_solutions();
}


x86 assembly (clang, -O0):
<standard_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  0xe90(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1080 <syscon_read_standard_system@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1060 <syscon_write_standard_system@plt>
mov    %eax,-0x4(%rbp)
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe94(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x8(%rbp),%edi
movsd  0xe4e(%rip),%xmm0
lea    -0xc(%rbp),%rsi
call   1030 <solve_with_standard_doubles@plt>
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <solcon_write_standard_solutions@plt>
mov    %eax,-0x4(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standard_test>:
push   %rax
xor    %eax,%eax
call   1080 <syscon_read_standard_system@plt>
xor    %eax,%eax
call   1060 <syscon_write_standard_system@plt>
lea    0xe92(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeae(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1070 <scanf@plt>
mov    0x4(%rsp),%edi
movsd  0xe66(%rip),%xmm0
mov    %rsp,%rsi
call   1030 <solve_with_standard_doubles@plt>
mov    (%rsp),%esi
lea    0xe89(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <solcon_write_standard_solutions@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [42 x i8] c"\0AGive the maximum number of iterations : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [28 x i8] c"\0ANumber of iterations : %d\0A\00"
define void @standard_test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
store double 0x3D719799812DEA11, double* %4
%5 = call i32 (...) @syscon_read_standard_system()
store i32 %5, i32* %1
%6 = call i32 (...) @syscon_write_standard_system()
store i32 %6, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = call i32 @solve_with_standard_doubles(i32 %9, double 0x3D719799812DEA11, i32* %3)
store i32 %10, i32* %1
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = call i32 (...) @solcon_write_standard_solutions()
store i32 %13, i32* %1
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"\0AGive the maximum number of iterations : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [28 x i8] c"\0ANumber of iterations : %d\0A\00"
define void @standard_test() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (...) @syscon_read_standard_system()
%6 = tail call i32 (...) @syscon_write_standard_system()
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = load i32, i32* %1
%10 = call i32 @solve_with_standard_doubles(i32 %9, double 0x3D719799812DEA11, i32* %2)
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = call i32 (...) @solcon_write_standard_solutions()
ret void
}