xunge/DecIR huggingface dataset:
/* Variables and functions */
int *realloc(int *, int);
int main(void) {
  int *x = realloc(NULL, 800);
  int *y;
  x = realloc(x, 800);
  x = realloc(x, 400);
  x = realloc(x, 1200);
  y = realloc(x + 10, 1600);
  x = realloc(x, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
mov    $0x320,%esi
call   1030 <realloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x320,%esi
call   1030 <realloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x190,%esi
call   1030 <realloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x4b0,%esi
call   1030 <realloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x28,%rdi
mov    $0x640,%esi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <realloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
mov    $0x320,%esi
call   1030 <realloc@plt>
mov    %rax,%rdi
mov    $0x320,%esi
call   1030 <realloc@plt>
mov    %rax,%rdi
mov    $0x190,%esi
call   1030 <realloc@plt>
mov    %rax,%rdi
mov    $0x4b0,%esi
call   1030 <realloc@plt>
mov    %rax,%rbx
lea    0x28(%rax),%rdi
mov    $0x640,%esi
call   1030 <realloc@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <realloc@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32* @realloc(i32* null, i32 800)
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = call i32* @realloc(i32* %5, i32 800)
store i32* %6, i32** %2
%7 = load i32*, i32** %2
%8 = call i32* @realloc(i32* %7, i32 400)
store i32* %8, i32** %2
%9 = load i32*, i32** %2
%10 = call i32* @realloc(i32* %9, i32 1200)
store i32* %10, i32** %2
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 10
%13 = call i32* @realloc(i32* %12, i32 1600)
store i32* %13, i32** %3
%14 = load i32*, i32** %2
%15 = call i32* @realloc(i32* %14, i32 0)
store i32* %15, i32** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @realloc(i32* null, i32 800)
%2 = tail call i32* @realloc(i32* %1, i32 800)
%3 = tail call i32* @realloc(i32* %2, i32 400)
%4 = tail call i32* @realloc(i32* %3, i32 1200)
%5 = getelementptr inbounds i32, i32* %4, i64 10
%6 = tail call i32* @realloc(i32* %5, i32 1600)
%7 = tail call i32* @realloc(i32* %4, i32 0)
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ nrerror(char *);
double *dvector(long nl, long nh) {
  double *v;
  v = (double *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(double)));
  if (!v)
    nrerror("allocation failure in dvector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <dvector+0x44>
lea    0xea1(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x10(,%rsi,8),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <dvector+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <nrerror@plt>
shl    $0x3,%r14
sub    %r14,%rbx
add    $0x8,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in dvector()\00"
define double* @dvector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca double*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 8
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to double*
store double* %13, double** %5
%14 = load double*, double** %5
%15 = icmp ne double* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load double*, double** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds double, double* %19, i64 %21
%23 = getelementptr inbounds double, double* %22, i64 1
ret double* %23
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in dvector()\00"
define double* @dvector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 3
%5 = add i64 %4, 16
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to double*
%12 = sub i64 0, %0
%13 = getelementptr inbounds double, double* %11, i64 %12
%14 = getelementptr inbounds double, double* %13, i64 1
ret double* %14
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ perror(char *);
int do_fork() {
  const pid_t fpid = fork();
  if (fpid < 0) {
    perror("Failed to fork()");
    return -1;
  } else if (fpid > 0) {
    exit(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<do_fork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <fork@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1166 <do_fork+0x36>
lea    0xeab(%rip),%rdi
call   1030 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1184 <do_fork+0x54>
cmpq   $0x0,-0x10(%rbp)
jle    1178 <do_fork+0x48>
xor    %edi,%edi
call   1040 <exit@plt>
jmp    117d <do_fork+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_fork>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
js     1145 <do_fork+0x15>
jne    1158 <do_fork+0x28>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xeb4(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%ebx
jmp    1141 <do_fork+0x11>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Failed to fork()\00"
define i32 @do_fork() {
%1 = alloca i32
%2 = alloca i64
%3 = call i64 (...) @fork()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %15
8: ; preds = %0
%9 = load i64, i64* %2
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %8
br label %14
14: ; preds = %13
store i32 0, i32* %1
br label %15
15: ; preds = %14, %6
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str = [17 x i8] c"Failed to fork()\00"
define i32 @do_fork() {
%1 = tail call i64 (...) @fork()
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %9
5: ; preds = %0
%6 = icmp eq i64 %1, 0
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %5, %3
%10 = phi i32 [ -1, %3 ], [ 0, %5 ]
ret i32 %10
}
int clickplc_exe_EOF_dec(unsigned char *stream, void *obj) {
  int encsize = 4;
  return (encsize);
}


x86 assembly (clang, -O0):
<clickplc_exe_EOF_dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clickplc_exe_EOF_dec>:
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @clickplc_exe_EOF_dec(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 4, i32* %5
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @clickplc_exe_EOF_dec(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 4
}
char *ntlibc_strcpy(char *des, const char *src) {
  char *d = des;
  const char *s = src;
  while (*s) {
    *d = *s;
    d++;
    s++;
  }
  *d = '\0';
  return des;
}


x86 assembly (clang, -O0):
<ntlibc_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1152 <ntlibc_strcpy+0x52>
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <ntlibc_strcpy+0x1c>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntlibc_strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <ntlibc_strcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <ntlibc_strcpy+0x20>
movb   $0x0,(%rdx)
ret

LLVM IR (-O0):
define i8* @ntlibc_strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
%8 = load i8*, i8** %4
store i8* %8, i8** %6
br label %9
9: ; preds = %13, %2
%10 = load i8*, i8** %6
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %9
%14 = load i8*, i8** %6
%15 = load i8, i8* %14
%16 = load i8*, i8** %5
store i8 %15, i8* %16
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %5
%19 = load i8*, i8** %6
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %6
br label %9
21: ; preds = %9
%22 = load i8*, i8** %5
store i8 0, i8* %22
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
define i8* @ntlibc_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
store i8 %6, i8* %8
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %9, %5 ]
store i8 0, i8* %14
ret i8* %0
}
int arthur_panel_init(void) { return 0; }


x86 assembly (clang, -O0):
<arthur_panel_init>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arthur_panel_init>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @arthur_panel_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @arthur_panel_init() {
ret i32 0
}
bzero(b, length) register char *b;
register unsigned int length;
{
  if (length)
    do
      *b++ = '\0';
    while (--length);
  return (length);
}


x86 assembly (clang, -O0):
<bzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1143 <bzero+0x43>
jmp    111a <bzero+0x1a>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jne    111a <bzero+0x1a>
jmp    1143 <bzero+0x43>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bzero>:
test   %esi,%esi
je     1122 <bzero+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @bzero(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %2
br label %8
8: ; preds = %11, %7
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
store i8 0, i8* %9
br label %11
11: ; preds = %8
%12 = load i32, i32* %4
%13 = add i32 %12, -1
store i32 %13, i32* %4
%14 = icmp ne i32 %13, 0
br i1 %14, label %8, label %15
15: ; preds = %11
br label %16
16: ; preds = %15, %2
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
define i32 @bzero(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret i32 0
}
double FTtoM(double FT) { return FT * 0.3048; }


x86 assembly (clang, -O0):
<FTtoM>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<FTtoM>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @FTtoM(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 3.048000e-01
ret double %4
}

LLVM IR (-O2):
define double @FTtoM(double %0) {
%2 = fmul double %0, 3.048000e-01
ret double %2
}
void fun(int a[]) {
  int tmp = *(a + 5), *p;
  for (p = a + 5; p > a; p--)
    *p = *(p - 1);
  *p = tmp;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jbe    114a <fun+0x4a>
mov    -0x18(%rbp),%rax
mov    -0x4(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x18(%rbp)
jmp    111e <fun+0x1e>
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
lea    0x14(%rdi),%rcx
mov    0x14(%rdi),%eax
nopw   0x0(%rax,%rax,1)
mov    -0x4(%rcx),%edx
mov    %edx,(%rcx)
add    $0xfffffffffffffffc,%rcx
cmp    %rdi,%rcx
ja     1110 <fun+0x10>
mov    %eax,(%rcx)
ret

LLVM IR (-O0):
define void @fun(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 5
%7 = load i32, i32* %6
store i32 %7, i32* %3
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 5
store i32* %9, i32** %4
br label %10
10: ; preds = %19, %1
%11 = load i32*, i32** %4
%12 = load i32*, i32** %2
%13 = icmp ugt i32* %11, %12
br i1 %13, label %14, label %22
14: ; preds = %10
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 -1
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
store i32 %17, i32* %18
br label %19
19: ; preds = %14
%20 = load i32*, i32** %4
%21 = getelementptr inbounds i32, i32* %20, i32 -1
store i32* %21, i32** %4
br label %10
22: ; preds = %10
%23 = load i32, i32* %3
%24 = load i32*, i32** %4
store i32 %23, i32* %24
ret void
}

LLVM IR (-O2):
define void @fun(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
br label %4
4: ; preds = %1, %4
%5 = phi i32* [ %2, %1 ], [ %6, %4 ]
%6 = getelementptr inbounds i32, i32* %5, i64 -1
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = icmp ugt i32* %6, %0
br i1 %8, label %4, label %9
9: ; preds = %4
store i32 %3, i32* %6
ret void
}
double funcTimeStep(double x, double y) { return x + y; }


x86 assembly (clang, -O0):
<funcTimeStep>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcTimeStep>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @funcTimeStep(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @funcTimeStep(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ make_histogram(int *, int);
int main() {
  int word_lengths[] = {0, 3, 6, 5};
  make_histogram(word_lengths, 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1030 <make_histogram@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
call   1030 <make_histogram@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.word_lengths = [4 x i32] [i32 0, i32 3, i32 6, i32 5]
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
store i32 0, i32* %1
%3 = bitcast [4 x i32]* %2 to i8*
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%5 = call i32 @make_histogram(i32* %4, i32 4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.word_lengths = [4 x i32] [i32 0, i32 3, i32 6, i32 5]
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @make_histogram(i32* %3, i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ parallel_clr_eoi(int);
int /*<<< orphan*/ parallel_set_eoi(int);
void parallel_drv3_set_eoi(unsigned char val) {
  if (val) {
    parallel_set_eoi(0x20);
  } else {
    parallel_clr_eoi(~0x20);
  }
}


x86 assembly (clang, -O0):
<parallel_drv3_set_eoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1147 <parallel_drv3_set_eoi+0x27>
mov    $0x20,%edi
call   1040 <parallel_set_eoi@plt>
jmp    1151 <parallel_drv3_set_eoi+0x31>
mov    $0xffffffdf,%edi
call   1030 <parallel_clr_eoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parallel_drv3_set_eoi>:
test   %edi,%edi
je     112e <parallel_drv3_set_eoi+0xe>
mov    $0x20,%edi
jmp    1040 <parallel_set_eoi@plt>
mov    $0xffffffdf,%edi
jmp    1030 <parallel_clr_eoi@plt>

LLVM IR (-O0):
define void @parallel_drv3_set_eoi(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @parallel_set_eoi(i32 32)
br label %9
7: ; preds = %1
%8 = call i32 @parallel_clr_eoi(i32 -33)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @parallel_drv3_set_eoi(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @parallel_set_eoi(i32 32)
br label %7
5: ; preds = %1
%6 = tail call i32 @parallel_clr_eoi(i32 -33)
br label %7
7: ; preds = %5, %3
ret void
}
__attribute__((no)) unsigned int nondet_unsigned_int() {}


x86 assembly (clang, -O0):
<nondet_unsigned_int>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nondet_unsigned_int>:
ret

LLVM IR (-O0):
define i32 @nondet_unsigned_int() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @nondet_unsigned_int() {
ret i32 undef
}
/* Variables and functions */
double ldexp(double, int);
__attribute__((__weak__, __always___)) double softboundmpx_ldexp(double x,
                                                                 int exp) {
  return ldexp(x, exp);
}


x86 assembly (clang, -O0):
<softboundmpx_ldexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
call   1030 <ldexp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx_ldexp>:
jmp    1030 <ldexp@plt>

LLVM IR (-O0):
define weak double @softboundmpx_ldexp(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = load i32, i32* %4
%7 = call double @ldexp(double %5, i32 %6)
ret double %7
}

LLVM IR (-O2):
define weak double @softboundmpx_ldexp(double %0, i32 %1) {
%3 = tail call double @ldexp(double %0, i32 %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
char *f(int);
main() {
  char *a = f(2);
  char *b = f(1);
  if (a + 2 != b)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
call   1040 <f@plt>
mov    %rax,-0x10(%rbp)
mov    $0x1,%edi
call   1040 <f@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x2,%rax
cmp    -0x18(%rbp),%rax
je     1164 <main+0x44>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x2,%edi
call   1040 <f@plt>
mov    %rax,%rbx
mov    $0x1,%edi
call   1040 <f@plt>
add    $0x2,%rbx
cmp    %rax,%rbx
jne    1145 <main+0x25>
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i8* @f(i32 2)
store i8* %4, i8** %2
%5 = call i8* @f(i32 1)
store i8* %5, i8** %3
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 2
%8 = load i8*, i8** %3
%9 = icmp ne i8* %7, %8
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* @f(i32 2)
%2 = tail call i8* @f(i32 1)
%3 = getelementptr inbounds i8, i8* %1, i64 2
%4 = icmp eq i8* %3, %2
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %0
ret i32 0
}
int LZ4_versionNumber(void) { return (1 * 100 * 100 + 3 * 100 + 1); }


x86 assembly (clang, -O0):
<LZ4_versionNumber>:
push   %rbp
mov    %rsp,%rbp
mov    $0x283d,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4_versionNumber>:
mov    $0x283d,%eax
ret

LLVM IR (-O0):
define i32 @LZ4_versionNumber() {
ret i32 10301
}

LLVM IR (-O2):
define i32 @LZ4_versionNumber() {
ret i32 10301
}
/* Variables and functions */
int /*<<< orphan*/ usleep(double);
void _delay_us(double __us) { usleep(__us); }


x86 assembly (clang, -O0):
<_delay_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_delay_us>:
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @_delay_us(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @usleep(double %3)
ret void
}

LLVM IR (-O2):
define void @_delay_us(double %0) {
%2 = tail call i32 @usleep(double %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Just a simple application here...");
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
jmp    112b <main+0x1b>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
nopl   (%rax)
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [34 x i8] c"Just a simple application here...\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
@.str = [34 x i8] c"Just a simple application here...\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
int sched_yield(void) { return 0; }


x86 assembly (clang, -O0):
<sched_yield>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sched_yield>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @sched_yield() {
ret i32 0
}

LLVM IR (-O2):
define i32 @sched_yield() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SYS_exit;
int /*<<< orphan*/ abort();
scalar_t__ foo();
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int);
int main() {
  if (foo() <= 0)
    abort();
  syscall(SYS_exit, 11);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <foo@plt>
cmp    $0x0,%rax
jg     1157 <main+0x27>
mov    $0x0,%al
call   1030 <abort@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
mov    $0xb,%esi
call   1040 <syscall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <foo@plt>
test   %rax,%rax
jle    1154 <main+0x24>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    $0xb,%esi
call   1040 <syscall@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@SYS_exit = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @foo()
%3 = icmp sle i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = load i32, i32* @SYS_exit
%8 = call i32 @syscall(i32 %7, i32 11)
ret i32 0
}

LLVM IR (-O2):
@SYS_exit = global i32 0
define i32 @main() {
%1 = tail call i64 (...) @foo()
%2 = icmp slt i64 %1, 1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = load i32, i32* @SYS_exit
%7 = tail call i32 @syscall(i32 %6, i32 11)
ret i32 0
}
unsigned xrop3_184_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D ^ T;
  stk2 = S & stk3;
  stk1 = T ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_184_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_184_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_184_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %7
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %6
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %7
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %5
%37 = load i32, i32* %6
%38 = and i32 %36, %37
%39 = or i32 %35, %38
ret i32 %39
}

LLVM IR (-O2):
define i32 @xrop3_184_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = or i32 %8, %3
ret i32 %9
}
void my_write(int output, void *buffer, int size) {
  unsigned int buff_addr;
  buff_addr = (long)buffer;
  __asm__("movl $04, %%eax\n\t"
          "movl %00, %%ebx\n\t"
          "movl %01, %%ecx\n\t"
          "movl %02, %%edx\n\t"
          "int  $0x80\n\t"
          :
          : "r"(output), "r"(buff_addr), "r"(size)
          : "%eax", "%ebx", "%ecx", "%edx");
}


x86 assembly (clang, -O0):
<my_write>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%edi
mov    -0x1c(%rbp),%r8d
mov    $0x4,%eax
mov    %esi,%ebx
mov    %edi,%ecx
mov    %r8d,%edx
int    $0x80
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_write>:
push   %rbx
mov    %edx,%r8d
mov    $0x4,%eax
mov    %edi,%ebx
mov    %esi,%ecx
mov    %r8d,%edx
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define void @my_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = ptrtoint i8* %8 to i64
%10 = trunc i64 %9 to i32
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = load i32, i32* %7
%13 = load i32, i32* %6
ret void
}

LLVM IR (-O2):
define void @my_write(i32 %0, i8* %1, i32 %2) {
%4 = ptrtoint i8* %1 to i64
%5 = trunc i64 %4 to i32
tail call void asm sideeffect "movl $$04, %eax\0A\09movl $0, %ebx\0A\09movl $1, %ecx\0A\09movl $2, %edx\0A\09int $$0x80\0A\09", "r,r,r,~{eax},~{ebx},~{ecx},~{edx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %5, i32 %2)
ret void
}
int strcmp(register const char *s1, register const char *s2) {
  register unsigned int a, b;
  do {
    a = *s1++;
    b = *s2++;
    if (a != b)
      return a - b;
  } while (a != '\0');
  return 0;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
je     1150 <strcmp+0x50>
mov    -0x1c(%rbp),%eax
sub    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <strcmp+0x66>
jmp    1155 <strcmp+0x55>
cmpl   $0x0,-0x1c(%rbp)
jne    110c <strcmp+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi,%rcx,1),%eax
movsbl (%rsi,%rcx,1),%edx
cmp    %dl,%al
jne    1127 <strcmp+0x27>
add    $0x1,%rcx
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
ret
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %8
8: ; preds = %25, %2
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %4
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
store i32 %12, i32* %6
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %5
%15 = load i8, i8* %13
%16 = sext i8 %15 to i32
store i32 %16, i32* %7
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = icmp ne i32 %17, %18
br i1 %19, label %20, label %24
20: ; preds = %8
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = sub i32 %21, %22
store i32 %23, i32* %3
br label %29
24: ; preds = %8
br label %25
25: ; preds = %24
%26 = load i32, i32* %6
%27 = icmp ne i32 %26, 0
br i1 %27, label %8, label %28
28: ; preds = %25
store i32 0, i32* %3
br label %29
29: ; preds = %28, %20
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %13, %2
%4 = phi i8* [ %1, %2 ], [ %14, %13 ]
%5 = phi i8* [ %0, %2 ], [ %15, %13 ]
%6 = load i8, i8* %5
%7 = load i8, i8* %4
%8 = icmp eq i8 %6, %7
br i1 %8, label %13, label %9
9: ; preds = %3
%10 = sext i8 %6 to i32
%11 = sext i8 %7 to i32
%12 = sub nsw i32 %10, %11
br label %17
13: ; preds = %3
%14 = getelementptr inbounds i8, i8* %4, i64 1
%15 = getelementptr inbounds i8, i8* %5, i64 1
%16 = icmp eq i8 %6, 0
br i1 %16, label %17, label %3
17: ; preds = %13, %9
%18 = phi i32 [ %12, %9 ], [ 0, %13 ]
ret i32 %18
}
/* Variables and functions */
scalar_t__ rand();
size_t rand_1_N(size_t N) { return ((size_t)rand() % N) + 1; }


x86 assembly (clang, -O0):
<rand_1_N>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x8(%rbp)
mov    %rdx,%rax
add    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_1_N>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     1131 <rand_1_N+0x21>
xor    %edx,%edx
div    %rbx
mov    %rdx,%rax
jmp    1137 <rand_1_N+0x27>
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
add    $0x1,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @rand_1_N(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i64 (...) @rand()
%4 = load i64, i64* %2
%5 = urem i64 %3, %4
%6 = add i64 %5, 1
ret i64 %6
}

LLVM IR (-O2):
define i64 @rand_1_N(i64 %0) {
%2 = tail call i64 (...) @rand()
%3 = urem i64 %2, %0
%4 = add nuw i64 %3, 1
ret i64 %4
}
adr0adrx1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((*((double *)10000000)) <=
      (((double *)(11111111 & ~(__alignof__(double) - 1)))[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adr0adrx1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    $0x989680,%eax
movsd  (%rax),%xmm1
movslq -0x20(%rbp),%rcx
mov    $0xa98ac0,%eax
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jb     1149 <adr0adrx1+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1150 <adr0adrx1+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0adrx1>:
movslq %esi,%rax
movsd  0xa98ac0(,%rax,8),%xmm0
xor    %eax,%eax
ucomisd 0x989680,%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @adr0adrx1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double, double* inttoptr (i64 10000000 to double*)
%15 = load i32, i32* %11
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* inttoptr (i64 11111104 to double*), i64 %16
%18 = load double, double* %17
%19 = fcmp ole double %14, %18
br i1 %19, label %20, label %21
20: ; preds = %6
store i32 1, i32* %7
br label %22
21: ; preds = %6
store i32 0, i32* %7
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @adr0adrx1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture readnone %5) {
%7 = load double, double* inttoptr (i64 10000000 to double*)
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds double, double* inttoptr (i64 11111104 to double*), i64 %8
%10 = load double, double* %9
%11 = fcmp ole double %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t mpu401_mca_feedb(void *p) { return 1; }


x86 assembly (clang, -O0):
<mpu401_mca_feedb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpu401_mca_feedb>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @mpu401_mca_feedb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i32 1
}

LLVM IR (-O2):
define i32 @mpu401_mca_feedb(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
char toupper(char);
char *strtoupper(char *start) {
  char *in;
  in = start;
  while (*in) {
    *in = toupper(*in);
    in++;
  }
  return start;
}


x86 assembly (clang, -O0):
<strtoupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <strtoupper+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strtoupper+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoupper>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <strtoupper+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strtoupper+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strtoupper(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %9, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = call signext i8 @toupper(i8 signext %11)
%13 = load i8*, i8** %3
store i8 %12, i8* %13
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
br label %5
16: ; preds = %5
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
define i8* @strtoupper(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
char *get(char *buff, unsigned row, unsigned col, unsigned width) {
  return buff + row * (width + 1) + col;
}


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    -0x14(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
mov    %ecx,%ecx
add    %rcx,%rax
mov    -0x10(%rbp),%ecx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get>:
add    $0x1,%ecx
imul   %esi,%ecx
add    %rdi,%rcx
mov    %edx,%eax
add    %rcx,%rax
ret

LLVM IR (-O0):
define i8* @get(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %8
%12 = add i32 %11, 1
%13 = mul i32 %10, %12
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %9, i64 %14
%16 = load i32, i32* %7
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
ret i8* %18
}

LLVM IR (-O2):
define i8* @get(i8* readnone %0, i32 %1, i32 %2, i32 %3) {
%5 = add i32 %3, 1
%6 = mul i32 %5, %1
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = zext i32 %2 to i64
%10 = getelementptr inbounds i8, i8* %8, i64 %9
ret i8* %10
}
void ps_background(int color) { color = color; }


x86 assembly (clang, -O0):
<ps_background>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps_background>:
ret

LLVM IR (-O0):
define void @ps_background(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store i32 %3, i32* %2
ret void
}

LLVM IR (-O2):
define void @ps_background(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NSEEL_start();
void JamesDSPGlobalMemoryAllocation() { NSEEL_start(); }


x86 assembly (clang, -O0):
<JamesDSPGlobalMemoryAllocation>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <NSEEL_start@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<JamesDSPGlobalMemoryAllocation>:
xor    %eax,%eax
jmp    1030 <NSEEL_start@plt>

LLVM IR (-O0):
define void @JamesDSPGlobalMemoryAllocation() {
%1 = call i32 (...) @NSEEL_start()
ret void
}

LLVM IR (-O2):
define void @JamesDSPGlobalMemoryAllocation() {
%1 = tail call i32 (...) @NSEEL_start()
ret void
}
int elg_pform_is_gclock() { return 1; }


x86 assembly (clang, -O0):
<elg_pform_is_gclock>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<elg_pform_is_gclock>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @elg_pform_is_gclock() {
ret i32 1
}

LLVM IR (-O2):
define i32 @elg_pform_is_gclock() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int usage(char *prog) {
  printf("Usage is %s <host> <port> <ipv6|ipv4|any>\n", prog);
  printf("\n");
  printf("Connect to the remote echo server and\n");
  printf("send text\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
lea    0xef2(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Usage is %s <host> <port> <ipv6|ipv4|any>\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [39 x i8] c"Connect to the remote echo server and\0A\00"
@.str.3 = [11 x i8] c"send text\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@.str = [43 x i8] c"Usage is %s <host> <port> <ipv6|ipv4|any>\0A\00"
@str = [38 x i8] c"Connect to the remote echo server and\00"
@str.4 = [10 x i8] c"send text\00"
define i32 @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.4, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ delay_mock_add_micros(int);
void delay_mock_add_seconds(uint32_t seconds) {
  uint64_t seconds_u64 = seconds;
  uint64_t micros_u64 = seconds_u64 * 1000000;
  delay_mock_add_micros(micros_u64);
}


x86 assembly (clang, -O0):
<delay_mock_add_seconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
imul   $0xf4240,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <delay_mock_add_micros@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_mock_add_seconds>:
imul   $0xf4240,%edi,%edi
jmp    1030 <delay_mock_add_micros@plt>

LLVM IR (-O0):
define void @delay_mock_add_seconds(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 1000000
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 @delay_mock_add_micros(i32 %8)
ret void
}

LLVM IR (-O2):
define void @delay_mock_add_seconds(i32 %0) {
%2 = mul nsw i32 %0, 1000000
%3 = tail call i32 @delay_mock_add_micros(i32 %2)
ret void
}
/* Variables and functions */
size_t strlen(char const *);
char *lastchar(const char *str) {
  size_t len;
  len = strlen(str);
  if (len)
    return ((char *)&str[len - 1]);
  return ((char *)str);
}


x86 assembly (clang, -O0):
<lastchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114c <lastchar+0x3c>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1154 <lastchar+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lastchar>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
xor    %ecx,%ecx
sub    $0x1,%rax
cmovb  %rcx,%rax
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @lastchar(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = load i64, i64* %4
%12 = sub i64 %11, 1
%13 = getelementptr inbounds i8, i8* %10, i64 %12
store i8* %13, i8** %2
br label %16
14: ; preds = %1
%15 = load i8*, i8** %3
store i8* %15, i8** %2
br label %16
16: ; preds = %14, %9
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
define i8* @lastchar(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
%4 = add i64 %2, -1
%5 = select i1 %3, i64 0, i64 %4
%6 = getelementptr i8, i8* %0, i64 %5
ret i8* %6
}
int test_imm_77uint32_mem(unsigned int *val) {
  return ((*val) & (0x77 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_77uint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x77,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_77uint32_mem>:
testb  $0x77,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_77uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 119
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_77uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 119
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}