xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ rintf(float);
int interpNN_b(unsigned char *sl, int w, int h, float x, float y, float o,
               unsigned char *v) {
  *v = sl[(int)rintf(x) + (int)rintf(y) * w];
  return 0;
}


x86 assembly (clang, -O0):
<interpNN_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  %xmm1,-0x18(%rbp)
movss  %xmm2,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
movss  -0x14(%rbp),%xmm0
call   1030 <rintf@plt>
mov    %eax,-0x34(%rbp)
movss  -0x18(%rbp),%xmm0
call   1030 <rintf@plt>
mov    -0x34(%rbp),%ecx
mov    %rax,%rdx
mov    -0x30(%rbp),%rax
imul   -0xc(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x28(%rbp),%rax
mov    %cl,(%rax)
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpNN_b>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
movss  %xmm1,0x4(%rsp)
mov    %esi,%ebp
mov    %rdi,%r15
call   1030 <rintf@plt>
mov    %rax,%rbx
movss  0x4(%rsp),%xmm0
call   1030 <rintf@plt>
imul   %ebp,%eax
add    %ebx,%eax
cltq
mov    (%r15,%rax,1),%al
mov    %al,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @interpNN_b(i8* %0, i32 %1, i32 %2, float %3, float %4, float %5, i8* %6) {
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca i8*
store i8* %0, i8** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store float %3, float* %11
store float %4, float* %12
store float %5, float* %13
store i8* %6, i8** %14
%15 = load i8*, i8** %8
%16 = load float, float* %11
%17 = call i64 @rintf(float %16)
%18 = trunc i64 %17 to i32
%19 = load float, float* %12
%20 = call i64 @rintf(float %19)
%21 = trunc i64 %20 to i32
%22 = load i32, i32* %9
%23 = mul nsw i32 %21, %22
%24 = add nsw i32 %18, %23
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %15, i64 %25
%27 = load i8, i8* %26
%28 = load i8*, i8** %14
store i8 %27, i8* %28
ret i32 0
}

LLVM IR (-O2):
define i32 @interpNN_b(i8* nocapture %0, i32 %1, i32 %2, float %3, float %4, float %5, i8* nocapture writeonly %6) {
%8 = tail call i64 @rintf(float %3)
%9 = trunc i64 %8 to i32
%10 = tail call i64 @rintf(float %4)
%11 = trunc i64 %10 to i32
%12 = mul nsw i32 %11, %1
%13 = add nsw i32 %12, %9
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
store i8 %16, i8* %6
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
unsigned char pluscccb(unsigned char a, unsigned char b) {
  unsigned char sum = a + b;
  if (sum < b)
    abort();
  return sum;
}


x86 assembly (clang, -O0):
<pluscccb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
add    %ecx,%eax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
movzbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jge    1148 <pluscccb+0x38>
mov    $0x0,%al
call   1030 <abort@plt>
movzbl -0x3(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pluscccb>:
add    %dil,%sil
jb     1118 <pluscccb+0x8>
mov    %esi,%eax
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define zeroext i8 @pluscccb(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = add nsw i32 %7, %9
%11 = trunc i32 %10 to i8
store i8 %11, i8* %5
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = load i8, i8* %4
%15 = zext i8 %14 to i32
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @abort()
unreachable
19: ; preds = %2
%20 = load i8, i8* %5
ret i8 %20
}

LLVM IR (-O2):
define zeroext i8 @pluscccb(i8 zeroext %0, i8 zeroext %1) {
%3 = add i8 %1, %0
%4 = icmp ult i8 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ insertion_sort(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strlen(char *);
int main(int argc, char const *argv[]) {
  char c[] = "mighty cohadar";
  insertion_sort(c, strlen(c));
  printf("%s\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeb3(%rip),%rax
mov    %rax,-0x1f(%rbp)
mov    0xeb1(%rip),%eax
mov    %eax,-0x17(%rbp)
mov    0xeab(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xea3(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x1f(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x1f(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1050 <insertion_sort@plt>
lea    -0x1f(%rbp),%rsi
lea    0xe7a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x72616461686f63,%rax
mov    %rax,0x7(%rsp)
movabs $0x632079746867696d,%rax
79 20 63
mov    %rax,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <insertion_sort@plt>
lea    0xea1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.c = [15 x i8] c"mighty cohadar\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [15 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [15 x i8]* %6 to i8*
%8 = getelementptr inbounds [15 x i8], [15 x i8]* %6, i64 0, i64 0
%9 = getelementptr inbounds [15 x i8], [15 x i8]* %6, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @insertion_sort(i8* %8, i32 %10)
%12 = getelementptr inbounds [15 x i8], [15 x i8]* %6, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.c = [15 x i8] c"mighty cohadar\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [15 x i8]
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 0
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @insertion_sort(i8* %4, i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
size_t fmt_strlen(const char *str) {
  const char *tmp = str;
  while (*tmp) {
    tmp++;
  }
  return (tmp - str);
}


x86 assembly (clang, -O0):
<fmt_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <fmt_strlen+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <fmt_strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmt_strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <fmt_strlen+0x10>
ret

LLVM IR (-O0):
define i64 @fmt_strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %9, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
br label %5
12: ; preds = %5
%13 = load i8*, i8** %3
%14 = load i8*, i8** %2
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @fmt_strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
int main() {
  long int y;
  long int *p;
  y = (long int)&y;
  p = (long int *)y;
  *p = 0;
  return (int)y;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64*
store i32 0, i32* %1
%4 = ptrtoint i64* %2 to i64
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = inttoptr i64 %5 to i64*
store i64* %6, i64** %3
%7 = load i64*, i64** %3
store i64 0, i64* %7
%8 = load i64, i64* %2
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
double nlopt_seconds();
int nlopt_stop_time_(double start, double maxtime) {
  return (maxtime > 0 && nlopt_seconds() - start >= maxtime);
}


x86 assembly (clang, -O0):
<nlopt_stop_time_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
jbe    1150 <nlopt_stop_time_+0x40>
mov    $0x0,%al
call   1030 <nlopt_seconds@plt>
subsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nlopt_stop_time_>:
xor    %eax,%eax
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jbe    1148 <nlopt_stop_time_+0x38>
sub    $0x18,%rsp
xor    %eax,%eax
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1030 <nlopt_seconds@plt>
subsd  0x8(%rsp),%xmm0
xor    %eax,%eax
ucomisd 0x10(%rsp),%xmm0
setae  %al
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @nlopt_stop_time_(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fcmp ogt double %5, 0.000000e+00
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = call double (...) @nlopt_seconds()
%9 = load double, double* %3
%10 = fsub double %8, %9
%11 = load double, double* %4
%12 = fcmp oge double %10, %11
br label %13
13: ; preds = %7, %2
%14 = phi i1 [ false, %2 ], [ %12, %7 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @nlopt_stop_time_(double %0, double %1) {
%3 = fcmp ogt double %1, 0.000000e+00
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = tail call double (...) @nlopt_seconds()
%6 = fsub double %5, %0
%7 = fcmp oge double %6, %1
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %2
%10 = phi i32 [ 0, %2 ], [ %8, %4 ]
ret i32 %10
}
int main() {
  int i;
  i = 0;
  while (i < 100) {
    i = i + 1;
    i = i - 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1133 <main+0x33>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 100
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
/* Type definitions */
struct katcp_dispatch {
  int dummy;
};

/* Variables and functions */
int run_client_katcp(struct katcp_dispatch *, char *, int);
int run_server_katcp(struct katcp_dispatch *, char *, int);
int run_katcp(struct katcp_dispatch *d, int server, char *host, int port) {
  if (server == 0) {
    return run_client_katcp(d, host, port);
  } else {
    return run_server_katcp(d, host, port);
  }
}


x86 assembly (clang, -O0):
<run_katcp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1158 <run_katcp+0x38>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1040 <run_client_katcp@plt>
mov    %eax,-0x4(%rbp)
jmp    116b <run_katcp+0x4b>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1030 <run_server_katcp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_katcp>:
test   %esi,%esi
je     112e <run_katcp+0xe>
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <run_server_katcp@plt>
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1040 <run_client_katcp@plt>

LLVM IR (-O0):
%struct.katcp_dispatch = type { i32 }
define i32 @run_katcp(%struct.katcp_dispatch* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.katcp_dispatch*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
store %struct.katcp_dispatch* %0, %struct.katcp_dispatch** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
%10 = load i32, i32* %7
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %4
%13 = load %struct.katcp_dispatch*, %struct.katcp_dispatch** %6
%14 = load i8*, i8** %8
%15 = load i32, i32* %9
%16 = call i32 @run_client_katcp(%struct.katcp_dispatch* %13, i8* %14, i32 %15)
store i32 %16, i32* %5
br label %22
17: ; preds = %4
%18 = load %struct.katcp_dispatch*, %struct.katcp_dispatch** %6
%19 = load i8*, i8** %8
%20 = load i32, i32* %9
%21 = call i32 @run_server_katcp(%struct.katcp_dispatch* %18, i8* %19, i32 %20)
store i32 %21, i32* %5
br label %22
22: ; preds = %17, %12
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
%struct.katcp_dispatch = type { i32 }
define i32 @run_katcp(%struct.katcp_dispatch* %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %1, 0
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @run_client_katcp(%struct.katcp_dispatch* %0, i8* %2, i32 %3)
br label %10
8: ; preds = %4
%9 = tail call i32 @run_server_katcp(%struct.katcp_dispatch* %0, i8* %2, i32 %3)
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ terminal_writestring(char *);
int print1() {
  terminal_writestring("1\n");
  return 1;
}


x86 assembly (clang, -O0):
<print1>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <terminal_writestring@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<print1>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <terminal_writestring@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"1\0A\00"
define i32 @print1() {
%1 = call i32 @terminal_writestring(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [3 x i8] c"1\0A\00"
define i32 @print1() {
%1 = tail call i32 @terminal_writestring(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ core2_print(char *, char const *);
void U_EMRPOLYPOLYGON_print(const char *contents) {
  core2_print("U_EMRPOLYPOLYGON", contents);
}


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

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"U_EMRPOLYPOLYGON\00"
define void @U_EMRPOLYPOLYGON_print(i8* %0) {
%2 = tail call i32 @core2_print(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int log(int);
double uniform_distribution(int /*<<< orphan*/, int);
double exponential_distribution(double lambda) {
  double temp = uniform_distribution(0, 1);
  return log(1 - temp) * (-1 / lambda);
}


x86 assembly (clang, -O0):
<exponential_distribution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <uniform_distribution@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xec2(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <log@plt>
cvtsi2sd %eax,%xmm0
movsd  0xea0(%rip),%xmm1
divsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exponential_distribution>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <uniform_distribution@plt>
movsd  0xec6(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1040 <log@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xeb2(%rip),%xmm0
divsd  (%rsp),%xmm0
mulsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @exponential_distribution(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = call double @uniform_distribution(i32 0, i32 1)
store double %4, double* %3
%5 = load double, double* %3
%6 = fsub double 1.000000e+00, %5
%7 = fptosi double %6 to i32
%8 = call i32 @log(i32 %7)
%9 = sitofp i32 %8 to double
%10 = load double, double* %2
%11 = fdiv double -1.000000e+00, %10
%12 = fmul double %9, %11
ret double %12
}

LLVM IR (-O2):
define double @exponential_distribution(double %0) {
%2 = tail call double @uniform_distribution(i32 0, i32 1)
%3 = fsub double 1.000000e+00, %2
%4 = fptosi double %3 to i32
%5 = tail call i32 @log(i32 %4)
%6 = sitofp i32 %5 to double
%7 = fdiv double -1.000000e+00, %0
%8 = fmul double %7, %6
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ glDisableClientState(int /*<<< orphan*/);
void DisableClientState(GLenum cap) { glDisableClientState(cap); }


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

x86 assembly (clang, -O2):
<DisableClientState>:
jmp    1030 <glDisableClientState@plt>

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

LLVM IR (-O2):
define void @DisableClientState(i32 %0) {
%2 = tail call i32 @glDisableClientState(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void debugger_on() { outb(0xfedc, 0x01); }


x86 assembly (clang, -O0):
<debugger_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfedc,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<debugger_on>:
mov    $0xfedc,%edi
mov    $0x1,%esi
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @debugger_on() {
%1 = call i32 @outb(i32 65244, i32 1)
ret void
}

LLVM IR (-O2):
define void @debugger_on() {
%1 = tail call i32 @outb(i32 65244, i32 1)
ret void
}
unsigned long __fls(unsigned long word) {
  __asm__("bsrq %1,%0" : "=r"(word) : "rm"(word));
  return word;
}


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

x86 assembly (clang, -O2):
<__fls>:
mov    %rdi,-0x8(%rsp)
bsr    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @__fls(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 asm "bsrq $1,$0", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i64 %3)
store i64 %4, i64* %2
%5 = load i64, i64* %2
ret i64 %5
}

LLVM IR (-O2):
define i64 @__fls(i64 %0) {
%2 = tail call i64 asm "bsrq $1,$0", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret i64 %2
}
int cairo_code_draw_casWLabel_get_width() { return 9; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casWLabel_get_width() {
ret i32 9
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casWLabel_get_width() {
ret i32 9
}
int iscleft(char c) { return '(' == c; }


x86 assembly (clang, -O0):
<iscleft>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x28,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscleft>:
xor    %eax,%eax
cmp    $0x28,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @iscleft(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 40, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @iscleft(i8 signext %0) {
%2 = icmp eq i8 %0, 40
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void set_pmu_sleep_radio(void) {
  mbus_remote_register_write(0x8, 0x15,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (0 << 13) | (10 << 9) | (5 << 5) | (5)));
  delay(200);
  mbus_remote_register_write(0x8, 0x15,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (0 << 13) | (10 << 9) | (5 << 5) | (5)));
  delay(200);
  mbus_remote_register_write(
      0x8, 0x17, ((3 << 14) | (0 << 13) | (2 << 9) | (2 << 5) | (5)));
  delay(200);
}


x86 assembly (clang, -O0):
<set_pmu_sleep_radio>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
mov    $0x15,%esi
mov    $0xd4a5,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1030 <delay@plt>
mov    $0x8,%edi
mov    $0x15,%esi
mov    $0xd4a5,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1030 <delay@plt>
mov    $0x8,%edi
mov    $0x17,%esi
mov    $0xc445,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pmu_sleep_radio>:
push   %rax
mov    $0x8,%edi
mov    $0x15,%esi
mov    $0xd4a5,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1030 <delay@plt>
mov    $0x8,%edi
mov    $0x15,%esi
mov    $0xd4a5,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1030 <delay@plt>
mov    $0x8,%edi
mov    $0x17,%esi
mov    $0xc445,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @set_pmu_sleep_radio() {
%1 = call i32 @mbus_remote_register_write(i32 8, i32 21, i32 54437)
%2 = call i32 @delay(i32 200)
%3 = call i32 @mbus_remote_register_write(i32 8, i32 21, i32 54437)
%4 = call i32 @delay(i32 200)
%5 = call i32 @mbus_remote_register_write(i32 8, i32 23, i32 50245)
%6 = call i32 @delay(i32 200)
ret void
}

LLVM IR (-O2):
define void @set_pmu_sleep_radio() {
%1 = tail call i32 @mbus_remote_register_write(i32 8, i32 21, i32 54437)
%2 = tail call i32 @delay(i32 200)
%3 = tail call i32 @mbus_remote_register_write(i32 8, i32 21, i32 54437)
%4 = tail call i32 @delay(i32 200)
%5 = tail call i32 @mbus_remote_register_write(i32 8, i32 23, i32 50245)
%6 = tail call i32 @delay(i32 200)
ret void
}
char foo(long unsigned int n) {
  char c[1][n];
  return c[0][0];
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
mov    %rcx,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
imul   $0x0,%rcx,%rcx
mov    (%rax,%rcx,1),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
movsbl %al,%eax
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @foo(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = call i8* @llvm.stacksave()
store i8* %6, i8** %3
%7 = mul nuw i64 1, %5
%8 = alloca i8, i64 %7
store i64 %5, i64* %4
%9 = mul nsw i64 0, %5
%10 = getelementptr inbounds i8, i8* %8, i64 %9
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = load i8*, i8** %3
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @foo(i64 %0) {
ret i8 undef
}
int main() {
  if (1 + 2 + 3 != 6)
    return 1;
  return 0 + 0 + 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int _p11_hash_direct_equal(const void *ptr_one, const void *ptr_two) {
  return ptr_one == ptr_two;
}


x86 assembly (clang, -O0):
<_p11_hash_direct_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_p11_hash_direct_equal>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @_p11_hash_direct_equal(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 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @_p11_hash_direct_equal(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned char rotate_right(unsigned char data, unsigned char bits) {
  return data >> bits | data << (sizeof(data) * 8 - bits);
}


x86 assembly (clang, -O0):
<rotate_right>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
sar    %cl,%eax
movzbl -0x1(%rbp),%edx
movzbl -0x2(%rbp),%ecx
mov    %ecx,%esi
mov    $0x8,%ecx
sub    %rsi,%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate_right>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @rotate_right(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = ashr i32 %6, %8
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = load i8, i8* %4
%13 = zext i8 %12 to i64
%14 = sub i64 8, %13
%15 = trunc i64 %14 to i32
%16 = shl i32 %11, %15
%17 = or i32 %9, %16
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @rotate_right(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i8 @llvm.fshr.i8(i8 %0, i8 %0, i8 %1)
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ putc(char);
void puts(const char *s) {
  while (*s)
    putc(*s++);
  putc('\r');
  putc('\n');
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <puts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putc@plt>
jmp    111c <puts+0xc>
mov    $0xd,%edi
call   1030 <putc@plt>
mov    $0xa,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
mov    $0xd,%edi
call   1030 <putc@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putc@plt>

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

LLVM IR (-O2):
define void @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @putc(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = tail call i32 @putc(i8 signext 13)
%13 = tail call i32 @putc(i8 signext 10)
ret void
}
/* Variables and functions */
scalar_t__ GLeeInit();
int /*<<< orphan*/ pglFinishTextureSUNX();
void _Lazy_glFinishTextureSUNX(void) {
  if (GLeeInit())
    pglFinishTextureSUNX();
}


x86 assembly (clang, -O0):
<_Lazy_glFinishTextureSUNX>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <GLeeInit@plt>
cmp    $0x0,%rax
je     113c <_Lazy_glFinishTextureSUNX+0x1c>
mov    $0x0,%al
call   1040 <pglFinishTextureSUNX@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Lazy_glFinishTextureSUNX>:
push   %rax
xor    %eax,%eax
call   1030 <GLeeInit@plt>
test   %rax,%rax
je     1135 <_Lazy_glFinishTextureSUNX+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <pglFinishTextureSUNX@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @_Lazy_glFinishTextureSUNX() {
%1 = call i64 (...) @GLeeInit()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @pglFinishTextureSUNX()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @_Lazy_glFinishTextureSUNX() {
%1 = tail call i64 (...) @GLeeInit()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @pglFinishTextureSUNX()
br label %5
5: ; preds = %3, %0
ret void
}
int _pow(int m, int n) {
  int sum = 1;
  while (n != 0) {
    sum *= m;
    n--;
  }
}


x86 assembly (clang, -O0):
<_pow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1133 <_pow+0x33>
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <_pow+0x11>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_pow(i32 %0, i32 %1) {
ret i32 undef
}
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1138 <gcd+0x28>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <gcd+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,%rsi
call   1030 <gcd@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1135 <gcd+0x35>
mov    %rsi,%rdx
jmp    111d <gcd+0x1d>
nopl   (%rax)
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <gcd+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <gcd+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <gcd+0x15>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @gcd(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i64, i64* %3
br label %15
9: ; preds = %2
%10 = load i64, i64* %4
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = srem i64 %11, %12
%14 = call i64 @gcd(i64 %10, i64 %13)
br label %15
15: ; preds = %9, %7
%16 = phi i64 [ %8, %7 ], [ %14, %9 ]
ret i64 %16
}

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %1, %2 ]
%6 = phi i64 [ %5, %4 ], [ %0, %2 ]
%7 = srem i64 %6, %5
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i64 [ %0, %2 ], [ %5, %4 ]
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void baz_command() {
  printf("baz"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [4 x i8] c"baz\00"
define void @baz_command() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET6;
int /*<<< orphan*/ IPPROTO_UDP;
int /*<<< orphan*/ SOCK_DGRAM;
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int coap_net_udp_create() {
  int netd;
  if ((netd = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
    return -1;
  }
  return netd;
}


x86 assembly (clang, -O0):
<coap_net_udp_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
call   1030 <socket@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    1150 <coap_net_udp_create+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <coap_net_udp_create+0x46>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coap_net_udp_create>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    0x2ec7(%rip),%rax
mov    (%rax),%esi
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
call   1030 <socket@plt>
test   %eax,%eax
mov    $0xffffffff,%ecx
cmovs  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@AF_INET6 = global i32 0
@SOCK_DGRAM = global i32 0
@IPPROTO_UDP = global i32 0
define i32 @coap_net_udp_create() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @AF_INET6
%4 = load i32, i32* @SOCK_DGRAM
%5 = load i32, i32* @IPPROTO_UDP
%6 = call i32 @socket(i32 %3, i32 %4, i32 %5)
store i32 %6, i32* %2
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 -1, i32* %1
br label %11
9: ; preds = %0
%10 = load i32, i32* %2
store i32 %10, i32* %1
br label %11
11: ; preds = %9, %8
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@AF_INET6 = global i32 0
@SOCK_DGRAM = global i32 0
@IPPROTO_UDP = global i32 0
define i32 @coap_net_udp_create() {
%1 = load i32, i32* @AF_INET6
%2 = load i32, i32* @SOCK_DGRAM
%3 = load i32, i32* @IPPROTO_UDP
%4 = tail call i32 @socket(i32 %1, i32 %2, i32 %3)
%5 = icmp sgt i32 %4, -1
%6 = select i1 %5, i32 %4, i32 -1
ret i32 %6
}
/* Variables and functions */
int spawn(int, char **);
int main(int argc, char *argv[]) {
  argv[0] = "/usr/bin/finger";
  return (spawn(argc, argv));
}


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    -0x10(%rbp),%rax
lea    0xecf(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <spawn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rax
mov    %rax,(%rsi)
jmp    1030 <spawn@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"/usr/bin/finger\00"
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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %7
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call i32 @spawn(i32 %8, i8** %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [16 x i8] c"/usr/bin/finger\00"
define i32 @main(i32 %0, i8** %1) {
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = tail call i32 @spawn(i32 %0, i8** %1)
ret i32 %3
}
int test_imm_9Bint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x9B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_9Bint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 10158080
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ FeedCDDA(unsigned char *, int);
void SPUplayCDDAchannel(short *pcm, int nbytes) {
  if (!pcm)
    return;
  if (nbytes <= 0)
    return;
  FeedCDDA((unsigned char *)pcm, nbytes);
}


x86 assembly (clang, -O0):
<SPUplayCDDAchannel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112f <SPUplayCDDAchannel+0x1f>
jmp    114a <SPUplayCDDAchannel+0x3a>
cmpl   $0x0,-0xc(%rbp)
jg     113e <SPUplayCDDAchannel+0x2e>
jmp    114a <SPUplayCDDAchannel+0x3a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <FeedCDDA@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPUplayCDDAchannel>:
test   %rdi,%rdi
je     111e <SPUplayCDDAchannel+0xe>
test   %esi,%esi
jle    111e <SPUplayCDDAchannel+0xe>
jmp    1030 <FeedCDDA@plt>
ret

LLVM IR (-O0):
define void @SPUplayCDDAchannel(i16* %0, i32 %1) {
%3 = alloca i16*
%4 = alloca i32
store i16* %0, i16** %3
store i32 %1, i32* %4
%5 = load i16*, i16** %3
%6 = icmp ne i16* %5, null
br i1 %6, label %8, label %7
7: ; preds = %2
br label %17
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp sle i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
br label %17
12: ; preds = %8
%13 = load i16*, i16** %3
%14 = bitcast i16* %13 to i8*
%15 = load i32, i32* %4
%16 = call i32 @FeedCDDA(i8* %14, i32 %15)
br label %17
17: ; preds = %12, %11, %7
ret void
}

LLVM IR (-O2):
define void @SPUplayCDDAchannel(i16* %0, i32 %1) {
%3 = icmp eq i16* %0, null
%4 = icmp slt i32 %1, 1
%5 = or i1 %3, %4
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = bitcast i16* %0 to i8*
%8 = tail call i32 @FeedCDDA(i8* %7, i32 %1)
br label %9
9: ; preds = %2, %6
ret void
}
void _timer_int_handler() { (*((char *)(0xB8000 + 79 * 2)))++; }


x86 assembly (clang, -O0):
<_timer_int_handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb809e,%eax
mov    (%rax),%cl
add    $0x1,%cl
mov    $0xb809e,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_timer_int_handler>:
addb   $0x1,0xb809e
01
ret

LLVM IR (-O0):
define void @_timer_int_handler() {
%1 = load i8, i8* inttoptr (i64 753822 to i8*)
%2 = add i8 %1, 1
store i8 %2, i8* inttoptr (i64 753822 to i8*)
ret void
}

LLVM IR (-O2):
define void @_timer_int_handler() {
%1 = load i8, i8* inttoptr (i64 753822 to i8*)
%2 = add i8 %1, 1
store i8 %2, i8* inttoptr (i64 753822 to i8*)
ret void
}
/* Type definitions */
typedef void *locale_t;

/* Variables and functions */
locale_t newlocale(int mask, const char *locale, locale_t base) {
  return (void *)0xdeadbeef;
}


x86 assembly (clang, -O0):
<newlocale>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xdeadbeef,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @newlocale(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
ret i8* inttoptr (i64 3735928559 to i8*)
}

LLVM IR (-O2):
define i8* @newlocale(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i8* inttoptr (i64 3735928559 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ subfn(int *);
int free_local() {
  volatile int x = 12;
  subfn((int *)&x);
  return 1;
}


x86 assembly (clang, -O0):
<free_local>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <subfn@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_local>:
push   %rax
movl   $0xc,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <subfn@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @free_local() {
%1 = alloca i32
store volatile i32 12, i32* %1
%2 = call i32 @subfn(i32* %1)
ret i32 1
}

LLVM IR (-O2):
define i32 @free_local() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 12, i32* %1
%3 = call i32 @subfn(i32* %1)
ret i32 1
}
void __DELETE_org_apache_harmony_luni_util_NumberConverter(void *me,
                                                           void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_org_apache_harmony_luni_util_NumberConverter(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_usage(char *fn) {
  printf(" WPA-PSK Key Cracker for Xeon phi\n\n");
  printf(" usage : %s [hashcat file]\n", fn);
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c" WPA-PSK Key Cracker for Xeon phi\0A\0A\00"
@.str.1 = [28 x i8] c" usage : %s [hashcat file]\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str.1 = [28 x i8] c" usage : %s [hashcat file]\0A\00"
@str = [35 x i8] c" WPA-PSK Key Cracker for Xeon phi\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void h265hvcc_set_constant_frame_rate(uint8_t *p, uint8_t val) {
  p[20] &= ~0xc0;
  p[20] |= val << 6;
}


x86 assembly (clang, -O0):
<h265hvcc_set_constant_frame_rate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x50(%rax),%ecx
and    $0xffffff3f,%ecx
mov    %ecx,0x50(%rax)
mov    -0xc(%rbp),%ecx
shl    $0x6,%ecx
mov    -0x8(%rbp),%rax
or     0x50(%rax),%ecx
mov    %ecx,0x50(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265hvcc_set_constant_frame_rate>:
mov    $0xffffff3f,%eax
and    0x50(%rdi),%eax
shl    $0x6,%esi
or     %eax,%esi
mov    %esi,0x50(%rdi)
ret

LLVM IR (-O0):
define void @h265hvcc_set_constant_frame_rate(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 = getelementptr inbounds i32, i32* %5, i64 20
%7 = load i32, i32* %6
%8 = and i32 %7, -193
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = shl i32 %9, 6
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 20
%13 = load i32, i32* %12
%14 = or i32 %13, %10
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @h265hvcc_set_constant_frame_rate(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 20
%4 = load i32, i32* %3
%5 = and i32 %4, -193
%6 = shl i32 %1, 6
%7 = or i32 %5, %6
store i32 %7, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int tempFunction(int a, int b) {
  printf("tempFunction is called, a = %d, b = %d \n", a, b);
  return (a + b);
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"tempFunction is called, a = %d, b = %d \0A\00"
define i32 @tempFunction(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 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
@.str = [41 x i8] c"tempFunction is called, a = %d, b = %d \0A\00"
define i32 @tempFunction(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = add nsw i32 %1, %0
ret i32 %4
}