#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 Reverse1(unsigned int);
int Reverse2(unsigned int);
int Reverse3(unsigned int);
int /*<<< orphan*/ abort();
int llReverse1(unsigned long long);
int llReverse2(unsigned long long);
int llReverse3(unsigned long long);
int main() {
  unsigned int x = 0x12345678;
  unsigned long long y = 0x123456789abcdef0ull;
  if (Reverse1(x) != 0x78563412)
    abort();
  if (Reverse2(x) != 0x78563412)
    abort();
  if (Reverse3(x) != 0x78563412)
    abort();
  if (llReverse1(y) != 0xf0debc9a78563412ull)
    abort();
  if (llReverse2(y) != 0xf0debc9a78563412ull)
    abort();
  if (llReverse3(y) != 0xf0debc9a78563412ull)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x12345678,-0x8(%rbp)
movabs $0x123456789abcdef0,%rax
56 34 12
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1060 <Reverse1@plt>
cmp    $0x78563412,%eax
je     11ae <main+0x3e>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%edi
call   1040 <Reverse2@plt>
cmp    $0x78563412,%eax
je     11c8 <main+0x58>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%edi
call   1070 <Reverse3@plt>
cmp    $0x78563412,%eax
je     11e2 <main+0x72>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rdi
call   1090 <llReverse1@plt>
cltq
movabs $0xf0debc9a78563412,%rcx
bc de f0
cmp    %rcx,%rax
je     1207 <main+0x97>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rdi
call   1050 <llReverse2@plt>
cltq
movabs $0xf0debc9a78563412,%rcx
bc de f0
cmp    %rcx,%rax
je     122c <main+0xbc>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rdi
call   1080 <llReverse3@plt>
cltq
movabs $0xf0debc9a78563412,%rcx
bc de f0
cmp    %rcx,%rax
je     1251 <main+0xe1>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x12345678,%edi
call   1050 <Reverse1@plt>
cmp    $0x78563412,%eax
jne    1193 <main+0x43>
mov    $0x12345678,%edi
call   1040 <Reverse2@plt>
cmp    $0x78563412,%eax
jne    1193 <main+0x43>
mov    $0x12345678,%edi
call   1060 <Reverse3@plt>
cmp    $0x78563412,%eax
jne    1193 <main+0x43>
movabs $0x123456789abcdef0,%rdi
56 34 12
call   1070 <llReverse1@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i32 0, i32* %1
store i32 305419896, i32* %2
store i64 1311768467463790320, i64* %3
%4 = load i32, i32* %2
%5 = call i32 @Reverse1(i32 %4)
%6 = icmp ne i32 %5, 2018915346
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %0
%10 = load i32, i32* %2
%11 = call i32 @Reverse2(i32 %10)
%12 = icmp ne i32 %11, 2018915346
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %9
%16 = load i32, i32* %2
%17 = call i32 @Reverse3(i32 %16)
%18 = icmp ne i32 %17, 2018915346
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 (...) @abort()
unreachable
21: ; preds = %15
%22 = load i64, i64* %3
%23 = call i32 @llReverse1(i64 %22)
%24 = sext i32 %23 to i64
%25 = icmp ne i64 %24, -1090226688147180526
br i1 %25, label %26, label %28
26: ; preds = %21
%27 = call i32 (...) @abort()
unreachable
28: ; preds = %21
%29 = load i64, i64* %3
%30 = call i32 @llReverse2(i64 %29)
%31 = sext i32 %30 to i64
%32 = icmp ne i64 %31, -1090226688147180526
br i1 %32, label %33, label %35
33: ; preds = %28
%34 = call i32 (...) @abort()
unreachable
35: ; preds = %28
%36 = load i64, i64* %3
%37 = call i32 @llReverse3(i64 %36)
%38 = sext i32 %37 to i64
%39 = icmp ne i64 %38, -1090226688147180526
br i1 %39, label %40, label %42
40: ; preds = %35
%41 = call i32 (...) @abort()
unreachable
42: ; preds = %35
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @Reverse1(i32 305419896)
%2 = icmp eq i32 %1, 2018915346
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @Reverse2(i32 305419896)
%7 = icmp eq i32 %6, 2018915346
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
%11 = tail call i32 @Reverse3(i32 305419896)
%12 = icmp eq i32 %11, 2018915346
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 (...) @abort()
unreachable
15: ; preds = %10
%16 = tail call i32 @llReverse1(i64 1311768467463790320)
%17 = tail call i32 (...) @abort()
unreachable
}