#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 */
typedef int /*<<< orphan*/ data4;
typedef int /*<<< orphan*/ data3;
typedef int /*<<< orphan*/ data2;
typedef int /*<<< orphan*/ data1;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ nilsimsa_compute(char const *, int, char *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  const char data1[] = "abcdefgh";
  const char data2[] =
      "This is a much more ridiculous test because of 21347597.";
  const char data3[] = "The rain in Spain falls mostly in the plains.";
  const char data4[] = "The rain in Spain falls mainly in the plains.";
  int data1_sz = sizeof(data1) / sizeof(data1[0]) - 1;
  int data2_sz = sizeof(data2) / sizeof(data2[0]) - 1;
  int data3_sz = sizeof(data3) / sizeof(data3[0]) - 1;
  int data4_sz = sizeof(data4) / sizeof(data4[0]) - 1;
  char hash1[65] = {0};
  char hash2[65] = {0};
  char hash3[65] = {0};
  char hash4[65] = {0};
  nilsimsa_compute(data1, data1_sz, hash1);
  nilsimsa_compute(data2, data2_sz, hash2);
  nilsimsa_compute(data3, data3_sz, hash3);
  nilsimsa_compute(data4, data4_sz, hash4);
  assert(
      strcmp(
          hash1,
          "14C8118000000000030800000004042004189020001308014088003280000078") ==
      0);
  assert(
      strcmp(
          hash2,
          "5D9C6A6B22384BCD524A8D414D82237777433FC1A07A02C3E06985D96ECDF8FB") ==
      0);
  assert(
      strcmp(
          hash3,
          "039020EB1050188BE400091130981860648E39F5B1246D8C3C3C7623801186AC") ==
      0);
  assert(
      strcmp(
          hash4,
          "23B000E908501883C408019410D83A60C48F1977A3246CCC3CBC7213C81104BC") ==
      0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xe90(%rip),%rax
mov    %rax,-0x19(%rbp)
mov    0xe8e(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xf88(%rip),%rsi
mov    $0x39,%edx
call   1070 <memcpy@plt>
lea    -0x90(%rbp),%rdi
lea    0xfb0(%rip),%rsi
mov    $0x2e,%edx
call   1070 <memcpy@plt>
lea    -0xc0(%rbp),%rdi
lea    0xfc8(%rip),%rsi
mov    $0x2e,%edx
call   1070 <memcpy@plt>
movl   $0x8,-0xc4(%rbp)
movl   $0x38,-0xc8(%rbp)
movl   $0x2d,-0xcc(%rbp)
movl   $0x2d,-0xd0(%rbp)
lea    -0x120(%rbp),%rdi
xor    %esi,%esi
mov    $0x41,%edx
call   1040 <memset@plt>
lea    -0x170(%rbp),%rdi
xor    %esi,%esi
mov    $0x41,%edx
call   1040 <memset@plt>
lea    -0x1c0(%rbp),%rdi
xor    %esi,%esi
mov    $0x41,%edx
call   1040 <memset@plt>
lea    -0x210(%rbp),%rdi
xor    %esi,%esi
mov    $0x41,%edx
call   1040 <memset@plt>
lea    -0x19(%rbp),%rdi
mov    -0xc4(%rbp),%esi
lea    -0x120(%rbp),%rdx
call   1030 <nilsimsa_compute@plt>
lea    -0x60(%rbp),%rdi
mov    -0xc8(%rbp),%esi
lea    -0x170(%rbp),%rdx
call   1030 <nilsimsa_compute@plt>
lea    -0x90(%rbp),%rdi
mov    -0xcc(%rbp),%esi
lea    -0x1c0(%rbp),%rdx
call   1030 <nilsimsa_compute@plt>
lea    -0xc0(%rbp),%rdi
mov    -0xd0(%rbp),%esi
lea    -0x210(%rbp),%rdx
call   1030 <nilsimsa_compute@plt>
lea    -0x120(%rbp),%rdi
lea    0xd67(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    -0x170(%rbp),%rdi
lea    0xd84(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    -0x1c0(%rbp),%rdi
lea    0xda1(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    -0x210(%rbp),%rdi
lea    0xdbe(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
xor    %eax,%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x1f8,%rsp
movabs $0x6867666564636261,%rax
66 67 68
mov    %rax,(%rsp)
movb   $0x0,0x8(%rsp)
movups 0xfe1(%rip),%xmm0
movups %xmm0,0x179(%rsp)
movaps 0xfc9(%rip),%xmm0
movaps %xmm0,0x170(%rsp)
movaps 0xfaa(%rip),%xmm0
movaps %xmm0,0x160(%rsp)
movaps 0xf8b(%rip),%xmm0
movaps %xmm0,0x150(%rsp)
movups 0xfda(%rip),%xmm0
movups %xmm0,0x1de(%rsp)
movaps 0xfbd(%rip),%xmm0
movaps %xmm0,0x1d0(%rsp)
movaps 0xf9e(%rip),%xmm0
movaps %xmm0,0x1c0(%rsp)
movups 0xfdd(%rip),%xmm0
movups %xmm0,0x1ae(%rsp)
movaps 0xfc0(%rip),%xmm0
movaps %xmm0,0x1a0(%rsp)
movaps 0xfa1(%rip),%xmm0
movaps %xmm0,0x190(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movb   $0x0,0x140(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movb   $0x0,0xf0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movb   $0x0,0xa0(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movb   $0x0,0x50(%rsp)
mov    %rsp,%rdi
lea    0x100(%rsp),%rbx
mov    $0x8,%esi
mov    %rbx,%rdx
call   1030 <nilsimsa_compute@plt>
lea    0x150(%rsp),%rdi
lea    0xb0(%rsp),%r12
mov    $0x38,%esi
mov    %r12,%rdx
call   1030 <nilsimsa_compute@plt>
lea    0x1c0(%rsp),%rdi
lea    0x60(%rsp),%r15
mov    $0x2d,%esi
mov    %r15,%rdx
call   1030 <nilsimsa_compute@plt>
lea    0x190(%rsp),%rdi
lea    0x10(%rsp),%r14
mov    $0x2d,%esi
mov    %r14,%rdx
call   1030 <nilsimsa_compute@plt>
lea    0xd24(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
lea    0xd48(%rip),%rsi
mov    %r12,%rdi
call   1040 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
lea    0xd6c(%rip),%rsi
mov    %r15,%rdi
call   1040 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
lea    0xd90(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x1f8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.data1 = [9 x i8] c"abcdefgh\00"
@__const.main.data2 = [57 x i8] c"This is a much more ridiculous test because of 21347597.\00"
@__const.main.data3 = [46 x i8] c"The rain in Spain falls mostly in the plains.\00"
@__const.main.data4 = [46 x i8] c"The rain in Spain falls mainly in the plains.\00"
@.str = [65 x i8] c"14C8118000000000030800000004042004189020001308014088003280000078\00"
@.str.1 = [65 x i8] c"5D9C6A6B22384BCD524A8D414D82237777433FC1A07A02C3E06985D96ECDF8FB\00"
@.str.2 = [65 x i8] c"039020EB1050188BE400091130981860648E39F5B1246D8C3C3C7623801186AC\00"
@.str.3 = [65 x i8] c"23B000E908501883C408019410D83A60C48F1977A3246CCC3CBC7213C81104BC\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [9 x i8]
%7 = alloca [57 x i8]
%8 = alloca [46 x i8]
%9 = alloca [46 x i8]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca [65 x i8]
%15 = alloca [65 x i8]
%16 = alloca [65 x i8]
%17 = alloca [65 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = bitcast [9 x i8]* %6 to i8*
%19 = bitcast [57 x i8]* %7 to i8*
%20 = bitcast [46 x i8]* %8 to i8*
%21 = bitcast [46 x i8]* %9 to i8*
store i32 8, i32* %10
store i32 56, i32* %11
store i32 45, i32* %12
store i32 45, i32* %13
%22 = bitcast [65 x i8]* %14 to i8*
%23 = bitcast [65 x i8]* %15 to i8*
%24 = bitcast [65 x i8]* %16 to i8*
%25 = bitcast [65 x i8]* %17 to i8*
%26 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 0
%27 = load i32, i32* %10
%28 = getelementptr inbounds [65 x i8], [65 x i8]* %14, i64 0, i64 0
%29 = call i32 @nilsimsa_compute(i8* %26, i32 %27, i8* %28)
%30 = getelementptr inbounds [57 x i8], [57 x i8]* %7, i64 0, i64 0
%31 = load i32, i32* %11
%32 = getelementptr inbounds [65 x i8], [65 x i8]* %15, i64 0, i64 0
%33 = call i32 @nilsimsa_compute(i8* %30, i32 %31, i8* %32)
%34 = getelementptr inbounds [46 x i8], [46 x i8]* %8, i64 0, i64 0
%35 = load i32, i32* %12
%36 = getelementptr inbounds [65 x i8], [65 x i8]* %16, i64 0, i64 0
%37 = call i32 @nilsimsa_compute(i8* %34, i32 %35, i8* %36)
%38 = getelementptr inbounds [46 x i8], [46 x i8]* %9, i64 0, i64 0
%39 = load i32, i32* %13
%40 = getelementptr inbounds [65 x i8], [65 x i8]* %17, i64 0, i64 0
%41 = call i32 @nilsimsa_compute(i8* %38, i32 %39, i8* %40)
%42 = getelementptr inbounds [65 x i8], [65 x i8]* %14, i64 0, i64 0
%43 = call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
%45 = zext i1 %44 to i32
%46 = call i32 @assert(i32 %45)
%47 = getelementptr inbounds [65 x i8], [65 x i8]* %15, i64 0, i64 0
%48 = call i64 @strcmp(i8* %47, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
%50 = zext i1 %49 to i32
%51 = call i32 @assert(i32 %50)
%52 = getelementptr inbounds [65 x i8], [65 x i8]* %16, i64 0, i64 0
%53 = call i64 @strcmp(i8* %52, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.2, i64 0, i64 0))
%54 = icmp eq i64 %53, 0
%55 = zext i1 %54 to i32
%56 = call i32 @assert(i32 %55)
%57 = getelementptr inbounds [65 x i8], [65 x i8]* %17, i64 0, i64 0
%58 = call i64 @strcmp(i8* %57, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.3, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
%60 = zext i1 %59 to i32
%61 = call i32 @assert(i32 %60)
ret i32 0
}

LLVM IR (-O2):
@__const.main.data1 = [9 x i8] c"abcdefgh\00"
@__const.main.data2 = [57 x i8] c"This is a much more ridiculous test because of 21347597.\00"
@__const.main.data3 = [46 x i8] c"The rain in Spain falls mostly in the plains.\00"
@__const.main.data4 = [46 x i8] c"The rain in Spain falls mainly in the plains.\00"
@.str = [65 x i8] c"14C8118000000000030800000004042004189020001308014088003280000078\00"
@.str.1 = [65 x i8] c"5D9C6A6B22384BCD524A8D414D82237777433FC1A07A02C3E06985D96ECDF8FB\00"
@.str.2 = [65 x i8] c"039020EB1050188BE400091130981860648E39F5B1246D8C3C3C7623801186AC\00"
@.str.3 = [65 x i8] c"23B000E908501883C408019410D83A60C48F1977A3246CCC3CBC7213C81104BC\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [9 x i8]
%4 = alloca [57 x i8]
%5 = alloca [46 x i8]
%6 = alloca [46 x i8]
%7 = alloca [65 x i8]
%8 = alloca [65 x i8]
%9 = alloca [65 x i8]
%10 = alloca [65 x i8]
%11 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds [57 x i8], [57 x i8]* %4, i64 0, i64 0
%13 = getelementptr inbounds [46 x i8], [46 x i8]* %5, i64 0, i64 0
%14 = getelementptr inbounds [46 x i8], [46 x i8]* %6, i64 0, i64 0
%15 = getelementptr inbounds [65 x i8], [65 x i8]* %7, i64 0, i64 0
%16 = getelementptr inbounds [65 x i8], [65 x i8]* %8, i64 0, i64 0
%17 = getelementptr inbounds [65 x i8], [65 x i8]* %9, i64 0, i64 0
%18 = getelementptr inbounds [65 x i8], [65 x i8]* %10, i64 0, i64 0
%19 = call i32 @nilsimsa_compute(i8* %11, i32 8, i8* %15)
%20 = call i32 @nilsimsa_compute(i8* %12, i32 56, i8* %16)
%21 = call i32 @nilsimsa_compute(i8* %13, i32 45, i8* %17)
%22 = call i32 @nilsimsa_compute(i8* %14, i32 45, i8* %18)
%23 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
%27 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.2, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
%33 = zext i1 %32 to i32
%34 = call i32 @assert(i32 %33)
%35 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.3, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
%37 = zext i1 %36 to i32
%38 = call i32 @assert(i32 %37)
ret i32 0
}