#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 dobldobl_row_reduce_system(int);
int /*<<< orphan*/ printf(char *);
int syscon_read_dobldobl_system();
int syscon_write_dobldobl_system();
int dobldobl_reducer(void) {
  int fail, dim, i;
  fail = syscon_read_dobldobl_system();
  if (fail == 0) {
    printf("\nThe system in the container : \n");
    fail = syscon_write_dobldobl_system();
    fail = dobldobl_row_reduce_system(1);
    printf("\nThe system after reduction : \n");
    fail = syscon_write_dobldobl_system();
  }
  return fail;
}


x86 assembly (clang, -O0):
<dobldobl_reducer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <syscon_read_dobldobl_system@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1195 <dobldobl_reducer+0x55>
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <syscon_write_dobldobl_system@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%edi
call   1050 <dobldobl_row_reduce_system@plt>
mov    %eax,-0x4(%rbp)
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <syscon_write_dobldobl_system@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dobldobl_reducer>:
push   %rax
xor    %eax,%eax
call   1060 <syscon_read_dobldobl_system@plt>
test   %eax,%eax
je     114e <dobldobl_reducer+0xe>
pop    %rcx
ret
lea    0xeab(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <syscon_write_dobldobl_system@plt>
mov    $0x1,%edi
call   1050 <dobldobl_row_reduce_system@plt>
lea    0xeae(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <syscon_write_dobldobl_system@plt>

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 @dobldobl_reducer() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @syscon_read_dobldobl_system()
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (...) @syscon_write_dobldobl_system()
store i32 %9, i32* %1
%10 = call i32 @dobldobl_row_reduce_system(i32 1)
store i32 %10, i32* %1
%11 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 (...) @syscon_write_dobldobl_system()
store i32 %12, i32* %1
br label %13
13: ; preds = %7, %0
%14 = load i32, i32* %1
ret i32 %14
}

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 @dobldobl_reducer() {
%1 = tail call i32 (...) @syscon_read_dobldobl_system()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (...) @syscon_write_dobldobl_system()
%6 = tail call i32 @dobldobl_row_reduce_system(i32 1)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.2, i64 0, i64 0))
%8 = tail call i32 (...) @syscon_write_dobldobl_system()
br label %9
9: ; preds = %3, %0
%10 = phi i32 [ %8, %3 ], [ %1, %0 ]
ret i32 %10
}