xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ dump_buf_with_offset(unsigned char *, int,
                                        int /*<<< orphan*/);
dump_buf(unsigned char *p, int s) { dump_buf_with_offset(p, s, 0); }


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

x86 assembly (clang, -O2):
<dump_buf>:
xor    %edx,%edx
jmp    1030 <dump_buf_with_offset@plt>

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

LLVM IR (-O2):
define i32 @dump_buf(i8* %0, i32 %1) {
%3 = tail call i32 @dump_buf_with_offset(i8* %0, i32 %1, i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void check(int *a, int *b, int N) {
  int i;
  for (i = 0; i < N; i++)
    if (a[i] != b[i])
      abort();
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    116c <check+0x5c>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     1159 <check+0x49>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    115e <check+0x4e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <check+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
push   %rax
test   %edx,%edx
jle    1131 <check+0x21>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    (%rdi,%rcx,4),%edx
cmp    (%rsi,%rcx,4),%edx
jne    1133 <check+0x23>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1120 <check+0x10>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @check(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
store i32 0, i32* %7
br label %8
8: ; preds = %27, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %30
12: ; preds = %8
%13 = load i32*, i32** %4
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %5
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %21
%23 = icmp ne i32 %17, %22
br i1 %23, label %24, label %26
24: ; preds = %12
%25 = call i32 (...) @abort()
unreachable
26: ; preds = %12
br label %27
27: ; preds = %26
%28 = load i32, i32* %7
%29 = add nsw i32 %28, 1
store i32 %29, i32* %7
br label %8
30: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @check(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %19
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %19, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %16, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %1, i64 %10
%14 = load i32, i32* %13
%15 = icmp eq i32 %12, %14
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %7, label %17
17: ; preds = %9
%18 = tail call i32 (...) @abort()
unreachable
19: ; preds = %7, %3
ret void
}
int K256Length(const char *K) {
  const char *p;
  int c0;
  p = K;
  c0 = 1;
  while (c0) {
    if (*p & 0x80) {
      c0++;
    } else {
      c0--;
    }
    p++;
  }
  return p - K;
}


x86 assembly (clang, -O0):
<K256Length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     115e <K256Length+0x5e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1144 <K256Length+0x44>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114d <K256Length+0x4d>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <K256Length+0x17>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<K256Length>:
mov    $0x1,%ecx
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
movzbl (%rdi,%rax,1),%edx
shr    $0x7,%dl
movzbl %dl,%edx
lea    (%rcx,%rdx,2),%ecx
add    $0x1,%rax
add    $0xffffffff,%ecx
jne    1110 <K256Length+0x10>
ret

LLVM IR (-O0):
define i32 @K256Length(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
store i32 1, i32* %4
br label %6
6: ; preds = %21, %1
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = and i32 %12, 128
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %9
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %21
18: ; preds = %9
%19 = load i32, i32* %4
%20 = add nsw i32 %19, -1
store i32 %20, i32* %4
br label %21
21: ; preds = %18, %15
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %3
br label %6
24: ; preds = %6
%25 = load i8*, i8** %3
%26 = load i8*, i8** %2
%27 = ptrtoint i8* %25 to i64
%28 = ptrtoint i8* %26 to i64
%29 = sub i64 %27, %28
%30 = trunc i64 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @K256Length(i8* %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 1, %1 ], [ %8, %2 ]
%4 = phi i8* [ %0, %1 ], [ %9, %2 ]
%5 = load i8, i8* %4
%6 = icmp sgt i8 %5, -1
%7 = select i1 %6, i32 -1, i32 1
%8 = add nsw i32 %7, %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = icmp eq i32 %8, 0
br i1 %10, label %11, label %2
11: ; preds = %2
%12 = ptrtoint i8* %9 to i64
%13 = ptrtoint i8* %0 to i64
%14 = sub i64 %12, %13
%15 = trunc i64 %14 to i32
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xfa() {
  Assert_real((ispunct(250) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              1255, ("ispunct should be 0 for 0xfa"));
}


x86 assembly (clang, -O0):
<t_ispunct_0xfa>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfa,%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4e7,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0xfa>:
push   %rax
mov    $0xfa,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4e7,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xfa\00"
define void @t_ispunct_0xfa() {
%1 = call i64 @ispunct(i32 250)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1255, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xfa\00"
define void @t_ispunct_0xfa() {
%1 = tail call i64 @ispunct(i32 250)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1255, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned long long f(unsigned int a) { return a; }


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

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

LLVM IR (-O0):
define i64 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @f(i32 %0) {
%2 = zext i32 %0 to i64
ret i64 %2
}
void get_coords_from_xyz(const double *xyz, double *x) {
  x[0] = xyz[0];
  x[1] = xyz[1];
  x[2] = xyz[2];
}


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

x86 assembly (clang, -O2):
<get_coords_from_xyz>:
movsd  (%rdi),%xmm0
movsd  %xmm0,(%rsi)
movsd  0x8(%rdi),%xmm0
movsd  %xmm0,0x8(%rsi)
movsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x10(%rsi)
ret

LLVM IR (-O0):
define void @get_coords_from_xyz(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
store double %7, double* %9
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load double, double* %11
%13 = load double*, double** %4
%14 = getelementptr inbounds double, double* %13, i64 1
store double %12, double* %14
%15 = load double*, double** %3
%16 = getelementptr inbounds double, double* %15, i64 2
%17 = load double, double* %16
%18 = load double*, double** %4
%19 = getelementptr inbounds double, double* %18, i64 2
store double %17, double* %19
ret void
}

LLVM IR (-O2):
define void @get_coords_from_xyz(double* nocapture %0, double* nocapture writeonly %1) {
%3 = load double, double* %0
store double %3, double* %1
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %1, i64 1
store double %5, double* %6
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 2
store double %8, double* %9
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_long;

/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ err(int, char *, int /*<<< orphan*/);
void *xcalloc(size_t nmem, size_t size) {
  void *ret = calloc(nmem, size);
  if (ret == NULL)
    err(2, "xcalloc can not allocate %lu bytes", (u_long)(size * nmem));
  return ret;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1168 <xcalloc+0x48>
mov    -0x10(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    %eax,%edx
mov    $0x2,%edi
lea    0xe9d(%rip),%rsi
call   1040 <err@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1150 <xcalloc+0x30>
imul   %r15d,%r14d
lea    0xebd(%rip),%rsi
mov    $0x2,%edi
mov    %r14d,%edx
call   1040 <err@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [35 x i8] c"xcalloc can not allocate %lu bytes\00"
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i64, i64* %4
%13 = load i64, i64* %3
%14 = mul i64 %12, %13
%15 = trunc i64 %14 to i32
%16 = call i32 @err(i32 2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %11, %2
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
@.str = [35 x i8] c"xcalloc can not allocate %lu bytes\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = mul i64 %1, %0
%7 = trunc i64 %6 to i32
%8 = tail call i32 @err(i32 2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %5, %2
ret i8* %3
}
void pgd_alloc_count(unsigned long addr) {}


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

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

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

LLVM IR (-O2):
define void @pgd_alloc_count(i64 %0) {
ret void
}
char *hash_plugin_summary(void) {
  return ("androidfde \tAndroid Full Disk Encryption plugin");
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"androidfde \09Android Full Disk Encryption plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [48 x i8] c"androidfde \09Android Full Disk Encryption plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int bar();
int hide_old_foo1() { return 100 + bar(); }


x86 assembly (clang, -O0):
<hide_old_foo1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x64,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hide_old_foo1>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
add    $0x64,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hide_old_foo1() {
%1 = call i32 (...) @bar()
%2 = add nsw i32 100, %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @hide_old_foo1() {
%1 = tail call i32 (...) @bar()
%2 = add nsw i32 %1, 100
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ out1fmt(char *, char *);
int versioncmd(int argc, char **argv) {
  out1fmt("%s\n", "10.2.0");
  return 0;
}


x86 assembly (clang, -O0):
<versioncmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <out1fmt@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [7 x i8] c"10.2.0\00"
define i32 @versioncmd(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @out1fmt(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [7 x i8] c"10.2.0\00"
define i32 @versioncmd(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @out1fmt(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lua_error(char *);
int /*<<< orphan*/ lua_getparam(int);
char *lua_getstring(int /*<<< orphan*/);
void luaI_error(void) {
  char *s = lua_getstring(lua_getparam(1));
  if (s == 0)
    s = "(no message)";
  lua_error(s);
}


x86 assembly (clang, -O0):
<luaI_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1050 <lua_getparam@plt>
mov    %eax,%edi
call   1030 <lua_getstring@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1163 <luaI_error+0x33>
lea    0xea1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <lua_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<luaI_error>:
push   %rax
mov    $0x1,%edi
call   1050 <lua_getparam@plt>
mov    %eax,%edi
call   1030 <lua_getstring@plt>
test   %rax,%rax
lea    0xeb4(%rip),%rdi
cmovne %rax,%rdi
pop    %rax
jmp    1040 <lua_error@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"(no message)\00"
define void @luaI_error() {
%1 = alloca i8*
%2 = call i32 @lua_getparam(i32 1)
%3 = call i8* @lua_getstring(i32 %2)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %0
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %1
br label %7
7: ; preds = %6, %0
%8 = load i8*, i8** %1
%9 = call i32 @lua_error(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"(no message)\00"
define void @luaI_error() {
%1 = tail call i32 @lua_getparam(i32 1)
%2 = tail call i8* @lua_getstring(i32 %1)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %2
%5 = tail call i32 @lua_error(i8* %4)
ret void
}
unsigned null_CAN_TRANSMIT(const char *devicename) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @null_CAN_TRANSMIT(i8* nocapture readnone %0) {
ret i32 1
}
int llvm_fcmp_ord(double X, double Y) { return X == X && Y == Y; }


x86 assembly (clang, -O0):
<llvm_fcmp_ord>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x8(%rbp),%xmm0
mov    %al,-0x11(%rbp)
jne    113e <llvm_fcmp_ord+0x3e>
jp     113e <llvm_fcmp_ord+0x3e>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llvm_fcmp_ord>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setnp  %al
ret

LLVM IR (-O0):
define i32 @llvm_fcmp_ord(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = fcmp oeq double %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load double, double* %4
%10 = load double, double* %4
%11 = fcmp oeq double %9, %10
br label %12
12: ; preds = %8, %2
%13 = phi i1 [ false, %2 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @llvm_fcmp_ord(double %0, double %1) {
%3 = fcmp ord double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char **);
void free_args(char **args) {
  if (args == NULL)
    return;
  char **a = args;
  while (*a) {
    free(*a++);
  }
  free(args);
}


x86 assembly (clang, -O0):
<free_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <free_args+0x1c>
jmp    1167 <free_args+0x57>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     115e <free_args+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rdi
call   1030 <free@plt>
jmp    1134 <free_args+0x24>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_args>:
test   %rdi,%rdi
je     1150 <free_args+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <free_args+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <free_args+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @free_args(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %12, %6 ], [ %4, %3 ]
%8 = phi i8** [ %9, %6 ], [ %0, %3 ]
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = bitcast i8* %7 to i8**
%11 = tail call i32 @free(i8** %10)
%12 = load i8*, i8** %9
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %6
14: ; preds = %6, %3
%15 = tail call i32 @free(i8** %0)
br label %16
16: ; preds = %1, %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(char);
int main(void) {
  int local_data;
  char more_local_data = 'X';
  f(more_local_data);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x58,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i8 88, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @f(i8 signext %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i8 signext 88)
ret i32 0
}
/* Variables and functions */
void *do_malloc(size_t, int /*<<< orphan*/);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *ps_calloc(size_t n, size_t size) {
  void *ret = do_malloc(n * size, 0);
  memset(ret, 0, size);
  return ret;
}


x86 assembly (clang, -O0):
<ps_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <do_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
imul   %rsi,%rdi
xor    %esi,%esi
call   1030 <do_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ps_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = mul i64 %6, %7
%9 = call i8* @do_malloc(i64 %8, i32 0)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i64, i64* %4
%12 = call i32 @memset(i8* %10, i32 0, i64 %11)
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
define i8* @ps_calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @do_malloc(i64 %3, i32 0)
%5 = tail call i32 @memset(i8* %4, i32 0, i64 %1)
ret i8* %4
}
/* Variables and functions */
int exp(double const);
double const sin(double const);
double boltzmann_sin(const double phase, const double k) {
  return 1. / (1. + exp(k * sin(phase)));
}


x86 assembly (clang, -O0):
<boltzmann_sin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe9d(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xe91(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<boltzmann_sin>:
push   %rax
movsd  %xmm1,(%rsp)
call   1030 <sin@plt>
mulsd  (%rsp),%xmm0
call   1040 <exp@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xebc(%rip),%xmm0
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @boltzmann_sin(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 = load double, double* %3
%7 = call double @sin(double %6)
%8 = fmul double %5, %7
%9 = call i32 @exp(double %8)
%10 = sitofp i32 %9 to double
%11 = fadd double 1.000000e+00, %10
%12 = fdiv double 1.000000e+00, %11
ret double %12
}

LLVM IR (-O2):
define double @boltzmann_sin(double %0, double %1) {
%3 = tail call double @sin(double %0)
%4 = fmul double %3, %1
%5 = tail call i32 @exp(double %4)
%6 = sitofp i32 %5 to double
%7 = fadd double %6, 1.000000e+00
%8 = fdiv double 1.000000e+00, %7
ret double %8
}
/* Variables and functions */
int reloc_imm(int);
int reloc_bl(int offset) { return 0xeb000000 | reloc_imm(offset); }


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

x86 assembly (clang, -O2):
<reloc_bl>:
push   %rax
call   1030 <reloc_imm@plt>
or     $0xeb000000,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @reloc_bl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @reloc_imm(i32 %3)
%5 = or i32 -352321536, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @reloc_bl(i32 %0) {
%2 = tail call i32 @reloc_imm(i32 %0)
%3 = or i32 %2, -352321536
ret i32 %3
}
/* Type definitions */
struct kv_pair {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kv_pair_get_style();
int /*<<< orphan*/ kv_pair_print_to_file(int /*<<< orphan*/, struct kv_pair *,
                                         int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void kv_pair_print(struct kv_pair *kv_list) {
  kv_pair_print_to_file(stdout, kv_list, kv_pair_get_style());
}


x86 assembly (clang, -O0):
<kv_pair_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <kv_pair_get_style@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
call   1040 <kv_pair_print_to_file@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kv_pair_print>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1030 <kv_pair_get_style@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <kv_pair_print_to_file@plt>

LLVM IR (-O0):
%struct.kv_pair = type { i32 }
@stdout = global i32 0
define void @kv_pair_print(%struct.kv_pair* %0) {
%2 = alloca %struct.kv_pair*
store %struct.kv_pair* %0, %struct.kv_pair** %2
%3 = load i32, i32* @stdout
%4 = load %struct.kv_pair*, %struct.kv_pair** %2
%5 = call i32 (...) @kv_pair_get_style()
%6 = call i32 @kv_pair_print_to_file(i32 %3, %struct.kv_pair* %4, i32 %5)
ret void
}

LLVM IR (-O2):
%struct.kv_pair = type { i32 }
@stdout = global i32 0
define void @kv_pair_print(%struct.kv_pair* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 (...) @kv_pair_get_style()
%4 = tail call i32 @kv_pair_print_to_file(i32 %2, %struct.kv_pair* %0, i32 %3)
ret void
}
/* Type definitions */
struct Layer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_layer_arrays(struct Layer const *);
void neural_layer_upsample_free(const struct Layer *l) { free_layer_arrays(l); }


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

x86 assembly (clang, -O2):
<neural_layer_upsample_free>:
jmp    1030 <free_layer_arrays@plt>

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

LLVM IR (-O2):
%struct.Layer = type { i32 }
define void @neural_layer_upsample_free(%struct.Layer* %0) {
%2 = tail call i32 @free_layer_arrays(%struct.Layer* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void show_bytes(char *addr, int len) {
  while (len--) {
    printf("%x ", *addr++);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<show_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1158 <show_bytes+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    111f <show_bytes+0xf>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_bytes>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1158 <show_bytes+0x38>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1140 <show_bytes+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%x \00"
define void @show_bytes(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %6
%10 = sext i8 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = icmp eq i32 %7, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Match(int, char *);
int /*<<< orphan*/ Statement_Block(int *);
void Program(void) {
  int nChain;
  Match(1, "main");
  Match(26, "(");
  Match(27, ")");
  Statement_Block(&nChain);
}


x86 assembly (clang, -O0):
<Program>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
lea    0xecc(%rip),%rsi
call   1030 <Match@plt>
mov    $0x1a,%edi
lea    0xec0(%rip),%rsi
call   1030 <Match@plt>
mov    $0x1b,%edi
lea    0xeb1(%rip),%rsi
call   1030 <Match@plt>
lea    -0x4(%rbp),%rdi
call   1040 <Statement_Block@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Program>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
call   1030 <Match@plt>
lea    0xecc(%rip),%rsi
mov    $0x1a,%edi
call   1030 <Match@plt>
lea    0xebd(%rip),%rsi
mov    $0x1b,%edi
call   1030 <Match@plt>
lea    0x4(%rsp),%rdi
call   1040 <Statement_Block@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"main\00"
@.str.1 = [2 x i8] c"(\00"
@.str.2 = [2 x i8] c")\00"
define void @Program() {
%1 = alloca i32
%2 = call i32 @Match(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @Match(i32 26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @Match(i32 27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @Statement_Block(i32* %1)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"main\00"
@.str.1 = [2 x i8] c"(\00"
@.str.2 = [2 x i8] c")\00"
define void @Program() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @Match(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @Match(i32 26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @Match(i32 27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @Statement_Block(i32* %1)
ret void
}
/* Variables and functions */
unsigned long bar();
unsigned long foo() {
  unsigned long retval;
  retval = bar();
  if (retval == -1)
    return 0;
  return 3;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <bar@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
jne    113b <foo+0x2b>
movq   $0x0,-0x8(%rbp)
jmp    1143 <foo+0x33>
movq   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
xor    %ecx,%ecx
cmp    $0xffffffffffffffff,%rax
setne  %cl
lea    (%rcx,%rcx,2),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @foo() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 (...) @bar()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = icmp eq i64 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %0
store i64 0, i64* %1
br label %8
7: ; preds = %0
store i64 3, i64* %1
br label %8
8: ; preds = %7, %6
%9 = load i64, i64* %1
ret i64 %9
}

LLVM IR (-O2):
define i64 @foo() {
%1 = tail call i64 (...) @bar()
%2 = icmp eq i64 %1, -1
%3 = select i1 %2, i64 0, i64 3
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ yield();
void gchild_func() {
  int k = 0;
  printf("k = %d\n", k);
  yield();
  k++;
  printf("k = %d\n", k);
  yield();
}


x86 assembly (clang, -O0):
<gchild_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <yield@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <yield@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gchild_func>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <yield@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <yield@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"k = %d\0A\00"
define void @gchild_func() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 (...) @yield()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = tail call i32 (...) @yield()
ret void
}
int base2() { return 2; }


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

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

LLVM IR (-O0):
define i32 @base2() {
ret i32 2
}

LLVM IR (-O2):
define i32 @base2() {
ret i32 2
}
/* Variables and functions */
double M2z_x(double, double, double, double);
double M3y_x(double sign, double xi, double et, double qq) {
  return M2z_x(sign, xi, et, qq);
}


x86 assembly (clang, -O0):
<M3y_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <M2z_x@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M3y_x>:
jmp    1030 <M2z_x@plt>

LLVM IR (-O0):
define double @M3y_x(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* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call double @M2z_x(double %9, double %10, double %11, double %12)
ret double %13
}

LLVM IR (-O2):
define double @M3y_x(double %0, double %1, double %2, double %3) {
%5 = tail call double @M2z_x(double %0, double %1, double %2, double %3)
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
size_t coap_opt_put_string_with_len(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                    int /*<<< orphan*/, char const *,
                                    int /*<<< orphan*/, char);
int /*<<< orphan*/ strlen(char const *);
size_t coap_opt_put_string(uint8_t *buf, uint16_t lastonum, uint16_t optnum,
                           const char *string, char separator) {
  return coap_opt_put_string_with_len(buf, lastonum, optnum, string,
                                      strlen(string), separator);
}


x86 assembly (clang, -O0):
<coap_opt_put_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %r8b,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%esi
mov    -0x2c(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    %eax,%r8d
movsbl -0x19(%rbp),%r9d
call   1040 <coap_opt_put_string_with_len@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coap_opt_put_string>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %rcx,%rbx
mov    %edx,%r15d
mov    %esi,%r12d
mov    %rdi,%rbp
mov    %rcx,%rdi
call   1030 <strlen@plt>
mov    %rbp,%rdi
mov    %r12d,%esi
mov    %r15d,%edx
mov    %rbx,%rcx
mov    %eax,%r8d
mov    %r14d,%r9d
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <coap_opt_put_string_with_len@plt>

LLVM IR (-O0):
define i64 @coap_opt_put_string(i32* %0, i32 %1, i32 %2, i8* %3, i8 signext %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i8 %4, i8* %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i8*, i8** %9
%15 = load i8*, i8** %9
%16 = call i32 @strlen(i8* %15)
%17 = load i8, i8* %10
%18 = call i64 @coap_opt_put_string_with_len(i32* %11, i32 %12, i32 %13, i8* %14, i32 %16, i8 signext %17)
ret i64 %18
}

LLVM IR (-O2):
define i64 @coap_opt_put_string(i32* %0, i32 %1, i32 %2, i8* %3, i8 signext %4) {
%6 = tail call i32 @strlen(i8* %3)
%7 = tail call i64 @coap_opt_put_string_with_len(i32* %0, i32 %1, i32 %2, i8* %3, i32 %6, i8 signext %4)
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ test(int *);
int main(int argc, char *argv[]) {
  int a = 0;
  int b = 1;
  test(&a);
  if (a >= 0) {
    b++;
  } else {
    a++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <test@plt>
cmpl   $0x0,-0x14(%rbp)
jl     1155 <main+0x45>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115e <main+0x4e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i32 @test(i32* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ error_message();
int /*<<< orphan*/ sprintf(int /*<<< orphan*/, char *);
int prefix_add(const char *ifname, int ifindex, const char *prefixPlain,
               int prefixLength, unsigned long prefered, unsigned long valid) {
  sprintf(error_message(),
          "Prefix configuration on BSD systems not implemented yet.");
  return -12;
}


x86 assembly (clang, -O0):
<prefix_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    $0x0,%al
call   1030 <error_message@plt>
mov    %eax,%edi
lea    0xeb2(%rip),%rsi
call   1040 <sprintf@plt>
mov    $0xfffffff4,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefix_add>:
push   %rax
xor    %eax,%eax
call   1030 <error_message@plt>
lea    0xed1(%rip),%rsi
mov    %eax,%edi
call   1040 <sprintf@plt>
mov    $0xfffffff4,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [57 x i8] c"Prefix configuration on BSD systems not implemented yet.\00"
define i32 @prefix_add(i8* %0, i32 %1, i8* %2, i32 %3, i64 %4, i64 %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i64
%12 = alloca i64
store i8* %0, i8** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i64 %4, i64* %11
store i64 %5, i64* %12
%13 = call i32 (...) @error_message()
%14 = call i32 @sprintf(i32 %13, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret i32 -12
}

LLVM IR (-O2):
@.str = [57 x i8] c"Prefix configuration on BSD systems not implemented yet.\00"
define i32 @prefix_add(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3, i64 %4, i64 %5) {
%7 = tail call i32 (...) @error_message()
%8 = tail call i32 @sprintf(i32 %7, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret i32 -12
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
size_t strlen(char *);
char *copyString(char *str) {
  size_t charCount = strlen(str);
  char *result = (char *)malloc(sizeof(char) * (charCount + 1));
  strcpy(result, str);
  return result;
}


x86 assembly (clang, -O0):
<copyString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyString>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @copyString(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = mul i64 1, %8
%10 = trunc i64 %9 to i32
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = load i8*, i8** %2
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
define i8* @copyString(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = add i32 %3, 1
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @strcpy(i8* %6, i8* %0)
ret i8* %6
}
void WebPInitSamplersMIPSdspR2(void) {}


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

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

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

LLVM IR (-O2):
define void @WebPInitSamplersMIPSdspR2() {
ret void
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int __cpu_to_le16(int);
int ieee80211_has_moredata(__le16 fc) {
  return (fc & __cpu_to_le16(0x2000)) != 0;
}


x86 assembly (clang, -O0):
<ieee80211_has_moredata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x2000,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_has_moredata>:
push   %rbx
mov    %edi,%ebx
mov    $0x2000,%edi
call   1030 <__cpu_to_le16@plt>
xor    %ecx,%ecx
test   %ebx,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ieee80211_has_moredata(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__cpu_to_le16(i32 8192)
%5 = and i32 %3, %4
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @ieee80211_has_moredata(i32 %0) {
%2 = tail call i32 @__cpu_to_le16(i32 8192)
%3 = and i32 %2, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}