xunge/DecIR huggingface dataset:
/* Variables and functions */
int get_semvalue(int, int);
void get_2_semv(int id, int *v0, int *v1) {
  *v0 = get_semvalue(id, 0);
  *v1 = get_semvalue(id, 1);
}


x86 assembly (clang, -O0):
<get_2_semv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <get_semvalue@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <get_semvalue@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_2_semv>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %esi,%esi
call   1030 <get_semvalue@plt>
mov    %eax,(%rbx)
mov    %ebp,%edi
mov    $0x1,%esi
call   1030 <get_semvalue@plt>
mov    %eax,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @get_2_semv(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = call i32 @get_semvalue(i32 %7, i32 0)
%9 = load i32*, i32** %5
store i32 %8, i32* %9
%10 = load i32, i32* %4
%11 = call i32 @get_semvalue(i32 %10, i32 1)
%12 = load i32*, i32** %6
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @get_2_semv(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @get_semvalue(i32 %0, i32 0)
store i32 %4, i32* %1
%5 = tail call i32 @get_semvalue(i32 %0, i32 1)
store i32 %5, i32* %2
ret void
}
/* Variables and functions */
scalar_t__ COND_NE();
int /*<<< orphan*/ EA_AY_DI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_sne_8_di(void) {
  m68ki_write_8(EA_AY_DI_8(), COND_NE() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_sne_8_di>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <EA_AY_DI_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <COND_NE@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sne_8_di>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <EA_AY_DI_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <COND_NE@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sne_8_di() {
%1 = call i32 (...) @EA_AY_DI_8()
%2 = call i64 (...) @COND_NE()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sne_8_di() {
%1 = tail call i32 (...) @EA_AY_DI_8()
%2 = tail call i64 (...) @COND_NE()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
unsigned int maxu(unsigned int a, unsigned int b) { return (a >= b) ? a : b; }


x86 assembly (clang, -O0):
<maxu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jb     1121 <maxu+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <maxu+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxu>:
mov    %edi,%eax
cmp    %esi,%edi
cmovb  %esi,%eax
ret

LLVM IR (-O0):
define i32 @maxu(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp uge i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @maxu(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ bswap64(int /*<<< orphan*/);
uint64_t fetch64(char *data, bool swap) {
  uint64_t tmp = *(uint64_t *)data;
  if (swap)
    tmp = bswap64(tmp);
  return tmp;
}


x86 assembly (clang, -O0):
<fetch64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113d <fetch64+0x2d>
mov    -0x10(%rbp),%edi
call   1030 <bswap64@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fetch64>:
mov    (%rdi),%edi
test   %esi,%esi
je     111b <fetch64+0xb>
jmp    1030 <bswap64@plt>
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @fetch64(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = icmp eq i32 %1, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @bswap64(i32 %4)
br label %8
8: ; preds = %6, %2
%9 = phi i32 [ %7, %6 ], [ %4, %2 ]
ret i32 %9
}
void NVIC_SystemReset(void) {}


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

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

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

LLVM IR (-O2):
define void @NVIC_SystemReset() {
ret void
}
int do_989() { return 989; }


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

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

LLVM IR (-O0):
define i32 @do_989() {
ret i32 989
}

LLVM IR (-O2):
define i32 @do_989() {
ret i32 989
}
void bitmap_clear(void *p, unsigned long long b) {
  unsigned char *ptr = p;
  ptr[b / 8] &= ~(1U << (b & 7));
}


x86 assembly (clang, -O0):
<bitmap_clear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
and    $0x7,%rax
mov    %eax,%ecx
mov    $0x1,%esi
shl    %cl,%esi
xor    $0xffffffff,%esi
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x3,%rcx
movzbl (%rax,%rcx,1),%edx
and    %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_clear>:
mov    %rsi,%rcx
mov    $0xfe,%al
rol    %cl,%al
shr    $0x3,%rcx
and    %al,(%rdi,%rcx,1)
ret

LLVM IR (-O0):
define void @bitmap_clear(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i64, i64* %4
%8 = and i64 %7, 7
%9 = trunc i64 %8 to i32
%10 = shl i32 1, %9
%11 = xor i32 %10, -1
%12 = load i8*, i8** %5
%13 = load i64, i64* %4
%14 = udiv i64 %13, 8
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = and i32 %17, %11
%19 = trunc i32 %18 to i8
store i8 %19, i8* %15
ret void
}

LLVM IR (-O2):
define void @bitmap_clear(i8* nocapture %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = and i8 %3, 7
%5 = shl nuw i8 1, %4
%6 = xor i8 %5, -1
%7 = lshr i64 %1, 3
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = and i8 %9, %6
store i8 %10, i8* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M667_f(char *s) {
  debug("M667_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


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

x86 assembly (clang, -O2):
<M667_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M667_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M667_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M667_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M667_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
void CG_IronSightDown_f(void) {}


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

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

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

LLVM IR (-O2):
define void @CG_IronSightDown_f() {
ret void
}
void vla(int n) {
  volatile int vla[n];
  __builtin_memset(&vla[0], 0, 1);
}


x86 assembly (clang, -O0):
<vla>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @vla(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i32, i64 %6
store i64 %6, i64* %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = bitcast i32* %9 to i8*
%11 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @vla(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ echo(char *);
int /*<<< orphan*/ inlined();
main() {
  inlined();
hell:
  echo("Fuck");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <inlined@plt>
lea    0xece(%rip),%rdi
call   1030 <echo@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"Fuck\00"
define i32 @main() {
%1 = call i32 (...) @inlined()
br label %2
2: ; preds = %0
%3 = call i32 @echo(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"Fuck\00"
define i32 @main() {
%1 = tail call i32 (...) @inlined()
%2 = tail call i32 @echo(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(unsigned int);
int /*<<< orphan*/ printf(char *);
float *alloc_1d_dbl(int n) {
  float *new_t;
  new_t = (float *)malloc((unsigned)(n * sizeof(float)));
  if (new_t == NULL) {
    printf("ALLOC_1D_DBL: Couldn't allocate array of floats\n");
    return (NULL);
  }
  return (new_t);
}


x86 assembly (clang, -O0):
<alloc_1d_dbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1162 <alloc_1d_dbl+0x42>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0x8(%rbp)
jmp    116a <alloc_1d_dbl+0x4a>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_1d_dbl>:
push   %rax
shl    $0x2,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1130 <alloc_1d_dbl+0x10>
pop    %rcx
ret
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [49 x i8] c"ALLOC_1D_DBL: Couldn't allocate array of floats\0A\00"
define float* @alloc_1d_dbl(i32 %0) {
%2 = alloca float*
%3 = alloca i32
%4 = alloca float*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = mul i64 %6, 4
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to float*
store float* %10, float** %4
%11 = load float*, float** %4
%12 = icmp eq float* %11, null
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
store float* null, float** %2
br label %17
15: ; preds = %1
%16 = load float*, float** %4
store float* %16, float** %2
br label %17
17: ; preds = %15, %13
%18 = load float*, float** %2
ret float* %18
}

LLVM IR (-O2):
@str = [48 x i8] c"ALLOC_1D_DBL: Couldn't allocate array of floats\00"
define float* @alloc_1d_dbl(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i64 @malloc(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = inttoptr i64 %3 to float*
br label %9
9: ; preds = %7, %5
%10 = phi float* [ null, %5 ], [ %8, %7 ]
ret float* %10
}
int b(short oneShort, short *manyShorts) { return 42; }


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2a,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @b(i16 signext %0, i16* %1) {
%3 = alloca i16
%4 = alloca i16*
store i16 %0, i16* %3
store i16* %1, i16** %4
ret i32 42
}

LLVM IR (-O2):
define i32 @b(i16 signext %0, i16* nocapture readnone %1) {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xd1() {
  Assert_real((iscntrl(209) == 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_iscntrl.c",
              1050, ("iscntrl should be 0 for 0xd1"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xd1>:
push   %rax
mov    $0xd1,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x41a,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xd1\00"
define void @t_iscntrl_0xd1() {
%1 = call i64 @iscntrl(i32 209)
%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 1050, 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xd1\00"
define void @t_iscntrl_0xd1() {
%1 = tail call i64 @iscntrl(i32 209)
%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 1050, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void *opencl_x86_device_mem_alloc(struct opencl_x86_device_t *device,
                                  unsigned int size) {
  void *ptr;
  if (posix_memalign(&ptr, 4096, size))
    m2s_opencl_fatal("%s: out of memory", __FUNCTION__);
  ;
  return ptr;
}


x86 assembly (clang, -O0):
<opencl_x86_device_mem_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
lea    -0x18(%rbp),%rdi
mov    $0x1000,%esi
mov    $0x0,%al
call   1040 <posix_memalign@plt>
cmp    $0x0,%eax
je     1160 <opencl_x86_device_mem_alloc+0x40>
lea    0xeae(%rip),%rdi
lea    0xeb9(%rip),%rsi
mov    $0x0,%al
call   1030 <m2s_opencl_fatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opencl_x86_device_mem_alloc>:
push   %rax
mov    %esi,%edx
mov    %rsp,%rdi
mov    $0x1000,%esi
xor    %eax,%eax
call   1040 <posix_memalign@plt>
test   %eax,%eax
je     114b <opencl_x86_device_mem_alloc+0x2b>
lea    0xec3(%rip),%rdi
lea    0xece(%rip),%rsi
xor    %eax,%eax
call   1030 <m2s_opencl_fatal@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.opencl_x86_device_t = type opaque
@.str = [18 x i8] c"%s: out of memory\00"
@__FUNCTION__.opencl_x86_device_mem_alloc = [28 x i8] c"opencl_x86_device_mem_alloc\00"
define i8* @opencl_x86_device_mem_alloc(%struct.opencl_x86_device_t* %0, i32 %1) {
%3 = alloca %struct.opencl_x86_device_t*
%4 = alloca i32
%5 = alloca i8*
store %struct.opencl_x86_device_t* %0, %struct.opencl_x86_device_t** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 (i8**, i32, i32, ...) bitcast (i32 (...)* @posix_memalign to i32 (i8**, i32, i32, ...)*)(i8** %5, i32 4096, i32 %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @m2s_opencl_fatal to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @__FUNCTION__.opencl_x86_device_mem_alloc, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
%struct.opencl_x86_device_t = type opaque
@.str = [18 x i8] c"%s: out of memory\00"
@__FUNCTION__.opencl_x86_device_mem_alloc = [28 x i8] c"opencl_x86_device_mem_alloc\00"
define i8* @opencl_x86_device_mem_alloc(%struct.opencl_x86_device_t* nocapture readnone %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 (i8**, i32, i32, ...) bitcast (i32 (...)* @posix_memalign to i32 (i8**, i32, i32, ...)*)(i8** %3, i32 4096, i32 %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @m2s_opencl_fatal to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @__FUNCTION__.opencl_x86_device_mem_alloc, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = load i8*, i8** %3
ret i8* %10
}
/* Variables and functions */
void *calloc(int, size_t);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *xcalloc(size_t size) {
  void *p = calloc(1, size);
  if (p == NULL) {
    fprintf(stderr, "[!] calloc failed (returned NULL).\n");
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1178 <xcalloc+0x48>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
lea    0xe97(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rax
mov    %rdi,%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
test   %rax,%rax
je     1145 <xcalloc+0x15>
pop    %rcx
ret
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"[!] calloc failed (returned NULL).\0A\00"
define i8* @xcalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @calloc(i32 1, i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"[!] calloc failed (returned NULL).\0A\00"
define i8* @xcalloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Type definitions */
struct xqueue_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct xqueue_t *);
int xqueue_destroy(struct xqueue_t *q) {
  free(q);
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.xqueue_t = type { i32 }
define i32 @xqueue_destroy(%struct.xqueue_t* nocapture %0) {
%2 = tail call i32 @free(%struct.xqueue_t* %0)
ret i32 0
}
int test_imm_A8uint16_mem(unsigned short *val) {
  return ((*val) & (0xA8 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A8uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 168
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ line_width;
};
typedef TYPE_1__ XGCValues;

/* Variables and functions */
int get_XGCValues_line_width(void *_p) {
  return (int)((XGCValues *)_p)->line_width;
}


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

x86 assembly (clang, -O2):
<get_XGCValues_line_width>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XGCValues_line_width(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XGCValues_line_width(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_shell_version() { printf("%s\n", "0.1.0-SNAPSHOT"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [15 x i8] c"0.1.0-SNAPSHOT\00"
define void @print_shell_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cave_temp_room_unlite();
int /*<<< orphan*/ spread_cave_temp(int, int, int, int);
void unlite_room(int y, int x) {
  spread_cave_temp(y, x, 20, 1);
  cave_temp_room_unlite();
}


x86 assembly (clang, -O0):
<unlite_room>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x14,%edx
mov    $0x1,%ecx
call   1030 <spread_cave_temp@plt>
mov    $0x0,%al
call   1040 <cave_temp_room_unlite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlite_room>:
push   %rax
mov    $0x14,%edx
mov    $0x1,%ecx
call   1030 <spread_cave_temp@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <cave_temp_room_unlite@plt>

LLVM IR (-O0):
define void @unlite_room(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @spread_cave_temp(i32 %5, i32 %6, i32 20, i32 1)
%8 = call i32 (...) @cave_temp_room_unlite()
ret void
}

LLVM IR (-O2):
define void @unlite_room(i32 %0, i32 %1) {
%3 = tail call i32 @spread_cave_temp(i32 %0, i32 %1, i32 20, i32 1)
%4 = tail call i32 (...) @cave_temp_room_unlite()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *, int, char *);
char *strerror(int);
void fail(const char *msg, int x) {
  printf("%s failed with %d (%s)\n", msg, x, strerror(x));
  exit(1);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <strerror@plt>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%edx
mov    %rax,%rcx
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1050 <strerror@plt>
lea    0xeb9(%rip),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
mov    %rax,%rcx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"%s failed with %d (%s)\0A\00"
define void @fail(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 = load i32, i32* %4
%8 = call i8* @strerror(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6, i8* %8)
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [24 x i8] c"%s failed with %d (%s)\0A\00"
define void @fail(i8* %0, i32 %1) {
%3 = tail call i8* @strerror(i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
float const sinf(float const);
float sincf(const float x) { return (x == 0) ? 1 : sinf(x) / x; }


x86 assembly (clang, -O0):
<sincf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1146 <sincf+0x36>
jp     1146 <sincf+0x36>
movss  0xec4(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    115a <sincf+0x4a>
movss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
divss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sincf>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1125 <sincf+0x15>
jp     1125 <sincf+0x15>
movss  0xedd(%rip),%xmm0
pop    %rax
ret
movss  %xmm0,0x4(%rsp)
call   1030 <sinf@plt>
divss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sincf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oeq float %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load float, float* %2
%8 = call float @sinf(float %7)
%9 = load float, float* %2
%10 = fdiv float %8, %9
br label %11
11: ; preds = %6, %5
%12 = phi float [ 1.000000e+00, %5 ], [ %10, %6 ]
ret float %12
}

LLVM IR (-O2):
define float @sincf(float %0) {
%2 = fcmp oeq float %0, 0.000000e+00
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call float @sinf(float %0)
%5 = fdiv float %4, %0
br label %6
6: ; preds = %1, %3
%7 = phi float [ %5, %3 ], [ 1.000000e+00, %1 ]
ret float %7
}
/* Variables and functions */
int str_len(const char *str) {
  if (str == NULL) {
    return -1;
  }
  int i = 0;
  char *it;
  it = str;
  while (*it != '\0') {
    it++;
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<str_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <str_len+0x1f>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <str_len+0x5e>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1158 <str_len+0x58>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112e <str_len+0x2e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_len>:
test   %rdi,%rdi
je     111c <str_len+0x1c>
cmpb   $0x0,(%rdi)
je     1122 <str_len+0x22>
xor    %eax,%eax
nopl   0x0(%rax)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <str_len+0x10>
ret
mov    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @str_len(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %9, %6 ], [ %0, %3 ]
%8 = phi i32 [ %10, %6 ], [ 0, %3 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = add nuw nsw i32 %8, 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
%14 = phi i32 [ -1, %1 ], [ 0, %3 ], [ %10, %6 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ touch_all(int);
int main(void) {
  int i;
  for (i = 0; i < 8; i++)
    touch_all(i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    1146 <main+0x36>
mov    -0x8(%rbp),%edi
call   1030 <touch_all@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <touch_all@plt>
mov    $0x1,%edi
call   1030 <touch_all@plt>
mov    $0x2,%edi
call   1030 <touch_all@plt>
mov    $0x3,%edi
call   1030 <touch_all@plt>
mov    $0x4,%edi
call   1030 <touch_all@plt>
mov    $0x5,%edi
call   1030 <touch_all@plt>
mov    $0x6,%edi
call   1030 <touch_all@plt>
mov    $0x7,%edi
call   1030 <touch_all@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @touch_all(i32 0)
%2 = tail call i32 @touch_all(i32 1)
%3 = tail call i32 @touch_all(i32 2)
%4 = tail call i32 @touch_all(i32 3)
%5 = tail call i32 @touch_all(i32 4)
%6 = tail call i32 @touch_all(i32 5)
%7 = tail call i32 @touch_all(i32 6)
%8 = tail call i32 @touch_all(i32 7)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
size_t list_meter_int8_t(const void *el) {
  if (el) {
  }
  return sizeof(int8_t);
}


x86 assembly (clang, -O0):
<list_meter_int8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1118 <list_meter_int8_t+0x18>
jmp    1118 <list_meter_int8_t+0x18>
mov    $0x4,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @list_meter_int8_t(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret i64 4
}

LLVM IR (-O2):
define i64 @list_meter_int8_t(i8* nocapture readnone %0) {
ret i64 4
}
/* Variables and functions */
int fabs(double const);
bool almost_equal(const double value, const double reference) {
  return (fabs(value - reference) / fabs(reference)) <= 1e-15;
}


x86 assembly (clang, -O0):
<almost_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm1
movsd  0xeae(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<almost_equal>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
xor    %ecx,%ecx
test   %eax,%eax
setle  %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @almost_equal(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* %4
%7 = fsub double %5, %6
%8 = call i32 @fabs(double %7)
%9 = load double, double* %4
%10 = call i32 @fabs(double %9)
%11 = sdiv i32 %8, %10
%12 = sitofp i32 %11 to double
%13 = fcmp ole double %12, 1.000000e-15
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @almost_equal(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call i32 @fabs(double %3)
%5 = tail call i32 @fabs(double %1)
%6 = sdiv i32 %4, %5
%7 = icmp slt i32 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int mpath_recv_reply(int, char **, unsigned int);
scalar_t__ mpath_send_cmd(int, char const *);
int mpath_process_cmd(int fd, const char *cmd, char **reply,
                      unsigned int timeout) {
  if (mpath_send_cmd(fd, cmd) != 0)
    return -1;
  return mpath_recv_reply(fd, reply, timeout);
}


x86 assembly (clang, -O0):
<mpath_process_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <mpath_send_cmd@plt>
cmp    $0x0,%rax
je     1158 <mpath_process_cmd+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <mpath_process_cmd+0x4a>
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <mpath_recv_reply@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpath_process_cmd>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %edi,%ebp
call   1040 <mpath_send_cmd@plt>
test   %rax,%rax
je     1140 <mpath_process_cmd+0x20>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <mpath_recv_reply@plt>

LLVM IR (-O0):
define i32 @mpath_process_cmd(i32 %0, i8* %1, i8** %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8**
%9 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8** %2, i8*** %8
store i32 %3, i32* %9
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = call i64 @mpath_send_cmd(i32 %10, i8* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %4
store i32 -1, i32* %5
br label %20
15: ; preds = %4
%16 = load i32, i32* %6
%17 = load i8**, i8*** %8
%18 = load i32, i32* %9
%19 = call i32 @mpath_recv_reply(i32 %16, i8** %17, i32 %18)
store i32 %19, i32* %5
br label %20
20: ; preds = %15, %14
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @mpath_process_cmd(i32 %0, i8* %1, i8** %2, i32 %3) {
%5 = tail call i64 @mpath_send_cmd(i32 %0, i8* %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @mpath_recv_reply(i32 %0, i8** %2, i32 %3)
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ %8, %7 ], [ -1, %4 ]
ret i32 %10
}
long num_coeff(long n) { return n / 2; }


x86 assembly (clang, -O0):
<num_coeff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_coeff>:
mov    %rdi,%rax
shr    $0x3f,%rax
add    %rdi,%rax
sar    %rax
ret

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

LLVM IR (-O2):
define i64 @num_coeff(i64 %0) {
%2 = sdiv i64 %0, 2
ret i64 %2
}
int dhcp_snoop_init(struct hostapd_data *hapd) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.hostapd_data = type opaque
define i32 @dhcp_snoop_init(%struct.hostapd_data* nocapture readnone %0) {
ret i32 0
}
void free_short(short *val) {}


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

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

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

LLVM IR (-O2):
define void @free_short(i16* nocapture %0) {
ret void
}
int test_imm_32uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x32 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_32uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 214748364800
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void board_fix_long_desc(int num, char *headers[30]) {
  struct obj_data *ob;
  return;
}


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

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

LLVM IR (-O0):
%struct.obj_data = type opaque
define void @board_fix_long_desc(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca %struct.obj_data*
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret void
}

LLVM IR (-O2):
%struct.obj_data = type opaque
define void @board_fix_long_desc(i32 %0, i8** nocapture %1) {
ret void
}
void __attribute__((weak)) _cleanup() {}


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

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

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

LLVM IR (-O2):
define weak void @_cleanup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pr_inf_skip(char *, char const *);
int /*<<< orphan*/ stress_check_capability(int);
int stress_rawudp_supported(const char *name) {
  if (!stress_check_capability((-1))) {
    pr_inf_skip("%s stressor will be skipped, "
                "need to be running with CAP_NET_RAW "
                "rights for this stressor\n",
                name);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<stress_rawudp_supported>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0xffffffff,%edi
call   1030 <stress_check_capability@plt>
cmp    $0x0,%eax
jne    115b <stress_rawudp_supported+0x3b>
mov    -0x10(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1040 <pr_inf_skip@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1162 <stress_rawudp_supported+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_rawudp_supported>:
push   %rbx
mov    %rdi,%rbx
mov    $0xffffffff,%edi
call   1030 <stress_check_capability@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1138 <stress_rawudp_supported+0x18>
pop    %rbx
ret
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <pr_inf_skip@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [91 x i8] c"%s stressor will be skipped, need to be running with CAP_NET_RAW rights for this stressor\0A\00"
define i32 @stress_rawudp_supported(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @stress_check_capability(i32 -1)
%5 = icmp ne i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i32 @pr_inf_skip(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %7)
store i32 -1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [91 x i8] c"%s stressor will be skipped, need to be running with CAP_NET_RAW rights for this stressor\0A\00"
define i32 @stress_rawudp_supported(i8* %0) {
%2 = tail call i32 @stress_check_capability(i32 -1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @pr_inf_skip(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ getMemory(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, const char *argv[]) {
  char *str = NULL;
  getMemory(str);
  strcpy(str, "hello");
  printf("%s\n", str);
  free(str);
  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)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <getMemory@plt>
mov    -0x18(%rbp),%rdi
lea    0xe8e(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x18(%rbp),%rsi
lea    0xe84(%rip),%rdi
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <getMemory@plt>
lea    0xeb1(%rip),%rsi
xor    %edi,%edi
call   1040 <strcpy@plt>
lea    0xea9(%rip),%rdi
xor    %esi,%esi
call   1060 <printf@plt>
xor    %edi,%edi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @getMemory(i8* %7)
%9 = load i8*, i8** %6
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %6
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %6
%14 = call i32 @free(i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @getMemory(i8* null)
%4 = tail call i32 @strcpy(i8* null, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* null)
%6 = tail call i32 @free(i8* null)
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
bool mii_can_10_mbps_full_dp(uint16_t bmsr) { return (bmsr & 0x00001000); }


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

x86 assembly (clang, -O2):
<mii_can_10_mbps_full_dp>:
mov    %edi,%eax
and    $0x1000,%eax
ret

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

LLVM IR (-O2):
define i32 @mii_can_10_mbps_full_dp(i32 %0) {
%2 = and i32 %0, 4096
ret i32 %2
}