xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ lua_closefile();
scalar_t__ lua_openfile(char *);
scalar_t__ lua_parse();
int lua_dofile(char *filename) {
  if (lua_openfile(filename))
    return 1;
  if (lua_parse()) {
    lua_closefile();
    return 1;
  }
  lua_closefile();
  return 0;
}


x86 assembly (clang, -O0):
<lua_dofile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <lua_openfile@plt>
cmp    $0x0,%rax
je     115b <lua_dofile+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    118d <lua_dofile+0x5d>
mov    $0x0,%al
call   1040 <lua_parse@plt>
cmp    $0x0,%rax
je     117f <lua_dofile+0x4f>
mov    $0x0,%al
call   1050 <lua_closefile@plt>
movl   $0x1,-0x4(%rbp)
jmp    118d <lua_dofile+0x5d>
mov    $0x0,%al
call   1050 <lua_closefile@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lua_dofile>:
push   %rbx
call   1030 <lua_openfile@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    1156 <lua_dofile+0x26>
xor    %eax,%eax
call   1040 <lua_parse@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
xor    %eax,%eax
call   1050 <lua_closefile@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @lua_dofile(i8* %0) {
%2 = tail call i64 @lua_openfile(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i64 (...) @lua_parse()
%6 = icmp ne i64 %5, 0
%7 = tail call i32 (...) @lua_closefile()
%8 = zext i1 %6 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %10
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  {
    state[0UL] = input[0UL] + 4284877637U;
    local1 = 0UL;
    while (local1 < 0U) {
      state[local1] *= state[local1];
      local1 += 2UL;
    }
    output[0UL] = state[0UL] - 2699719578U;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0xff660b45,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jae    114d <RandomFunc+0x4d>
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp,%rax,4),%ecx
mov    -0x18(%rbp),%eax
imul   -0x14(%rbp,%rax,4),%ecx
mov    %ecx,-0x14(%rbp,%rax,4)
mov    -0x18(%rbp),%eax
add    $0x2,%rax
mov    %eax,-0x18(%rbp)
jmp    1121 <RandomFunc+0x21>
mov    -0x14(%rbp),%ecx
sub    $0xa0ea739a,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0x5e7b97ab,%eax
add    (%rdi),%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = add i32 %9, -10089659
%11 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %10, i32* %11
store i32 0, i32* %6
br label %12
12: ; preds = %15, %2
%13 = load i32, i32* %6
%14 = icmp ult i32 %13, 0
br i1 %14, label %15, label %29
15: ; preds = %12
%16 = load i32, i32* %6
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = load i32, i32* %6
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = mul i32 %23, %19
store i32 %24, i32* %22
%25 = load i32, i32* %6
%26 = zext i32 %25 to i64
%27 = add i64 %26, 2
%28 = trunc i64 %27 to i32
store i32 %28, i32* %6
br label %12
29: ; preds = %12
%30 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%31 = load i32, i32* %30
%32 = sub i32 %31, -1595247718
%33 = load i32*, i32** %4
%34 = getelementptr inbounds i32, i32* %33, i64 0
store i32 %32, i32* %34
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = add i32 %3, 1585158059
store i32 %4, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printTri() {
  printf("*\n");
  printf("**\n");
  printf("***\n");
}


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

x86 assembly (clang, -O2):
<printTri>:
push   %rax
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
lea    0xed0(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [2 x i8] c"*\00"
@str.3 = [3 x i8] c"**\00"
@str.4 = [4 x i8] c"***\00"
define void @printTri() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage(void) {
  fprintf(stderr, "Usage: lwm2mclient\r\n");
  fprintf(stderr, "Launch a LWM2M client.\r\n\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee6(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Usage: lwm2mclient\0D\0A\00"
@.str.1 = [26 x i8] c"Launch a LWM2M client.\0D\0A\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Usage: lwm2mclient\0D\0A\00"
@.str.1 = [26 x i8] c"Launch a LWM2M client.\0D\0A\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
__attribute(()) int target() { return 3; }


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

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

LLVM IR (-O0):
define i32 @target() {
ret i32 3
}

LLVM IR (-O2):
define i32 @target() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int *p;
  int a = 3;
  p = &a;
  printf("Value of integer pointed by p: %d\n", *p);
  p++;
  printf("Next value of integer pointed by p: %d\n", *p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [35 x i8] c"Value of integer pointed by p: %d\0A\00"
@.str.1 = [40 x i8] c"Next value of integer pointed by p: %d\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32
store i32 3, i32* %2
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32*, i32** %1
%7 = getelementptr inbounds i32, i32* %6, i32 1
store i32* %7, i32** %1
%8 = load i32*, i32** %1
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"Value of integer pointed by p: %d\0A\00"
@.str.1 = [40 x i8] c"Next value of integer pointed by p: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 poison)
ret i32 0
}
int test_imm_62int8_mem(signed char *val) {
  return ((*val) & (0x62 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_62int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 98
%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_62int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 98
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ cpu_swap64p(int /*<<< orphan*/ *, int /*<<< orphan*/);
void be64_to_cpup(uint64_t *outp, uint64_t in) { cpu_swap64p(outp, in); }


x86 assembly (clang, -O0):
<be64_to_cpup>:
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 <cpu_swap64p@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be64_to_cpup>:
jmp    1030 <cpu_swap64p@plt>

LLVM IR (-O0):
define void @be64_to_cpup(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 @cpu_swap64p(i32* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @be64_to_cpup(i32* %0, i32 %1) {
%3 = tail call i32 @cpu_swap64p(i32* %0, i32 %1)
ret void
}
int a(int m, int n) {
  if (m <= 0) {
    return n + 1;
  } else {
    if (n <= 0) {
      return a(m - 1, 1);
    } else {
      return a(m - 1, a(m, n - 1));
    }
  }
}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1136 <a+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    117c <a+0x6c>
cmpl   $0x0,-0xc(%rbp)
jg     1158 <a+0x48>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    $0x1,%esi
call   1030 <a@plt>
mov    %eax,-0x4(%rbp)
jmp    117c <a+0x6c>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <a@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1030 <a@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
push   %rbx
mov    %esi,%eax
test   %edi,%edi
jle    1141 <a+0x31>
mov    %edi,%ebx
jmp    112f <a+0x1f>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%eax
lea    -0x1(%rbx),%ecx
cmp    $0x2,%ebx
mov    %ecx,%ebx
jl     1141 <a+0x31>
test   %eax,%eax
jle    1120 <a+0x10>
add    $0xffffffff,%eax
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <a@plt>
jmp    1125 <a+0x15>
add    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @a(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp sle i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %26
11: ; preds = %2
%12 = load i32, i32* %5
%13 = icmp sle i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 1
%17 = call i32 @a(i32 %16, i32 1)
store i32 %17, i32* %3
br label %26
18: ; preds = %11
%19 = load i32, i32* %4
%20 = sub nsw i32 %19, 1
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = sub nsw i32 %22, 1
%24 = call i32 @a(i32 %21, i32 %23)
%25 = call i32 @a(i32 %20, i32 %24)
store i32 %25, i32* %3
br label %26
26: ; preds = %18, %14, %8
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @a(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %11, %2
%5 = phi i32 [ %1, %2 ], [ %12, %11 ]
%6 = add nsw i32 %5, 1
ret i32 %6
7: ; preds = %2, %11
%8 = phi i32 [ %12, %11 ], [ %1, %2 ]
%9 = phi i32 [ %13, %11 ], [ %0, %2 ]
%10 = icmp slt i32 %8, 1
br i1 %10, label %11, label %15
11: ; preds = %7, %15
%12 = phi i32 [ %17, %15 ], [ 1, %7 ]
%13 = add nsw i32 %9, -1
%14 = icmp slt i32 %9, 2
br i1 %14, label %4, label %7
15: ; preds = %7
%16 = add nsw i32 %8, -1
%17 = tail call i32 @a(i32 %9, i32 %16)
br label %11
}
/* Type definitions */
struct hashMap {
  int dummy;
};

/* Variables and functions */
scalar_t__ capacity(struct hashMap *);
scalar_t__ size(struct hashMap *);
float tableLoad(struct hashMap *ht) {
  return ((float)size(ht) / (float)capacity(ht));
}


x86 assembly (clang, -O0):
<tableLoad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <size@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <capacity@plt>
movss  -0xc(%rbp),%xmm0
cvtsi2ss %rax,%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tableLoad>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1040 <size@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <capacity@plt>
cvtsi2ss %rax,%xmm1
movss  0xc(%rsp),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.hashMap = type { i32 }
define float @tableLoad(%struct.hashMap* %0) {
%2 = alloca %struct.hashMap*
store %struct.hashMap* %0, %struct.hashMap** %2
%3 = load %struct.hashMap*, %struct.hashMap** %2
%4 = call i64 @size(%struct.hashMap* %3)
%5 = sitofp i64 %4 to float
%6 = load %struct.hashMap*, %struct.hashMap** %2
%7 = call i64 @capacity(%struct.hashMap* %6)
%8 = sitofp i64 %7 to float
%9 = fdiv float %5, %8
ret float %9
}

LLVM IR (-O2):
%struct.hashMap = type { i32 }
define float @tableLoad(%struct.hashMap* %0) {
%2 = tail call i64 @size(%struct.hashMap* %0)
%3 = sitofp i64 %2 to float
%4 = tail call i64 @capacity(%struct.hashMap* %0)
%5 = sitofp i64 %4 to float
%6 = fdiv float %3, %5
ret float %6
}
/* Variables and functions */
unsigned long long read_num(char const *, int, char *);
unsigned long long read_hex(const char *s) {
  return read_num(s, 16, "hexadecimal");
}


x86 assembly (clang, -O0):
<read_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x10,%esi
lea    0xed4(%rip),%rdx
call   1030 <read_num@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_hex>:
lea    0xee9(%rip),%rdx
mov    $0x10,%esi
jmp    1030 <read_num@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"hexadecimal\00"
define i64 @read_hex(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @read_num(i8* %3, i32 16, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i64 %4
}

LLVM IR (-O2):
@.str = [12 x i8] c"hexadecimal\00"
define i64 @read_hex(i8* %0) {
%2 = tail call i64 @read_num(i8* %0, i32 16, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ clearscreen();
int /*<<< orphan*/ curinvis();
int /*<<< orphan*/ wingo();
winfirst() {
  clearscreen();
  curinvis();
  wingo();
}


x86 assembly (clang, -O0):
<winfirst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <clearscreen@plt>
mov    $0x0,%al
call   1050 <curinvis@plt>
mov    $0x0,%al
call   1040 <wingo@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<winfirst>:
push   %rax
xor    %eax,%eax
call   1030 <clearscreen@plt>
xor    %eax,%eax
call   1050 <curinvis@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <wingo@plt>

LLVM IR (-O0):
define i32 @winfirst() {
%1 = alloca i32
%2 = call i32 (...) @clearscreen()
%3 = call i32 (...) @curinvis()
%4 = call i32 (...) @wingo()
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @winfirst() {
%1 = tail call i32 (...) @clearscreen()
%2 = tail call i32 (...) @curinvis()
%3 = tail call i32 (...) @wingo()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *ret;
  ret = malloc(size);
  if (ret)
    return ret;
  fprintf(stderr, "cannot allocate memory\n");
  exit(2);
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115e <xmalloc+0x2e>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xe92(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"cannot allocate memory\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
ret i8* %2
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 2)
unreachable
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
scalar_t__ EOF;
scalar_t__ decompress_byte();
int /*<<< orphan*/ write_char(scalar_t__);
void decompress(void) {
  uint16_t t;
  for (;;) {
    t = decompress_byte();
    if (t == (uint16_t)EOF)
      return;
    write_char(t);
  }
}


x86 assembly (clang, -O0):
<decompress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <decompress_byte@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2eaa(%rip),%rcx
cmp    (%rcx),%rax
jne    114d <decompress+0x2d>
add    $0x10,%rsp
pop    %rbp
ret
mov    -0x8(%rbp),%rdi
call   1040 <write_char@plt>
jmp    1128 <decompress+0x8>

x86 assembly (clang, -O2):
<decompress>:
push   %rbx
xor    %eax,%eax
call   1030 <decompress_byte@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%rax
je     1154 <decompress+0x34>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,%rdi
call   1040 <write_char@plt>
xor    %eax,%eax
call   1030 <decompress_byte@plt>
cmp    (%rbx),%rax
jne    1140 <decompress+0x20>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i64 0
define void @decompress() {
%1 = alloca i64
br label %2
2: ; preds = %8, %0
%3 = call i64 (...) @decompress_byte()
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %2
ret void
8: ; preds = %2
%9 = load i64, i64* %1
%10 = call i32 @write_char(i64 %9)
br label %2
}

LLVM IR (-O2):
@EOF = global i64 0
define void @decompress() {
%1 = tail call i64 (...) @decompress_byte()
%2 = load i64, i64* @EOF
%3 = icmp eq i64 %1, %2
br i1 %3, label %4, label %5
4: ; preds = %5, %0
ret void
5: ; preds = %0, %5
%6 = phi i64 [ %8, %5 ], [ %1, %0 ]
%7 = tail call i32 @write_char(i64 %6)
%8 = tail call i64 (...) @decompress_byte()
%9 = load i64, i64* @EOF
%10 = icmp eq i64 %8, %9
br i1 %10, label %4, label %5
}
int has_cpuid() { return 1; }


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

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

LLVM IR (-O0):
define i32 @has_cpuid() {
ret i32 1
}

LLVM IR (-O2):
define i32 @has_cpuid() {
ret i32 1
}
/* Variables and functions */
int japi_getscaledimage(int, int, int, int, int, int, int);
int j_getscaledimage(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5,
                     int arg6) {
  return (japi_getscaledimage(arg0, arg1, arg2, arg3, arg4, arg5, arg6));
}


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

x86 assembly (clang, -O2):
<j_getscaledimage>:
jmp    1030 <japi_getscaledimage@plt>

LLVM IR (-O0):
define i32 @j_getscaledimage(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = load i32, i32* %13
%21 = load i32, i32* %14
%22 = call i32 @japi_getscaledimage(i32 %15, i32 %16, i32 %17, i32 %18, i32 %19, i32 %20, i32 %21)
ret i32 %22
}

LLVM IR (-O2):
define i32 @j_getscaledimage(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i32 @japi_getscaledimage(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6)
ret i32 %8
}
int f() {
  int foo = 0;
  return foo;
}


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

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 0
}
void vec2_mul(const float a[2], float k, float out[2]) {
  out[0] = a[0] * k;
  out[1] = a[1] * k;
}


x86 assembly (clang, -O0):
<vec2_mul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mulss  -0xc(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mulss  -0xc(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_mul>:
movss  (%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rsi)
mulss  0x4(%rdi),%xmm0
movss  %xmm0,0x4(%rsi)
ret

LLVM IR (-O0):
define void @vec2_mul(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 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float, float* %5
%11 = fmul float %9, %10
%12 = load float*, float** %6
%13 = getelementptr inbounds float, float* %12, i64 0
store float %11, float* %13
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = load float, float* %5
%18 = fmul float %16, %17
%19 = load float*, float** %6
%20 = getelementptr inbounds float, float* %19, i64 1
store float %18, float* %20
ret void
}

LLVM IR (-O2):
define void @vec2_mul(float* nocapture %0, float %1, float* nocapture writeonly %2) {
%4 = load float, float* %0
%5 = fmul float %4, %1
store float %5, float* %2
%6 = getelementptr inbounds float, float* %0, i64 1
%7 = load float, float* %6
%8 = fmul float %7, %1
%9 = getelementptr inbounds float, float* %2, i64 1
store float %8, float* %9
ret void
}
void GB_MINUS_f_FP32(float *z, const float *x, const float *y) {
  (*z) = (*x) - (*y);
}


x86 assembly (clang, -O0):
<GB_MINUS_f_FP32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GB_MINUS_f_FP32>:
movss  (%rsi),%xmm0
subss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @GB_MINUS_f_FP32(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* %7
%9 = load float*, float** %6
%10 = load float, float* %9
%11 = fsub float %8, %10
%12 = load float*, float** %4
store float %11, float* %12
ret void
}

LLVM IR (-O2):
define void @GB_MINUS_f_FP32(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fsub float %4, %5
store float %6, float* %0
ret void
}
long long int Ladd(long long int x, long long int y) { return x + y; }


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

x86 assembly (clang, -O2):
<Ladd>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @Ladd(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @Ladd(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tagstruct_put_timeval() {
  printf("NOT IMPLEMENTED:"
         "pa_tagstruct_put_timeval"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"NOT IMPLEMENTED:pa_tagstruct_put_timeval\0A\00"
define i32 @pa_tagstruct_put_timeval() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [41 x i8] c"NOT IMPLEMENTED:pa_tagstruct_put_timeval\00"
define i32 @pa_tagstruct_put_timeval() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int SerialAPI_request(unsigned char *, int);
int SerialAPI_soft_reset(void) {
  unsigned char buf[2];
  buf[0] = 0x00;
  buf[1] = 0x08;
  return SerialAPI_request(buf, 2);
}


x86 assembly (clang, -O0):
<SerialAPI_soft_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x2(%rbp)
movb   $0x8,-0x1(%rbp)
lea    -0x2(%rbp),%rdi
mov    $0x2,%esi
call   1030 <SerialAPI_request@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SerialAPI_soft_reset>:
push   %rax
movw   $0x800,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <SerialAPI_request@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @SerialAPI_soft_reset() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
store i8 0, i8* %2
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
store i8 8, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%5 = call i32 @SerialAPI_request(i8* %4, i32 2)
ret i32 %5
}

LLVM IR (-O2):
define i32 @SerialAPI_soft_reset() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
store i8 0, i8* %2
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
store i8 8, i8* %3
%4 = call i32 @SerialAPI_request(i8* %2, i32 2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _c_setbyte(int);
void SAHF() {
  ;
  _c_setbyte(0x9e);
  ;
}


x86 assembly (clang, -O0):
<SAHF>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9e,%edi
call   1030 <_c_setbyte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SAHF>:
mov    $0x9e,%edi
jmp    1030 <_c_setbyte@plt>

LLVM IR (-O0):
define void @SAHF() {
%1 = call i32 @_c_setbyte(i32 158)
ret void
}

LLVM IR (-O2):
define void @SAHF() {
%1 = tail call i32 @_c_setbyte(i32 158)
ret void
}
/* Variables and functions */
int recv(int, void *, int, int /*<<< orphan*/);
int socket_receive(int fileDesc, void *data, int max_size) {
  return recv(fileDesc, data, max_size, 0);
}


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

x86 assembly (clang, -O2):
<socket_receive>:
xor    %ecx,%ecx
jmp    1030 <recv@plt>

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

LLVM IR (-O2):
define i32 @socket_receive(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
int parity(unsigned long long _inp) {
  unsigned long long mask;
  int res;
  int i;
  mask = 1;
  res = 0;
  for (i = 0; i < sizeof(unsigned long long) * 8; i++) {
    res ^= (_inp & mask) ? 1 : 0;
    mask *= 2;
  }
  return (res);
}


x86 assembly (clang, -O0):
<parity>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movslq -0x18(%rbp),%rax
cmp    $0x40,%rax
jae    1162 <parity+0x62>
mov    -0x8(%rbp),%rdx
and    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111e <parity+0x1e>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parity>:
mov    $0x1,%ecx
xor    %eax,%eax
mov    $0x40,%r8d
nopl   (%rax)
xor    %esi,%esi
test   %rdi,%rcx
setne  %sil
xor    %eax,%esi
lea    (%rcx,%rcx,1),%rax
xor    %edx,%edx
test   %rdi,%rax
setne  %dl
xor    %esi,%edx
lea    0x0(,%rcx,4),%rax
xor    %esi,%esi
test   %rdi,%rax
setne  %sil
lea    0x0(,%rcx,8),%r9
xor    %eax,%eax
test   %rdi,%r9
setne  %al
xor    %esi,%eax
xor    %edx,%eax
shl    $0x4,%rcx
add    $0xfffffffc,%r8d
jne    1110 <parity+0x10>
ret

LLVM IR (-O0):
define i32 @parity(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i64 %0, i64* %2
store i64 1, i64* %3
store i32 0, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %21, %1
%7 = load i32, i32* %5
%8 = sext i32 %7 to i64
%9 = icmp ult i64 %8, 64
br i1 %9, label %10, label %24
10: ; preds = %6
%11 = load i64, i64* %2
%12 = load i64, i64* %3
%13 = and i64 %11, %12
%14 = icmp ne i64 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 1, i32 0
%17 = load i32, i32* %4
%18 = xor i32 %17, %16
store i32 %18, i32* %4
%19 = load i64, i64* %3
%20 = mul i64 %19, 2
store i64 %20, i64* %3
br label %21
21: ; preds = %10
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
define i32 @parity(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %26, %2 ]
%4 = phi i32 [ 0, %1 ], [ %24, %2 ]
%5 = phi i64 [ 1, %1 ], [ %25, %2 ]
%6 = and i64 %5, %0
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
%9 = xor i32 %4, %8
%10 = shl i64 %5, 1
%11 = and i64 %10, %0
%12 = icmp ne i64 %11, 0
%13 = zext i1 %12 to i32
%14 = xor i32 %9, %13
%15 = shl i64 %5, 2
%16 = and i64 %15, %0
%17 = icmp ne i64 %16, 0
%18 = zext i1 %17 to i32
%19 = xor i32 %14, %18
%20 = shl i64 %5, 3
%21 = and i64 %20, %0
%22 = icmp ne i64 %21, 0
%23 = zext i1 %22 to i32
%24 = xor i32 %19, %23
%25 = shl i64 %5, 4
%26 = add nuw nsw i32 %3, 4
%27 = icmp eq i32 %26, 64
br i1 %27, label %28, label %2
28: ; preds = %2
ret i32 %24
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stdout;
void logstr(char *name, char *str) {
  fprintf(stdout, "STRING -- `%s`: %s -- (str)\n", name, str);
}


x86 assembly (clang, -O0):
<logstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logstr>:
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [29 x i8] c"STRING -- `%s`: %s -- (str)\0A\00"
define void @logstr(i8* %0, i8* %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
int test_imm_25uint8_mem(unsigned char *val) {
  return ((*val) & (0x25 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_25uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 37
%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_25uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 37
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int chk_int(char *name, int ierr) {
#pragma xmp nodes p(*)
#pragma xmp task on p(1)
  {
    if (ierr == 0) {
      printf("PASS %s\n", name);
    } else {
      printf("ERROR\n");
      exit(1);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<chk_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1150 <chk_int+0x30>
mov    -0x8(%rbp),%rsi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1168 <chk_int+0x48>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chk_int>:
push   %rax
test   %esi,%esi
jne    114d <chk_int+0x1d>
mov    %rdi,%rax
lea    0xec1(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"PASS %s\0A\00"
@.str.1 = [7 x i8] c"ERROR\0A\00"
define i32 @chk_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %13
10: ; preds = %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"PASS %s\0A\00"
@str = [6 x i8] c"ERROR\00"
define i32 @chk_int(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *realloc(void *, size_t);
void *fcitx_utils_realloc(void *ptr, size_t size) {
  void *result = realloc(ptr, size);
  if (!result) {
    abort();
  }
  return result;
}


x86 assembly (clang, -O0):
<fcitx_utils_realloc>:
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   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <fcitx_utils_realloc+0x33>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcitx_utils_realloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     112d <fcitx_utils_realloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @fcitx_utils_realloc(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
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @fcitx_utils_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
scalar_t__ write(int, char *, int);
void vprint(int fd, char *s, int len) {
  if (write(fd, s, len))
    ;
}


x86 assembly (clang, -O0):
<vprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
cmp    $0x0,%rax
je     1140 <vprint+0x30>
jmp    1140 <vprint+0x30>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vprint>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @vprint(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i64 @write(i32 %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void space(int count) {
  for (int i = 0; i < count; i++)
    printf(" ");
}


x86 assembly (clang, -O0):
<space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <space+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <space+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<space>:
push   %rbx
test   %edi,%edi
jle    112f <space+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <space+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @space(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @putchar(i32 32)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int /*<<< orphan*/, int);
void wes_version() {
  printf("%s %d.%d\n"
         "Copyright (C) 2005-2013 Alejandro Ricoveri\n"
         "This is free software; see the source for "
         "copying conditions.  There is NO\n"
         "warranty; not even for MERCHANTABILITY or "
         "FITNESS FOR A PARTICULAR PURPOSE.\n\n",
         "wes", 0, 1);
}


x86 assembly (clang, -O0):
<wes_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xfab(%rip),%rsi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wes_version>:
lea    0xee9(%rip),%rdi
lea    0xfaf(%rip),%rsi
xor    %edx,%edx
mov    $0x1,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [205 x i8] c"%s %d.%d\0ACopyright (C) 2005-2013 Alejandro Ricoveri\0AThis is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\0A\0A\00"
@.str.1 = [4 x i8] c"wes\00"
define void @wes_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([205 x i8], [205 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [205 x i8] c"%s %d.%d\0ACopyright (C) 2005-2013 Alejandro Ricoveri\0AThis is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\0A\0A\00"
@.str.1 = [4 x i8] c"wes\00"
define void @wes_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([205 x i8], [205 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 1)
ret void
}
/* Variables and functions */
size_t power2(size_t power) { return (size_t)1 << power; }


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

x86 assembly (clang, -O2):
<power2>:
mov    %rdi,%rcx
mov    $0x1,%eax
shl    %cl,%rax
ret

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

LLVM IR (-O2):
define i64 @power2(i64 %0) {
%2 = shl nuw i64 1, %0
ret i64 %2
}
/* Type definitions */
struct render_backend {
  int dummy;
};
struct host {
  int dummy;
};

/* Variables and functions */
struct render_backend *video_create_renderer(struct host *base) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.render_backend = type { i32 }
%struct.host = type { i32 }
define %struct.render_backend* @video_create_renderer(%struct.host* %0) {
%2 = alloca %struct.host*
store %struct.host* %0, %struct.host** %2
ret %struct.render_backend* null
}

LLVM IR (-O2):
%struct.render_backend = type { i32 }
%struct.host = type { i32 }
define noalias %struct.render_backend* @video_create_renderer(%struct.host* nocapture readnone %0) {
ret %struct.render_backend* null
}
int finitel(long double x) { return __builtin_isfinite(x); }


x86 assembly (clang, -O0):
<finitel>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fabs
flds   0xeeb(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<finitel>:
fldt   0x8(%rsp)
fabs
flds   0xef4(%rip)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setne  %al
ret

LLVM IR (-O0):
define i32 @finitel(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @llvm.fabs.f80(x86_fp80 %3)
%5 = fcmp one x86_fp80 %4, 0xK7FFF8000000000000000
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @finitel(x86_fp80 %0) {
%2 = tail call x86_fp80 @llvm.fabs.f80(x86_fp80 %0)
%3 = fcmp one x86_fp80 %2, 0xK7FFF8000000000000000
%4 = zext i1 %3 to i32
ret i32 %4
}