xunge/DecIR huggingface dataset:
char *rm_first_spaces(char *ptr) {
  while (*ptr == ' ' || *ptr == '\t') {
    ptr++;
  }
  return (ptr);
}


x86 assembly (clang, -O0):
<rm_first_spaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     112d <rm_first_spaces+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <rm_first_spaces+0x3d>
jmp    114e <rm_first_spaces+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <rm_first_spaces+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rm_first_spaces>:
mov    %rdi,%rax
jmp    1114 <rm_first_spaces+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <rm_first_spaces+0x10>
cmp    $0x9,%cl
je     1110 <rm_first_spaces+0x10>
ret

LLVM IR (-O0):
define i8* @rm_first_spaces(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
%7 = icmp eq i32 %6, 32
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 9
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ true, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @rm_first_spaces(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int kevent_add_del_socket(int, int /*<<< orphan*/);
int kevent_add_socket(int socket) { return kevent_add_del_socket(socket, 0); }


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

x86 assembly (clang, -O2):
<kevent_add_socket>:
xor    %esi,%esi
jmp    1030 <kevent_add_del_socket@plt>

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

LLVM IR (-O2):
define i32 @kevent_add_socket(i32 %0) {
%2 = tail call i32 @kevent_add_del_socket(i32 %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ElSuiteSparse_tic(double *);
double ElSuiteSparse_time(void) {
  double toc[2];
  ElSuiteSparse_tic(toc);
  return (toc[0] + 1e-9 * toc[1]);
}


x86 assembly (clang, -O0):
<ElSuiteSparse_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
call   1030 <ElSuiteSparse_tic@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xecd(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ElSuiteSparse_time>:
sub    $0x18,%rsp
mov    %rsp,%rdi
call   1030 <ElSuiteSparse_tic@plt>
movsd  0x8(%rsp),%xmm0
mulsd  0xed6(%rip),%xmm0
addsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @ElSuiteSparse_time() {
%1 = alloca [2 x double]
%2 = getelementptr inbounds [2 x double], [2 x double]* %1, i64 0, i64 0
%3 = call i32 @ElSuiteSparse_tic(double* %2)
%4 = getelementptr inbounds [2 x double], [2 x double]* %1, i64 0, i64 0
%5 = load double, double* %4
%6 = getelementptr inbounds [2 x double], [2 x double]* %1, i64 0, i64 1
%7 = load double, double* %6
%8 = call double @llvm.fmuladd.f64(double 1.000000e-09, double %7, double %5)
ret double %8
}

LLVM IR (-O2):
define double @ElSuiteSparse_time() {
%1 = alloca [2 x double]
%2 = bitcast [2 x double]* %1 to i8*
%3 = getelementptr inbounds [2 x double], [2 x double]* %1, i64 0, i64 0
%4 = call i32 @ElSuiteSparse_tic(double* %3)
%5 = load double, double* %3
%6 = getelementptr inbounds [2 x double], [2 x double]* %1, i64 0, i64 1
%7 = load double, double* %6
%8 = call double @llvm.fmuladd.f64(double %7, double 1.000000e-09, double %5)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ __print_int(int);
int main() {
  int i, j;
  int a;
  int b;
  int c;
  int d = 4;
  for (i = 0; i < 5; i++) {
    for (j = 0; j < 5; j++) {
      a = 5 * d;
      b = i * 5;
      c = i * j;
    }
  }
  __print_int(a);
  __print_int(b);
  __print_int(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x1c(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1181 <main+0x71>
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    116e <main+0x5e>
imul   $0x5,-0x1c(%rbp),%eax
mov    %eax,-0x10(%rbp)
imul   $0x5,-0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113e <main+0x2e>
jmp    1173 <main+0x63>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0x10(%rbp),%edi
call   1030 <__print_int@plt>
mov    -0x14(%rbp),%edi
call   1030 <__print_int@plt>
mov    -0x18(%rbp),%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x14,%edi
call   1030 <__print_int@plt>
mov    $0x14,%edi
call   1030 <__print_int@plt>
mov    $0x10,%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_int(i32 20)
%2 = tail call i32 @__print_int(i32 20)
%3 = tail call i32 @__print_int(i32 16)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bar(void) { printf("bar()\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"bar()\00"
define void @bar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
int letter(int ch) {
  if (ch >= 'a' && ch <= 'z')
    return (1);
  if (ch >= 'A' && ch <= 'Z')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<letter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1127 <letter+0x27>
cmpl   $0x7a,-0x8(%rbp)
jg     1127 <letter+0x27>
movl   $0x1,-0x4(%rbp)
jmp    114e <letter+0x4e>
cmpl   $0x41,-0x8(%rbp)
jl     1147 <letter+0x47>
cmpl   $0x5a,-0x8(%rbp)
jg     1147 <letter+0x47>
movl   $0x1,-0x4(%rbp)
jmp    114e <letter+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<letter>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @letter(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
unsigned sancus_urzd(ssize_t v, ssize_t a, ssize_t b) {
  assert((v >= a) && (v <= b));
  return (unsigned)v;
}


x86 assembly (clang, -O0):
<sancus_urzd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jl     1145 <sancus_urzd+0x35>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
setle  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_urzd>:
push   %rbx
mov    %rdi,%rbx
cmp    %rsi,%rdi
setge  %al
cmp    %rdx,%rdi
setle  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sancus_urzd(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = icmp sge i64 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i64, i64* %4
%12 = load i64, i64* %6
%13 = icmp sle i64 %11, %12
br label %14
14: ; preds = %10, %3
%15 = phi i1 [ false, %3 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i64, i64* %4
%19 = trunc i64 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @sancus_urzd(i64 %0, i64 %1, i64 %2) {
%4 = icmp sge i64 %0, %1
%5 = icmp sle i64 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = trunc i64 %0 to i32
ret i32 %9
}
/* Variables and functions */
int rust_callfunc(int);
int main(int argc, char *argv[]) {
  rust_callfunc(1);
  return rust_callfunc(0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <rust_callfunc@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <rust_callfunc@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @rust_callfunc(i32 1)
%4 = tail call i32 @rust_callfunc(i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(int argc, char *argv[]) {
  printf(
      "Usage: %s [options]\n\n"
      "-d | --device name	Input device to use as source "
      "[/dev/input/event1]\n"
      "                	  Use comma to separate multiple devices, i.e.\n"
      "                	  /dev/input/event0,/dev/input/event1\n"
      "-c | --config name	Config file [/etc/mouse-emu]\n"
      "-b | --daemon		Run daemon in the background\n"
      "-l | --list		List supported key codes\n"
      "-h | --help		Print this message\n",
      argv[0]);
}


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

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

LLVM IR (-O0):
@.str = [372 x i8] c"Usage: %s [options]\0A\0A-d | --device name\09Input device to use as source [/dev/input/event1]\0A \09 Use comma to separate multiple devices, i.e.\0A \09 /dev/input/event0,/dev/input/event1\0A-c | --config name\09Config file [/etc/mouse-emu]\0A-b | --daemon\09\09Run daemon in the background\0A-l | --list\09\09List supported key codes\0A-h | --help\09\09Print this message\0A\00"
define void @usage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([372 x i8], [372 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [372 x i8] c"Usage: %s [options]\0A\0A-d | --device name\09Input device to use as source [/dev/input/event1]\0A \09 Use comma to separate multiple devices, i.e.\0A \09 /dev/input/event0,/dev/input/event1\0A-c | --config name\09Config file [/etc/mouse-emu]\0A-b | --daemon\09\09Run daemon in the background\0A-l | --list\09\09List supported key codes\0A-h | --help\09\09Print this message\0A\00"
define void @usage(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([372 x i8], [372 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
int crescent(const void *rigth, const void *left) {
  int f = *((int *)rigth);
  int s = *((int *)left);
  if (f > s)
    return 1;
  if (f < s)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<crescent>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    1136 <crescent+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1155 <crescent+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    114e <crescent+0x4e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <crescent+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crescent>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @crescent(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ crc32_iscsi_ref(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
uint32_t crc32_iscsi_ref_wrap(uint32_t seed, uint8_t *buf, uint64_t len) {
  return crc32_iscsi_ref(buf, len, seed);
}


x86 assembly (clang, -O0):
<crc32_iscsi_ref_wrap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x4(%rbp),%edx
call   1030 <crc32_iscsi_ref@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc32_iscsi_ref_wrap>:
mov    %edi,%eax
mov    %rsi,%rdi
mov    %edx,%esi
mov    %eax,%edx
jmp    1030 <crc32_iscsi_ref@plt>

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

LLVM IR (-O2):
define i32 @crc32_iscsi_ref_wrap(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @crc32_iscsi_ref(i32* %1, i32 %2, i32 %0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int A, B;
  scanf("%d %d", &A, &B);
  printf("SOMA = %d\n", A + B);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [11 x i8] c"SOMA = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int ct_mask_u64(int);
uint64_t ct_select_u64(uint64_t x, uint64_t y, uint64_t bit) {
  uint64_t m = ct_mask_u64(bit);
  return (x & m) | (y & ~m);
}


x86 assembly (clang, -O0):
<ct_select_u64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <ct_mask_u64@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ct_select_u64>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edx,%edi
call   1030 <ct_mask_u64@plt>
xor    %ebx,%ebp
and    %ebp,%eax
xor    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ct_select_u64(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @ct_mask_u64(i32 %8)
store i32 %9, i32* %7
%10 = load i32, i32* %4
%11 = load i32, i32* %7
%12 = and i32 %10, %11
%13 = load i32, i32* %5
%14 = load i32, i32* %7
%15 = xor i32 %14, -1
%16 = and i32 %13, %15
%17 = or i32 %12, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @ct_select_u64(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @ct_mask_u64(i32 %2)
%5 = and i32 %4, %0
%6 = xor i32 %4, -1
%7 = and i32 %6, %1
%8 = or i32 %5, %7
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ hmac_sha1_vector(int /*<<< orphan*/ const *, size_t, int,
                                    int /*<<< orphan*/ const **, size_t *,
                                    int /*<<< orphan*/ *);
void hmac_sha1(const uint8_t *key, size_t key_len, const uint8_t *data,
               size_t data_len, uint8_t *mac) {
  hmac_sha1_vector(key, key_len, 1, &data, &data_len, mac);
}


x86 assembly (clang, -O0):
<hmac_sha1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%r9
mov    $0x1,%edx
lea    -0x18(%rbp),%rcx
lea    -0x20(%rbp),%r8
call   1030 <hmac_sha1_vector@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hmac_sha1>:
sub    $0x18,%rsp
mov    %r8,%r9
mov    %rdx,0x10(%rsp)
mov    %rcx,0x8(%rsp)
lea    0x10(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    $0x1,%edx
call   1030 <hmac_sha1_vector@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @hmac_sha1(i32* %0, i64 %1, i32* %2, i64 %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i64
%10 = alloca i32*
store i32* %0, i32** %6
store i64 %1, i64* %7
store i32* %2, i32** %8
store i64 %3, i64* %9
store i32* %4, i32** %10
%11 = load i32*, i32** %6
%12 = load i64, i64* %7
%13 = load i32*, i32** %10
%14 = call i32 @hmac_sha1_vector(i32* %11, i64 %12, i32 1, i32** %8, i64* %9, i32* %13)
ret void
}

LLVM IR (-O2):
define void @hmac_sha1(i32* %0, i64 %1, i32* %2, i64 %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i64
store i32* %2, i32** %6
store i64 %3, i64* %7
%8 = call i32 @hmac_sha1_vector(i32* %0, i64 %1, i32 1, i32** %6, i64* %7, i32* %4)
ret void
}
int i2cslave_cmdproc_addres(unsigned char data) { return 0; }


x86 assembly (clang, -O0):
<i2cslave_cmdproc_addres>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @i2cslave_cmdproc_addres(i8 zeroext %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ is_op_char(int /*<<< orphan*/);
int number_size(const char *s) {
  int result = 1;
  s++;
  while (!is_op_char(*(s++)))
    result++;
  return result;
}


x86 assembly (clang, -O0):
<number_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <is_op_char@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    115b <number_size+0x4b>
jmp    1169 <number_size+0x59>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112f <number_size+0x1f>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_size>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
movsbl 0x1(%r14,%rbx,1),%edi
call   1030 <is_op_char@plt>
add    $0x1,%rbx
test   %eax,%eax
je     1120 <number_size+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @number_size(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 1, i32* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i32 1
store i8* %5, i8** %2
br label %6
6: ; preds = %14, %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %2
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
%11 = call i32 @is_op_char(i32 %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br i1 %13, label %14, label %17
14: ; preds = %6
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %6
17: ; preds = %6
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @number_size(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %5, %2 ]
%4 = phi i32 [ 1, %1 ], [ %10, %2 ]
%5 = getelementptr inbounds i8, i8* %3, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = tail call i32 @is_op_char(i32 %7)
%9 = icmp eq i32 %8, 0
%10 = add nuw nsw i32 %4, 1
br i1 %9, label %2, label %11
11: ; preds = %2
ret i32 %4
}
void computeRates(double voi, double *states, double *rates,
                  double *variables) {
  rates[0] = 5.0;
  rates[1] = 1000.0 * 9.0;
}


x86 assembly (clang, -O0):
<computeRates>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  0xee7(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0xecf(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeRates>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @computeRates(double %0, double* %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
store double %0, double* %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double*, double** %7
%10 = getelementptr inbounds double, double* %9, i64 0
store double 5.000000e+00, double* %10
%11 = load double*, double** %7
%12 = getelementptr inbounds double, double* %11, i64 1
store double 9.000000e+03, double* %12
ret void
}

LLVM IR (-O2):
define void @computeRates(double %0, double* nocapture readnone %1, double* nocapture writeonly %2, double* nocapture readnone %3) {
%5 = bitcast double* %2 to <2 x double>*
store <2 x double> <double 5.000000e+00, double 9.000000e+03>, <2 x double>* %5
ret void
}
void insertionSort(int myarray[]) {}


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

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

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

LLVM IR (-O2):
define void @insertionSort(i32* nocapture %0) {
ret void
}
/* Type definitions */
struct sha256 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sha256_update(struct sha256 *, void const *, unsigned int);
void hashmd(struct sha256 *s, unsigned int n, const void *md) {
  unsigned int i;
  for (i = n; i > 32; i -= 32)
    sha256_update(s, md, 32);
  sha256_update(s, md, i);
}


x86 assembly (clang, -O0):
<hashmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x20,-0x1c(%rbp)
jbe    1153 <hashmd+0x43>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x20,%edx
call   1030 <sha256_update@plt>
mov    -0x1c(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x1c(%rbp)
jmp    1129 <hashmd+0x19>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <sha256_update@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashmd>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
cmp    $0x21,%esi
jb     1148 <hashmd+0x38>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x20,%edx
call   1030 <sha256_update@plt>
add    $0xffffffe0,%ebp
cmp    $0x20,%ebp
ja     1130 <hashmd+0x20>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <sha256_update@plt>

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

LLVM IR (-O2):
%struct.sha256 = type { i32 }
define void @hashmd(%struct.sha256* %0, i32 %1, i8* %2) {
%4 = icmp ugt i32 %1, 32
br i1 %4, label %5, label %10
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ %1, %3 ]
%7 = tail call i32 @sha256_update(%struct.sha256* %0, i8* %2, i32 32)
%8 = add i32 %6, -32
%9 = icmp ugt i32 %8, 32
br i1 %9, label %5, label %10
10: ; preds = %5, %3
%11 = phi i32 [ %1, %3 ], [ %8, %5 ]
%12 = tail call i32 @sha256_update(%struct.sha256* %0, i8* %2, i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Welcome to C!\n"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Welcome to C!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Welcome to C!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ int2str(int, char *);
int /*<<< orphan*/ printf(char *, ...);
int str2dec(char *);
int main() {
  char *num = "2011";
  int realNum;
  realNum = str2dec(num);
  printf("the int is %d\n", realNum);
  char strNum[4];
  int2str(realNum, strNum);
  printf("the converted back string is %s \n", strNum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <str2dec@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <int2str@plt>
lea    -0x10(%rbp),%rsi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
call   1050 <str2dec@plt>
mov    %eax,%ebx
lea    0xebc(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%r14
mov    %ebx,%edi
mov    %r14,%rsi
call   1030 <int2str@plt>
lea    0xeac(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"2011\00"
@.str.1 = [15 x i8] c"the int is %d\0A\00"
@.str.2 = [34 x i8] c"the converted back string is %s \0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca [4 x i8]
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @str2dec(i8* %4)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%10 = call i32 @int2str(i32 %8, i8* %9)
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"2011\00"
@.str.1 = [15 x i8] c"the int is %d\0A\00"
@.str.2 = [34 x i8] c"the converted back string is %s \0A\00"
define i32 @main() {
%1 = alloca [4 x i8]
%2 = tail call i32 @str2dec(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%5 = call i32 @int2str(i32 %2, i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i8* %4)
ret i32 0
}
int atoi(char line[]) {
  double atof(char line[]);
  return (int)atof(line);
}


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

x86 assembly (clang, -O2):
<atoi>:
push   %rax
call   1030 <atof@plt>
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @atoi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call double @atof(i8* %3)
%5 = fptosi double %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = tail call double @atof(i8* %0)
%3 = fptosi double %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int /*<<< orphan*/, int,
                          int /*<<< orphan*/);
void version(char *name) { printf("%s version %d.%d.%d\n", name, 0, 3, 0); }


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

x86 assembly (clang, -O2):
<version>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %edx,%edx
mov    $0x3,%ecx
xor    %r8d,%r8d
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [21 x i8] c"%s version %d.%d.%d\0A\00"
define void @version(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0, i32 0, i32 3, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int evaluate_postfix(char *);
void test_complex() {
  assert(evaluate_postfix("1 2 + 12 3 / -") == -1);
  assert(evaluate_postfix("1 2 3 * + 5 -") == 2);
}


x86 assembly (clang, -O0):
<test_complex>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <evaluate_postfix@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xec8(%rip),%rdi
call   1030 <evaluate_postfix@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_complex>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <evaluate_postfix@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xecd(%rip),%rdi
call   1030 <evaluate_postfix@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"1 2 + 12 3 / -\00"
@.str.1 = [14 x i8] c"1 2 3 * + 5 -\00"
define void @test_complex() {
%1 = call i32 @evaluate_postfix(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, -1
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
%5 = call i32 @evaluate_postfix(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 2
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"1 2 + 12 3 / -\00"
@.str.1 = [14 x i8] c"1 2 3 * + 5 -\00"
define void @test_complex() {
%1 = tail call i32 @evaluate_postfix(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, -1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @evaluate_postfix(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 2
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret void
}
char __max_impl_char(char a, char b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<__max_impl_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jle    112c <__max_impl_char+0x2c>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <__max_impl_char+0x33>
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @__max_impl_char(i8 signext %0, i8 signext %1) {
%3 = icmp sgt i8 %0, %1
%4 = select i1 %3, i8 %0, i8 %1
ret i8 %4
}
void foo() {
#pragma omp critical
  { return; }
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ __put_unaligned_2(int, int /*<<< orphan*/ *);
extern void __put_unaligned_4(__u32 __v, register __u8 *__p) {
  __put_unaligned_2(__v >> 16, __p + 2);
  __put_unaligned_2(__v, __p);
}


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

x86 assembly (clang, -O2):
<__put_unaligned_4>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
sar    $0x10,%edi
add    $0x8,%rsi
call   1030 <__put_unaligned_2@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <__put_unaligned_2@plt>

LLVM IR (-O0):
define void @__put_unaligned_4(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 = ashr i32 %5, 16
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 2
%9 = call i32 @__put_unaligned_2(i32 %6, i32* %8)
%10 = load i32, i32* %3
%11 = load i32*, i32** %4
%12 = call i32 @__put_unaligned_2(i32 %10, i32* %11)
ret void
}

LLVM IR (-O2):
define void @__put_unaligned_4(i32 %0, i32* %1) {
%3 = ashr i32 %0, 16
%4 = getelementptr inbounds i32, i32* %1, i64 2
%5 = tail call i32 @__put_unaligned_2(i32 %3, i32* %4)
%6 = tail call i32 @__put_unaligned_2(i32 %0, i32* %1)
ret void
}
int main(int argc, char const *argv[]) {
  char name[81];
  char talents[81];
  int i;
  const char m1[40] = "Limit yourself to one line's worth";
  const char m2[] = "If you can't think of anything, fake it.";
  const char *m3 = "";
  const char *mytal[5] = {
      "Adding numbers swiftly", "Multiplying accurately", "Stashing data",
      "Following instructions to the letter", "Understanding the C language"};
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x100(%rbp),%rdi
lea    0xeb9(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x130(%rbp),%rdi
lea    0xed1(%rip),%rsi
mov    $0x29,%edx
call   1040 <memcpy@plt>
lea    0xf24(%rip),%rax
mov    %rax,-0x138(%rbp)
lea    -0x160(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1030 <memset@plt>
lea    0xec8(%rip),%rax
mov    %rax,-0x160(%rbp)
lea    0xed1(%rip),%rax
mov    %rax,-0x158(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x150(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x148(%rbp)
lea    0xef1(%rip),%rax
mov    %rax,-0x140(%rbp)
xor    %eax,%eax
add    $0x160,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.m1 = [40 x i8] c"Limit yourself to one line's worth\00\00\00\00\00\00"
@__const.main.m2 = [41 x i8] c"If you can't think of anything, fake it.\00"
@.str = [1 x i8] zeroinitializer
@.str.1 = [23 x i8] c"Adding numbers swiftly\00"
@.str.2 = [23 x i8] c"Multiplying accurately\00"
@.str.3 = [14 x i8] c"Stashing data\00"
@.str.4 = [37 x i8] c"Following instructions to the letter\00"
@.str.5 = [29 x i8] c"Understanding the C language\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [81 x i8]
%7 = alloca [81 x i8]
%8 = alloca i32
%9 = alloca [40 x i8]
%10 = alloca [41 x i8]
%11 = alloca i8*
%12 = alloca [5 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = bitcast [40 x i8]* %9 to i8*
%14 = bitcast [41 x i8]* %10 to i8*
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %11
%15 = bitcast [5 x i8*]* %12 to i8*
%16 = bitcast i8* %15 to [5 x i8*]*
%17 = getelementptr inbounds [5 x i8*], [5 x i8*]* %16, i32 0, i32 0
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i32 0, i32 0), i8** %17
%18 = getelementptr inbounds [5 x i8*], [5 x i8*]* %16, i32 0, i32 1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i32 0, i32 0), i8** %18
%19 = getelementptr inbounds [5 x i8*], [5 x i8*]* %16, i32 0, i32 2
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i32 0, i32 0), i8** %19
%20 = getelementptr inbounds [5 x i8*], [5 x i8*]* %16, i32 0, i32 3
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i32 0, i32 0), i8** %20
%21 = getelementptr inbounds [5 x i8*], [5 x i8*]* %16, i32 0, i32 4
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i32 0, i32 0), i8** %21
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
void freeMemory(char **buf) {
  if (buf == NULL && *buf == NULL) {
    return;
  }
  *buf = NULL;
}


x86 assembly (clang, -O0):
<freeMemory>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1126 <freeMemory+0x26>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1126 <freeMemory+0x26>
jmp    1131 <freeMemory+0x31>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeMemory>:
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @freeMemory(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = icmp eq i8** %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %5
br label %12
10: ; preds = %5, %1
%11 = load i8**, i8*** %2
store i8* null, i8** %11
br label %12
12: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
define void @freeMemory(i8** writeonly %0) {
store i8* null, i8** %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_palindrome(char const *, int, int);
void test1(void) {
  const char a[] = {'a'};
  test_palindrome(a, sizeof(a), 1);
  test_palindrome(a, sizeof(a), 2);
  printf("\n");
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x1(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1040 <test_palindrome@plt>
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1040 <test_palindrome@plt>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rbx
sub    $0x10,%rsp
movb   $0x61,0xf(%rsp)
lea    0xf(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1040 <test_palindrome@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1040 <test_palindrome@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test1.a = [1 x i8] c"a"
@.str = [2 x i8] c"\0A\00"
define void @test1() {
%1 = alloca [1 x i8]
%2 = bitcast [1 x i8]* %1 to i8*
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%4 = call i32 @test_palindrome(i8* %3, i32 1, i32 1)
%5 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%6 = call i32 @test_palindrome(i8* %5, i32 1, i32 2)
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @test1() {
%1 = alloca [1 x i8]
%2 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
store i8 97, i8* %2
%3 = call i32 @test_palindrome(i8* %2, i32 1, i32 1)
%4 = call i32 @test_palindrome(i8* %2, i32 1, i32 2)
%5 = call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rr_hl();
void opcb_1e() { rr_hl(); }


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

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

LLVM IR (-O0):
define void @opcb_1e() {
%1 = call i32 (...) @rr_hl()
ret void
}

LLVM IR (-O2):
define void @opcb_1e() {
%1 = tail call i32 (...) @rr_hl()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_pair(int, int, int);
void init_pair_c(int index, int color_1, int color_2) {
  init_pair(index, color_1, color_2);
}


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

x86 assembly (clang, -O2):
<init_pair_c>:
jmp    1030 <init_pair@plt>

LLVM IR (-O0):
define void @init_pair_c(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 = load i32, i32* %6
%10 = call i32 @init_pair(i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @init_pair_c(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @init_pair(i32 %0, i32 %1, i32 %2)
ret void
}