xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  float i = 42.42;
  int f = 2;
  float res = (double)3.58888888889;
  short s = (int)278999999999999123;
  printf("%f\n", res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xedd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movss  0xec5(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movw   $0x7c93,-0x12(%rbp)
movss  -0x10(%rbp),%xmm0
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
%4 = alloca float
%5 = alloca i16
store i32 0, i32* %1
store float 0x404535C280000000, float* %2
store i32 2, i32* %3
store float 0x400CB60B60000000, float* %4
store i16 31891, i16* %5
%6 = load float, float* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 0x400CB60B60000000)
ret i32 0
}
int block_differ(char *b1, char *b2, int len) {
  int idx;
  for (idx = 0; idx < len; idx++)
    if (b1[idx] != b2[idx])
      return -idx;
  return (0);
}


x86 assembly (clang, -O0):
<block_differ>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1162 <block_differ+0x62>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     114f <block_differ+0x4f>
xor    %eax,%eax
sub    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <block_differ+0x69>
jmp    1154 <block_differ+0x54>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <block_differ+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<block_differ>:
test   %edx,%edx
jle    1122 <block_differ+0x22>
mov    %edx,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rdi,%rax,1),%edx
cmp    (%rsi,%rax,1),%dl
jne    1125 <block_differ+0x25>
add    $0x1,%rax
cmp    %rax,%rcx
jne    1110 <block_differ+0x10>
xor    %eax,%eax
ret
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @block_differ(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %20
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %17
%8 = phi i64 [ 0, %5 ], [ %18, %17 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = getelementptr inbounds i8, i8* %1, i64 %8
%12 = load i8, i8* %11
%13 = icmp eq i8 %10, %12
br i1 %13, label %17, label %14
14: ; preds = %7
%15 = trunc i64 %8 to i32
%16 = sub nsw i32 0, %15
br label %20
17: ; preds = %7
%18 = add nuw nsw i64 %8, 1
%19 = icmp eq i64 %18, %6
br i1 %19, label %20, label %7
20: ; preds = %17, %3, %14
%21 = phi i32 [ %16, %14 ], [ 0, %3 ], [ 0, %17 ]
ret i32 %21
}
int cr_plugin_dummy_init(int stage) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cr_plugin_dummy_init(i32 %0) {
ret i32 0
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, long double);
char *ldtoa(long double ld) {
  char *tmp = malloc(20 * sizeof(char));
  sprintf(tmp, "%Lf", ld);
  return tmp;
}


x86 assembly (clang, -O0):
<ldtoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    $0x14,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xeb1(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldtoa>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fstpt  0x14(%rsp)
mov    $0x14,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
lea    0xeb8(%rip),%rsi
mov    %rax,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%Lf\00"
define i8* @ldtoa(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca i8*
store x86_fp80 %0, x86_fp80* %2
%4 = call i8* @malloc(i32 20)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load x86_fp80, x86_fp80* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), x86_fp80 %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"%Lf\00"
define noalias i8* @ldtoa(x86_fp80 %0) {
%2 = tail call dereferenceable_or_null(20) i8* @malloc(i32 20)
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), x86_fp80 %0)
ret i8* %2
}
int f(int *a) { return a; }


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

x86 assembly (clang, -O2):
<f>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i32 @f(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
double pow(double, double);
double func2(double *x, int N) {
  double f;
  f = pow((double)2.7182818284590452353602874713526624977572, x[0] - 1.0) +
      x[1] * x[1] * x[1] - 2.0;
  return f;
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  0xee1(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xecd(%rip),%xmm0
call   1030 <pow@plt>
movaps %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe92(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
push   %rbx
mov    %rdi,%rbx
movsd  (%rdi),%xmm1
addsd  0xee0(%rip),%xmm1
movsd  0xee0(%rip),%xmm0
call   1030 <pow@plt>
movsd  0x8(%rbx),%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
addsd  0xec6(%rip),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @func2(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca double
store double* %0, double** %3
store i32 %1, i32* %4
%6 = load double*, double** %3
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = fsub double %8, 1.000000e+00
%10 = call double @pow(double 0x4005BF0A8B145769, double %9)
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %3
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = load double*, double** %3
%19 = getelementptr inbounds double, double* %18, i64 1
%20 = load double, double* %19
%21 = call double @llvm.fmuladd.f64(double %17, double %20, double %10)
%22 = fsub double %21, 2.000000e+00
store double %22, double* %5
%23 = load double, double* %5
ret double %23
}

LLVM IR (-O2):
define double @func2(double* nocapture %0, i32 %1) {
%3 = load double, double* %0
%4 = fadd double %3, -1.000000e+00
%5 = tail call double @pow(double 0x4005BF0A8B145769, double %4)
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = fmul double %7, %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %7, double %5)
%10 = fadd double %9, -2.000000e+00
ret double %10
}
/* Variables and functions */
scalar_t__ strncmp(char const *, char *, int);
int check_signature(const char *data) {
  if (strncmp(data, "KC-TAPE by AF", 13) == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<check_signature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0xd,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1147 <check_signature+0x37>
movl   $0x1,-0x4(%rbp)
jmp    114e <check_signature+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_signature>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0xd,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"KC-TAPE by AF\00"
define i32 @check_signature(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strncmp(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [14 x i8] c"KC-TAPE by AF\00"
define i32 @check_signature(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
void rl_insert(void) {}


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

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

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

LLVM IR (-O2):
define void @rl_insert() {
ret void
}
int main() {
  int *p;
  int a;
  int havoc;
  a = 0;
  p = (int *)&p;
  assert(p > 0);
  *p = &a;
  if (havoc) {
    assert(*p == 0);
  } else {
    assert(p > 0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
lea    -0x14(%rbp),%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
cmpl   $0x0,-0x18(%rbp)
je     1173 <main+0x63>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
jmp    1187 <main+0x77>
cmpq   $0x0,-0x10(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rax
mov    %rax,0x10(%rsp)
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
lea    0xc(%rsp),%rax
mov    0x10(%rsp),%rcx
mov    %eax,(%rcx)
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%5 = bitcast i32** %2 to i32*
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = icmp ugt i32* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %8)
%10 = ptrtoint i32* %3 to i32
%11 = load i32*, i32** %2
store i32 %10, i32* %11
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %0
%15 = load i32*, i32** %2
%16 = load i32, i32* %15
%17 = icmp eq i32 %16, 0
%18 = zext i1 %17 to i32
%19 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %18)
br label %25
20: ; preds = %0
%21 = load i32*, i32** %2
%22 = icmp ugt i32* %21, null
%23 = zext i1 %22 to i32
%24 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %23)
br label %25
25: ; preds = %20, %14
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32
%3 = bitcast i32** %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = bitcast i32** %1 to i32***
store i32** %1, i32*** %5
%6 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%7 = ptrtoint i32* %2 to i64
%8 = trunc i64 %7 to i32
%9 = load i32*, i32** %1
store i32 %8, i32* %9
%10 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
ret i32 0
}
/* Variables and functions */
char *add(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
char *subtractone(char *);
void print1CCchain(char *primeorigin, int primelength) {
  if (primelength == 0) {
    return;
  }
  print1CCchain(add(primeorigin, primeorigin), primelength - 1);
  printf("%s,", subtractone(primeorigin));
}


x86 assembly (clang, -O0):
<print1CCchain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    115e <print1CCchain+0x1e>
jmp    1191 <print1CCchain+0x51>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <add@plt>
mov    %rax,%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1040 <print1CCchain@plt>
mov    -0x8(%rbp),%rdi
call   1050 <subtractone@plt>
mov    %rax,%rsi
lea    0xe74(%rip),%rdi
call   1060 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print1CCchain>:
test   %esi,%esi
je     117e <print1CCchain+0x3e>
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rdi,%rsi
call   1030 <add@plt>
add    $0xffffffff,%ebp
mov    %rax,%rdi
mov    %ebp,%esi
call   1040 <print1CCchain@plt>
mov    %rbx,%rdi
call   1050 <subtractone@plt>
lea    0xe90(%rip),%rdi
mov    %rax,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <printf@plt>
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s,\00"
define void @print1CCchain(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 eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %17
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i8*, i8** %3
%11 = call i8* @add(i8* %9, i8* %10)
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 1
%14 = load i8*, i8** %3
%15 = call i8* @subtractone(i8* %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s,\00"
define void @print1CCchain(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %2, %5
ret void
5: ; preds = %2
%6 = tail call i8* @add(i8* %0, i8* %0)
%7 = add nsw i32 %1, -1
tail call void @print1CCchain(i8* %6, i32 %7)
%8 = tail call i8* @subtractone(i8* %0)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("\033[37;42mHello world!!!\n\033[0m");
  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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"\1B[37;42mHello world!!!\0A\1B[0m\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"\1B[37;42mHello world!!!\0A\1B[0m\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void _M2_interpen_init(__attribute__((unused)) int argc,
                       __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_interpen_init(i32 %0, i8** nocapture %1) {
ret void
}
void poke(long *addr, long x) { *addr = x; }


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

x86 assembly (clang, -O2):
<poke>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @poke(i64* nocapture writeonly %0, i64 %1) {
store i64 %1, i64* %0
ret void
}
/* Type definitions */
struct object {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ apply(struct object *);
int /*<<< orphan*/ object_release(struct object *);
struct object *pop();
void pop_apply(struct object *data) {
  struct object *f = pop();
  object_release(data);
  apply(f);
}


x86 assembly (clang, -O0):
<pop_apply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <pop@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <object_release@plt>
mov    -0x10(%rbp),%rdi
call   1050 <apply@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop_apply>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <pop@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <object_release@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <apply@plt>

LLVM IR (-O0):
%struct.object = type { i32 }
define void @pop_apply(%struct.object* %0) {
%2 = alloca %struct.object*
%3 = alloca %struct.object*
store %struct.object* %0, %struct.object** %2
%4 = call %struct.object* (...) @pop()
store %struct.object* %4, %struct.object** %3
%5 = load %struct.object*, %struct.object** %2
%6 = call i32 @object_release(%struct.object* %5)
%7 = load %struct.object*, %struct.object** %3
%8 = call i32 @apply(%struct.object* %7)
ret void
}

LLVM IR (-O2):
%struct.object = type { i32 }
define void @pop_apply(%struct.object* %0) {
%2 = tail call %struct.object* (...) @pop()
%3 = tail call i32 @object_release(%struct.object* %0)
%4 = tail call i32 @apply(%struct.object* %2)
ret void
}
/* Type definitions */
struct lxc_mount_attr {
  int dummy;
};

/* Variables and functions */
int syscall(int, int, char const *, unsigned int, struct lxc_mount_attr *,
            size_t);
int mount_setattr(int dfd, const char *path, unsigned int flags,
                  struct lxc_mount_attr *attr, size_t size) {
  return syscall(442, dfd, path, flags, attr, size);
}


x86 assembly (clang, -O0):
<mount_setattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    $0x1ba,%edi
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mount_setattr>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x1ba,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.lxc_mount_attr = type { i32 }
define i32 @mount_setattr(i32 %0, i8* %1, i32 %2, %struct.lxc_mount_attr* %3, i64 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca %struct.lxc_mount_attr*
%10 = alloca i64
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store %struct.lxc_mount_attr* %3, %struct.lxc_mount_attr** %9
store i64 %4, i64* %10
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load %struct.lxc_mount_attr*, %struct.lxc_mount_attr** %9
%15 = load i64, i64* %10
%16 = call i32 @syscall(i32 442, i32 %11, i8* %12, i32 %13, %struct.lxc_mount_attr* %14, i64 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.lxc_mount_attr = type { i32 }
define i32 @mount_setattr(i32 %0, i8* %1, i32 %2, %struct.lxc_mount_attr* %3, i64 %4) {
%6 = tail call i32 @syscall(i32 442, i32 %0, i8* %1, i32 %2, %struct.lxc_mount_attr* %3, i64 %4)
ret i32 %6
}
void __attribute__((no)) HEX00_typetraitsInit(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @HEX00_typetraitsInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_127() {
  Assert_real((isqrt(127) == 11),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              640, ("Integer square root of 127 should be 11"));
}


x86 assembly (clang, -O0):
<t_sqrt_127>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f,%edi
call   1030 <isqrt@plt>
cmp    $0xb,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x280,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_127>:
push   %rax
mov    $0x7f,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xb,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x280,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 127 should be 11\00"
define void @t_sqrt_127() {
%1 = call i32 @isqrt(i32 127)
%2 = icmp eq i32 %1, 11
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 640, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 127 should be 11\00"
define void @t_sqrt_127() {
%1 = tail call i32 @isqrt(i32 127)
%2 = icmp eq i32 %1, 11
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 640, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, int /*<<< orphan*/);
scalar_t__ malloc(unsigned int);
char *xmalloc(unsigned size) {
  char *result = (char *)malloc(size);
  if (!result) {
    fatal("virtual memory exhausted", 0);
  }
  return result;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <xmalloc+0x30>
lea    0xeb7(%rip),%rdi
xor    %esi,%esi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <xmalloc+0x1c>
lea    0xecb(%rip),%rdi
xor    %esi,%esi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i8* @xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 0)
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i8* @xmalloc(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 0)
br label %6
6: ; preds = %4, %1
%7 = inttoptr i64 %2 to i8*
ret i8* %7
}
/* Variables and functions */
int strlen(char *src) {
  int i = 0;
  while (*src++)
    i++;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <strlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %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 i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
int vscan_end(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @vscan_end() {
ret i32 -1
}
void foo3(short s, short t) {
  if (s == s) {
  }
  if (s == t) {
  }
}


x86 assembly (clang, -O0):
<foo3>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jne    1127 <foo3+0x27>
jmp    1127 <foo3+0x27>
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
cmp    %ecx,%eax
jne    113c <foo3+0x3c>
jmp    113c <foo3+0x3c>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo3(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i16, i16* %3
%8 = sext i16 %7 to i32
%9 = icmp eq i32 %6, %8
br i1 %9, label %10, label %11
10: ; preds = %2
br label %11
11: ; preds = %10, %2
%12 = load i16, i16* %3
%13 = sext i16 %12 to i32
%14 = load i16, i16* %4
%15 = sext i16 %14 to i32
%16 = icmp eq i32 %13, %15
br i1 %16, label %17, label %18
17: ; preds = %11
br label %18
18: ; preds = %17, %11
ret void
}

LLVM IR (-O2):
define void @foo3(i16 signext %0, i16 signext %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void handleKeypress(unsigned char key, int x, int y) {
  switch (key) {
  case 27:
    exit(0);
  }
}


x86 assembly (clang, -O0):
<handleKeypress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    113b <handleKeypress+0x2b>
jmp    1134 <handleKeypress+0x24>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handleKeypress>:
cmp    $0x1b,%dil
je     1117 <handleKeypress+0x7>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @handleKeypress(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
]
9: ; preds = %3
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @handleKeypress(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ move_file(char *, char *);
int /*<<< orphan*/ pre_write(char *);
void sendnas(char *path) {
  pre_write(" all nas ");
  move_file("all.bdf", path);
}


x86 assembly (clang, -O0):
<sendnas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <pre_write@plt>
mov    -0x8(%rbp),%rsi
lea    0xec7(%rip),%rdi
call   1030 <move_file@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendnas>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <pre_write@plt>
lea    0xed3(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <move_file@plt>

LLVM IR (-O0):
@.str = [10 x i8] c" all nas \00"
@.str.1 = [8 x i8] c"all.bdf\00"
define void @sendnas(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @pre_write(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @move_file(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c" all nas \00"
@.str.1 = [8 x i8] c"all.bdf\00"
define void @sendnas(i8* %0) {
%2 = tail call i32 @pre_write(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @move_file(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
bool es_divisible_entre_cuatro(int numero) { return numero % 4 == 0; }


x86 assembly (clang, -O0):
<es_divisible_entre_cuatro>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<es_divisible_entre_cuatro>:
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @es_divisible_entre_cuatro(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @es_divisible_entre_cuatro(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned char);
void sprint_dec_atRi(char *str, unsigned char i) {
  sprintf(str, "DEC   @R%X                       ", i);
}


x86 assembly (clang, -O0):
<sprint_dec_atRi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed3(%rip),%rsi
movzbl -0x9(%rbp),%edx
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_dec_atRi>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"DEC @R%X \00"
define void @sprint_dec_atRi(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %4
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %6)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"DEC @R%X \00"
define void @sprint_dec_atRi(i8* nocapture writeonly %0, i8 zeroext %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %1)
ret void
}
int get_piece(int row, int col, int **board) { return board[row - 1][8 - col]; }


x86 assembly (clang, -O0):
<get_piece>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    $0x8,%ecx
sub    -0x8(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_piece>:
movslq %edi,%rax
mov    -0x8(%rdx,%rax,8),%rax
mov    $0x8,%ecx
sub    %esi,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @get_piece(i32 %0, i32 %1, i32** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32**
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32** %2, i32*** %6
%7 = load i32**, i32*** %6
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32*, i32** %7, i64 %10
%12 = load i32*, i32** %11
%13 = load i32, i32* %5
%14 = sub nsw i32 8, %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %12, i64 %15
%17 = load i32, i32* %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @get_piece(i32 %0, i32 %1, i32** nocapture %2) {
%4 = add nsw i32 %0, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32*, i32** %2, i64 %5
%7 = load i32*, i32** %6
%8 = sub nsw i32 8, %1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = load i32, i32* %10
ret i32 %11
}
void *anular_1_svc(void *argp, struct svc_req *rqstp) {
  static char *result;
  return (void *)&result;
}


x86 assembly (clang, -O0):
<anular_1_svc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0x2f15(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<anular_1_svc>:
lea    0x2f21(%rip),%rax
ret

LLVM IR (-O0):
%struct.svc_req = type opaque
@anular_1_svc.result = internal global i8* null
define i8* @anular_1_svc(i8* %0, %struct.svc_req* %1) {
%3 = alloca i8*
%4 = alloca %struct.svc_req*
store i8* %0, i8** %3
store %struct.svc_req* %1, %struct.svc_req** %4
ret i8* bitcast (i8** @anular_1_svc.result to i8*)
}

LLVM IR (-O2):
%struct.svc_req = type opaque
@anular_1_svc.result = internal global i8* null
define i8* @anular_1_svc(i8* nocapture readnone %0, %struct.svc_req* nocapture readnone %1) {
ret i8* bitcast (i8** @anular_1_svc.result to i8*)
}
void short_wait(void) {
  int i;
  for (i = 0; i < 150; i++) {
    asm volatile("nop");
  }
}


x86 assembly (clang, -O0):
<short_wait>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x96,-0x4(%rbp)
jge    1127 <short_wait+0x27>
nop
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <short_wait+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<short_wait>:
mov    $0x96,%eax
cs nopw 0x0(%rax,%rax,1)
nop
nop
add    $0xffffffff,%eax
jne    1110 <short_wait+0x10>
ret

LLVM IR (-O0):
define void @short_wait() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 150
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @short_wait() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
%3 = add nuw nsw i32 %2, 1
%4 = icmp eq i32 %3, 150
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Scheme_SetQueryName(char const *);
void WSQ_SetQueryName(const char *name) { Scheme_SetQueryName(name); }


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

x86 assembly (clang, -O2):
<WSQ_SetQueryName>:
jmp    1030 <Scheme_SetQueryName@plt>

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

LLVM IR (-O2):
define void @WSQ_SetQueryName(i8* %0) {
%2 = tail call i32 @Scheme_SetQueryName(i8* %0)
ret void
}
int main(int argc, char *argv[]) {
  char str[] = "hello i am string";
  str[1];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeeb(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xee8(%rip),%ax
mov    %ax,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.str = [18 x i8] c"hello i am string\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [18 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = bitcast [18 x i8]* %5 to i8*
%7 = getelementptr inbounds [18 x i8], [18 x i8]* %5, i64 0, i64 1
%8 = load i8, i8* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int msgu_string_compare(void const *, void const *);
int msgu_string_cmp(const void *a, const void *b) {
  return msgu_string_compare(a, b);
}


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

x86 assembly (clang, -O2):
<msgu_string_cmp>:
jmp    1030 <msgu_string_compare@plt>

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

LLVM IR (-O2):
define i32 @msgu_string_cmp(i8* %0, i8* %1) {
%3 = tail call i32 @msgu_string_compare(i8* %0, i8* %1)
ret i32 %3
}
int musbgm_wait(int no, int timeout) {
  printf("%s not implemented\n", __func__);
  return (-1);
}


x86 assembly (clang, -O0):
<musbgm_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xedb(%rip),%rdi
lea    0xee8(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<musbgm_wait>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef5(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"%s not implemented\0A\00"
@__func__.musbgm_wait = [12 x i8] c"musbgm_wait\00"
define i32 @musbgm_wait(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.musbgm_wait, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [20 x i8] c"%s not implemented\0A\00"
@__func__.musbgm_wait = [12 x i8] c"musbgm_wait\00"
define i32 @musbgm_wait(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.musbgm_wait, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cmdGenericHelp() { printf("executes supplied command line\n"); }


x86 assembly (clang, -O0):
<cmdGenericHelp>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdGenericHelp>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"executes supplied command line\0A\00"
define void @cmdGenericHelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c"executes supplied command line\00"
define void @cmdGenericHelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_D1int8_reg(signed char val) {
  return ((val) & (0xD1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D1int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xd1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D1int8_reg>:
test   $0xd1,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D1int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 209
%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_D1int8_reg(i8 signext %0) {
%2 = and i8 %0, -47
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct in_addr {
  int dummy;
};
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ inet_ntop(int, struct in_addr *, char *, int);
char *addr_str(int addrtype, struct in_addr *addr) {
  static char buf[128] = {0};
  inet_ntop(addrtype, addr, buf, sizeof(buf));
  return buf;
}


x86 assembly (clang, -O0):
<addr_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0x2f13(%rip),%rdx
mov    $0x80,%ecx
call   1030 <inet_ntop@plt>
lea    0x2f02(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addr_str>:
push   %rbx
lea    0x2f28(%rip),%rbx
mov    %rbx,%rdx
mov    $0x80,%ecx
call   1030 <inet_ntop@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@addr_str.buf = internal global [128 x i8] zeroinitializer
define i8* @addr_str(i32 %0, %struct.in_addr* %1) {
%3 = alloca i32
%4 = alloca %struct.in_addr*
store i32 %0, i32* %3
store %struct.in_addr* %1, %struct.in_addr** %4
%5 = load i32, i32* %3
%6 = load %struct.in_addr*, %struct.in_addr** %4
%7 = call i32 @inet_ntop(i32 %5, %struct.in_addr* %6, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @addr_str.buf, i64 0, i64 0), i32 128)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @addr_str.buf, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@addr_str.buf = internal global [128 x i8] zeroinitializer
define i8* @addr_str(i32 %0, %struct.in_addr* %1) {
%3 = tail call i32 @inet_ntop(i32 %0, %struct.in_addr* %1, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @addr_str.buf, i64 0, i64 0), i32 128)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @addr_str.buf, i64 0, i64 0)
}
void stop_nostart() {}


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

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

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

LLVM IR (-O2):
define void @stop_nostart() {
ret void
}
/* Variables and functions */
int func17();
int func18() { return func17() + 1; }


x86 assembly (clang, -O0):
<func18>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <func17@plt>
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func18>:
push   %rax
xor    %eax,%eax
call   1030 <func17@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @func18() {
%1 = call i32 (...) @func17()
%2 = add nsw i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @func18() {
%1 = tail call i32 (...) @func17()
%2 = add nsw i32 %1, 1
ret i32 %2
}
void foo442(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo442(i32 %0) {
ret void
}
/* Variables and functions */
int S_IRUSR;
int S_IWGRP;
int S_IWUSR;
int chmod(char *, int);
char *ptsname(int);
int grantpt(int fdm) {
  char *pts_name;
  pts_name = ptsname(fdm);
  return (chmod(pts_name, S_IRUSR | S_IWUSR | S_IWGRP));
}


x86 assembly (clang, -O0):
<grantpt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ptsname@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
mov    0x2e95(%rip),%rax
or     (%rax),%esi
mov    0x2e94(%rip),%rax
or     (%rax),%esi
call   1040 <chmod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grantpt>:
push   %rax
call   1030 <ptsname@plt>
mov    0x2ea3(%rip),%rcx
mov    0x2eac(%rip),%rdx
mov    (%rdx),%esi
or     (%rcx),%esi
mov    0x2ea9(%rip),%rcx
or     (%rcx),%esi
mov    %rax,%rdi
pop    %rax
jmp    1040 <chmod@plt>

LLVM IR (-O0):
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IWGRP = global i32 0
define i32 @grantpt(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @ptsname(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* @S_IRUSR
%8 = load i32, i32* @S_IWUSR
%9 = or i32 %7, %8
%10 = load i32, i32* @S_IWGRP
%11 = or i32 %9, %10
%12 = call i32 @chmod(i8* %6, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IWGRP = global i32 0
define i32 @grantpt(i32 %0) {
%2 = tail call i8* @ptsname(i32 %0)
%3 = load i32, i32* @S_IRUSR
%4 = load i32, i32* @S_IWUSR
%5 = or i32 %4, %3
%6 = load i32, i32* @S_IWGRP
%7 = or i32 %5, %6
%8 = tail call i32 @chmod(i8* %2, i32 %7)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x, y;
  printf("%d\n", &x + 1 == &y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rax
add    $0x4,%rax
lea    -0x8(%rbp),%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = getelementptr inbounds i32, i32* %1, i64 1
%4 = icmp eq i32* %3, %2
%5 = zext i1 %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}