xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int filelen(const char *file) {
  struct stat st;
  if (stat(file, &st))
    return -1;
  return st.st_size;
}


x86 assembly (clang, -O0):
<filelen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     113f <filelen+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1145 <filelen+0x35>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filelen>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
neg    %rax
sbb    %eax,%eax
or     (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @filelen(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 %7, i32 -1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR7E_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR7E_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR7E_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ rawFillRect(int /*<<< orphan*/, int /*<<< orphan*/,
                               int /*<<< orphan*/, int /*<<< orphan*/,
                               int /*<<< orphan*/);
void fillRect(uint16_t x, uint16_t y, uint16_t w, uint16_t h,
              uint16_t fillcolor) {
  rawFillRect(x, y, w, h, fillcolor);
}


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

x86 assembly (clang, -O2):
<fillRect>:
jmp    1030 <rawFillRect@plt>

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

LLVM IR (-O2):
define void @fillRect(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @rawFillRect(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}
/* Variables and functions */
void *memcpy(int /*<<< orphan*/, void const *, size_t);
int /*<<< orphan*/ xmalloc(size_t);
void *xdup(const void *Buf, size_t Size) {
  return memcpy(xmalloc(Size), Buf, Size);
}


x86 assembly (clang, -O0):
<xdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <xmalloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdup>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <xmalloc@plt>
mov    %eax,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memcpy@plt>

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

LLVM IR (-O2):
define i8* @xdup(i8* %0, i64 %1) {
%3 = tail call i32 @xmalloc(i64 %1)
%4 = tail call i8* @memcpy(i32 %3, i8* %0, i64 %1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void alarmfire(int signum) { abort(); }


x86 assembly (clang, -O0):
<alarmfire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<alarmfire>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @alarmfire(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @alarmfire(i32 %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
float builtin_fmsf(float b, float c, float d) {
  return __builtin_fmaf(b, c, -d);
}


x86 assembly (clang, -O0):
<builtin_fmsf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movd   %xmm2,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
call   1030 <fmaf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<builtin_fmsf>:
xorps  0xee9(%rip),%xmm2
jmp    1030 <fmaf@plt>

LLVM IR (-O0):
define float @builtin_fmsf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = fneg float %9
%11 = call float @llvm.fma.f32(float %7, float %8, float %10)
ret float %11
}

LLVM IR (-O2):
define float @builtin_fmsf(float %0, float %1, float %2) {
%4 = fneg float %2
%5 = tail call float @llvm.fma.f32(float %0, float %1, float %4)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ japi_dispose(int);
void j_dispose(int arg0) { japi_dispose(arg0); }


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

x86 assembly (clang, -O2):
<j_dispose>:
jmp    1030 <japi_dispose@plt>

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

LLVM IR (-O2):
define void @j_dispose(i32 %0) {
%2 = tail call i32 @japi_dispose(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ displayNums(int *);
int /*<<< orphan*/ displayNums2(int *);
int /*<<< orphan*/ getNums(int *);
int main() {
  int i, nums[4];
  int *ptr;
  ptr = nums;
  getNums(ptr);
  displayNums(nums);
  displayNums2(nums);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1050 <getNums@plt>
lea    -0x20(%rbp),%rdi
call   1040 <displayNums@plt>
lea    -0x20(%rbp),%rdi
call   1030 <displayNums2@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <getNums@plt>
mov    %rbx,%rdi
call   1040 <displayNums@plt>
mov    %rbx,%rdi
call   1030 <displayNums2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [4 x i32]
%4 = alloca i32*
store i32 0, i32* %1
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
store i32* %5, i32** %4
%6 = load i32*, i32** %4
%7 = call i32 @getNums(i32* %6)
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%9 = call i32 @displayNums(i32* %8)
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%11 = call i32 @displayNums2(i32* %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @getNums(i32* %3)
%5 = call i32 @displayNums(i32* %3)
%6 = call i32 @displayNums2(i32* %3)
ret i32 0
}
int _is_broadwell(int devid) {
  switch ((devid >> 4) & 0xf) {
  case 0:
  case 1:
  case 2:
    break;
  default:
    return 0;
  }
  devid &= ~0xf0;
  switch (devid) {
  case 0x1602:
  case 0x1606:
  case 0x160B:
  case 0x160E:
  case 0x160A:
  case 0x160D:
    break;
  default:
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<_is_broadwell>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x4,%eax
and    $0xf,%eax
sub    $0x2,%eax
ja     1123 <_is_broadwell+0x23>
jmp    111e <_is_broadwell+0x1e>
jmp    112f <_is_broadwell+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    11a4 <_is_broadwell+0xa4>
mov    -0x8(%rbp),%al
and    $0xf,%al
mov    %al,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1602,%eax
je     118c <_is_broadwell+0x8c>
jmp    114d <_is_broadwell+0x4d>
mov    -0xc(%rbp),%eax
sub    $0x1606,%eax
je     118c <_is_broadwell+0x8c>
jmp    1160 <_is_broadwell+0x60>
mov    -0xc(%rbp),%eax
add    $0xffffe9f6,%eax
sub    $0x2,%eax
jb     118c <_is_broadwell+0x8c>
jmp    1176 <_is_broadwell+0x76>
mov    -0xc(%rbp),%eax
add    $0xffffe9f3,%eax
sub    $0x1,%eax
ja     1191 <_is_broadwell+0x91>
jmp    118c <_is_broadwell+0x8c>
jmp    119d <_is_broadwell+0x9d>
movl   $0x0,-0x4(%rbp)
jmp    11a4 <_is_broadwell+0xa4>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_broadwell>:
mov    %edi,%ecx
and    $0xf0,%ecx
xor    %eax,%eax
cmp    $0x2f,%ecx
ja     112d <_is_broadwell+0x2d>
and    $0xffffff0f,%edi
add    $0xffffe9fe,%edi
cmp    $0xc,%edi
ja     112d <_is_broadwell+0x2d>
movslq %edi,%rax
lea    0xed6(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @_is_broadwell(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = ashr i32 %4, 4
%6 = and i32 %5, 15
switch i32 %6, label %8 [
i32 0, label %7
i32 1, label %7
i32 2, label %7
]
7: ; preds = %1, %1, %1
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %16
9: ; preds = %7
%10 = load i32, i32* %3
%11 = and i32 %10, -241
store i32 %11, i32* %3
%12 = load i32, i32* %3
switch i32 %12, label %14 [
i32 5634, label %13
i32 5638, label %13
i32 5643, label %13
i32 5646, label %13
i32 5642, label %13
i32 5645, label %13
]
13: ; preds = %9, %9, %9, %9, %9, %9
br label %15
14: ; preds = %9
store i32 0, i32* %2
br label %16
15: ; preds = %13
store i32 1, i32* %2
br label %16
16: ; preds = %15, %14, %8
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@switch.table._is_broadwell = [13 x i32] [i32 1, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 1, i32 1, i32 0, i32 1, i32 1]
define i32 @_is_broadwell(i32 %0) {
%2 = and i32 %0, 240
%3 = icmp ult i32 %2, 48
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = and i32 %0, -241
%6 = add i32 %5, -5634
%7 = icmp ult i32 %6, 13
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = sext i32 %6 to i64
%10 = getelementptr inbounds [13 x i32], [13 x i32]* @switch.table._is_broadwell, i64 0, i64 %9
%11 = load i32, i32* %10
br label %12
12: ; preds = %8, %4, %1
%13 = phi i32 [ 0, %1 ], [ 0, %4 ], [ %11, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ call2(int);
int /*<<< orphan*/ init(char *);
int ok();
int /*<<< orphan*/ test();
int main() {
  init("function calls");
  test();
  call2(1);
  return ok();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1050 <init@plt>
mov    $0x0,%al
call   1060 <test@plt>
mov    $0x1,%edi
call   1030 <call2@plt>
mov    $0x0,%al
call   1040 <ok@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1050 <init@plt>
xor    %eax,%eax
call   1060 <test@plt>
mov    $0x1,%edi
call   1030 <call2@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ok@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"function calls\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @init(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @test()
%4 = call i32 @call2(i32 1)
%5 = call i32 (...) @ok()
ret i32 %5
}

LLVM IR (-O2):
@.str = [15 x i8] c"function calls\00"
define i32 @main() {
%1 = tail call i32 @init(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @test()
%3 = tail call i32 @call2(i32 1)
%4 = tail call i32 (...) @ok()
ret i32 %4
}
void arp_print(struct arphdr *hdr) {}


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

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

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

LLVM IR (-O2):
%struct.arphdr = type opaque
define void @arp_print(%struct.arphdr* nocapture %0) {
ret void
}
int uds_set_routine_control(int controlType) { return controlType; }


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

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

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

LLVM IR (-O2):
define i32 @uds_set_routine_control(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, int);
void *Prims_magic(void *_) {
  do {
    printf("Unimplemented function at %s:%d\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/briangmilnes/vale/refs/heads/master/"
           "tools/Kremlin/kremlib/kremlib.c",
           30);
    exit(254);
  } while (0);
}


x86 assembly (clang, -O0):
<Prims_magic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
lea    0xee7(%rip),%rsi
mov    $0x1e,%edx
call   1030 <printf@plt>
mov    $0xfe,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Prims_magic>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xef2(%rip),%rsi
mov    $0x1e,%edx
call   1030 <printf@plt>
mov    $0xfe,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Unimplemented function at %s:%d\0A\00"
@.str.1 = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/briangmilnes/vale/refs/heads/master/tools/Kremlin/kremlib/kremlib.c\00"
define i8* @Prims_magic(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %1
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 30)
%6 = call i32 @exit(i32 254)
unreachable
7: ; No predecessors!
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [33 x i8] c"Unimplemented function at %s:%d\0A\00"
@.str.1 = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/briangmilnes/vale/refs/heads/master/tools/Kremlin/kremlib/kremlib.c\00"
define noalias i8* @Prims_magic(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i32 30)
%3 = tail call i32 @exit(i32 254)
unreachable
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ spacer(char *, char *, int, int, int);
int strlen(char *);
int main() {
  char str[] = "abc";
  char *dstr = (char *)malloc(sizeof(char) * strlen(str));
  dstr[0] = str[0];
  spacer(str, dstr, 1, 1, 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
lea    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%ecx
mov    $0x3,%r8d
mov    %ecx,%edx
call   1040 <spacer@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x636261,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
call   1050 <malloc@plt>
mov    0xc(%rsp),%cl
mov    %cl,(%rax)
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x1,%edx
mov    $0x1,%ecx
mov    $0x3,%r8d
call   1040 <spacer@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [4 x i8] c"abc\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [4 x i8]* %2 to i8*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%6 = call i32 @strlen(i8* %5)
%7 = sext i32 %6 to i64
%8 = mul i64 1, %7
%9 = trunc i64 %8 to i32
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %3
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%13 = load i8, i8* %12
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 0
store i8 %13, i8* %15
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%17 = load i8*, i8** %3
%18 = call i32 @spacer(i8* %16, i8* %17, i32 1, i32 1, i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 6513249, i32* %1
%3 = call i32 @strlen(i8* %2)
%4 = call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = load i8, i8* %2
store i8 %6, i8* %5
%7 = call i32 @spacer(i8* %2, i8* %5, i32 1, i32 1, i32 3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int trs_create_blank_jv1(char *fname) {
  FILE *f;
  f = fopen(fname, "wb");
  if (f == NULL)
    return -1;
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<trs_create_blank_jv1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1157 <trs_create_blank_jv1+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <trs_create_blank_jv1+0x47>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trs_create_blank_jv1>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     113e <trs_create_blank_jv1+0x1e>
mov    %rax,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"wb\00"
define i32 @trs_create_blank_jv1(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %13
10: ; preds = %1
%11 = load i32*, i32** %4
%12 = call i32 @fclose(i32* %11)
store i32 0, i32* %2
br label %13
13: ; preds = %10, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"wb\00"
define i32 @trs_create_blank_jv1(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ -1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ _IONBF;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
int main(void) {
  setvbuf(stdout, NULL, _IONBF, 0);
  printf("ABCDE");
  sleep(5);
  printf("FGHIJ");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1050 <sleep@plt>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1050 <sleep@plt>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@_IONBF = global i32 0
@.str = [6 x i8] c"ABCDE\00"
@.str.1 = [6 x i8] c"FGHIJ\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = load i32, i32* @_IONBF
%4 = call i32 @setvbuf(i32 %2, i32* null, i32 %3, i32 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @sleep(i32 5)
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@_IONBF = global i32 0
@.str = [6 x i8] c"ABCDE\00"
@.str.1 = [6 x i8] c"FGHIJ\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = load i32, i32* @_IONBF
%3 = tail call i32 @setvbuf(i32 %1, i32* null, i32 %2, i32 0)
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @sleep(i32 5)
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void f2() {
  int a = 42;
  int b = 35;
  if (a = b)
    a = 36;
  return;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2a,-0x4(%rbp)
movl   $0x23,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1128 <f2+0x28>
movl   $0x24,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f2() {
%1 = alloca i32
%2 = alloca i32
store i32 42, i32* %1
store i32 35, i32* %2
%3 = load i32, i32* %2
store i32 %3, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 36, i32* %1
br label %6
6: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @f2() {
ret void
}
int test_imm_3Cuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x3C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_3Cuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 60
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int age = 26;
  char name[] = "Batman";
  printf("%d %s\n", 26, "Batman");
  printf("%s %d\n", name, age);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1a,-0x8(%rbp)
mov    0xed4(%rip),%eax
mov    %eax,-0xf(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0xb(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0x9(%rbp)
lea    0xebd(%rip),%rdi
mov    $0x1a,%esi
lea    0xeaa(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xf(%rbp),%rsi
mov    -0x8(%rbp),%edx
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x6e616d,0x3(%rsp)
movl   $0x6d746142,(%rsp)
lea    0xee0(%rip),%rdx
lea    0xed2(%rip),%rdi
mov    $0x1a,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    %rsp,%rsi
mov    $0x1a,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %s\0A\00"
@.str.1 = [7 x i8] c"Batman\00"
@.str.2 = [7 x i8] c"%s %d\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 26, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %2, i32 26)
ret i32 0
}
int test_imm_81uint8_reg(unsigned char val) {
  return ((val) & (-0x81 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_81uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff7f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_81uint8_reg>:
test   $0x7f,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_81uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 127
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
islower(c) char c;
{
  if (c >= 'a' & c <= 'z')
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<islower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
movsbl -0x5(%rbp),%ecx
cmp    $0x7a,%ecx
setle  %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1140 <islower+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <islower+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<islower>:
shl    $0x18,%edi
add    $0x9fffffff,%edi
xor    %eax,%eax
cmp    $0x1affffff,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @islower(i32 %0) {
%2 = shl i32 %0, 24
%3 = add i32 %2, -1610612737
%4 = icmp ult i32 %3, 452984831
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strncpy(char *, char const *, int);
char *strndup_(char const string[], int count) {
  char *new_string = (char *)malloc(count + 1);
  strncpy(new_string, string, count);
  new_string[count] = '\0';
  return new_string;
}


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

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

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

LLVM IR (-O2):
define i8* @strndup_(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strncpy(i8* %5, i8* %0, i32 %1)
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 0, i8* %8
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ nrf_raal_continuous_mode_exit();
void nrf_drv_radio802154_priority_drop_timeslot_exit(void) {
  nrf_raal_continuous_mode_exit();
}


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

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

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

LLVM IR (-O2):
define void @nrf_drv_radio802154_priority_drop_timeslot_exit() {
%1 = tail call i32 (...) @nrf_raal_continuous_mode_exit()
ret void
}
void omap4_sar_overwrite(void) {}


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

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

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

LLVM IR (-O2):
define void @omap4_sar_overwrite() {
ret void
}
void button_init() {
  *((volatile unsigned long *)0x56000050) &=
      ~((0x3 << (0 * 2)) | (0x3 << (1 * 2)) | (0x3 << (2 * 2)) |
        (0x3 << (4 * 2)));
  *((volatile unsigned long *)0x56000050) |=
      ((0x2 << (0 * 2)) | (0x2 << (1 * 2)) | (0x2 << (2 * 2)) |
       (0x2 << (4 * 2)));
}


x86 assembly (clang, -O0):
<button_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x56000050,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffcc0,%rcx
mov    $0x56000050,%eax
mov    %rcx,(%rax)
mov    $0x56000050,%eax
mov    (%rax),%rcx
or     $0x22a,%rcx
mov    $0x56000050,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<button_init>:
andq   $0xfffffffffffffcc0,0x56000050
56 c0 fc ff ff
orq    $0x22a,0x56000050
ret

LLVM IR (-O0):
define void @button_init() {
%1 = load volatile i64, i64* inttoptr (i64 1442840656 to i64*)
%2 = and i64 %1, -832
store volatile i64 %2, i64* inttoptr (i64 1442840656 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1442840656 to i64*)
%4 = or i64 %3, 554
store volatile i64 %4, i64* inttoptr (i64 1442840656 to i64*)
ret void
}

LLVM IR (-O2):
define void @button_init() {
%1 = load volatile i64, i64* inttoptr (i64 1442840656 to i64*)
%2 = and i64 %1, -832
store volatile i64 %2, i64* inttoptr (i64 1442840656 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1442840656 to i64*)
%4 = or i64 %3, 554
store volatile i64 %4, i64* inttoptr (i64 1442840656 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void print_double_array(double a[], int num_elements) {
  int i;
  for (i = 0; i < num_elements; i++) {
    printf("%lf\n", a[i]);
  }
}


x86 assembly (clang, -O0):
<print_double_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_double_array+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_double_array+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_double_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <print_double_array+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_double_array+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lf\0A\00"
define void @print_double_array(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double, double* %0, i64 %7
%9 = load double, double* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getremoteip(int);
int popNumber();
int /*<<< orphan*/ pushString(int /*<<< orphan*/);
void basGetRemoteIp() {
  int sock;
  sock = popNumber();
  pushString(getremoteip(sock));
}


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

x86 assembly (clang, -O2):
<basGetRemoteIp>:
push   %rax
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%edi
call   1040 <getremoteip@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <pushString@plt>

LLVM IR (-O0):
define void @basGetRemoteIp() {
%1 = alloca i32
%2 = call i32 (...) @popNumber()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @getremoteip(i32 %3)
%5 = call i32 @pushString(i32 %4)
ret void
}

LLVM IR (-O2):
define void @basGetRemoteIp() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 @getremoteip(i32 %1)
%3 = tail call i32 @pushString(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main(int argc, char **argv) {
  char *ptr = "PointersAreFreakingCool";
  printf("%cn", *&*&*ptr);
  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)
lea    0xed3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
lea    0xedc(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%cn\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 80)
ret i32 0
}
float lerp1(float a, float b, float t) { return b * t + a * (1.0f - t); }


x86 assembly (clang, -O0):
<lerp1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
movss  0xed6(%rip),%xmm3
subss  -0xc(%rbp),%xmm3
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerp1>:
movss  0xef8(%rip),%xmm3
subss  %xmm2,%xmm3
mulss  %xmm3,%xmm0
mulss  %xmm2,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @lerp1(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = load float, float* %6
%9 = load float, float* %4
%10 = load float, float* %6
%11 = fsub float 1.000000e+00, %10
%12 = fmul float %9, %11
%13 = call float @llvm.fmuladd.f32(float %7, float %8, float %12)
ret float %13
}

LLVM IR (-O2):
define float @lerp1(float %0, float %1, float %2) {
%4 = fsub float 1.000000e+00, %2
%5 = fmul float %4, %0
%6 = tail call float @llvm.fmuladd.f32(float %1, float %2, float %5)
ret float %6
}
void foo_1_1_2_2_2_1_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_2_2_1_2_2_1() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
double C(uint8_t xi) {
  if (xi == 0) {
    return 0.70710678118;
  } else {
    return 1.;
  }
}


x86 assembly (clang, -O0):
<C>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1125 <C+0x25>
movsd  0xeed(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1132 <C+0x32>
movsd  0xed3(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<C>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
lea    0xef1(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @C(i64 %0) {
%2 = alloca double
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0x3FE6A09E667E556E, double* %2
br label %8
7: ; preds = %1
store double 1.000000e+00, double* %2
br label %8
8: ; preds = %7, %6
%9 = load double, double* %2
ret double %9
}

LLVM IR (-O2):
define double @C(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, double 0x3FE6A09E667E556E, double 1.000000e+00
ret double %3
}
/* Variables and functions */
int fprintf(int /*<<< orphan*/, char *, char const *const);
int /*<<< orphan*/ stderr;
int snoopy_output_stderroutput(char const *const logMessage, int errorOrMessage,
                               char const *const arg) {
  return fprintf(stderr, "%s\n", logMessage);
}


x86 assembly (clang, -O0):
<snoopy_output_stderroutput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snoopy_output_stderroutput>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @snoopy_output_stderroutput(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 %9
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @snoopy_output_stderroutput(i8* %0, i32 %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ read_u16(int /*<<< orphan*/ *);
int16_t read_16(FILE *stream) { return read_u16(stream); }


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

x86 assembly (clang, -O2):
<read_16>:
jmp    1030 <read_u16@plt>

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

LLVM IR (-O2):
define i32 @read_16(i32* %0) {
%2 = tail call i32 @read_u16(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  int length = argc;
  int i;
  for (i = 1; i < length; i++) {
    printf("%s ", argv[i]);
  }
}


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)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1165 <main+0x55>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1133 <main+0x23>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1145 <main+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xed1(%rip),%r14
nop
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s \00"
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
%8 = load i32, i32* %4
store i32 %8, i32* %6
store i32 1, i32* %7
br label %9
9: ; preds = %20, %2
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %23
13: ; preds = %9
%14 = load i8**, i8*** %5
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
%18 = load i8*, i8** %17
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %13
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
br label %9
23: ; preds = %9
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void *std_calloc(size_t nmemb, size_t size) {
  void *p;
  if ((p = calloc(nmemb, size)) == NULL) {
    perror("calloc");
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<std_calloc>:
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)
cmp    $0x0,%rax
jne    1171 <std_calloc+0x41>
lea    0xe9e(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_calloc>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     113d <std_calloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"calloc\00"
define i8* @std_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 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [7 x i8] c"calloc\00"
define noalias i8* @std_calloc(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 %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i8* %3
}