xunge/DecIR huggingface dataset:
unsigned xrop3_140_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~T;
  stk2 = D | stk3;
  stk1 = S & stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


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

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

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

LLVM IR (-O2):
define i32 @xrop3_140_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = xor i32 %6, -1
%8 = and i32 %4, %7
%9 = xor i32 %4, -1
%10 = and i32 %9, %5
%11 = or i32 %8, %10
ret i32 %11
}
void ff_hevc_put_hevc_bi_w_qpel_hv24_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_hv24_12_sse4() {
ret void
}
void *alloca_test() {
  void *p = __builtin_alloca(10);
  return p;
}


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

x86 assembly (clang, -O2):
<alloca_test>:
lea    -0x18(%rsp),%rax
ret

LLVM IR (-O0):
define i8* @alloca_test() {
%1 = alloca i8*
%2 = alloca i8, i64 10
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @alloca_test() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
ret i8* %2
}
int isAlive(int *current, int length) {
  int i = 0;
  for (; i < length; i++) {
    if (current[i] == 0)
      continue;
    else
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isAlive>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    114f <isAlive+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1135 <isAlive+0x35>
jmp    1141 <isAlive+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1156 <isAlive+0x56>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <isAlive+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isAlive>:
test   %esi,%esi
jle    111f <isAlive+0x1f>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmpl   $0x0,(%rdi,%rcx,4)
jne    1122 <isAlive+0x22>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <isAlive+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isAlive(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %13, %5
br i1 %7, label %14, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 0, %4 ], [ %13, %6 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 0
%13 = add nuw nsw i64 %9, 1
br i1 %12, label %6, label %14
14: ; preds = %8, %6, %2
%15 = phi i32 [ 0, %2 ], [ 0, %6 ], [ 1, %8 ]
ret i32 %15
}
int fooble(void) {
  int x, y;
  y = 0;
  for (x = 0; x < 100; x++) {
    if ((x % 3) == 0)
      y += x;
    else
      y++;
  }
  return y;
}


x86 assembly (clang, -O0):
<fooble>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    115a <fooble+0x5a>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113e <fooble+0x3e>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <fooble+0x47>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114c <fooble+0x4c>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <fooble+0x12>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fooble() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
store i32 0, i32* %1
br label %3
3: ; preds = %18, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 100
br i1 %5, label %6, label %21
6: ; preds = %3
%7 = load i32, i32* %1
%8 = srem i32 %7, 3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = add nsw i32 %12, %11
store i32 %13, i32* %2
br label %17
14: ; preds = %6
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %17
17: ; preds = %14, %10
br label %18
18: ; preds = %17
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %3
21: ; preds = %3
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @fooble() {
ret i32 1749
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, double);
void display_progress(int completed, int total, int cmp_mod) {
  if (completed % cmp_mod == 0) {
    double pct_complete = 100 * ((double)completed / (double)total);
    printf("%d of %d (%.2f%%) Completed.\n", completed, total, pct_complete);
  }
}


x86 assembly (clang, -O0):
<display_progress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1167 <display_progress+0x57>
cvtsi2sdl -0x4(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
divsd  %xmm0,%xmm1
movsd  0xeb9(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_progress>:
mov    %edx,%ecx
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     111c <display_progress+0xc>
ret
mov    %esi,%r8d
mov    %edi,%esi
cvtsi2sd %edi,%xmm0
cvtsi2sd %r8d,%xmm1
divsd  %xmm1,%xmm0
mulsd  0xeca(%rip),%xmm0
lea    0xecb(%rip),%rdi
mov    %r8d,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"%d of %d (%.2f%%) Completed.\0A\00"
define void @display_progress(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = srem i32 %8, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %23
12: ; preds = %3
%13 = load i32, i32* %4
%14 = sitofp i32 %13 to double
%15 = load i32, i32* %5
%16 = sitofp i32 %15 to double
%17 = fdiv double %14, %16
%18 = fmul double 1.000000e+02, %17
store double %18, double* %7
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = load double, double* %7
%22 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %19, i32 %20, double %21)
br label %23
23: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"%d of %d (%.2f%%) Completed.\0A\00"
define void @display_progress(i32 %0, i32 %1, i32 %2) {
%4 = srem i32 %0, %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = sitofp i32 %0 to double
%8 = sitofp i32 %1 to double
%9 = fdiv double %7, %8
%10 = fmul double %9, 1.000000e+02
%11 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, double %10)
br label %12
12: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nsblk_reg(char *, int);
void nsblk_spam_reg(int id) { nsblk_reg("spam", id); }


x86 assembly (clang, -O0):
<nsblk_spam_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <nsblk_reg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsblk_spam_reg>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <nsblk_reg@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"spam\00"
define void @nsblk_spam_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @nsblk_reg(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"spam\00"
define void @nsblk_spam_reg(i32 %0) {
%2 = tail call i32 @nsblk_reg(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ perror(char *);
int dsm_server_close(int s) {
  int ret;
  if (ret = close(s))
    perror("close error");
  return (ret);
}


x86 assembly (clang, -O0):
<dsm_server_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     114b <dsm_server_close+0x2b>
lea    0xeba(%rip),%rdi
call   1040 <perror@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsm_server_close>:
push   %rbx
call   1030 <close@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1130 <dsm_server_close+0x10>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec9(%rip),%rdi
call   1040 <perror@plt>
jmp    112c <dsm_server_close+0xc>

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

LLVM IR (-O2):
@.str = [12 x i8] c"close error\00"
define i32 @dsm_server_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main() {
  abort();
  abort();
  abort();
  abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_d2();
int /*<<< orphan*/ take_struct_d2(int /*<<< orphan*/);
void test_struct_d2() { take_struct_d2(return_struct_d2()); }


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

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

LLVM IR (-O0):
define void @test_struct_d2() {
%1 = call i32 (...) @return_struct_d2()
%2 = call i32 @take_struct_d2(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_d2() {
%1 = tail call i32 (...) @return_struct_d2()
%2 = tail call i32 @take_struct_d2(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syscall_write(int, char *, int);
int /*<<< orphan*/ wait(int);
int main() {
  syscall_write(1, "Running executable 2\n\n", 36);
  while (1) {
    wait(100);
    syscall_write(1, "Myaaaaaahhhhhh\n\n", 36);
  };
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    0xec5(%rip),%rsi
mov    $0x24,%edx
call   1030 <syscall_write@plt>
mov    $0x64,%edi
call   1040 <wait@plt>
mov    $0x1,%edi
lea    0xebc(%rip),%rsi
mov    $0x24,%edx
call   1030 <syscall_write@plt>
jmp    1145 <main+0x25>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
mov    $0x24,%edx
call   1030 <syscall_write@plt>
lea    0xed9(%rip),%rbx
xchg   %ax,%ax
mov    $0x64,%edi
call   1040 <wait@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x24,%edx
call   1030 <syscall_write@plt>
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [23 x i8] c"Running executable 2\0A\0A\00"
@.str.1 = [17 x i8] c"Myaaaaaahhhhhh\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @syscall_write(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 36)
br label %3
3: ; preds = %0, %3
%4 = call i32 @wait(i32 100)
%5 = call i32 @syscall_write(i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 36)
br label %3
}

LLVM IR (-O2):
@.str = [23 x i8] c"Running executable 2\0A\0A\00"
@.str.1 = [17 x i8] c"Myaaaaaahhhhhh\0A\0A\00"
define i32 @main() {
%1 = tail call i32 @syscall_write(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 36)
br label %2
2: ; preds = %0, %2
%3 = tail call i32 @wait(i32 100)
%4 = tail call i32 @syscall_write(i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 36)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, World!");
  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 = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void diag_scal3(double *restrict scal_coeffs, double *restrict v) {
  do {
    *v++ *= *scal_coeffs++;
    *v++ *= *scal_coeffs++;
    *v++ *= *scal_coeffs++;
  } while (0);
}


x86 assembly (clang, -O0):
<diag_scal3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<diag_scal3>:
movupd (%rdi),%xmm0
movupd (%rsi),%xmm1
mulpd  %xmm0,%xmm1
movupd %xmm1,(%rsi)
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x10(%rsi)
ret

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

LLVM IR (-O2):
define void @diag_scal3(double* noalias nocapture %0, double* noalias nocapture %1) {
%3 = getelementptr inbounds double, double* %0, i64 2
%4 = bitcast double* %0 to <2 x double>*
%5 = load <2 x double>, <2 x double>* %4
%6 = getelementptr inbounds double, double* %1, i64 2
%7 = bitcast double* %1 to <2 x double>*
%8 = load <2 x double>, <2 x double>* %7
%9 = fmul <2 x double> %5, %8
%10 = bitcast double* %1 to <2 x double>*
store <2 x double> %9, <2 x double>* %10
%11 = load double, double* %3
%12 = load double, double* %6
%13 = fmul double %11, %12
store double %13, double* %6
ret void
}
OP(fd, ee) { op_ee(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_ee()
ret i32 undef
}
/* Variables and functions */
void qsort(void *base __attribute__((unused)),
           size_t nmemb __attribute__((unused)),
           size_t size __attribute__((unused)),
           int (*compar)(const void *, const void *) __attribute__((unused))) {}


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

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

LLVM IR (-O0):
define void @qsort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32 (i8*, i8*)*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32 (i8*, i8*)* %3, i32 (i8*, i8*)** %8
ret void
}

LLVM IR (-O2):
define void @qsort(i8* nocapture %0, i64 %1, i64 %2, i32 (i8*, i8*)* nocapture %3) {
ret void
}
long double strtold(const char *str, char **endptr) { return 0.0; }


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

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

LLVM IR (-O0):
define x86_fp80 @strtold(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
ret x86_fp80 0xK00000000000000000000
}

LLVM IR (-O2):
define x86_fp80 @strtold(i8* nocapture readnone %0, i8** nocapture readnone %1) {
ret x86_fp80 0xK00000000000000000000
}
/* Variables and functions */
int fpcompare(double, double, int, int /*<<< orphan*/);
int islessgreater(double x, double y) { return fpcompare(x, y, 0x0100, 0); }


x86 assembly (clang, -O0):
<islessgreater>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    $0x100,%edi
xor    %esi,%esi
call   1030 <fpcompare@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<islessgreater>:
mov    $0x100,%edi
xor    %esi,%esi
jmp    1030 <fpcompare@plt>

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

LLVM IR (-O2):
define i32 @islessgreater(double %0, double %1) {
%3 = tail call i32 @fpcompare(double %0, double %1, i32 256, i32 0)
ret i32 %3
}
/* Variables and functions */
float __rlg10(float);
float r_lg10(float *x) { return (__rlg10(*x)); }


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

x86 assembly (clang, -O2):
<r_lg10>:
movss  (%rdi),%xmm0
jmp    1030 <__rlg10@plt>

LLVM IR (-O0):
define float @r_lg10(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
%5 = call float @__rlg10(float %4)
ret float %5
}

LLVM IR (-O2):
define float @r_lg10(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call float @__rlg10(float %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ perr(char *);
int ceilInt(int m, int n) {
  int q;
  if (n != 0) {
    q = m / n;
    if (m % n != 0)
      q += 1;
    return q;
  } else {
    perr("The dividend shouldn't be zero.\n");
    return 0;
  }
}


x86 assembly (clang, -O0):
<ceilInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1156 <ceilInt+0x46>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     114b <ceilInt+0x3b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <ceilInt+0x59>
lea    0xea3(%rip),%rdi
call   1030 <perr@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceilInt>:
test   %esi,%esi
je     1120 <ceilInt+0x10>
mov    %edi,%eax
cltd
idiv   %esi
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
ret
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <perr@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"The dividend shouldn't be zero.\0A\00"
define i32 @ceilInt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %22
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = sdiv i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = srem i32 %13, %14
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %9
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
br label %20
20: ; preds = %17, %9
%21 = load i32, i32* %6
store i32 %21, i32* %3
br label %24
22: ; preds = %2
%23 = call i32 @perr(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %24
24: ; preds = %22, %20
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
@.str = [33 x i8] c"The dividend shouldn't be zero.\0A\00"
define i32 @ceilInt(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = sdiv i32 %0, %1
%6 = srem i32 %0, %1
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
%9 = add nsw i32 %5, %8
br label %12
10: ; preds = %2
%11 = tail call i32 @perr(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %4
%13 = phi i32 [ %9, %4 ], [ 0, %10 ]
ret i32 %13
}
void platform_random_seed(int seed) {}


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

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

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

LLVM IR (-O2):
define void @platform_random_seed(i32 %0) {
ret void
}
unsigned int swab32(unsigned int x) {
  return (((x)&0x000000FF) << 24) + (((x)&0x0000FF00) << 8) +
         (((x)&0x00FF0000) >> 8) + (((x)&0xFF000000) >> 24);
}


x86 assembly (clang, -O0):
<swab32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shr    $0x8,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swab32>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @swab32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 8
%9 = add i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = lshr i32 %11, 8
%13 = add i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = lshr i32 %15, 24
%17 = add i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @swab32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Type definitions */
struct cm_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct cm_node *);
void cm_node_destroy(struct cm_node *node) { free(node); }


x86 assembly (clang, -O0):
<cm_node_destroy>:
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):
<cm_node_destroy>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.cm_node = type { i32 }
define void @cm_node_destroy(%struct.cm_node* %0) {
%2 = alloca %struct.cm_node*
store %struct.cm_node* %0, %struct.cm_node** %2
%3 = load %struct.cm_node*, %struct.cm_node** %2
%4 = call i32 @free(%struct.cm_node* %3)
ret void
}

LLVM IR (-O2):
%struct.cm_node = type { i32 }
define void @cm_node_destroy(%struct.cm_node* nocapture %0) {
%2 = tail call i32 @free(%struct.cm_node* %0)
ret void
}
char *key_ident() { return "$Id: key_devel.c 230 2007-10-23 17:42:49Z  $"; }


x86 assembly (clang, -O0):
<key_ident>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [45 x i8] c"$Id: key_devel.c 230 2007-10-23 17:42:49Z $\00"
define i8* @key_ident() {
ret i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [45 x i8] c"$Id: key_devel.c 230 2007-10-23 17:42:49Z $\00"
define i8* @key_ident() {
ret i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0)
}
void nand_addr(unsigned char addr) {
  (*((volatile unsigned char *)0x7020000c)) = addr;
}


x86 assembly (clang, -O0):
<nand_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%cl
mov    $0x7020000c,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_addr>:
mov    %dil,0x7020000c
70
ret

LLVM IR (-O0):
define void @nand_addr(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
store volatile i8 %3, i8* inttoptr (i64 1881145356 to i8*)
ret void
}

LLVM IR (-O2):
define void @nand_addr(i8 zeroext %0) {
store volatile i8 %0, i8* inttoptr (i64 1881145356 to i8*)
ret void
}
/* Variables and functions */
int go(int a) { return (a + 1); }


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

x86 assembly (clang, -O2):
<go>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @go(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @go(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
void minmax_div_const_Good(int n) {
  int a[9];
  if (0 < n && n < 65) {
    int x = a[n / 8];
  }
}


x86 assembly (clang, -O0):
<minmax_div_const_Good>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jge    1130 <minmax_div_const_Good+0x30>
cmpl   $0x41,-0x4(%rbp)
jge    1130 <minmax_div_const_Good+0x30>
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cltq
mov    -0x30(%rbp,%rax,4),%eax
mov    %eax,-0x34(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @minmax_div_const_Good(i32 %0) {
%2 = alloca i32
%3 = alloca [9 x i32]
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 0, %5
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 65
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %2
%12 = sdiv i32 %11, 8
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 %13
%15 = load i32, i32* %14
store i32 %15, i32* %4
br label %16
16: ; preds = %10, %7, %1
ret void
}

LLVM IR (-O2):
define void @minmax_div_const_Good(i32 %0) {
ret void
}
void av_bprintf() {}


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

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

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

LLVM IR (-O2):
define void @av_bprintf() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int find_first_zero_bit(int, int *);
int /*<<< orphan*/ printf(char *);
void find_first_zero_bit_test() {
  int bit;
  int a[3] = {0xffffffff, 0xc0000003, 0xf1ff1111};
  printf("Testing find_first_zero_bit...");
  bit = find_first_zero_bit(sizeof(a) * 32, a);
  assert(bit == 34);
  printf("[OK]\n");
}


x86 assembly (clang, -O0):
<find_first_zero_bit_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xebf(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
lea    -0x10(%rbp),%rsi
mov    $0x180,%edi
call   1050 <find_first_zero_bit@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x22,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_first_zero_bit_test>:
sub    $0x18,%rsp
mov    0xebe(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xeab(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    $0x180,%edi
call   1060 <find_first_zero_bit@plt>
xor    %edi,%edi
cmp    $0x22,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.find_first_zero_bit_test.a = [3 x i32] [i32 -1, i32 -1073741821, i32 -234942191]
@.str = [31 x i8] c"Testing find_first_zero_bit...\00"
@.str.1 = [6 x i8] c"[OK]\0A\00"
define void @find_first_zero_bit_test() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = bitcast [3 x i32]* %2 to i8*
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%6 = call i32 @find_first_zero_bit(i32 384, i32* %5)
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 34
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__const.find_first_zero_bit_test.a = [3 x i32] [i32 -1, i32 -1073741821, i32 -234942191]
@.str = [31 x i8] c"Testing find_first_zero_bit...\00"
@str = [5 x i8] c"[OK]\00"
define void @find_first_zero_bit_test() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%5 = call i32 @find_first_zero_bit(i32 384, i32* %4)
%6 = icmp eq i32 %5, 34
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ detab(char *, char *);
int get_line(char *, int);
int /*<<< orphan*/ printf(char *, char *);
main() {
  int len;
  char line[1000];
  char detabbed_line[1000];
  while ((len = get_line(line, 1000)) > 0) {
    detab(detabbed_line, line);
    printf("%s", detabbed_line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7e0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <get_line@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    118a <main+0x5a>
lea    -0x7e0(%rbp),%rdi
lea    -0x3f0(%rbp),%rsi
call   1030 <detab@plt>
lea    -0x7e0(%rbp),%rsi
lea    0xe80(%rip),%rdi
call   1050 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x7e0,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <get_line@plt>
test   %eax,%eax
jle    1187 <main+0x57>
lea    0x3f0(%rsp),%r14
mov    %rsp,%rbx
lea    0xea1(%rip),%r15
nop
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <detab@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <get_line@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
%4 = alloca [1000 x i8]
store i32 0, i32* %1
br label %5
5: ; preds = %9, %0
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%7 = call i32 @get_line(i8* %6, i32 1000)
store i32 %7, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%12 = call i32 @detab(i8* %10, i8* %11)
%13 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %5
15: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 @get_line(i8* %3, i32 1000)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %0, %7
%8 = call i32 @detab(i8* %4, i8* %3)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%10 = call i32 @get_line(i8* %3, i32 1000)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %7, label %12
12: ; preds = %7, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write_break();
int /*<<< orphan*/ write_line(char *);
void html_enumerate_item(void) {
  write_break();
  write_line("<LI>");
}


x86 assembly (clang, -O0):
<html_enumerate_item>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <write_break@plt>
lea    0xece(%rip),%rdi
call   1040 <write_line@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<html_enumerate_item>:
push   %rax
xor    %eax,%eax
call   1030 <write_break@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <write_line@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"<LI>\00"
define void @html_enumerate_item() {
%1 = call i32 (...) @write_break()
%2 = call i32 @write_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"<LI>\00"
define void @html_enumerate_item() {
%1 = tail call i32 (...) @write_break()
%2 = tail call i32 @write_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ move_chessman(int *, int *);
int main() {
  int current_coordinates[2] = {2, 1};
  int target_coordinates[2] = {2, 3};
  move_chessman(current_coordinates, target_coordinates);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x100000002,%rax
mov    %rax,0x10(%rsp)
movabs $0x300000002,%rax
mov    %rax,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <move_chessman@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
store i64 4294967298, i64* %1
%4 = bitcast i64* %2 to i8*
store i64 12884901890, i64* %2
%5 = bitcast i64* %1 to i32*
%6 = bitcast i64* %2 to i32*
%7 = call i32 @move_chessman(i32* %5, i32* %6)
ret i32 0
}
int Maxi(int a, int b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<Maxi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <Maxi+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <Maxi+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Maxi>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @Maxi(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @Maxi(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
unsigned long sup_pts_to_ms(uint32_t pts) { return pts / 90; }


x86 assembly (clang, -O0):
<sup_pts_to_ms>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5a,%ecx
cltd
idiv   %ecx
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<sup_pts_to_ms>:
movslq %edi,%rax
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x6,%eax
add    %ecx,%eax
cltq
ret

LLVM IR (-O0):
define i64 @sup_pts_to_ms(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 90
%5 = sext i32 %4 to i64
ret i64 %5
}

LLVM IR (-O2):
define i64 @sup_pts_to_ms(i32 %0) {
%2 = sdiv i32 %0, 90
%3 = sext i32 %2 to i64
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void exchange(int a, int b) {
  int temp;
  temp = a;
  a = b;
  b = temp;
  printf(" From function exchange: ");
  printf("a = %d, b = %d\n", a, b);
}


x86 assembly (clang, -O0):
<exchange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exchange>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c" From function exchange: \00"
@.str.1 = [16 x i8] c"a = %d, b = %d\0A\00"
define void @exchange(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
store i32 %6, i32* %5
%7 = load i32, i32* %4
store i32 %7, i32* %3
%8 = load i32, i32* %5
store i32 %8, i32* %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c" From function exchange: \00"
@.str.1 = [16 x i8] c"a = %d, b = %d\0A\00"
define void @exchange(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __johnson_trotter(int);
void permutation(int n) { __johnson_trotter(n); }


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

x86 assembly (clang, -O2):
<permutation>:
jmp    1030 <__johnson_trotter@plt>

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

LLVM IR (-O2):
define void @permutation(i32 %0) {
%2 = tail call i32 @__johnson_trotter(i32 %0)
ret void
}
int sys$wflor(unsigned int efn, unsigned int mask) {
  return ({
    unsigned long resultvar;
    register long int _a2 asm("rsi") = (long)(mask);
    register long int _a1 asm("rdi") = (long)(efn);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(7), "r"(_a1), "r"(_a2)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$wflor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x7,%rax
int    $0x81
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$wflor>:
mov    %esi,%esi
mov    %edi,%edi
mov    $0x7,%rax
int    $0x81
ret

LLVM IR (-O0):
define i32 @"sys$wflor"(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
store i64 %10, i64* %6
%11 = load i32, i32* %3
%12 = zext i32 %11 to i64
store i64 %12, i64* %7
%13 = load i64, i64* %7
%14 = load i64, i64* %6
%15 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 7, i64 %13, i64 %14)
store i64 %15, i64* %5
%16 = load i64, i64* %5
store i64 %16, i64* %8
%17 = load i64, i64* %8
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @"sys$wflor"(i32 %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = zext i32 %0 to i64
%5 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 7, i64 %4, i64 %3)
%6 = trunc i64 %5 to i32
ret i32 %6
}