#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 MD5_DIGEST_LENGTH;
void addHashInHistory(unsigned int hashcode[MD5_DIGEST_LENGTH],
                      unsigned int hash_history[100000][MD5_DIGEST_LENGTH],
                      unsigned int nb) {
  int i;
  for (i = 0; i < MD5_DIGEST_LENGTH; i++) {
    hash_history[nb][i] = hashcode[i];
  }
}


x86 assembly (clang, -O0):
<addHashInHistory>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%eax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    0x2eb3(%rip),%rcx
cmp    (%rcx),%eax
jge    116b <addHashInHistory+0x6b>
mov    -0x20(%rbp),%rsi
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
imul   %rsi,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1123 <addHashInHistory+0x23>
pop    %rbp
ret

x86 assembly (clang, -O2):
<addHashInHistory>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
test   %ecx,%ecx
jle    1132 <addHashInHistory+0x32>
mov    %edx,%edx
imul   %rdx,%rcx
lea    (%rsi,%rcx,4),%rcx
xor    %edx,%edx
nopl   0x0(%rax)
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rcx,%rdx,4)
add    $0x1,%rdx
movslq (%rax),%rsi
cmp    %rsi,%rdx
jl     1120 <addHashInHistory+0x20>
ret

LLVM IR (-O0):
@MD5_DIGEST_LENGTH = global i32 0
define void @addHashInHistory(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i32, i32* @MD5_DIGEST_LENGTH
%9 = zext i32 %8 to i64
%10 = load i32, i32* @MD5_DIGEST_LENGTH
%11 = zext i32 %10 to i64
store i32 0, i32* %7
br label %12
12: ; preds = %30, %3
%13 = load i32, i32* %7
%14 = load i32, i32* @MD5_DIGEST_LENGTH
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %33
16: ; preds = %12
%17 = load i32*, i32** %4
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
%22 = load i32*, i32** %5
%23 = load i32, i32* %6
%24 = zext i32 %23 to i64
%25 = mul nsw i64 %24, %11
%26 = getelementptr inbounds i32, i32* %22, i64 %25
%27 = load i32, i32* %7
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %26, i64 %28
store i32 %21, i32* %29
br label %30
30: ; preds = %16
%31 = load i32, i32* %7
%32 = add nsw i32 %31, 1
store i32 %32, i32* %7
br label %12
33: ; preds = %12
ret void
}

LLVM IR (-O2):
@MD5_DIGEST_LENGTH = global i32 0
define void @addHashInHistory(i32* nocapture %0, i32* nocapture writeonly %1, i32 %2) {
%4 = load i32, i32* @MD5_DIGEST_LENGTH
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %20
6: ; preds = %3
%7 = zext i32 %4 to i64
%8 = zext i32 %2 to i64
%9 = mul nuw nsw i64 %7, %8
%10 = getelementptr inbounds i32, i32* %1, i64 %9
br label %11
11: ; preds = %6, %11
%12 = phi i64 [ 0, %6 ], [ %16, %11 ]
%13 = getelementptr inbounds i32, i32* %0, i64 %12
%14 = load i32, i32* %13
%15 = getelementptr inbounds i32, i32* %10, i64 %12
store i32 %14, i32* %15
%16 = add nuw nsw i64 %12, 1
%17 = load i32, i32* @MD5_DIGEST_LENGTH
%18 = sext i32 %17 to i64
%19 = icmp slt i64 %16, %18
br i1 %19, label %11, label %20
20: ; preds = %11, %3
ret void
}