#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(int argc, char *argv[]) {
  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    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <get_shnodep_value@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
je     11b5 <main+0x45>
mov    -0x14(%rbp),%esi
lea    0xe5c(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    12a7 <main+0x137>
mov    $0x0,%al
call   1070 <get_stnodep_value@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
je     11e4 <main+0x74>
mov    -0x14(%rbp),%esi
lea    0xe4a(%rip),%rdi
call   1040 <printf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    12a7 <main+0x137>
mov    $0x0,%al
call   1090 <get_shshdep_value@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
je     1213 <main+0xa3>
mov    -0x14(%rbp),%esi
lea    0xe38(%rip),%rdi
call   1040 <printf@plt>
movl   $0xfffffffd,-0x4(%rbp)
jmp    12a7 <main+0x137>
mov    $0x0,%al
call   1060 <get_shstdep_value@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
je     1242 <main+0xd2>
mov    -0x14(%rbp),%esi
lea    0xe26(%rip),%rdi
call   1040 <printf@plt>
movl   $0xfffffffc,-0x4(%rbp)
jmp    12a7 <main+0x137>
mov    $0x0,%al
call   1050 <get_stshdep_value@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
je     1271 <main+0x101>
mov    -0x14(%rbp),%esi
lea    0xe14(%rip),%rdi
call   1040 <printf@plt>
movl   $0xfffffffb,-0x4(%rbp)
jmp    12a7 <main+0x137>
mov    $0x0,%al
call   1080 <get_ststdep_value@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
je     12a0 <main+0x130>
mov    -0x14(%rbp),%esi
lea    0xe02(%rip),%rdi
call   1040 <printf@plt>
movl   $0xfffffffa,-0x4(%rbp)
jmp    12a7 <main+0x137>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%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(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @get_shnodep_value()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %11)
store i32 -1, i32* %3
br label %49
13: ; preds = %2
%14 = call i32 (...) @get_stnodep_value()
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = icmp ne i32 %15, 2
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i32, i32* %6
%19 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %18)
store i32 -2, i32* %3
br label %49
20: ; preds = %13
%21 = call i32 (...) @get_shshdep_value()
store i32 %21, i32* %6
%22 = load i32, i32* %6
%23 = icmp ne i32 %22, 1
br i1 %23, label %24, label %27
24: ; preds = %20
%25 = load i32, i32* %6
%26 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %25)
store i32 -3, i32* %3
br label %49
27: ; preds = %20
%28 = call i32 (...) @get_shstdep_value()
store i32 %28, i32* %6
%29 = load i32, i32* %6
%30 = icmp ne i32 %29, 2
br i1 %30, label %31, label %34
31: ; preds = %27
%32 = load i32, i32* %6
%33 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %32)
store i32 -4, i32* %3
br label %49
34: ; preds = %27
%35 = call i32 (...) @get_stshdep_value()
store i32 %35, i32* %6
%36 = load i32, i32* %6
%37 = icmp ne i32 %36, 1
br i1 %37, label %38, label %41
38: ; preds = %34
%39 = load i32, i32* %6
%40 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %39)
store i32 -5, i32* %3
br label %49
41: ; preds = %34
%42 = call i32 (...) @get_ststdep_value()
store i32 %42, i32* %6
%43 = load i32, i32* %6
%44 = icmp ne i32 %43, 2
br i1 %44, label %45, label %48
45: ; preds = %41
%46 = load i32, i32* %6
%47 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 %46)
store i32 -6, i32* %3
br label %49
48: ; preds = %41
store i32 0, i32* %3
br label %49
49: ; preds = %48, %45, %38, %31, %24, %17, %10
%50 = load i32, i32* %3
ret i32 %50
}

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(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @get_shnodep_value()
%4 = icmp eq i32 %3, 1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %32
7: ; preds = %2
%8 = tail call i32 (...) @get_stnodep_value()
%9 = icmp eq i32 %8, 2
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %32
12: ; preds = %7
%13 = tail call i32 (...) @get_shshdep_value()
%14 = icmp eq i32 %13, 1
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %13)
br label %32
17: ; preds = %12
%18 = tail call i32 (...) @get_shstdep_value()
%19 = icmp eq i32 %18, 2
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %18)
br label %32
22: ; preds = %17
%23 = tail call i32 (...) @get_stshdep_value()
%24 = icmp eq i32 %23, 1
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %23)
br label %32
27: ; preds = %22
%28 = tail call i32 (...) @get_ststdep_value()
%29 = icmp eq i32 %28, 2
br i1 %29, label %32, label %30
30: ; preds = %27
%31 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 %28)
br label %32
32: ; preds = %27, %30, %25, %20, %15, %10, %5
%33 = phi i32 [ -1, %5 ], [ -2, %10 ], [ -3, %15 ], [ -4, %20 ], [ -5, %25 ], [ -6, %30 ], [ 0, %27 ]
ret i32 %33
}