#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 */
char getchar();
int make_standard_tableau_form(int);
int /*<<< orphan*/ printf(char *);
int retrieve_standard_tableau_form(int);
int syscon_read_standard_system();
int syscon_write_standard_system();
int test_standard_container(void) {
  int fail, verbose = 0;
  char ans;
  printf("Verbose ? (y/n) ");
  ans = getchar();
  if (ans == 'y')
    verbose = 1;
  fail = syscon_read_standard_system();
  if (fail == 0)
    fail = syscon_write_standard_system();
  if (fail == 0)
    fail = make_standard_tableau_form(verbose);
  if (fail == 0)
    fail = retrieve_standard_tableau_form(verbose);
  return fail;
}


x86 assembly (clang, -O0):
<test_standard_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x79,%eax
jne    1199 <test_standard_container+0x39>
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1080 <syscon_read_standard_system@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    11b7 <test_standard_container+0x57>
mov    $0x0,%al
call   1070 <syscon_write_standard_system@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    11cc <test_standard_container+0x6c>
mov    -0x8(%rbp),%edi
call   1030 <make_standard_tableau_form@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    11e1 <test_standard_container+0x81>
mov    -0x8(%rbp),%edi
call   1060 <retrieve_standard_tableau_form@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_standard_container>:
push   %rbp
push   %rbx
push   %rax
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %ebx,%ebx
cmp    $0x79,%al
sete   %bpl
xor    %eax,%eax
call   1080 <syscon_read_standard_system@plt>
test   %eax,%eax
jne    11a2 <test_standard_container+0x42>
xor    %eax,%eax
call   1070 <syscon_write_standard_system@plt>
test   %eax,%eax
jne    11a2 <test_standard_container+0x42>
mov    %bpl,%bl
mov    %ebx,%edi
call   1030 <make_standard_tableau_form@plt>
test   %eax,%eax
je     11a9 <test_standard_container+0x49>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <retrieve_standard_tableau_form@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Verbose ? (y/n) \00"
define i32 @test_standard_container() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 121
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 1, i32* %2
br label %10
10: ; preds = %9, %0
%11 = call i32 (...) @syscon_read_standard_system()
store i32 %11, i32* %1
%12 = load i32, i32* %1
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i32 (...) @syscon_write_standard_system()
store i32 %15, i32* %1
br label %16
16: ; preds = %14, %10
%17 = load i32, i32* %1
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i32, i32* %2
%21 = call i32 @make_standard_tableau_form(i32 %20)
store i32 %21, i32* %1
br label %22
22: ; preds = %19, %16
%23 = load i32, i32* %1
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load i32, i32* %2
%27 = call i32 @retrieve_standard_tableau_form(i32 %26)
store i32 %27, i32* %1
br label %28
28: ; preds = %25, %22
%29 = load i32, i32* %1
ret i32 %29
}

LLVM IR (-O2):
@.str = [17 x i8] c"Verbose ? (y/n) \00"
define i32 @test_standard_container() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 121
%4 = zext i1 %3 to i32
%5 = tail call i32 (...) @syscon_read_standard_system()
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %0
%8 = tail call i32 (...) @syscon_write_standard_system()
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = tail call i32 @make_standard_tableau_form(i32 %4)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 @retrieve_standard_tableau_form(i32 %4)
br label %15
15: ; preds = %0, %7, %13, %10
%16 = phi i32 [ %14, %13 ], [ %11, %10 ], [ %8, %7 ], [ %5, %0 ]
ret i32 %16
}