#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 standard_nonlinear_reduce_system(int const, int const, int const, int *,
                                     int *, int *);
int syscon_read_standard_system();
int syscon_write_standard_system();
int standard_nonlinear_reducer(void) {
  int fail, dim, i;
  const int eqmax = 100;
  const int spmax = 100;
  const int rpmax = 100;
  int eqcnt, spcnt, rpcnt;
  fail = syscon_read_standard_system();
  if (fail == 0) {
    printf("\nThe system in the container : \n");
    fail = syscon_write_standard_system();
    fail = standard_nonlinear_reduce_system(eqmax, spmax, rpmax, &eqcnt, &spcnt,
                                            &rpcnt);
    printf("\nThe system after reduction : \n");
    fail = syscon_write_standard_system();
  }
  return fail;
}


x86 assembly (clang, -O0):
<standard_nonlinear_reducer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x64,-0x10(%rbp)
movl   $0x64,-0x14(%rbp)
movl   $0x64,-0x18(%rbp)
mov    $0x0,%al
call   1060 <syscon_read_standard_system@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    11ba <standard_nonlinear_reducer+0x7a>
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <syscon_write_standard_system@plt>
mov    %eax,-0x4(%rbp)
mov    $0x64,%edx
lea    -0x1c(%rbp),%rcx
lea    -0x20(%rbp),%r8
lea    -0x24(%rbp),%r9
mov    %edx,%edi
mov    %edx,%esi
call   1030 <standard_nonlinear_reduce_system@plt>
mov    %eax,-0x4(%rbp)
lea    0xe76(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <syscon_write_standard_system@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standard_nonlinear_reducer>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1060 <syscon_read_standard_system@plt>
test   %eax,%eax
je     1154 <standard_nonlinear_reducer+0x14>
add    $0x18,%rsp
ret
lea    0xea5(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <syscon_write_standard_system@plt>
lea    0x14(%rsp),%rcx
lea    0x10(%rsp),%r8
lea    0xc(%rsp),%r9
mov    $0x64,%edi
mov    $0x64,%esi
mov    $0x64,%edx
call   1030 <standard_nonlinear_reduce_system@plt>
lea    0xe8f(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <syscon_write_standard_system@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"\0AThe system in the container : \0A\00"
@.str.1 = [32 x i8] c"\0AThe system after reduction : \0A\00"
define i32 @standard_nonlinear_reducer() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 100, i32* %4
store i32 100, i32* %5
store i32 100, i32* %6
%10 = call i32 (...) @syscon_read_standard_system()
store i32 %10, i32* %1
%11 = load i32, i32* %1
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %0
%14 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%15 = call i32 (...) @syscon_write_standard_system()
store i32 %15, i32* %1
%16 = call i32 @standard_nonlinear_reduce_system(i32 100, i32 100, i32 100, i32* %7, i32* %8, i32* %9)
store i32 %16, i32* %1
%17 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%18 = call i32 (...) @syscon_write_standard_system()
store i32 %18, i32* %1
br label %19
19: ; preds = %13, %0
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@str = [32 x i8] c"\0AThe system in the container : \00"
@str.2 = [31 x i8] c"\0AThe system after reduction : \00"
define i32 @standard_nonlinear_reducer() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (...) @syscon_read_standard_system()
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %0
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%11 = tail call i32 (...) @syscon_write_standard_system()
%12 = call i32 @standard_nonlinear_reduce_system(i32 100, i32 100, i32 100, i32* %1, i32* %2, i32* %3)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.2, i64 0, i64 0))
%14 = call i32 (...) @syscon_write_standard_system()
br label %15
15: ; preds = %9, %0
%16 = phi i32 [ %14, %9 ], [ %7, %0 ]
ret i32 %16
}