xunge/DecIR huggingface dataset:
int cmpd(double const *ap, double const *bp) {
  double diff = *ap - *bp;
  return diff < 0 ? -1 : diff > 0 ? 1 : 0;
}


x86 assembly (clang, -O0):
<cmpd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    113c <cmpd+0x3c>
mov    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1155 <cmpd+0x55>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpd>:
movsd  (%rdi),%xmm0
subsd  (%rsi),%xmm0
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmpd(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = load double, double* %8
%10 = fsub double %7, %9
store double %10, double* %5
%11 = load double, double* %5
%12 = fcmp olt double %11, 0.000000e+00
br i1 %12, label %13, label %14
13: ; preds = %2
br label %19
14: ; preds = %2
%15 = load double, double* %5
%16 = fcmp ogt double %15, 0.000000e+00
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 1, i32 0
br label %19
19: ; preds = %14, %13
%20 = phi i32 [ -1, %13 ], [ %18, %14 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @cmpd(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fsub double %3, %4
%6 = fcmp olt double %5, 0.000000e+00
%7 = fcmp ogt double %5, 0.000000e+00
%8 = zext i1 %7 to i32
%9 = select i1 %6, i32 -1, i32 %8
ret i32 %9
}
char *my_strcpy(char *dest, char const *src) {
  int i = 0;
  while (src[i] != '\0') {
    dest[i] = src[i];
    i++;
  }
  dest[i] = '\0';
  return (dest);
}


x86 assembly (clang, -O0):
<my_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <my_strcpy+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <my_strcpy+0x13>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1127 <my_strcpy+0x27>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <my_strcpy+0x10>
mov    %edx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret
xor    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret

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

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


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

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

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

LLVM IR (-O2):
define void @mumps_ooc_end_write_c(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ini_getbool_default(int *, char *);
int ini_getbool_default_def(char *param, int def) {
  int value;
  if (!ini_getbool_default(&value, param))
    return def;
  return value;
}


x86 assembly (clang, -O0):
<ini_getbool_default_def>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdi
call   1030 <ini_getbool_default@plt>
cmp    $0x0,%eax
jne    1140 <ini_getbool_default_def+0x30>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <ini_getbool_default_def+0x36>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ini_getbool_default_def>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xc(%rsp),%rdi
call   1030 <ini_getbool_default@plt>
test   %eax,%eax
je     112c <ini_getbool_default_def+0x1c>
mov    0xc(%rsp),%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ini_getbool_default_def(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @ini_getbool_default(i32* %3, i8* %0)
%6 = icmp eq i32 %5, 0
%7 = load i32, i32* %3
%8 = select i1 %6, i32 %1, i32 %7
ret i32 %8
}
/* Variables and functions */
void cidF(int *x) { char *y = x; }


x86 assembly (clang, -O0):
<cidF>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cidF(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = bitcast i32* %4 to i8*
store i8* %5, i8** %3
ret void
}

LLVM IR (-O2):
define void @cidF(i32* nocapture %0) {
ret void
}
void readEnd() {}


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

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

LLVM IR (-O0):
define void @readEnd() {
ret void
}

LLVM IR (-O2):
define void @readEnd() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Alarm(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void handler(int sig) {
  static int beeps = 0;
  printf("BEEP\n");
  if (++beeps < 5)
    Alarm(1);
  else {
    printf("BOMP!\n");
    exit(0);
  }
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eef(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ee6(%rip)
cmp    $0x5,%eax
jge    116e <handler+0x3e>
mov    $0x1,%edi
call   1050 <Alarm@plt>
jmp    1181 <handler+0x51>
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ef9(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2ef0(%rip)
cmp    $0x3,%eax
jg     115c <handler+0x2c>
mov    $0x1,%edi
pop    %rax
jmp    1050 <Alarm@plt>
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@handler.beeps = internal global i32 0
@.str = [6 x i8] c"BEEP\0A\00"
@.str.1 = [7 x i8] c"BOMP!\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @handler.beeps
%5 = add nsw i32 %4, 1
store i32 %5, i32* @handler.beeps
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @Alarm(i32 1)
br label %12
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @exit(i32 0)
unreachable
12: ; preds = %7
ret void
}

LLVM IR (-O2):
@handler.beeps = internal unnamed_addr global i32 0
@str = [5 x i8] c"BEEP\00"
@str.2 = [6 x i8] c"BOMP!\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @handler.beeps
%4 = add nsw i32 %3, 1
store i32 %4, i32* @handler.beeps
%5 = icmp slt i32 %3, 4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @Alarm(i32 1)
ret void
8: ; preds = %1
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.2, i64 0, i64 0))
%10 = tail call i32 @exit(i32 0)
unreachable
}
int f(void) { return 23; }


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

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

LLVM IR (-O0):
define i32 @f() {
ret i32 23
}

LLVM IR (-O2):
define i32 @f() {
ret i32 23
}
int mult(int a, int b) { return (a * b); }


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

x86 assembly (clang, -O2):
<mult>:
mov    %edi,%eax
imul   %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @mult(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
int all_upper(str)
char *str;
{
  while (*str) {
    if (!(((unsigned char)*str) <= 0177) || !isupper((unsigned char)*str))
      return 0;
    ++str;
  }
  return 1;
}


x86 assembly (clang, -O0):
<all_upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116b <all_upper+0x5b>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x7f,%eax
jg     114e <all_upper+0x3e>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isupper@plt>
cmp    $0x0,%eax
jne    115a <all_upper+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1172 <all_upper+0x62>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <all_upper+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_upper>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     114b <all_upper+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %al,%al
js     1150 <all_upper+0x40>
movzbl %al,%edi
call   1030 <isupper@plt>
test   %eax,%eax
je     1150 <all_upper+0x40>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <all_upper+0x20>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @all_upper(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %7
4: ; preds = %11
%5 = load i8, i8* %15
%6 = icmp eq i8 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %15, %4 ], [ %0, %1 ]
%10 = icmp sgt i8 %8, -1
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = zext i8 %8 to i32
%13 = tail call i32 @isupper(i32 %12)
%14 = icmp eq i32 %13, 0
%15 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %14, label %16, label %4
16: ; preds = %11, %7, %4, %1
%17 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ], [ 0, %11 ]
ret i32 %17
}
int linear_search(int arr[], int n, int item) {
  int i;
  for (i = 0; i < n; i++) {
    if (arr[i] == item)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<linear_search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1153 <linear_search+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1140 <linear_search+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <linear_search+0x5a>
jmp    1145 <linear_search+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <linear_search+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_search>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <linear_search+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <linear_search+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <linear_search+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @linear_search(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Variables and functions */
int sqrt(int);
int hipotenusa(int a, int b) { return sqrt(a * a + b * b); }


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

x86 assembly (clang, -O2):
<hipotenusa>:
imul   %edi,%edi
imul   %esi,%esi
add    %esi,%edi
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define i32 @hipotenusa(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = mul nsw i32 %5, %6
%8 = load i32, i32* %4
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
%11 = add nsw i32 %7, %10
%12 = call i32 @sqrt(i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @hipotenusa(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, %0
%4 = mul nsw i32 %1, %1
%5 = add nuw nsw i32 %4, %3
%6 = tail call i32 @sqrt(i32 %5)
ret i32 %6
}
/* Variables and functions */
int close(int);
int metautils_syscall_close(int fd) { return close(fd); }


x86 assembly (clang, -O0):
<metautils_syscall_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<metautils_syscall_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @metautils_syscall_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int STDIN_FILENO;
int STDOUT_FILENO;
scalar_t__ flags_is_writing(int);
int standard_fd_from_flags(int flags) {
  return flags_is_writing(flags) ? STDOUT_FILENO : STDIN_FILENO;
}


x86 assembly (clang, -O0):
<standard_fd_from_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <flags_is_writing@plt>
cmp    $0x0,%rax
je     113e <standard_fd_from_flags+0x2e>
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
jmp    114a <standard_fd_from_flags+0x3a>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standard_fd_from_flags>:
push   %rax
call   1030 <flags_is_writing@plt>
test   %rax,%rax
jne    1124 <standard_fd_from_flags+0x14>
mov    0x2eb6(%rip),%rax
jmp    112b <standard_fd_from_flags+0x1b>
mov    0x2ec5(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@STDIN_FILENO = global i32 0
define i32 @standard_fd_from_flags(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @flags_is_writing(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* @STDOUT_FILENO
br label %10
8: ; preds = %1
%9 = load i32, i32* @STDIN_FILENO
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@STDIN_FILENO = global i32 0
define i32 @standard_fd_from_flags(i32 %0) {
%2 = tail call i64 @flags_is_writing(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = load i32, i32* @STDOUT_FILENO
%5 = load i32, i32* @STDIN_FILENO
%6 = select i1 %3, i32 %5, i32 %4
ret i32 %6
}
int isOperator(char is_operator) {
  if ((is_operator == '+') || (is_operator == '-') || (is_operator == '*') ||
      (is_operator == '/') || (is_operator == '%'))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isOperator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     114b <isOperator+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
je     114b <isOperator+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
je     114b <isOperator+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
je     114b <isOperator+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x25,%eax
jne    1157 <isOperator+0x57>
movl   $0x1,-0x4(%rbp)
jmp    115e <isOperator+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOperator>:
add    $0xdb,%dil
xor    %eax,%eax
cmp    $0xa,%dil
ja     111a <isOperator+0x1a>
movsbq %dil,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @isOperator(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 43
br i1 %6, label %23, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 45
br i1 %10, label %23, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 42
br i1 %14, label %23, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 47
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 37
br i1 %22, label %23, label %24
23: ; preds = %19, %15, %11, %7, %1
store i32 1, i32* %2
br label %25
24: ; preds = %19
store i32 0, i32* %2
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
@switch.table.isOperator = [11 x i32] [i32 1, i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 0, i32 1, i32 0, i32 1]
define i32 @isOperator(i8 signext %0) {
%2 = add i8 %0, -37
%3 = icmp ult i8 %2, 11
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = getelementptr inbounds [11 x i32], [11 x i32]* @switch.table.isOperator, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *);
char *hcharor(char *x) {
  *x |= 24;
  if (!*x)
    foo(x);
  return x;
}


x86 assembly (clang, -O0):
<hcharor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
or     $0x18,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    113e <hcharor+0x2e>
mov    -0x8(%rbp),%rdi
call   1030 <foo@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hcharor>:
mov    %rdi,%rax
orb    $0x18,(%rdi)
ret

LLVM IR (-O0):
define i8* @hcharor(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = or i32 %5, 24
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %1
%12 = load i8*, i8** %2
%13 = call i32 @foo(i8* %12)
br label %14
14: ; preds = %11, %1
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @hcharor(i8* returned %0) {
%2 = load i8, i8* %0
%3 = or i8 %2, 24
store i8 %3, i8* %0
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ add_opcode(int /*<<< orphan*/, int);
int /*<<< orphan*/ gen_move_to_ccr(char *, int);
void move_tcr(int opcode) {
  if ((opcode & 0xFDC0) != 0x44C0)
    return;
  add_opcode(gen_move_to_ccr("move", opcode), opcode);
}


x86 assembly (clang, -O0):
<move_tcr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfdc0,%eax
cmp    $0x44c0,%eax
je     1143 <move_tcr+0x23>
jmp    115c <move_tcr+0x3c>
mov    -0x4(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1040 <gen_move_to_ccr@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1030 <add_opcode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_tcr>:
mov    %edi,%eax
and    $0xfdc0,%eax
cmp    $0x44c0,%eax
jne    1149 <move_tcr+0x29>
push   %rbx
mov    %edi,%ebx
lea    0xec8(%rip),%rdi
mov    %ebx,%esi
call   1040 <gen_move_to_ccr@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <add_opcode@plt>
ret

LLVM IR (-O0):
@.str = [5 x i8] c"move\00"
define void @move_tcr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 64960
%5 = icmp ne i32 %4, 17600
br i1 %5, label %6, label %7
6: ; preds = %1
br label %12
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @gen_move_to_ccr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %2
%11 = call i32 @add_opcode(i32 %9, i32 %10)
br label %12
12: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"move\00"
define void @move_tcr(i32 %0) {
%2 = and i32 %0, 64960
%3 = icmp eq i32 %2, 17600
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @gen_move_to_ccr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = tail call i32 @add_opcode(i32 %5, i32 %0)
br label %7
7: ; preds = %1, %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ LLVMFuzzerTestOneInput(int /*<<< orphan*/ *, int);
int fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int main(void) {
  int ret;
  uint8_t buf[64 * 1024];
  ret = fread(buf, 1, sizeof(buf), stdin);
  if (ret < 0) {
    return 0;
  }
  LLVMFuzzerTestOneInput(buf, ret);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40010,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40010(%rbp),%rdi
mov    0x2ea8(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
mov    $0x40000,%edx
call   1030 <fread@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    116a <main+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1180 <main+0x60>
lea    -0x40010(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <LLVMFuzzerTestOneInput@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x40008,%rsp
mov    0x2eba(%rip),%rax
mov    (%rax),%ecx
mov    %rsp,%rdi
mov    $0x1,%esi
mov    $0x40000,%edx
call   1030 <fread@plt>
test   %eax,%eax
js     1150 <main+0x30>
mov    %rsp,%rdi
mov    %eax,%esi
call   1040 <LLVMFuzzerTestOneInput@plt>
xor    %eax,%eax
add    $0x40008,%rsp
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [65536 x i32]
store i32 0, i32* %1
%4 = getelementptr inbounds [65536 x i32], [65536 x i32]* %3, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fread(i32* %4, i32 1, i32 262144, i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 0, i32* %1
br label %14
10: ; preds = %0
%11 = getelementptr inbounds [65536 x i32], [65536 x i32]* %3, i64 0, i64 0
%12 = load i32, i32* %2
%13 = call i32 @LLVMFuzzerTestOneInput(i32* %11, i32 %12)
store i32 0, i32* %1
br label %14
14: ; preds = %10, %9
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = alloca [65536 x i32]
%2 = bitcast [65536 x i32]* %1 to i8*
%3 = getelementptr inbounds [65536 x i32], [65536 x i32]* %1, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fread(i32* %3, i32 1, i32 262144, i32 %4)
%6 = icmp slt i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32 @LLVMFuzzerTestOneInput(i32* %3, i32 %5)
br label %9
9: ; preds = %0, %7
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bswap_32(int /*<<< orphan*/);
uint32_t little32(uint32_t n) { return bswap_32(n); }


x86 assembly (clang, -O0):
<little32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <bswap_32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<little32>:
jmp    1030 <bswap_32@plt>

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

LLVM IR (-O2):
define i32 @little32(i32 %0) {
%2 = tail call i32 @bswap_32(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void write_footer(FILE *stream) {
  if (stream != NULL) {
    fprintf(stream, "%%%%EndData\n"
                    "grestore\t%% Restore previous graphic state\n");
  }
}


x86 assembly (clang, -O0):
<write_footer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1137 <write_footer+0x27>
mov    -0x8(%rbp),%rdi
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_footer>:
test   %rdi,%rdi
je     1121 <write_footer+0x11>
lea    0xee4(%rip),%rsi
jmp    1030 <fprintf@plt>
ret

LLVM IR (-O0):
@.str = [56 x i8] c"%%%%EndData\0Agrestore\09%% Restore previous graphic state\0A\00"
define void @write_footer(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32*, i32** %2
%7 = call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c"%%%%EndData\0Agrestore\09%% Restore previous graphic state\0A\00"
define void @write_footer(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  extern char *__progname;
  fprintf(stderr, "%s: [-ac][-b blocksize][-f no_forks][-m maxmem]\n",
          __progname);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%rdx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdx
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [49 x i8] c"%s: [-ac][-b blocksize][-f no_forks][-m maxmem]\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [49 x i8] c"%s: [-ac][-b blocksize][-f no_forks][-m maxmem]\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int i;
  i = __VERIFIER_nondet_int();
  while (i > 5) {
    i = i - 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jle    1141 <main+0x31>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %3, i32* %2
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 5
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 1
store i32 %9, i32* %2
br label %4
10: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ RemoveNewLines(char *);
int /*<<< orphan*/ RemoveQuotationMarks(char *);
char *fgets(char *, size_t, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void ReadFilename(char *buffer, size_t bufsize) {
  char *retStr;
  retStr = fgets(buffer, bufsize, stdin);
  if (retStr == NULL)
    buffer[0] = '\0';
  RemoveNewLines(buffer);
  RemoveQuotationMarks(buffer);
  return;
}


x86 assembly (clang, -O0):
<ReadFilename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
call   1050 <fgets@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116c <ReadFilename+0x3c>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <RemoveNewLines@plt>
mov    -0x8(%rbp),%rdi
call   1040 <RemoveQuotationMarks@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadFilename>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
call   1050 <fgets@plt>
test   %rax,%rax
jne    114a <ReadFilename+0x1a>
movb   $0x0,(%rbx)
mov    %rbx,%rdi
call   1030 <RemoveNewLines@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <RemoveQuotationMarks@plt>

LLVM IR (-O0):
@stdin = global i32 0
define void @ReadFilename(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = load i32, i32* @stdin
%9 = call i8* @fgets(i8* %6, i64 %7, i32 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 0
store i8 0, i8* %14
br label %15
15: ; preds = %12, %2
%16 = load i8*, i8** %3
%17 = call i32 @RemoveNewLines(i8* %16)
%18 = load i8*, i8** %3
%19 = call i32 @RemoveQuotationMarks(i8* %18)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @ReadFilename(i8* %0, i64 %1) {
%3 = load i32, i32* @stdin
%4 = tail call i8* @fgets(i8* %0, i64 %1, i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %2
store i8 0, i8* %0
br label %7
7: ; preds = %6, %2
%8 = tail call i32 @RemoveNewLines(i8* %0)
%9 = tail call i32 @RemoveQuotationMarks(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void at_freef(const char *msg) { free((void *)msg); }


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

x86 assembly (clang, -O2):
<at_freef>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @at_freef(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int HelpItem17(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem17() {
ret i32 0
}
int test_imm_82int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x82 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_82int64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0x82,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_82int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 8519680
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ OCSP_RESPDATA;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ OCSP_RESPDATA_it;
void OCSP_RESPDATA_free(OCSP_RESPDATA *a) {
  ASN1_item_free((ASN1_VALUE *)a, &OCSP_RESPDATA_it);
}


x86 assembly (clang, -O0):
<OCSP_RESPDATA_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rsi
call   1030 <ASN1_item_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OCSP_RESPDATA_free>:
mov    0x2ec9(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

LLVM IR (-O0):
@OCSP_RESPDATA_it = global i32 0
define void @OCSP_RESPDATA_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ASN1_item_free(i32* %3, i32* @OCSP_RESPDATA_it)
ret void
}

LLVM IR (-O2):
@OCSP_RESPDATA_it = global i32 0
define void @OCSP_RESPDATA_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @OCSP_RESPDATA_it)
ret void
}
void other_func() {
  printf("[%s] from [%s] is be called.\n", __func__,
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/WeiqiChenCN/symbol_test/refs/heads/master/"
         "sample1/c.c");
}


x86 assembly (clang, -O0):
<other_func>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xefc(%rip),%rsi
lea    0xf00(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<other_func>:
lea    0xee9(%rip),%rdi
lea    0xf00(%rip),%rsi
lea    0xf04(%rip),%rdx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"[%s] from [%s] is be called.\0A\00"
@__func__.other_func = [11 x i8] c"other_func\00"
@.str.1 = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/WeiqiChenCN/symbol_test/refs/heads/master/sample1/c.c\00"
define void @other_func() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.other_func, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"[%s] from [%s] is be called.\0A\00"
@__func__.other_func = [11 x i8] c"other_func\00"
@.str.1 = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/WeiqiChenCN/symbol_test/refs/heads/master/sample1/c.c\00"
define void @other_func() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.other_func, i64 0, i64 0), i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int any(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char s1[] = "Hello, world!\"";
  char s2[] = "\"!,ow";
  printf("%d\n", any(s1, s2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x13(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xec2(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xeba(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xeb2(%rip),%eax
mov    %eax,-0x19(%rbp)
mov    0xeac(%rip),%ax
mov    %ax,-0x15(%rbp)
lea    -0x13(%rbp),%rdi
lea    -0x19(%rbp),%rsi
call   1040 <any@plt>
mov    %eax,%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x2221646c726f77,%rax
mov    %rax,0xf(%rsp)
movabs $0x77202c6f6c6c6548,%rax
2c 20 77
mov    %rax,0x8(%rsp)
movw   $0x77,0x4(%rsp)
movl   $0x6f2c2122,(%rsp)
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <any@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s1 = [15 x i8] c"Hello, world!\22\00"
@__const.main.s2 = [6 x i8] c"\22!,ow\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [15 x i8]
%3 = alloca [6 x i8]
store i32 0, i32* %1
%4 = bitcast [15 x i8]* %2 to i8*
%5 = bitcast [6 x i8]* %3 to i8*
%6 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%8 = call i32 @any(i8* %6, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [15 x i8] c"Hello, world!\22\00"
@__const.main.s2 = [6 x i8] c"\22!,ow\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 @any(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ SHA512_CTX;

/* Variables and functions */
int /*<<< orphan*/ SHA512_Final(unsigned char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ SHA512_Init(int /*<<< orphan*/ *);
int /*<<< orphan*/ SHA512_Update(int /*<<< orphan*/ *, unsigned char const *,
                                 size_t);
unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md) {
  SHA512_CTX c;
  static unsigned char m[64];
  if (md == NULL)
    md = m;
  SHA512_Init(&c);
  SHA512_Update(&c, d, n);
  SHA512_Final(md, &c);
  1;
  return (md);
}


x86 assembly (clang, -O0):
<SHA512>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115a <SHA512+0x2a>
lea    0x2efa(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x1c(%rbp),%rdi
call   1050 <SHA512_Init@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    -0x1c(%rbp),%rdi
call   1030 <SHA512_Update@plt>
mov    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <SHA512_Final@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA512>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
test   %rdx,%rdx
lea    0x2f08(%rip),%rbx
cmovne %rdx,%rbx
lea    0x4(%rsp),%r12
mov    %r12,%rdi
call   1050 <SHA512_Init@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <SHA512_Update@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <SHA512_Final@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SHA512.m = internal global [64 x i8] zeroinitializer
define i8* @SHA512(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %3
store i8* getelementptr inbounds ([64 x i8], [64 x i8]* @SHA512.m, i64 0, i64 0), i8** %6
br label %11
11: ; preds = %10, %3
%12 = call i32 @SHA512_Init(i32* %7)
%13 = load i8*, i8** %4
%14 = load i64, i64* %5
%15 = call i32 @SHA512_Update(i32* %7, i8* %13, i64 %14)
%16 = load i8*, i8** %6
%17 = call i32 @SHA512_Final(i8* %16, i32* %7)
%18 = load i8*, i8** %6
ret i8* %18
}

LLVM IR (-O2):
@SHA512.m = internal global [64 x i8] zeroinitializer
define i8* @SHA512(i8* %0, i64 %1, i8* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = icmp eq i8* %2, null
%7 = select i1 %6, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @SHA512.m, i64 0, i64 0), i8* %2
%8 = call i32 @SHA512_Init(i32* %4)
%9 = call i32 @SHA512_Update(i32* %4, i8* %0, i64 %1)
%10 = call i32 @SHA512_Final(i8* %7, i32* %4)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ RadioComBridgeStatsHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void RadioComBridgeStatsLogging() {
  UAVObjLogging(RadioComBridgeStatsHandle());
}


x86 assembly (clang, -O0):
<RadioComBridgeStatsLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <RadioComBridgeStatsHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RadioComBridgeStatsLogging>:
push   %rax
xor    %eax,%eax
call   1040 <RadioComBridgeStatsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @RadioComBridgeStatsLogging() {
%1 = call i32 (...) @RadioComBridgeStatsHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @RadioComBridgeStatsLogging() {
%1 = tail call i32 (...) @RadioComBridgeStatsHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void *mzalloc(int size) {
  void *t;
  t = malloc(size);
  memset(t, 0, size);
  return t;
}


x86 assembly (clang, -O0):
<mzalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mzalloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @mzalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* %2
%8 = call i32 @memset(i8* %6, i32 0, i32 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @mzalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i32 %0)
ret i8* %2
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzNullAdapt_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_REQDOWN(int /*<<< orphan*/);
void BrzNullAdapt_reqdown(struct comp *comp, int port) {
  struct BrzNullAdapt_ *c = (struct BrzNullAdapt_ *)comp;
  SEND_REQDOWN(0);
}


x86 assembly (clang, -O0):
<BrzNullAdapt_reqdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %edi,%edi
call   1030 <SEND_REQDOWN@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzNullAdapt_reqdown>:
xor    %edi,%edi
jmp    1030 <SEND_REQDOWN@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzNullAdapt_ = type { i32 }
define void @BrzNullAdapt_reqdown(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzNullAdapt_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzNullAdapt_*
store %struct.BrzNullAdapt_* %7, %struct.BrzNullAdapt_** %5
%8 = call i32 @SEND_REQDOWN(i32 0)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzNullAdapt_reqdown(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @SEND_REQDOWN(i32 0)
ret void
}