#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 d(int);
int /*<<< orphan*/ exit(int);
int f(int);
int /*<<< orphan*/ printf(char *, ...);
int s(int);
int main() {
  {
    int x1 = f(5);
    if (x1 != 5) {
      printf("Error %d\n", (int)1);
      exit(1);
    };
  }
  {
    int x2 = f(256);
    if (x2 != 0) {
      printf("Error %d\n", (int)2);
      exit(2);
    };
  }
  {
    int x3 = s(65536 + 1);
    if (x3 != 1) {
      printf("Error %d\n", (int)3);
      exit(3);
    };
  }
  {
    int x4 = d(1);
    if (x4 != 1) {
      printf("Error %d\n", (int)4);
      exit(4);
    };
  }
  {
    printf("Success\n");
    exit(0);
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   1040 <f@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
je     1193 <main+0x43>
lea    0xe83(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    $0x100,%edi
call   1040 <f@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     11c7 <main+0x77>
lea    0xe4f(%rip),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x2,%edi
call   1070 <exit@plt>
mov    $0x10001,%edi
call   1060 <s@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
je     11fb <main+0xab>
lea    0xe1b(%rip),%rdi
mov    $0x3,%esi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x3,%edi
call   1070 <exit@plt>
mov    $0x1,%edi
call   1030 <d@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
je     122f <main+0xdf>
lea    0xde7(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x4,%edi
call   1070 <exit@plt>
lea    0xdd4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1050 <f@plt>
cmp    $0x5,%eax
jne    11af <main+0x4f>
mov    $0x100,%edi
call   1050 <f@plt>
test   %eax,%eax
jne    11cc <main+0x6c>
mov    $0x10001,%edi
call   1070 <s@plt>
cmp    $0x1,%eax
jne    11e9 <main+0x89>
mov    $0x1,%edi
call   1040 <d@plt>
cmp    $0x1,%eax
jne    1206 <main+0xa6>
lea    0xe67(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1080 <exit@plt>
lea    0xe4a(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
lea    0xe2d(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2,%edi
call   1080 <exit@plt>
lea    0xe10(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x3,%edi
call   1080 <exit@plt>
lea    0xdf3(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x4,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Error %d\0A\00"
@.str.1 = [9 x i8] c"Success\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @f(i32 5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 5
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %0
%13 = call i32 @f(i32 256)
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2)
%18 = call i32 @exit(i32 2)
unreachable
19: ; preds = %12
%20 = call i32 @s(i32 65537)
store i32 %20, i32* %4
%21 = load i32, i32* %4
%22 = icmp ne i32 %21, 1
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 3)
%25 = call i32 @exit(i32 3)
unreachable
26: ; preds = %19
%27 = call i32 @d(i32 1)
store i32 %27, i32* %5
%28 = load i32, i32* %5
%29 = icmp ne i32 %28, 1
br i1 %29, label %30, label %33
30: ; preds = %26
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 4)
%32 = call i32 @exit(i32 4)
unreachable
33: ; preds = %26
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%35 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"Error %d\0A\00"
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = tail call i32 @f(i32 5)
%2 = icmp eq i32 %1, 5
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
%7 = tail call i32 @f(i32 256)
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2)
%11 = tail call i32 @exit(i32 2)
unreachable
12: ; preds = %6
%13 = tail call i32 @s(i32 65537)
%14 = icmp eq i32 %13, 1
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 3)
%17 = tail call i32 @exit(i32 3)
unreachable
18: ; preds = %12
%19 = tail call i32 @d(i32 1)
%20 = icmp eq i32 %19, 1
br i1 %20, label %24, label %21
21: ; preds = %18
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 4)
%23 = tail call i32 @exit(i32 4)
unreachable
24: ; preds = %18
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%26 = tail call i32 @exit(i32 0)
unreachable
}