xunge/DecIR huggingface dataset:
void rop3_26_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S & T;
  stk2 = *D | stk3;
  stk1 = T ^ stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_26_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_26_0_1>:
mov    %edx,%eax
and    %sil,%al
mov    (%rdi),%r8b
mov    %r8d,%ecx
or     %al,%cl
xor    %dl,%cl
and    %sil,%cl
not    %al
and    %r8b,%al
or     %cl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_26_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = and i8 %2, %1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
%7 = xor i8 %6, %2
%8 = and i8 %7, %1
%9 = xor i8 %4, -1
%10 = and i8 %5, %9
%11 = or i8 %10, %8
store i8 %11, i8* %0
ret void
}
int x(int a) { return a; }


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

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

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

LLVM IR (-O2):
define i32 @x(i32 returned %0) {
ret i32 %0
}
void retro_unload_game() {}


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

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

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

LLVM IR (-O2):
define void @retro_unload_game() {
ret void
}
/* Type definitions */
struct n {
  int dummy;
};

/* Variables and functions */
void n_load_hex(struct n *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ slen(char *);
void n_load_hexz(struct n *r, char *hex) {
  return n_load_hex(r, hex, slen(hex));
}


x86 assembly (clang, -O0):
<n_load_hexz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <slen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <n_load_hex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_load_hexz>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <slen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <n_load_hex@plt>

LLVM IR (-O0):
%struct.n = type { i32 }
define void @n_load_hexz(%struct.n* %0, i8* %1) {
%3 = alloca %struct.n*
%4 = alloca i8*
store %struct.n* %0, %struct.n** %3
store i8* %1, i8** %4
%5 = load %struct.n*, %struct.n** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @slen(i8* %7)
ret void
}

LLVM IR (-O2):
%struct.n = type { i32 }
define void @n_load_hexz(%struct.n* %0, i8* %1) {
%3 = tail call i32 @slen(i8* %1)
tail call void @n_load_hex(%struct.n* %0, i8* %1, i32 %3)
ret void
}
extern void _kill(int pid_UNUSED __attribute__((__unused__)),
                  int sig_UNUSED __attribute__((__unused__))) {
  return;
}


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

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

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

LLVM IR (-O2):
define void @_kill(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
char *malloc(int);
char *fs_fnread(FILE *file, int len) {
  char *buffer = malloc(sizeof(char) * (len + 1));
  fread(buffer, 1, len, file);
  buffer[len] = '\0';
  return buffer;
}


x86 assembly (clang, -O0):
<fs_fnread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_fnread>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1,%esi
mov    %r15d,%edx
mov    %r14,%rcx
call   1030 <fread@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @fs_fnread(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = mul i64 1, %8
%10 = trunc i64 %9 to i32
%11 = call i8* @malloc(i32 %10)
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = load i32, i32* %4
%14 = load i32*, i32** %3
%15 = call i32 @fread(i8* %12, i32 1, i32 %13, i32* %14)
%16 = load i8*, i8** %5
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 0, i8* %19
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
define noalias i8* @fs_fnread(i32* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @fread(i8* %4, i32 1, i32 %1, i32* %0)
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
store i8 0, i8* %7
ret i8* %4
}
/* Variables and functions */
int ENOSYS;
int sysfs_set_frequency(unsigned int cpu, unsigned long target_frequency) {
  return -ENOSYS;
}


x86 assembly (clang, -O0):
<sysfs_set_frequency>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ed4(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysfs_set_frequency>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @sysfs_set_frequency(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* @ENOSYS
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @sysfs_set_frequency(i32 %0, i64 %1) {
%3 = load i32, i32* @ENOSYS
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int /*<<< orphan*/ twoWay(int, int);
int main() {
  int x = __VERIFIER_nondet_int();
  if (x < 0)
    return 0;
  int y = __VERIFIER_nondet_int();
  if (y < 0)
    return 0;
  int z = __VERIFIER_nondet_int();
  twoWay(1, x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    114f <main+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1186 <main+0x66>
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    116f <main+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    1186 <main+0x66>
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x1,%edi
call   1030 <twoWay@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
js     114c <main+0x2c>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
js     114c <main+0x2c>
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
mov    $0x1,%edi
mov    %ebx,%esi
call   1030 <twoWay@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 0, i32* %1
br label %18
9: ; preds = %0
%10 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 0, i32* %1
br label %18
14: ; preds = %9
%15 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %15, i32* %4
%16 = load i32, i32* %2
%17 = call i32 @twoWay(i32 1, i32 %16)
br label %18
18: ; preds = %14, %13, %8
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp slt i32 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = tail call i32 (...) @__VERIFIER_nondet_int()
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 (...) @__VERIFIER_nondet_int()
%8 = tail call i32 @twoWay(i32 1, i32 %1)
br label %9
9: ; preds = %6, %3, %0
ret i32 0
}
int dos_a_la(int n) {
  int result = 2;
  for (int i = 0; i < n - 1; i++) {
    result = result * 2;
  }
  return result;
}


x86 assembly (clang, -O0):
<dos_a_la>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    113d <dos_a_la+0x3d>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <dos_a_la+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dos_a_la>:
mov    $0x2,%eax
cmp    $0x2,%edi
jl     1147 <dos_a_la+0x47>
lea    -0x1(%rdi),%edx
add    $0xfffffffe,%edi
mov    %edx,%ecx
and    $0x7,%ecx
cmp    $0x7,%edi
jae    1121 <dos_a_la+0x21>
mov    $0x2,%eax
jmp    1138 <dos_a_la+0x38>
and    $0xfffffff8,%edx
mov    $0x2,%eax
nopl   0x0(%rax)
shl    $0x8,%eax
add    $0xfffffff8,%edx
jne    1130 <dos_a_la+0x30>
test   %ecx,%ecx
je     1147 <dos_a_la+0x47>
nopl   0x0(%rax)
add    %eax,%eax
add    $0xffffffff,%ecx
jne    1140 <dos_a_la+0x40>
ret

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

LLVM IR (-O2):
define i32 @dos_a_la(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %20
4: ; preds = %1
%5 = add i32 %0, -2
%6 = and i32 %2, 7
%7 = icmp ult i32 %5, 7
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = and i32 %2, -8
br label %22
10: ; preds = %22, %4
%11 = phi i32 [ undef, %4 ], [ %25, %22 ]
%12 = phi i32 [ 2, %4 ], [ %25, %22 ]
%13 = icmp eq i32 %6, 0
br i1 %13, label %20, label %14
14: ; preds = %10, %14
%15 = phi i32 [ %17, %14 ], [ %12, %10 ]
%16 = phi i32 [ %18, %14 ], [ 0, %10 ]
%17 = shl nsw i32 %15, 1
%18 = add i32 %16, 1
%19 = icmp eq i32 %18, %6
br i1 %19, label %20, label %14
20: ; preds = %10, %14, %1
%21 = phi i32 [ 2, %1 ], [ %11, %10 ], [ %17, %14 ]
ret i32 %21
22: ; preds = %22, %8
%23 = phi i32 [ 2, %8 ], [ %25, %22 ]
%24 = phi i32 [ 0, %8 ], [ %26, %22 ]
%25 = shl i32 %23, 8
%26 = add i32 %24, 8
%27 = icmp eq i32 %26, %9
br i1 %27, label %10, label %22
}
int get_array_size(double *userNumber) {
  int arraySize = 0;
  double temp = *userNumber;
  while ((int)temp != 0) {
    temp = temp / 2;
    ++arraySize;
  }
  return (arraySize);
}


x86 assembly (clang, -O0):
<get_array_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x18(%rbp),%eax
cmp    $0x0,%eax
je     114e <get_array_size+0x4e>
movsd  -0x18(%rbp),%xmm0
movsd  0xec9(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111c <get_array_size+0x1c>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_array_size>:
movsd  (%rdi),%xmm0
cvttsd2si %xmm0,%eax
test   %eax,%eax
je     1130 <get_array_size+0x30>
xor    %eax,%eax
movsd  0xeea(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
mulsd  %xmm1,%xmm0
add    $0x1,%eax
cvttsd2si %xmm0,%ecx
test   %ecx,%ecx
jne    1120 <get_array_size+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @get_array_size(double* %0) {
%2 = alloca double*
%3 = alloca i32
%4 = alloca double
store double* %0, double** %2
store i32 0, i32* %3
%5 = load double*, double** %2
%6 = load double, double* %5
store double %6, double* %4
br label %7
7: ; preds = %11, %1
%8 = load double, double* %4
%9 = fptosi double %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load double, double* %4
%13 = fdiv double %12, 2.000000e+00
store double %13, double* %4
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %7
16: ; preds = %7
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @get_array_size(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %1, %5
%6 = phi double [ %8, %5 ], [ %2, %1 ]
%7 = phi i32 [ %9, %5 ], [ 0, %1 ]
%8 = fmul double %6, 5.000000e-01
%9 = add nuw nsw i32 %7, 1
%10 = fptosi double %8 to i32
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %1
%13 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %13
}
int lw_thread_start(void (*func)(void *), void *args) {
  int result = 0;
  return result;
}


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

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

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

LLVM IR (-O2):
define i32 @lw_thread_start(void (i8*)* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
double power(int, int);
int /*<<< orphan*/ printf(char *, int, double, double);
int main() {
  int i;
  for (i = -5; i < 10; ++i)
    printf("%d: 2^x= %.2f   -3^x= %.2f\n", i, power(2, i), power(-3, i));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffffb,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    118a <main+0x6a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x2,%edi
call   1030 <power@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    $0xfffffffd,%edi
call   1030 <power@plt>
mov    -0x14(%rbp),%esi
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xfffffffb,%ebx
lea    0xed0(%rip),%r14
mov    $0x2,%edi
mov    %ebx,%esi
call   1030 <power@plt>
movsd  %xmm0,(%rsp)
mov    $0xfffffffd,%edi
mov    %ebx,%esi
call   1030 <power@plt>
movaps %xmm0,%xmm1
mov    %r14,%rdi
mov    %ebx,%esi
movsd  (%rsp),%xmm0
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    $0xa,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [28 x i8] c"%d: 2^x= %.2f -3^x= %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 -5, i32* %2
br label %3
3: ; preds = %13, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call double @power(i32 2, i32 %8)
%10 = load i32, i32* %2
%11 = call double @power(i32 -3, i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %7, double %9, double %11)
br label %13
13: ; preds = %6
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %3
16: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"%d: 2^x= %.2f -3^x= %.2f\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ -5, %0 ], [ %6, %1 ]
%3 = tail call double @power(i32 2, i32 %2)
%4 = tail call double @power(i32 -3, i32 %2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %2, double %3, double %4)
%6 = add nsw i32 %2, 1
%7 = icmp eq i32 %6, 10
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int /*<<< orphan*/ *screenBlitStart(int *, int *);
void DoClearScreenBuffer(void) {
  int w, h;
  uint8_t *p = screenBlitStart(&w, &h);
  memset(p, 0, w * h * 4);
}


x86 assembly (clang, -O0):
<DoClearScreenBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <screenBlitStart@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
imul   -0x8(%rbp),%edx
shl    $0x2,%edx
xor    %esi,%esi
call   1040 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoClearScreenBuffer>:
push   %rax
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <screenBlitStart@plt>
mov    0x4(%rsp),%edx
imul   (%rsp),%edx
shl    $0x2,%edx
mov    %rax,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @DoClearScreenBuffer() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32* @screenBlitStart(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = shl i32 %6, 2
%9 = mul i32 %8, %7
%10 = call i32 @memset(i32* %5, i32 0, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void blob_free(void *blob) { free(blob); }


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

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

LLVM IR (-O2):
define void @blob_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void sigctrlc(sig) {
  printf("\33[?25h");
  exit(0);
}


x86 assembly (clang, -O0):
<sigctrlc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigctrlc>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[?25h\00"
define void @sigctrlc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?25h\00"
define void @sigctrlc(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
tail call void @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ q1(int, char **);
int main(int argc, char *argv[]) {
  q1(argc, argv);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <q1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @q1(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  int overflow = 2147480000;
  while (overflow > 0) {
    printf("%d\n", overflow);
    overflow++;
  }
  printf("%d\n", overflow);
  float floatOverflow = 3.4E38 * 100.0f;
  printf("%f\n", floatOverflow);
  float floatUnderflow = 1.234567E-38 / 10.0f;
  printf("%e\n", floatUnderflow);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7ffff1c0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    114f <main+0x3f>
cvtsi2ssl -0x8(%rbp),%xmm0
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
cvtsi2ssl -0x8(%rbp),%xmm0
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
movss  0xe9c(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
movss  0xe7a(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x7ffff1c0,%ebp
lea    0xee1(%rip),%rbx
nop
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0x1,%ebp
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
@.str.2 = [4 x i8] c"%e\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
store i32 2147480000, i32* %2
br label %5
5: ; preds = %8, %0
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sitofp i32 %9 to float
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %10)
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %5
14: ; preds = %5
%15 = load i32, i32* %2
%16 = sitofp i32 %15 to float
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %16)
store float 0x7FF0000000000000, float* %3
%18 = load float, float* %3
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %18)
store float 0x37DAE2F000000000, float* %4
%20 = load float, float* %4
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), float %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 2147480000, %0 ], [ %5, %1 ]
%3 = sitofp i32 %2 to float
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %3)
%5 = add nuw nsw i32 %2, 1
br label %1
}
int TestPoint(int i, int j) {
  if (i < 0 || i > 18 || j < 0 || j > 18)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<TestPoint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1132 <TestPoint+0x32>
cmpl   $0x12,-0x8(%rbp)
jg     1132 <TestPoint+0x32>
cmpl   $0x0,-0xc(%rbp)
jl     1132 <TestPoint+0x32>
cmpl   $0x12,-0xc(%rbp)
jle    113e <TestPoint+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1145 <TestPoint+0x45>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestPoint>:
cmp    $0x13,%edi
setb   %al
cmp    $0x13,%esi
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @TestPoint(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, 19
%4 = icmp ult i32 %1, 19
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct srcu_struct {
  int dummy;
};

/* Variables and functions */
int __srcu_read_lock(struct srcu_struct *);
int srcu_read_lock(struct srcu_struct *sp) {
  int retval = __srcu_read_lock(sp);
  do {
  } while (0);
  return retval;
}


x86 assembly (clang, -O0):
<srcu_read_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__srcu_read_lock@plt>
mov    %eax,-0xc(%rbp)
jmp    112d <srcu_read_lock+0x1d>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srcu_read_lock>:
jmp    1030 <__srcu_read_lock@plt>

LLVM IR (-O0):
%struct.srcu_struct = type { i32 }
define i32 @srcu_read_lock(%struct.srcu_struct* %0) {
%2 = alloca %struct.srcu_struct*
%3 = alloca i32
store %struct.srcu_struct* %0, %struct.srcu_struct** %2
%4 = load %struct.srcu_struct*, %struct.srcu_struct** %2
%5 = call i32 @__srcu_read_lock(%struct.srcu_struct* %4)
store i32 %5, i32* %3
br label %6
6: ; preds = %1
br label %7
7: ; preds = %6
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
%struct.srcu_struct = type { i32 }
define i32 @srcu_read_lock(%struct.srcu_struct* %0) {
%2 = tail call i32 @__srcu_read_lock(%struct.srcu_struct* %0)
ret i32 %2
}
/* Variables and functions */
int memcmp(void *const, void *const, int);
int ipapwd_gentime_cmp(const void *p1, const void *p2) {
  return memcmp(*(void *const *)p2, *(void *const *)p1, 15);
}


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

x86 assembly (clang, -O2):
<ipapwd_gentime_cmp>:
mov    (%rsi),%rax
mov    (%rdi),%rsi
mov    %rax,%rdi
mov    $0xf,%edx
jmp    1030 <memcmp@plt>

LLVM IR (-O0):
define i32 @ipapwd_gentime_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** %4
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @memcmp(i8* %7, i8* %10, i32 15)
ret i32 %11
}

LLVM IR (-O2):
define i32 @ipapwd_gentime_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %0 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @memcmp(i8* %4, i8* %6, i32 15)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ g(char *);
int f() {
  char a[32608];
  g(a);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7f70,%rsp
lea    -0x7f70(%rbp),%rdi
call   1030 <g@plt>
mov    -0x4(%rbp),%eax
add    $0x7f70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sub    $0x7f68,%rsp
mov    %rsp,%rdi
call   1030 <g@plt>
add    $0x7f68,%rsp
ret

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
%2 = alloca [32608 x i8]
%3 = getelementptr inbounds [32608 x i8], [32608 x i8]* %2, i64 0, i64 0
%4 = call i32 @g(i8* %3)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @f() {
%1 = alloca [32608 x i8]
%2 = getelementptr inbounds [32608 x i8], [32608 x i8]* %1, i64 0, i64 0
%3 = call i32 @g(i8* %2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void cube(double n) {
  double sol;
  sol = n * n * n;
  printf("The solution is: %g\n", sol);
}


x86 assembly (clang, -O0):
<cube>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cube>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
lea    0xedd(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"The solution is: %g\0A\00"
define void @cube(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = load double, double* %2
%8 = fmul double %6, %7
store double %8, double* %3
%9 = load double, double* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double %9)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"The solution is: %g\0A\00"
define void @cube(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double %3)
ret void
}
unsigned setbits(int x, int p, int n, int y) {
  return x & ~(~(~0 << n) << (p + 1 - n)) | (y & ~(~0 << n)) << (p + 1 - n);
}


x86 assembly (clang, -O0):
<setbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%esi
shl    %cl,%esi
mov    %esi,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%edx
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbits>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
sub    %edx,%esi
lea    0x1(%rsi),%ecx
mov    %eax,%edx
shl    %cl,%edx
not    %edx
and    %edi,%edx
and    %r8d,%eax
shl    %cl,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = shl i32 -1, %10
%12 = xor i32 %11, -1
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
%15 = load i32, i32* %7
%16 = sub nsw i32 %14, %15
%17 = shl i32 %12, %16
%18 = xor i32 %17, -1
%19 = and i32 %9, %18
%20 = load i32, i32* %8
%21 = load i32, i32* %7
%22 = shl i32 -1, %21
%23 = xor i32 %22, -1
%24 = and i32 %20, %23
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
%27 = load i32, i32* %7
%28 = sub nsw i32 %26, %27
%29 = shl i32 %24, %28
%30 = or i32 %19, %29
ret i32 %30
}

LLVM IR (-O2):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl nsw i32 -1, %2
%6 = xor i32 %5, -1
%7 = add nsw i32 %1, 1
%8 = sub i32 %7, %2
%9 = shl i32 %6, %8
%10 = xor i32 %9, -1
%11 = and i32 %10, %0
%12 = and i32 %6, %3
%13 = shl i32 %12, %8
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ nl();
int /*<<< orphan*/ ol(char *);
void zret(void) {
  ol("ret");
  nl();
  nl();
}


x86 assembly (clang, -O0):
<zret>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <ol@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    $0x0,%al
call   1030 <nl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zret>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <ol@plt>
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <nl@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"ret\00"
define void @zret() {
%1 = call i32 @ol(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @nl()
%3 = call i32 (...) @nl()
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"ret\00"
define void @zret() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @nl()
%3 = tail call i32 (...) @nl()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ helloWorld();
int main(void) {
  helloWorld();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @helloWorld()
ret i32 0
}
void intel_crtc_unlock(struct drm_crtc *crtc) {}


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

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

LLVM IR (-O0):
%struct.drm_crtc = type opaque
define void @intel_crtc_unlock(%struct.drm_crtc* %0) {
%2 = alloca %struct.drm_crtc*
store %struct.drm_crtc* %0, %struct.drm_crtc** %2
ret void
}

LLVM IR (-O2):
%struct.drm_crtc = type opaque
define void @intel_crtc_unlock(%struct.drm_crtc* nocapture %0) {
ret void
}
/* Variables and functions */
bool isWhiteSpace(char character) {
  return character == ' ' || character == '\t' || character == '\r' ||
         character == '\n';
}


x86 assembly (clang, -O0):
<isWhiteSpace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <isWhiteSpace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     114d <isWhiteSpace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     114d <isWhiteSpace+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isWhiteSpace>:
cmp    $0x20,%dil
ja     1120 <isWhiteSpace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002200,%rdx
bt     %rcx,%rdx
jae    1120 <isWhiteSpace+0x20>
ret
xor    %eax,%eax
cmp    $0xa,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isWhiteSpace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 13
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 10
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @isWhiteSpace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 13, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ console_tx_hex16(unsigned short);
void print_warn_hex16(unsigned short value) { console_tx_hex16(value); }


x86 assembly (clang, -O0):
<print_warn_hex16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <console_tx_hex16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_warn_hex16>:
jmp    1030 <console_tx_hex16@plt>

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

LLVM IR (-O2):
define void @print_warn_hex16(i16 zeroext %0) {
%2 = tail call i32 @console_tx_hex16(i16 zeroext %0)
ret void
}
/* Type definitions */
struct lconv {
  char *decimal_point;
  char *thousands_sep;
};

/* Variables and functions */
struct lconv *localeconv();
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  struct lconv *lc;
  lc = localeconv();
  printf("lc->decimal_point = %s\n", lc->decimal_point);
  printf("lc->thousands_sep = %s\n", lc->thousands_sep);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <localeconv@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <localeconv@plt>
mov    %rax,%rbx
mov    (%rax),%rsi
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
mov    0x8(%rbx),%rsi
lea    0xed3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.lconv = type { i8*, i8* }
@.str = [24 x i8] c"lc->decimal_point = %s\0A\00"
@.str.1 = [24 x i8] c"lc->thousands_sep = %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.lconv*
store i32 0, i32* %1
%3 = call %struct.lconv* (...) @localeconv()
store %struct.lconv* %3, %struct.lconv** %2
%4 = load %struct.lconv*, %struct.lconv** %2
%5 = getelementptr inbounds %struct.lconv, %struct.lconv* %4, i32 0, i32 0
%6 = load i8*, i8** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load %struct.lconv*, %struct.lconv** %2
%9 = getelementptr inbounds %struct.lconv, %struct.lconv* %8, i32 0, i32 1
%10 = load i8*, i8** %9
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
%struct.lconv = type { i8*, i8* }
@.str = [24 x i8] c"lc->decimal_point = %s\0A\00"
@.str.1 = [24 x i8] c"lc->thousands_sep = %s\0A\00"
define i32 @main() {
%1 = tail call %struct.lconv* (...) @localeconv()
%2 = getelementptr inbounds %struct.lconv, %struct.lconv* %1, i64 0, i32 0
%3 = load i8*, i8** %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds %struct.lconv, %struct.lconv* %1, i64 0, i32 1
%6 = load i8*, i8** %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}
void populateQ(int *Q) {
  int i;
  for (i = 0; i < 5; i++)
    Q[i] = -9999999;
}


x86 assembly (clang, -O0):
<populateQ>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1136 <populateQ+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xff676981,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <populateQ+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<populateQ>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movl   $0xff676981,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @populateQ(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 -9999999, i32 -9999999, i32 -9999999, i32 -9999999>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
store i32 -9999999, i32* %3
ret void
}
unsigned ROL(unsigned word, int i) {
  asm("roll %%cl, %0" : "=r"(word) : "0"(word), "c"(i));
  return word;
}


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

x86 assembly (clang, -O2):
<ROL>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @ROL(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 = call i32 asm "roll %cl, $0", "=r,0,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @ROL(i32 %0, i32 %1) {
%3 = tail call i32 asm "roll %cl, $0", "=r,0,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int count(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x;
  scanf("%d", &x);
  int cnt = count(x);
  printf("cnt %d\n", cnt);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <count@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <count@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"cnt %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @count(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ reversesub(char *, char *);
int strlen(char *);
void reverse(char *s) {
  char *send = s + strlen(s) - 1;
  reversesub(s, (*send == '\n') ? --send : send);
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    117e <reverse+0x5e>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x28(%rbp)
jmp    1186 <reverse+0x66>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <reversesub@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
lea    (%rbx,%rax,1),%rsi
add    $0xffffffffffffffff,%rsi
xor    %ecx,%ecx
cmpb   $0xa,-0x1(%rbx,%rax,1)
sete   %cl
sub    %rcx,%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <reversesub@plt>

LLVM IR (-O0):
define void @reverse(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
%9 = getelementptr inbounds i8, i8* %8, i64 -1
store i8* %9, i8** %3
%10 = load i8*, i8** %2
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 10
br i1 %14, label %15, label %18
15: ; preds = %1
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 -1
store i8* %17, i8** %3
br label %20
18: ; preds = %1
%19 = load i8*, i8** %3
br label %20
20: ; preds = %18, %15
%21 = phi i8* [ %17, %15 ], [ %19, %18 ]
%22 = call i32 @reversesub(i8* %10, i8* %21)
ret void
}

LLVM IR (-O2):
define void @reverse(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 -1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
%8 = sext i1 %7 to i64
%9 = getelementptr i8, i8* %5, i64 %8
%10 = tail call i32 @reversesub(i8* %0, i8* %9)
ret void
}
int complex(int first, int second, int third) { return first + second + third; }


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

x86 assembly (clang, -O2):
<complex>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @complex(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* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @complex(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}