xunge/DecIR huggingface dataset:
void trdtoi(s) char *s;
{
  for (;; ++s)
    switch (*s) {
    case '\000':
      return;
    case '\216':
      *s = '\340';
      break;
    case '\231':
      *s = '\344';
      break;
    case '\334':
      *s = '\346';
      break;
    }
}


x86 assembly (clang, -O0):
<trdtoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
sub    $0xffffff8e,%eax
je     1154 <trdtoi+0x54>
jmp    1120 <trdtoi+0x20>
mov    -0xc(%rbp),%eax
sub    $0xffffff99,%eax
je     1160 <trdtoi+0x60>
jmp    1131 <trdtoi+0x31>
mov    -0xc(%rbp),%eax
sub    $0xffffffdc,%eax
je     116c <trdtoi+0x6c>
jmp    1142 <trdtoi+0x42>
mov    -0xc(%rbp),%eax
test   %eax,%eax
jne    1173 <trdtoi+0x73>
jmp    1152 <trdtoi+0x52>
pop    %rbp
ret
mov    -0x8(%rbp),%rax
movb   $0xe0,(%rax)
jmp    1173 <trdtoi+0x73>
mov    -0x8(%rbp),%rax
movb   $0xe4,(%rax)
jmp    1173 <trdtoi+0x73>
mov    -0x8(%rbp),%rax
movb   $0xe6,(%rax)
jmp    1178 <trdtoi+0x78>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <trdtoi+0x8>

x86 assembly (clang, -O2):
<trdtoi>:
jmp    111d <trdtoi+0x1d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    $0xffffffdc,%eax
jne    1135 <trdtoi+0x35>
mov    $0xe6,%cl
mov    %cl,(%rdi)
add    $0x1,%rdi
movsbl (%rdi),%eax
cmp    $0xffffffdb,%eax
jg     1110 <trdtoi+0x10>
mov    $0xe0,%cl
cmp    $0xffffff8e,%eax
je     1117 <trdtoi+0x17>
cmp    $0xffffff99,%eax
jne    1119 <trdtoi+0x19>
mov    $0xe4,%cl
jmp    1117 <trdtoi+0x17>
test   %eax,%eax
jne    1119 <trdtoi+0x19>
ret

LLVM IR (-O0):
define void @trdtoi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
switch i32 %6, label %14 [
i32 0, label %7
i32 -114, label %8
i32 -103, label %10
i32 -36, label %12
]
7: ; preds = %3
ret void
8: ; preds = %3
%9 = load i8*, i8** %2
store i8 -32, i8* %9
br label %14
10: ; preds = %3
%11 = load i8*, i8** %2
store i8 -28, i8* %11
br label %14
12: ; preds = %3
%13 = load i8*, i8** %2
store i8 -26, i8* %13
br label %14
14: ; preds = %3, %12, %10, %8
br label %15
15: ; preds = %14
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
}

LLVM IR (-O2):
define void @trdtoi(i8* nocapture %0) {
br label %2
2: ; preds = %11, %1
%3 = phi i8* [ %0, %1 ], [ %12, %11 ]
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %11 [
i32 0, label %6
i32 -114, label %9
i32 -103, label %7
i32 -36, label %8
]
6: ; preds = %2
ret void
7: ; preds = %2
br label %9
8: ; preds = %2
br label %9
9: ; preds = %2, %8, %7
%10 = phi i8 [ -28, %7 ], [ -26, %8 ], [ -32, %2 ]
store i8 %10, i8* %3
br label %11
11: ; preds = %9, %2
%12 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
}
float f_abs(float f) {
  int i = ((*(int *)&f) & 0x7fffffff);
  return (*(float *)&i);
}


x86 assembly (clang, -O0):
<f_abs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7fffffff,%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_abs>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define float @f_abs(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = bitcast float* %2 to i32*
%5 = load i32, i32* %4
%6 = and i32 %5, 2147483647
store i32 %6, i32* %3
%7 = bitcast i32* %3 to float*
%8 = load float, float* %7
ret float %8
}

LLVM IR (-O2):
define float @f_abs(float %0) {
%2 = bitcast float %0 to i32
%3 = and i32 %2, 2147483647
%4 = bitcast i32 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ pop();
int /*<<< orphan*/ read_varid();
int /*<<< orphan*/ setvar(int /*<<< orphan*/, int /*<<< orphan*/);
void pop_handler(void) { setvar(read_varid(), pop()); }


x86 assembly (clang, -O0):
<pop_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <read_varid@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <pop@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
call   1040 <setvar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop_handler>:
push   %rbx
xor    %eax,%eax
call   1050 <read_varid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <pop@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <setvar@plt>

LLVM IR (-O0):
define void @pop_handler() {
%1 = call i32 (...) @read_varid()
%2 = call i32 (...) @pop()
%3 = call i32 @setvar(i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
define void @pop_handler() {
%1 = tail call i32 (...) @read_varid()
%2 = tail call i32 (...) @pop()
%3 = tail call i32 @setvar(i32 %1, i32 %2)
ret void
}
void vPortStopTickTimer(void) {
  (*((volatile unsigned long *)0xe000e010)) = (1UL << 2UL) | (1UL << 1UL);
}


x86 assembly (clang, -O0):
<vPortStopTickTimer>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000e010,%eax
movq   $0x6,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vPortStopTickTimer>:
mov    $0xe000e010,%eax
movq   $0x6,(%rax)
ret

LLVM IR (-O0):
define void @vPortStopTickTimer() {
store volatile i64 6, i64* inttoptr (i64 3758153744 to i64*)
ret void
}

LLVM IR (-O2):
define void @vPortStopTickTimer() {
store volatile i64 6, i64* inttoptr (i64 3758153744 to i64*)
ret void
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
scalar_t__ clock();
void tickOneSecond() {
  clock_t start;
  int pauseLength = 1000;
  start = clock();
  while (clock() < start + pauseLength)
    ;
}


x86 assembly (clang, -O0):
<tickOneSecond>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3e8,-0xc(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jge    114a <tickOneSecond+0x3a>
jmp    112a <tickOneSecond+0x1a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tickOneSecond>:
push   %rbx
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
add    $0x3e8,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <clock@plt>
cmp    %rbx,%rax
jl     1130 <tickOneSecond+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @tickOneSecond() {
%1 = alloca i64
%2 = alloca i32
store i32 1000, i32* %2
%3 = call i64 (...) @clock()
store i64 %3, i64* %1
br label %4
4: ; preds = %11, %0
%5 = call i64 (...) @clock()
%6 = load i64, i64* %1
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = add nsw i64 %6, %8
%10 = icmp slt i64 %5, %9
br i1 %10, label %11, label %12
11: ; preds = %4
br label %4
12: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @tickOneSecond() {
%1 = tail call i64 (...) @clock()
%2 = add nsw i64 %1, 1000
br label %3
3: ; preds = %3, %0
%4 = tail call i64 (...) @clock()
%5 = icmp slt i64 %4, %2
br i1 %5, label %3, label %6
6: ; preds = %3
ret void
}
void foo768(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo768(i32 %0) {
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ fail(char *, char const *, int);
void *scalloc(size_t nmemb, size_t size, const char *file) {
  void *res = calloc(nmemb, size);
  if (!res && nmemb)
    fail("%s: allocation of %d bytes failed\n", file, (int)size * nmemb);
  return res;
}


x86 assembly (clang, -O0):
<scalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1178 <scalloc+0x58>
cmpq   $0x0,-0x8(%rbp)
je     1178 <scalloc+0x58>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rax
cltq
imul   -0x8(%rbp),%rax
mov    %eax,%edx
lea    0xe8d(%rip),%rdi
call   1030 <fail@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalloc>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%rbx
call   1040 <calloc@plt>
mov    %rax,%r15
test   %rbx,%rbx
je     1159 <scalloc+0x39>
test   %r15,%r15
jne    1159 <scalloc+0x39>
imul   %ebx,%r12d
lea    0xeb2(%rip),%rdi
mov    %r14,%rsi
mov    %r12d,%edx
call   1030 <fail@plt>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [35 x i8] c"%s: allocation of %d bytes failed\0A\00"
define i8* @scalloc(i64 %0, i64 %1, i8* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = call i8* @calloc(i64 %8, i64 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = icmp ne i8* %11, null
br i1 %12, label %25, label %13
13: ; preds = %3
%14 = load i64, i64* %4
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %25
16: ; preds = %13
%17 = load i8*, i8** %6
%18 = load i64, i64* %5
%19 = trunc i64 %18 to i32
%20 = sext i32 %19 to i64
%21 = load i64, i64* %4
%22 = mul i64 %20, %21
%23 = trunc i64 %22 to i32
%24 = call i32 @fail(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %17, i32 %23)
br label %25
25: ; preds = %16, %13, %3
%26 = load i8*, i8** %7
ret i8* %26
}

LLVM IR (-O2):
@.str = [35 x i8] c"%s: allocation of %d bytes failed\0A\00"
define noalias i8* @scalloc(i64 %0, i64 %1, i8* %2) {
%4 = tail call i8* @calloc(i64 %0, i64 %1)
%5 = icmp eq i8* %4, null
%6 = icmp ne i64 %0, 0
%7 = and i1 %6, %5
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = shl i64 %1, 32
%10 = ashr exact i64 %9, 32
%11 = mul i64 %10, %0
%12 = trunc i64 %11 to i32
%13 = tail call i32 @fail(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %12)
br label %14
14: ; preds = %8, %3
ret i8* %4
}
int test() {
  int a[10];
  a[1] = 65;
  char s[10];
  s[0] = a[1];
  int b[4] = {1, 3, 5, 12};
  if (b[0] != 1)
    return 1;
  if (b[1] != 3)
    return 1;
  if (b[2] != 5)
    return 1;
  if (b[3] != 12)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x41,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %al,-0x3a(%rbp)
mov    0xee8(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xee5(%rip),%rax
mov    %rax,-0x48(%rbp)
cmpl   $0x1,-0x50(%rbp)
je     113d <test+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1186 <test+0x86>
cmpl   $0x3,-0x4c(%rbp)
je     1153 <test+0x53>
movl   $0x1,-0x4(%rbp)
jmp    1186 <test+0x86>
cmpl   $0x5,-0x48(%rbp)
je     1169 <test+0x69>
movl   $0x1,-0x4(%rbp)
jmp    1186 <test+0x86>
cmpl   $0xc,-0x44(%rbp)
je     117f <test+0x7f>
movl   $0x1,-0x4(%rbp)
jmp    1186 <test+0x86>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.test.b = [4 x i32] [i32 1, i32 3, i32 5, i32 12]
define i32 @test() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca [10 x i8]
%4 = alloca [4 x i32]
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 1
store i32 65, i32* %5
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 1
%7 = load i32, i32* %6
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
store i8 %8, i8* %9
%10 = bitcast [4 x i32]* %4 to i8*
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%12 = load i32, i32* %11
%13 = icmp ne i32 %12, 1
br i1 %13, label %14, label %15
14: ; preds = %0
store i32 1, i32* %1
br label %31
15: ; preds = %0
%16 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 1
%17 = load i32, i32* %16
%18 = icmp ne i32 %17, 3
br i1 %18, label %19, label %20
19: ; preds = %15
store i32 1, i32* %1
br label %31
20: ; preds = %15
%21 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 2
%22 = load i32, i32* %21
%23 = icmp ne i32 %22, 5
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 1, i32* %1
br label %31
25: ; preds = %20
%26 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 3
%27 = load i32, i32* %26
%28 = icmp ne i32 %27, 12
br i1 %28, label %29, label %30
29: ; preds = %25
store i32 1, i32* %1
br label %31
30: ; preds = %25
store i32 0, i32* %1
br label %31
31: ; preds = %30, %29, %24, %19, %14
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
define i32 @test() {
ret i32 0
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int machdep_sys_sendto(int, void const *, int, int, struct sockaddr *,
                       int /*<<< orphan*/);
machdep_sys_send(int s, const void *buf, int len, int flags) {
  return (machdep_sys_sendto(s, buf, len, flags, (struct sockaddr *)NULL, 0));
}


x86 assembly (clang, -O0):
<machdep_sys_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
call   1030 <machdep_sys_sendto@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<machdep_sys_send>:
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <machdep_sys_sendto@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @machdep_sys_send(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @machdep_sys_sendto(i32 %9, i8* %10, i32 %11, i32 %12, %struct.sockaddr* null, i32 0)
ret i32 %13
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @machdep_sys_send(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @machdep_sys_sendto(i32 %0, i8* %1, i32 %2, i32 %3, %struct.sockaddr* null, i32 0)
ret i32 %5
}
int test_imm_80uint32_mem(unsigned int *val) {
  return ((*val) & (0x80 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_80uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 128
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cross_product(double const *, double const *, double *);
double dot_product(double const *, double *);
double scalar_triple(const double *u, const double *v, const double *w) {
  double tmp[3];
  cross_product(w, u, tmp);
  return dot_product(v, tmp);
}


x86 assembly (clang, -O0):
<scalar_triple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1040 <cross_product@plt>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <dot_product@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalar_triple>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rsp,%r14
mov    %rdx,%rdi
mov    %r14,%rdx
call   1040 <cross_product@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <dot_product@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @scalar_triple(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca [3 x double]
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%8 = load double*, double** %6
%9 = load double*, double** %4
%10 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%11 = call i32 @cross_product(double* %8, double* %9, double* %10)
%12 = load double*, double** %5
%13 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%14 = call double @dot_product(double* %12, double* %13)
ret double %14
}

LLVM IR (-O2):
define double @scalar_triple(double* %0, double* %1, double* %2) {
%4 = alloca [3 x double]
%5 = bitcast [3 x double]* %4 to i8*
%6 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%7 = call i32 @cross_product(double* %2, double* %0, double* %6)
%8 = call double @dot_product(double* %1, double* %6)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ __init_main_power();
int /*<<< orphan*/ __init_usb_host();
void systemInitPower(void) {
  __init_main_power();
  __init_usb_host();
}


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

x86 assembly (clang, -O2):
<systemInitPower>:
push   %rax
xor    %eax,%eax
call   1030 <__init_main_power@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <__init_usb_host@plt>

LLVM IR (-O0):
define void @systemInitPower() {
%1 = call i32 (...) @__init_main_power()
%2 = call i32 (...) @__init_usb_host()
ret void
}

LLVM IR (-O2):
define void @systemInitPower() {
%1 = tail call i32 (...) @__init_main_power()
%2 = tail call i32 (...) @__init_usb_host()
ret void
}
/* Variables and functions */
int operacao(int);
int /*<<< orphan*/ printf(char *, int);
int funcao(int x) {
  x += 2;
  int w = operacao(x);
  printf("x = %d", x);
  return w;
}


x86 assembly (clang, -O0):
<funcao>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <operacao@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcao>:
push   %rbp
push   %rbx
push   %rax
lea    0x2(%rdi),%ebx
mov    %ebx,%edi
call   1040 <operacao@plt>
mov    %eax,%ebp
lea    0xeca(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"x = %d\00"
define i32 @funcao(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 2
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @operacao(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@.str = [7 x i8] c"x = %d\00"
define i32 @funcao(i32 %0) {
%2 = add nsw i32 %0, 2
%3 = tail call i32 @operacao(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 %3
}
/* Variables and functions */
int f0_0(void *);
int f0() { return f0_0((void *)0x2); }


x86 assembly (clang, -O0):
<f0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <f0_0@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f0>:
mov    $0x2,%edi
jmp    1030 <f0_0@plt>

LLVM IR (-O0):
define i32 @f0() {
%1 = call i32 @f0_0(i8* inttoptr (i64 2 to i8*))
ret i32 %1
}

LLVM IR (-O2):
define i32 @f0() {
%1 = tail call i32 @f0_0(i8* inttoptr (i64 2 to i8*))
ret i32 %1
}
/* Variables and functions */
unsigned char *cuEnc64WithLines(unsigned char const *, unsigned int,
                                int /*<<< orphan*/, unsigned int *);
unsigned char *cuEnc64(const unsigned char *inbuf, unsigned inlen,
                       unsigned *outlen) {
  return cuEnc64WithLines(inbuf, inlen, 0, outlen);
}


x86 assembly (clang, -O0):
<cuEnc64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
xor    %edx,%edx
call   1030 <cuEnc64WithLines@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cuEnc64>:
mov    %rdx,%rcx
xor    %edx,%edx
jmp    1030 <cuEnc64WithLines@plt>

LLVM IR (-O0):
define i8* @cuEnc64(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i8* @cuEnc64WithLines(i8* %7, i32 %8, i32 0, i32* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @cuEnc64(i8* %0, i32 %1, i32* %2) {
%4 = tail call i8* @cuEnc64WithLines(i8* %0, i32 %1, i32 0, i32* %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void print_credits(void) {
  fprintf(stdout, "AUTHORS / CONTRIBUTORS\n"
                  "  Angus Mackay <amackay@gusnet.cx>\n"
                  "\n");
}


x86 assembly (clang, -O0):
<print_credits>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_credits>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [60 x i8] c"AUTHORS / CONTRIBUTORS\0A Angus Mackay <amackay@gusnet.cx>\0A\0A\00"
define void @print_credits() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [60 x i8] c"AUTHORS / CONTRIBUTORS\0A Angus Mackay <amackay@gusnet.cx>\0A\0A\00"
define void @print_credits() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void string_storage2c(char *s) { printf("%s", s); }


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

x86 assembly (clang, -O2):
<string_storage2c>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @string_storage2c(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
unsigned int RTP_get_timestamp(unsigned char *p) {
  return (((unsigned int)p[4]) << 24) + (((unsigned int)p[5]) << 16) +
         (((unsigned int)p[6]) << 8) + (unsigned int)p[7];
}


x86 assembly (clang, -O0):
<RTP_get_timestamp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x4(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x5(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x6(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x7(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTP_get_timestamp>:
mov    0x4(%rdi),%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @RTP_get_timestamp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 5
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = add i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 6
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = add i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 7
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = add i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @RTP_get_timestamp(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw i32 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 5
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 16
%10 = or i32 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 6
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = or i32 %10, %14
%16 = getelementptr inbounds i8, i8* %0, i64 7
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = or i32 %15, %18
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void unlockcfile(char *filename) { unlink(filename); }


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

x86 assembly (clang, -O2):
<unlockcfile>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define void @unlockcfile(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret void
}
void test28(x) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<test28>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <test28+0x7>

x86 assembly (clang, -O2):
<test28>:
jmp    1100 <test28>

LLVM IR (-O0):
define void @test28(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %3
br label %3
}

LLVM IR (-O2):
define void @test28(i32 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
int test_imm_6Cint16_mem(short *val) {
  return ((*val) & (-0x6C << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_6Cint16_mem>:
movzwl (%rdi),%eax
test   $0xff94,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_6Cint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -108
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int x(int, char *, char *, int, int);
int f(int no, char *pattern_arg, char *str_arg) {
  return x(no, pattern_arg, str_arg, -1, -1);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0xffffffff,%r8d
mov    %r8d,%ecx
call   1030 <x@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    $0xffffffff,%ecx
mov    $0xffffffff,%r8d
jmp    1030 <x@plt>

LLVM IR (-O0):
define i32 @f(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @x(i32 %7, i8* %8, i8* %9, i32 -1, i32 -1)
ret i32 %10
}

LLVM IR (-O2):
define i32 @f(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @x(i32 %0, i8* %1, i8* %2, i32 -1, i32 -1)
ret i32 %4
}
unsigned _longshl(unsigned low, unsigned high, char shift) {
  if (shift == 0)
    return high;
  return (low >> ((2 * (sizeof(unsigned) * 4)) - shift)) | (high << shift);
}


x86 assembly (clang, -O0):
<_longshl>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%eax
cmp    $0x0,%eax
jne    1127 <_longshl+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1149 <_longshl+0x49>
mov    -0x8(%rbp),%eax
movsbq -0xd(%rbp),%rdx
mov    $0x20,%ecx
sub    %rdx,%rcx
shr    %cl,%eax
mov    -0xc(%rbp),%edx
movsbl -0xd(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_longshl>:
mov    %esi,%eax
test   %dl,%dl
je     110b <_longshl+0xb>
mov    %edx,%ecx
shld   %cl,%edi,%eax
ret

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

LLVM IR (-O2):
define i32 @_longshl(i32 %0, i32 %1, i8 signext %2) {
%4 = icmp eq i8 %2, 0
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = sext i8 %2 to i32
%7 = sub nsw i32 32, %6
%8 = lshr i32 %0, %7
%9 = zext i8 %2 to i32
%10 = shl i32 %1, %9
%11 = or i32 %8, %10
br label %12
12: ; preds = %3, %5
%13 = phi i32 [ %11, %5 ], [ %1, %3 ]
ret i32 %13
}
int base64_decode_size(int s) { return (int)((s / 4) * 3); }


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

x86 assembly (clang, -O2):
<base64_decode_size>:
lea    0x3(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x2,%eax
lea    (%rax,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @base64_decode_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 4
%5 = mul nsw i32 %4, 3
ret i32 %5
}

LLVM IR (-O2):
define i32 @base64_decode_size(i32 %0) {
%2 = sdiv i32 %0, 4
%3 = mul nsw i32 %2, 3
ret i32 %3
}
/* Variables and functions */
int puts(char const *);
int ndk_puts(const char *_str) { return puts(_str); }


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

x86 assembly (clang, -O2):
<ndk_puts>:
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
define i32 @ndk_puts(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret i32 %2
}
int elg_pform_num_cpus() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @elg_pform_num_cpus() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ controller_layer_main(int /*<<< orphan*/ *);
void *system_payload(void *data) {
  data = NULL;
  controller_layer_main(NULL);
  return NULL;
}


x86 assembly (clang, -O0):
<system_payload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <controller_layer_main@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @system_payload(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %2
%3 = call i32 @controller_layer_main(i32* null)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @system_payload(i8* nocapture readnone %0) {
%2 = tail call i32 @controller_layer_main(i32* null)
ret i8* null
}
/* Type definitions */
struct evbuffer {
  int dummy;
};

/* Variables and functions */
int decode_int_internal(unsigned long *, struct evbuffer *, int /*<<< orphan*/);
int /*<<< orphan*/ evbuffer_drain(struct evbuffer *, int);
int evtag_decode_int(unsigned long *pnumber, struct evbuffer *evbuf) {
  int res = decode_int_internal(pnumber, evbuf, 0);
  if (res != -1)
    evbuffer_drain(evbuf, res);
  return (res == -1 ? -1 : 0);
}


x86 assembly (clang, -O0):
<evtag_decode_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <decode_int_internal@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1158 <evtag_decode_int+0x38>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <evbuffer_drain@plt>
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0xffffffff,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evtag_decode_int>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
xor    %edx,%edx
call   1030 <decode_int_internal@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
je     113e <evtag_decode_int+0x1e>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <evbuffer_drain@plt>
xor    %eax,%eax
cmp    $0xffffffff,%ebp
sete   %al
neg    %eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.evbuffer = type { i32 }
define i32 @evtag_decode_int(i64* %0, %struct.evbuffer* %1) {
%3 = alloca i64*
%4 = alloca %struct.evbuffer*
%5 = alloca i32
store i64* %0, i64** %3
store %struct.evbuffer* %1, %struct.evbuffer** %4
%6 = load i64*, i64** %3
%7 = load %struct.evbuffer*, %struct.evbuffer** %4
%8 = call i32 @decode_int_internal(i64* %6, %struct.evbuffer* %7, i32 0)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, -1
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load %struct.evbuffer*, %struct.evbuffer** %4
%13 = load i32, i32* %5
%14 = call i32 @evbuffer_drain(%struct.evbuffer* %12, i32 %13)
br label %15
15: ; preds = %11, %2
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, -1
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 -1, i32 0
ret i32 %19
}

LLVM IR (-O2):
%struct.evbuffer = type { i32 }
define i32 @evtag_decode_int(i64* %0, %struct.evbuffer* %1) {
%3 = tail call i32 @decode_int_internal(i64* %0, %struct.evbuffer* %1, i32 0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @evbuffer_drain(%struct.evbuffer* %1, i32 %3)
br label %7
7: ; preds = %5, %2
%8 = sext i1 %4 to i32
ret i32 %8
}
void os_idle_demon(void) {
  for (;;) {
  }
}


x86 assembly (clang, -O0):
<os_idle_demon>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <os_idle_demon+0x9>
jmp    1109 <os_idle_demon+0x9>

x86 assembly (clang, -O2):
<os_idle_demon>:
jmp    1100 <os_idle_demon>

LLVM IR (-O0):
define void @os_idle_demon() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @os_idle_demon() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ openme_callback(char *, void *);
extern void openme_callback_f_(char *event_name, void *params) {
  openme_callback(event_name, params);
}


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

x86 assembly (clang, -O2):
<openme_callback_f_>:
jmp    1030 <openme_callback@plt>

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

LLVM IR (-O2):
define void @openme_callback_f_(i8* %0, i8* %1) {
%3 = tail call i32 @openme_callback(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int omp_get_num_threads();
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int, int);
void bar(void) {
  printf("bar called by %d of %d\n", omp_get_thread_num(),
         omp_get_num_threads());
#pragma omp parallel
  {
    printf("bar parallel reached by %d of %d\n", omp_get_thread_num(),
           omp_get_num_threads());
  }
  return;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    -0x4(%rbp),%esi
mov    %eax,%edx
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <omp_get_num_threads@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <omp_get_num_threads@plt>
lea    0xeb0(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"bar called by %d of %d\0A\00"
@.str.1 = [34 x i8] c"bar parallel reached by %d of %d\0A\00"
define void @bar() {
%1 = call i32 (...) @omp_get_thread_num()
%2 = call i32 (...) @omp_get_num_threads()
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%4 = call i32 (...) @omp_get_thread_num()
%5 = call i32 (...) @omp_get_num_threads()
%6 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"bar called by %d of %d\0A\00"
@.str.1 = [34 x i8] c"bar parallel reached by %d of %d\0A\00"
define void @bar() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i32 (...) @omp_get_num_threads()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%4 = tail call i32 (...) @omp_get_thread_num()
%5 = tail call i32 (...) @omp_get_num_threads()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %5)
ret void
}
char *passthrough(char *a) { return a; }


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

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

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

LLVM IR (-O2):
define i8* @passthrough(i8* readnone returned %0) {
ret i8* %0
}
__attribute__((weak)) int _open(const char *name, int flags, int mode) {
  (void)flags;
  (void)mode;
  return -1;
}


x86 assembly (clang, -O0):
<_open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define weak i32 @_open(i8* %0, i32 %1, i32 %2) {
ret i32 -1
}
unsigned int choice_row_id_i(unsigned int row_i, unsigned int width,
                             unsigned int element_i) {
  return 1 + (row_i * width * 5) + (element_i * 5);
}


x86 assembly (clang, -O0):
<choice_row_id_i>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   $0x5,%eax,%eax
add    $0x1,%eax
imul   $0x5,-0xc(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<choice_row_id_i>:
imul   %esi,%edi
add    %edx,%edi
lea    (%rdi,%rdi,4),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @choice_row_id_i(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 = mul i32 %7, %8
%10 = mul i32 %9, 5
%11 = add i32 1, %10
%12 = load i32, i32* %6
%13 = mul i32 %12, 5
%14 = add i32 %11, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @choice_row_id_i(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %1, %0
%5 = add i32 %4, %2
%6 = mul i32 %5, 5
%7 = add i32 %6, 1
ret i32 %7
}
unsigned xrop3_43_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk2 = S ^ T;
  stk3 = T ^ D;
  stk2 = stk2 & stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


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

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

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

LLVM IR (-O2):
define i32 @xrop3_43_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, %4
%8 = xor i32 %6, 255
%9 = and i32 %7, %8
%10 = xor i32 %4, %9
%11 = xor i32 %10, -1
ret i32 %11
}
/* Variables and functions */
#define KEY_DOWN 131
#define KEY_LEFT 130
#define KEY_RIGHT 129
#define KEY_UP 128
int getch();
int pega_input() {
  switch (getch()) {
  case KEY_LEFT:
    return 0;
    break;
  case KEY_RIGHT:
    return 1;
    break;
  case KEY_DOWN:
    return 2;
    break;
  case KEY_UP:
    return 3;
    break;
  case 'q':
    return 4;
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<pega_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <getch@plt>
add    $0xffffff8f,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x12,%eax
ja     1181 <pega_input+0x71>
mov    -0x10(%rbp),%rax
lea    0xec4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    1186 <pega_input+0x76>
movl   $0x1,-0x4(%rbp)
jmp    1186 <pega_input+0x76>
movl   $0x2,-0x4(%rbp)
jmp    1186 <pega_input+0x76>
movl   $0x3,-0x4(%rbp)
jmp    1186 <pega_input+0x76>
movl   $0x4,-0x4(%rbp)
jmp    1186 <pega_input+0x76>
jmp    1186 <pega_input+0x76>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pega_input>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getch@plt>
add    $0xffffff8f,%eax
cmp    $0x12,%eax
ja     114c <pega_input+0x3c>
lea    0xed7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x4,%ebx
jmp    114c <pega_input+0x3c>
mov    $0x3,%ebx
jmp    114c <pega_input+0x3c>
mov    $0x1,%ebx
jmp    114c <pega_input+0x3c>
mov    $0x2,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @pega_input() {
%1 = alloca i32
%2 = call i32 (...) @getch()
switch i32 %2, label %8 [
i32 130, label %3
i32 129, label %4
i32 131, label %5
i32 128, label %6
i32 113, label %7
]
3: ; preds = %0
store i32 0, i32* %1
br label %9
4: ; preds = %0
store i32 1, i32* %1
br label %9
5: ; preds = %0
store i32 2, i32* %1
br label %9
6: ; preds = %0
store i32 3, i32* %1
br label %9
7: ; preds = %0
store i32 4, i32* %1
br label %9
8: ; preds = %0
br label %9
9: ; preds = %3, %4, %5, %6, %7, %8
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @pega_input() {
%1 = tail call i32 (...) @getch()
switch i32 %1, label %6 [
i32 113, label %5
i32 129, label %2
i32 131, label %3
i32 128, label %4
]
2: ; preds = %0
br label %6
3: ; preds = %0
br label %6
4: ; preds = %0
br label %6
5: ; preds = %0
br label %6
6: ; preds = %0, %2, %3, %4, %5
%7 = phi i32 [ 4, %5 ], [ 3, %4 ], [ 2, %3 ], [ 1, %2 ], [ 0, %0 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ *__m128;

/* Variables and functions */
__m128 __attribute__((__always___, __nodebug__))
_mm_div_ss(__m128 a, __m128 b) {
  a[0] /= b[0];
  return a;
}


x86 assembly (clang, -O0):
<_mm_div_ss>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    (%rax),%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mm_div_ss>:
mov    (%rdi),%eax
cltd
idivl  (%rsi)
mov    %eax,(%rdi)
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i32* @_mm_div_ss(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = sdiv i32 %10, %7
store i32 %11, i32* %9
%12 = load i32*, i32** %3
ret i32* %12
}

LLVM IR (-O2):
define i32* @_mm_div_ss(i32* returned %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
%5 = sdiv i32 %4, %3
store i32 %5, i32* %0
ret i32* %0
}