#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 /*<<< orphan*/ adler32;
int /*<<< orphan*/ crc32;
int /*<<< orphan*/ runTest(char *, int /*<<< orphan*/, int);
int main(void) {
  runTest("adler32", adler32, 1);
  runTest("adler32Update 0", adler32, 0);
  runTest("adler32Update 1", adler32, 1);
  runTest("adler32Update 123", adler32, 123);
  runTest("adler32Update 0xFFF0FFF0", adler32, 0xFFF0FFF0);
  runTest("crc32", crc32, 0);
  runTest("crc32Update 0", crc32, 0);
  runTest("crc32Update 1", crc32, 1);
  runTest("crc32Update 123", crc32, 123);
  runTest("crc32Update 0xFFFFFFFF", crc32, 0xFFFFFFFF);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%esi
lea    0xed1(%rip),%rdi
mov    $0x1,%edx
call   1030 <runTest@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
xor    %edx,%edx
call   1030 <runTest@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
mov    $0x1,%edx
call   1030 <runTest@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%esi
lea    0xeae(%rip),%rdi
mov    $0x7b,%edx
call   1030 <runTest@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%esi
lea    0xea6(%rip),%rdi
mov    $0xfff0fff0,%edx
call   1030 <runTest@plt>
mov    0x2e33(%rip),%rax
mov    (%rax),%esi
lea    0xea5(%rip),%rdi
xor    %edx,%edx
call   1030 <runTest@plt>
mov    0x2e1c(%rip),%rax
mov    (%rax),%esi
lea    0xe94(%rip),%rdi
xor    %edx,%edx
call   1030 <runTest@plt>
mov    0x2e05(%rip),%rax
mov    (%rax),%esi
lea    0xe8b(%rip),%rdi
mov    $0x1,%edx
call   1030 <runTest@plt>
mov    0x2deb(%rip),%rax
mov    (%rax),%esi
lea    0xe7f(%rip),%rdi
mov    $0x7b,%edx
call   1030 <runTest@plt>
mov    0x2dd1(%rip),%rax
mov    (%rax),%esi
lea    0xe75(%rip),%rdi
mov    $0xffffffff,%edx
call   1030 <runTest@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ed0(%rip),%rbx
mov    (%rbx),%esi
lea    0xedf(%rip),%rdi
mov    $0x1,%edx
call   1030 <runTest@plt>
mov    (%rbx),%esi
lea    0xed4(%rip),%rdi
xor    %edx,%edx
call   1030 <runTest@plt>
mov    (%rbx),%esi
lea    0xed4(%rip),%rdi
mov    $0x1,%edx
call   1030 <runTest@plt>
mov    (%rbx),%esi
lea    0xed1(%rip),%rdi
mov    $0x7b,%edx
call   1030 <runTest@plt>
mov    (%rbx),%esi
lea    0xed0(%rip),%rdi
mov    $0xfff0fff0,%edx
call   1030 <runTest@plt>
mov    0x2e5d(%rip),%rbx
mov    (%rbx),%esi
lea    0xecf(%rip),%rdi
xor    %edx,%edx
call   1030 <runTest@plt>
mov    (%rbx),%esi
lea    0xec5(%rip),%rdi
xor    %edx,%edx
call   1030 <runTest@plt>
mov    (%rbx),%esi
lea    0xec3(%rip),%rdi
mov    $0x1,%edx
call   1030 <runTest@plt>
mov    (%rbx),%esi
lea    0xebe(%rip),%rdi
mov    $0x7b,%edx
call   1030 <runTest@plt>
mov    (%rbx),%esi
lea    0xebb(%rip),%rdi
mov    $0xffffffff,%edx
call   1030 <runTest@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"adler32\00"
@adler32 = global i32 0
@.str.1 = [16 x i8] c"adler32Update 0\00"
@.str.2 = [16 x i8] c"adler32Update 1\00"
@.str.3 = [18 x i8] c"adler32Update 123\00"
@.str.4 = [25 x i8] c"adler32Update 0xFFF0FFF0\00"
@.str.5 = [6 x i8] c"crc32\00"
@crc32 = global i32 0
@.str.6 = [14 x i8] c"crc32Update 0\00"
@.str.7 = [14 x i8] c"crc32Update 1\00"
@.str.8 = [16 x i8] c"crc32Update 123\00"
@.str.9 = [23 x i8] c"crc32Update 0xFFFFFFFF\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @adler32
%3 = call i32 @runTest(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2, i32 1)
%4 = load i32, i32* @adler32
%5 = call i32 @runTest(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 0)
%6 = load i32, i32* @adler32
%7 = call i32 @runTest(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 1)
%8 = load i32, i32* @adler32
%9 = call i32 @runTest(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %8, i32 123)
%10 = load i32, i32* @adler32
%11 = call i32 @runTest(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %10, i32 -983056)
%12 = load i32, i32* @crc32
%13 = call i32 @runTest(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %12, i32 0)
%14 = load i32, i32* @crc32
%15 = call i32 @runTest(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %14, i32 0)
%16 = load i32, i32* @crc32
%17 = call i32 @runTest(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %16, i32 1)
%18 = load i32, i32* @crc32
%19 = call i32 @runTest(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i32 %18, i32 123)
%20 = load i32, i32* @crc32
%21 = call i32 @runTest(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i32 %20, i32 -1)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"adler32\00"
@adler32 = global i32 0
@.str.1 = [16 x i8] c"adler32Update 0\00"
@.str.2 = [16 x i8] c"adler32Update 1\00"
@.str.3 = [18 x i8] c"adler32Update 123\00"
@.str.4 = [25 x i8] c"adler32Update 0xFFF0FFF0\00"
@.str.5 = [6 x i8] c"crc32\00"
@crc32 = global i32 0
@.str.6 = [14 x i8] c"crc32Update 0\00"
@.str.7 = [14 x i8] c"crc32Update 1\00"
@.str.8 = [16 x i8] c"crc32Update 123\00"
@.str.9 = [23 x i8] c"crc32Update 0xFFFFFFFF\00"
define i32 @main() {
%1 = load i32, i32* @adler32
%2 = tail call i32 @runTest(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1, i32 1)
%3 = load i32, i32* @adler32
%4 = tail call i32 @runTest(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 0)
%5 = load i32, i32* @adler32
%6 = tail call i32 @runTest(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 1)
%7 = load i32, i32* @adler32
%8 = tail call i32 @runTest(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %7, i32 123)
%9 = load i32, i32* @adler32
%10 = tail call i32 @runTest(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %9, i32 -983056)
%11 = load i32, i32* @crc32
%12 = tail call i32 @runTest(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %11, i32 0)
%13 = load i32, i32* @crc32
%14 = tail call i32 @runTest(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %13, i32 0)
%15 = load i32, i32* @crc32
%16 = tail call i32 @runTest(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %15, i32 1)
%17 = load i32, i32* @crc32
%18 = tail call i32 @runTest(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i32 %17, i32 123)
%19 = load i32, i32* @crc32
%20 = tail call i32 @runTest(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i32 %19, i32 -1)
ret i32 0
}