#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 get_shnodep_value();
int get_shshdep_value();
int get_shstdep_value();
int get_stnodep_value();
int get_stshdep_value();
int get_ststdep_value();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int val;
  val = get_shnodep_value();
  if (val != 1) {
    printf("shnodep was %i instead of 1\n", val);
    return -1;
  }
  val = get_stnodep_value();
  if (val != 2) {
    printf("stnodep was %i instead of 2\n", val);
    return -2;
  }
  val = get_shshdep_value();
  if (val != 1) {
    printf("shshdep was %i instead of 1\n", val);
    return -3;
  }
  val = get_shstdep_value();
  if (val != 2) {
    printf("shstdep was %i instead of 2\n", val);
    return -4;
  }
  val = get_stshdep_value();
  if (val != 1) {
    printf("shstdep was %i instead of 1\n", val);
    return -5;
  }
  val = get_ststdep_value();
  if (val != 2) {
    printf("ststdep was %i instead of 2\n", val);
    return -6;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_shnodep_value@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     11ae <main+0x3e>
mov    -0x8(%rbp),%esi
lea    0xe63(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    12a0 <main+0x130>
mov    $0x0,%al
call   1070 <get_stnodep_value@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11dd <main+0x6d>
mov    -0x8(%rbp),%esi
lea    0xe51(%rip),%rdi
call   1040 <printf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    12a0 <main+0x130>
mov    $0x0,%al
call   1090 <get_shshdep_value@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     120c <main+0x9c>
mov    -0x8(%rbp),%esi
lea    0xe3f(%rip),%rdi
call   1040 <printf@plt>
movl   $0xfffffffd,-0x4(%rbp)
jmp    12a0 <main+0x130>
mov    $0x0,%al
call   1060 <get_shstdep_value@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     123b <main+0xcb>
mov    -0x8(%rbp),%esi
lea    0xe2d(%rip),%rdi
call   1040 <printf@plt>
movl   $0xfffffffc,-0x4(%rbp)
jmp    12a0 <main+0x130>
mov    $0x0,%al
call   1050 <get_stshdep_value@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     126a <main+0xfa>
mov    -0x8(%rbp),%esi
lea    0xe1b(%rip),%rdi
call   1040 <printf@plt>
movl   $0xfffffffb,-0x4(%rbp)
jmp    12a0 <main+0x130>
mov    $0x0,%al
call   1080 <get_ststdep_value@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1299 <main+0x129>
mov    -0x8(%rbp),%esi
lea    0xe09(%rip),%rdi
call   1040 <printf@plt>
movl   $0xfffffffa,-0x4(%rbp)
jmp    12a0 <main+0x130>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <get_shnodep_value@plt>
cmp    $0x1,%eax
jne    11d0 <main+0x60>
xor    %eax,%eax
call   1070 <get_stnodep_value@plt>
cmp    $0x2,%eax
jne    11e5 <main+0x75>
xor    %eax,%eax
call   1090 <get_shshdep_value@plt>
cmp    $0x1,%eax
jne    11fa <main+0x8a>
xor    %eax,%eax
call   1060 <get_shstdep_value@plt>
cmp    $0x2,%eax
jne    120f <main+0x9f>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <get_stshdep_value@plt>
cmp    $0x1,%eax
jne    1224 <main+0xb4>
xor    %eax,%eax
call   1080 <get_ststdep_value@plt>
cmp    $0x2,%eax
je     1237 <main+0xc7>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0xfffffffa,%ebx
jmp    1237 <main+0xc7>
lea    0xe29(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0xffffffff,%ebx
jmp    1237 <main+0xc7>
lea    0xe31(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0xfffffffe,%ebx
jmp    1237 <main+0xc7>
lea    0xe39(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0xfffffffd,%ebx
jmp    1237 <main+0xc7>
lea    0xe41(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0xfffffffc,%ebx
jmp    1237 <main+0xc7>
lea    0xe49(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0xfffffffb,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"shnodep was %i instead of 1\0A\00"
@.str.1 = [29 x i8] c"stnodep was %i instead of 2\0A\00"
@.str.2 = [29 x i8] c"shshdep was %i instead of 1\0A\00"
@.str.3 = [29 x i8] c"shstdep was %i instead of 2\0A\00"
@.str.4 = [29 x i8] c"shstdep was %i instead of 1\0A\00"
@.str.5 = [29 x i8] c"ststdep was %i instead of 2\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @get_shnodep_value()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 -1, i32* %1
br label %45
9: ; preds = %0
%10 = call i32 (...) @get_stnodep_value()
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = icmp ne i32 %11, 2
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* %2
%15 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %14)
store i32 -2, i32* %1
br label %45
16: ; preds = %9
%17 = call i32 (...) @get_shshdep_value()
store i32 %17, i32* %2
%18 = load i32, i32* %2
%19 = icmp ne i32 %18, 1
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = load i32, i32* %2
%22 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %21)
store i32 -3, i32* %1
br label %45
23: ; preds = %16
%24 = call i32 (...) @get_shstdep_value()
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = icmp ne i32 %25, 2
br i1 %26, label %27, label %30
27: ; preds = %23
%28 = load i32, i32* %2
%29 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %28)
store i32 -4, i32* %1
br label %45
30: ; preds = %23
%31 = call i32 (...) @get_stshdep_value()
store i32 %31, i32* %2
%32 = load i32, i32* %2
%33 = icmp ne i32 %32, 1
br i1 %33, label %34, label %37
34: ; preds = %30
%35 = load i32, i32* %2
%36 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %35)
store i32 -5, i32* %1
br label %45
37: ; preds = %30
%38 = call i32 (...) @get_ststdep_value()
store i32 %38, i32* %2
%39 = load i32, i32* %2
%40 = icmp ne i32 %39, 2
br i1 %40, label %41, label %44
41: ; preds = %37
%42 = load i32, i32* %2
%43 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 %42)
store i32 -6, i32* %1
br label %45
44: ; preds = %37
store i32 0, i32* %1
br label %45
45: ; preds = %44, %41, %34, %27, %20, %13, %6
%46 = load i32, i32* %1
ret i32 %46
}

LLVM IR (-O2):
@.str = [29 x i8] c"shnodep was %i instead of 1\0A\00"
@.str.1 = [29 x i8] c"stnodep was %i instead of 2\0A\00"
@.str.2 = [29 x i8] c"shshdep was %i instead of 1\0A\00"
@.str.3 = [29 x i8] c"shstdep was %i instead of 2\0A\00"
@.str.4 = [29 x i8] c"shstdep was %i instead of 1\0A\00"
@.str.5 = [29 x i8] c"ststdep was %i instead of 2\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @get_shnodep_value()
%2 = icmp eq i32 %1, 1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %30
5: ; preds = %0
%6 = tail call i32 (...) @get_stnodep_value()
%7 = icmp eq i32 %6, 2
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %30
10: ; preds = %5
%11 = tail call i32 (...) @get_shshdep_value()
%12 = icmp eq i32 %11, 1
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %11)
br label %30
15: ; preds = %10
%16 = tail call i32 (...) @get_shstdep_value()
%17 = icmp eq i32 %16, 2
br i1 %17, label %20, label %18
18: ; preds = %15
%19 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %16)
br label %30
20: ; preds = %15
%21 = tail call i32 (...) @get_stshdep_value()
%22 = icmp eq i32 %21, 1
br i1 %22, label %25, label %23
23: ; preds = %20
%24 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %21)
br label %30
25: ; preds = %20
%26 = tail call i32 (...) @get_ststdep_value()
%27 = icmp eq i32 %26, 2
br i1 %27, label %30, label %28
28: ; preds = %25
%29 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 %26)
br label %30
30: ; preds = %25, %28, %23, %18, %13, %8, %3
%31 = phi i32 [ -1, %3 ], [ -2, %8 ], [ -3, %13 ], [ -4, %18 ], [ -5, %23 ], [ -6, %28 ], [ 0, %25 ]
ret i32 %31
}