#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*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ i;

/* Variables and functions */
int /*<<< orphan*/ md5_hash(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *);
int execute(int thread_id, int num_threads, long long length, int test_argc,
            const void **test_argv) {
  long long i;
  uint32_t digest[4];
  for (i = 0; i < length; i++) {
    md5_hash((uint8_t *)&i, sizeof(i), digest);
  }
  return 0;
}


x86 assembly (clang, -O0):
<execute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1162 <execute+0x52>
lea    -0x28(%rbp),%rdi
lea    -0x40(%rbp),%rdx
mov    $0x8,%esi
call   1030 <md5_hash@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1131 <execute+0x21>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
movq   $0x0,0x8(%rsp)
test   %rdx,%rdx
jle    1163 <execute+0x53>
mov    %rdx,%rbx
lea    0x8(%rsp),%r14
lea    0x10(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    $0x8,%esi
mov    %r15,%rdx
call   1030 <md5_hash@plt>
mov    0x8(%rsp),%rax
add    $0x1,%rax
mov    %rax,0x8(%rsp)
cmp    %rbx,%rax
jl     1140 <execute+0x30>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @execute(i32 %0, i32 %1, i64 %2, i32 %3, i8** %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
%9 = alloca i32
%10 = alloca i8**
%11 = alloca i64
%12 = alloca [4 x i32]
store i32 %0, i32* %6
store i32 %1, i32* %7
store i64 %2, i64* %8
store i32 %3, i32* %9
store i8** %4, i8*** %10
store i64 0, i64* %11
br label %13
13: ; preds = %21, %5
%14 = load i64, i64* %11
%15 = load i64, i64* %8
%16 = icmp slt i64 %14, %15
br i1 %16, label %17, label %24
17: ; preds = %13
%18 = bitcast i64* %11 to i32*
%19 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 0, i64 0
%20 = call i32 @md5_hash(i32* %18, i32 8, i32* %19)
br label %21
21: ; preds = %17
%22 = load i64, i64* %11
%23 = add nsw i64 %22, 1
store i64 %23, i64* %11
br label %13
24: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
define i32 @execute(i32 %0, i32 %1, i64 %2, i32 %3, i8** nocapture readnone %4) {
%6 = alloca i64
%7 = alloca [4 x i32]
%8 = bitcast i64* %6 to i8*
%9 = bitcast [4 x i32]* %7 to i8*
store i64 0, i64* %6
%10 = icmp sgt i64 %2, 0
br i1 %10, label %11, label %19
11: ; preds = %5
%12 = bitcast i64* %6 to i32*
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
br label %14
14: ; preds = %11, %14
%15 = call i32 @md5_hash(i32* %12, i32 8, i32* %13)
%16 = load i64, i64* %6
%17 = add nsw i64 %16, 1
store i64 %17, i64* %6
%18 = icmp slt i64 %17, %2
br i1 %18, label %14, label %19
19: ; preds = %14, %5
ret i32 0
}