xunge/DecIR huggingface dataset:
regx0regx1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if ((p0[x0]) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<regx0regx1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x28(%rbp),%rcx
movslq -0x14(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jg     1140 <regx0regx1+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <regx0regx1+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0regx1>:
movslq %edx,%rax
mov    (%r8,%rax,4),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    (%r9,%rcx,4),%edx
setle  %al
ret

LLVM IR (-O0):
define i32 @regx0regx1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = 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
%14 = load i32*, i32** %12
%15 = load i32, i32* %10
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32*, i32** %13
%20 = load i32, i32* %11
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
%24 = icmp sle i32 %18, %23
br i1 %24, label %25, label %26
25: ; preds = %6
store i32 1, i32* %7
br label %27
26: ; preds = %6
store i32 0, i32* %7
br label %27
27: ; preds = %26, %25
%28 = load i32, i32* %7
ret i32 %28
}

LLVM IR (-O2):
define i32 @regx0regx1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %4, i64 %7
%9 = load i32, i32* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds i32, i32* %5, i64 %10
%12 = load i32, i32* %11
%13 = icmp sle i32 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sw_printHeader(void) {
  printf("*****************************************************************\n");
  printf("* Samsung System LSI wifi application for t20                   *\n");
  printf("*****************************************************************\n");
}


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

x86 assembly (clang, -O2):
<sw_printHeader>:
push   %rbx
lea    0xf2a(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [67 x i8] c"*****************************************************************\0A\00"
@.str.1 = [67 x i8] c"* Samsung System LSI wifi application for t20 *\0A\00"
define void @sw_printHeader() {
%1 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str.2 = [66 x i8] c"* Samsung System LSI wifi application for t20 *\00"
@str.3 = [66 x i8] c"*****************************************************************\00"
define void @sw_printHeader() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.3, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hash(int /*<<< orphan*/);
void test() {
  { hash(0); }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <hash@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
xor    %edi,%edi
jmp    1030 <hash@plt>

LLVM IR (-O0):
define void @test() {
%1 = call i32 @hash(i32 0)
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @hash(i32 0)
ret void
}
int main() {
  struct a {
    int f;
  } x[1];
  struct a y;
  x[0].f = 7;
  assert(x[0].f == 7);
  y = x[0];
  assert(y.f == 7);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x7,-0x8(%rbp)
cmpl   $0x7,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x7,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.a = type { i32 }
define i32 @main() {
%1 = alloca [1 x %struct.a]
%2 = alloca %struct.a
%3 = getelementptr inbounds [1 x %struct.a], [1 x %struct.a]* %1, i64 0, i64 0
%4 = getelementptr inbounds %struct.a, %struct.a* %3, i32 0, i32 0
store i32 7, i32* %4
%5 = getelementptr inbounds [1 x %struct.a], [1 x %struct.a]* %1, i64 0, i64 0
%6 = getelementptr inbounds %struct.a, %struct.a* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 7
%9 = zext i1 %8 to i32
%10 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %9)
%11 = getelementptr inbounds [1 x %struct.a], [1 x %struct.a]* %1, i64 0, i64 0
%12 = bitcast %struct.a* %2 to i8*
%13 = bitcast %struct.a* %11 to i8*
%14 = getelementptr inbounds %struct.a, %struct.a* %2, i32 0, i32 0
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 7
%17 = zext i1 %16 to i32
%18 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ rConnect(char *);
int /*<<< orphan*/ rForward(double, int);
char *rGetName();
int /*<<< orphan*/ rStop();
int /*<<< orphan*/ sleep(int);
int main() {
  const char *nombre;
  rConnect("192.168.2.100");
  rForward(.6, 1);
  sleep(1);
  rStop();
  nombre = rGetName();
  printf("El nombre del robot es : #%s#\n", nombre);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe82(%rip),%rdi
call   1060 <rConnect@plt>
movsd  0xe6d(%rip),%xmm0
mov    $0x1,%edi
call   1030 <rForward@plt>
mov    $0x1,%edi
call   1090 <sleep@plt>
mov    $0x0,%al
call   1040 <rStop@plt>
mov    $0x0,%al
call   1070 <rGetName@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe52(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xe90(%rip),%rdi
call   1060 <rConnect@plt>
movsd  0xe7b(%rip),%xmm0
mov    $0x1,%edi
call   1030 <rForward@plt>
mov    $0x1,%edi
call   1090 <sleep@plt>
xor    %eax,%eax
call   1040 <rStop@plt>
xor    %eax,%eax
call   1070 <rGetName@plt>
lea    0xe68(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"192.168.2.100\00"
@.str.1 = [31 x i8] c"El nombre del robot es : #%s#\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 @rConnect(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @rForward(double 6.000000e-01, i32 1)
%5 = call i32 @sleep(i32 1)
%6 = call i32 (...) @rStop()
%7 = call i8* (...) @rGetName()
store i8* %7, i8** %2
%8 = load i8*, i8** %2
%9 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"192.168.2.100\00"
@.str.1 = [31 x i8] c"El nombre del robot es : #%s#\0A\00"
define i32 @main() {
%1 = tail call i32 @rConnect(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @rForward(double 6.000000e-01, i32 1)
%3 = tail call i32 @sleep(i32 1)
%4 = tail call i32 (...) @rStop()
%5 = tail call i8* (...) @rGetName()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int open64(char const *, int, unsigned short);
int open(const char *pathname, int flags, unsigned short mode) {
  return open64(pathname, flags, mode);
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
movzwl -0xe(%rbp),%edx
call   1030 <open64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
jmp    1030 <open64@plt>

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

LLVM IR (-O2):
define i32 @open(i8* nocapture %0, i32 %1, i16 zeroext %2) {
%4 = tail call i32 @open64(i8* %0, i32 %1, i16 zeroext %2)
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ pw_name;
};

/* Variables and functions */
int /*<<< orphan*/ geteuid();
TYPE_1__ *getpwuid(int /*<<< orphan*/);
char *strdup(int /*<<< orphan*/);
char *username() { return strdup(getpwuid(geteuid())->pw_name); }


x86 assembly (clang, -O0):
<username>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <geteuid@plt>
mov    %eax,%edi
call   1030 <getpwuid@plt>
mov    (%rax),%edi
call   1050 <strdup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<username>:
push   %rax
xor    %eax,%eax
call   1040 <geteuid@plt>
mov    %eax,%edi
call   1030 <getpwuid@plt>
mov    (%rax),%edi
pop    %rax
jmp    1050 <strdup@plt>

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define i8* @username() {
%1 = call i32 (...) @geteuid()
%2 = call %struct.TYPE_2__* @getpwuid(i32 %1)
%3 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %2, i32 0, i32 0
%4 = load i32, i32* %3
%5 = call i8* @strdup(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
%struct.TYPE_2__ = type { i32 }
define i8* @username() {
%1 = tail call i32 (...) @geteuid()
%2 = tail call %struct.TYPE_2__* @getpwuid(i32 %1)
%3 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %2, i64 0, i32 0
%4 = load i32, i32* %3
%5 = tail call i8* @strdup(i32 %4)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
FILE *fopen_utf8(const char *_Filename, const char *_Mode) {
  return fopen(_Filename, _Mode);
}


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

x86 assembly (clang, -O2):
<fopen_utf8>:
jmp    1030 <fopen@plt>

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

LLVM IR (-O2):
define noalias i32* @fopen_utf8(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
ret i32* %3
}
char *get_dot_separated_int(unsigned val) {
  static char str[16];
  return str;
}


x86 assembly (clang, -O0):
<get_dot_separated_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0x2f22(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@get_dot_separated_int.str = internal global [16 x i8] zeroinitializer
define i8* @get_dot_separated_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @get_dot_separated_int.str, i64 0, i64 0)
}

LLVM IR (-O2):
@get_dot_separated_int.str = internal global [16 x i8] zeroinitializer
define i8* @get_dot_separated_int(i32 %0) {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @get_dot_separated_int.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ interpret(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  FILE *myfile;
  myfile = fopen(argv[1], "r");
  if (myfile == NULL)
    return -1;
  interpret(myfile);
  fclose(myfile);
  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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xeab(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1175 <main+0x45>
movl   $0xffffffff,-0x4(%rbp)
jmp    118e <main+0x5e>
mov    -0x18(%rbp),%rdi
call   1050 <interpret@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
lea    0xec4(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     115d <main+0x2d>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <interpret@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @interpret(i32* %5)
%9 = tail call i32 @fclose(i32* %5)
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ 0, %7 ], [ -1, %2 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t le64(uint64_t val) { return val; }


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

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

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

LLVM IR (-O2):
define i32 @le64(i32 returned %0) {
ret i32 %0
}
unsigned setbits(unsigned x, int p, int n, int y) {
  unsigned bitmask = ~(~0 << n);
  return ((bitmask & y) << p) | (~(bitmask << p) & x);
}


x86 assembly (clang, -O0):
<setbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    -0x4(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbits>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
and    %eax,%r8d
mov    %esi,%ecx
shl    %cl,%r8d
shl    %cl,%eax
not    %eax
and    %edi,%eax
or     %r8d,%eax
ret

LLVM IR (-O0):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %7
%11 = shl i32 -1, %10
%12 = xor i32 %11, -1
store i32 %12, i32* %9
%13 = load i32, i32* %9
%14 = load i32, i32* %8
%15 = and i32 %13, %14
%16 = load i32, i32* %6
%17 = shl i32 %15, %16
%18 = load i32, i32* %9
%19 = load i32, i32* %6
%20 = shl i32 %18, %19
%21 = xor i32 %20, -1
%22 = load i32, i32* %5
%23 = and i32 %21, %22
%24 = or i32 %17, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl nsw i32 -1, %2
%6 = xor i32 %5, -1
%7 = and i32 %6, %3
%8 = shl i32 %7, %1
%9 = shl i32 %6, %1
%10 = xor i32 %9, -1
%11 = and i32 %10, %0
%12 = or i32 %8, %11
ret i32 %12
}
/* Type definitions */
struct ev_loop {
  int dummy;
};

/* Variables and functions */
struct ev_loop *ev_default_loop_uc();
struct ev_loop *ev_default_loop(unsigned int flags) {
  struct ev_loop *loop = ev_default_loop_uc();
  if (!loop) {
    extern struct ev_loop *ev_default_loop_init(unsigned int flags);
    loop = ev_default_loop_init(flags);
  }
  return loop;
}


x86 assembly (clang, -O0):
<ev_default_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <ev_default_loop_uc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114d <ev_default_loop+0x2d>
mov    -0x4(%rbp),%edi
call   1030 <ev_default_loop_init@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ev_default_loop>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <ev_default_loop_uc@plt>
test   %rax,%rax
je     1131 <ev_default_loop+0x11>
pop    %rbx
ret
mov    %ebx,%edi
pop    %rbx
jmp    1030 <ev_default_loop_init@plt>

LLVM IR (-O0):
%struct.ev_loop = type { i32 }
define %struct.ev_loop* @ev_default_loop(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.ev_loop*
store i32 %0, i32* %2
%4 = call %struct.ev_loop* (...) @ev_default_loop_uc()
store %struct.ev_loop* %4, %struct.ev_loop** %3
%5 = load %struct.ev_loop*, %struct.ev_loop** %3
%6 = icmp ne %struct.ev_loop* %5, null
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call %struct.ev_loop* @ev_default_loop_init(i32 %8)
store %struct.ev_loop* %9, %struct.ev_loop** %3
br label %10
10: ; preds = %7, %1
%11 = load %struct.ev_loop*, %struct.ev_loop** %3
ret %struct.ev_loop* %11
}

LLVM IR (-O2):
%struct.ev_loop = type { i32 }
define %struct.ev_loop* @ev_default_loop(i32 %0) {
%2 = tail call %struct.ev_loop* (...) @ev_default_loop_uc()
%3 = icmp eq %struct.ev_loop* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call %struct.ev_loop* @ev_default_loop_init(i32 %0)
br label %6
6: ; preds = %4, %1
%7 = phi %struct.ev_loop* [ %2, %1 ], [ %5, %4 ]
ret %struct.ev_loop* %7
}
const char *TA_GetVersionTime(void) { return "06:18:21"; }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"06:18:21\00"
define i8* @TA_GetVersionTime() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"06:18:21\00"
define i8* @TA_GetVersionTime() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
void dereference_in_array_access(int **p) {
  if (p[0])
    ;
  if ((*p)[1])
    ;
  if (p[**p])
    ;
  if ((*p)[**p])
    ;
}


x86 assembly (clang, -O0):
<dereference_in_array_access>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     111b <dereference_in_array_access+0x1b>
jmp    111b <dereference_in_array_access+0x1b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmpl   $0x0,0x4(%rax)
je     1131 <dereference_in_array_access+0x31>
jmp    1131 <dereference_in_array_access+0x31>
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
movslq (%rcx),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     114f <dereference_in_array_access+0x4f>
jmp    114f <dereference_in_array_access+0x4f>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
movslq (%rcx),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     116f <dereference_in_array_access+0x6f>
jmp    116f <dereference_in_array_access+0x6f>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dereference_in_array_access(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32**, i32*** %2
%4 = getelementptr inbounds i32*, i32** %3, i64 0
%5 = load i32*, i32** %4
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %1
%9 = load i32**, i32*** %2
%10 = load i32*, i32** %9
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %8
br label %15
15: ; preds = %14, %8
%16 = load i32**, i32*** %2
%17 = load i32**, i32*** %2
%18 = load i32*, i32** %17
%19 = load i32, i32* %18
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32*, i32** %16, i64 %20
%22 = load i32*, i32** %21
%23 = icmp ne i32* %22, null
br i1 %23, label %24, label %25
24: ; preds = %15
br label %25
25: ; preds = %24, %15
%26 = load i32**, i32*** %2
%27 = load i32*, i32** %26
%28 = load i32**, i32*** %2
%29 = load i32*, i32** %28
%30 = load i32, i32* %29
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i32, i32* %27, i64 %31
%33 = load i32, i32* %32
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %36
35: ; preds = %25
br label %36
36: ; preds = %35, %25
ret void
}

LLVM IR (-O2):
define void @dereference_in_array_access(i32** nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint;

/* Variables and functions */
int cmpuints(const void *A, const void *B) {
  uint *a = (uint *)A;
  uint *b = (uint *)B;
  return ((*a) >= (*b));
}


x86 assembly (clang, -O0):
<cmpuints>:
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
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpuints>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmp    (%rsi),%rcx
setge  %al
ret

LLVM IR (-O0):
define i32 @cmpuints(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i64*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i64*
store i64* %8, i64** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i64*
store i64* %10, i64** %6
%11 = load i64*, i64** %5
%12 = load i64, i64* %11
%13 = load i64*, i64** %6
%14 = load i64, i64* %13
%15 = icmp sge i64 %12, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @cmpuints(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sge i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void outw(unsigned short value, int port) {
  asm volatile("out"
               "w"
               " %"
               "w"
               "0, %w1"
               :
               : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x8(%rbp),%edx
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw>:
mov    %esi,%edx
mov    %edi,%eax
out    %ax,(%dx)
ret

LLVM IR (-O0):
define void @outw(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @outw(i16 zeroext %0, i32 %1) {
tail call void asm sideeffect "outw ${0:w}, ${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0, i32 %1)
ret void
}
/* Variables and functions */
double calc_linear_factor(double, double);
double sin(double);
double calc_sine_factor(double middle, double z) {
  z = calc_linear_factor(middle, z);
  return (sin((-3.141592653 / 2.0) + 3.141592653 * z) + 1.0) / 2.0;
}


x86 assembly (clang, -O0):
<calc_sine_factor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <calc_linear_factor@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xebd(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb9(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sin@plt>
movsd  0xe98(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe84(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_sine_factor>:
push   %rax
call   1040 <calc_linear_factor@plt>
mulsd  0xed2(%rip),%xmm0
addsd  0xed2(%rip),%xmm0
call   1030 <sin@plt>
addsd  0xecd(%rip),%xmm0
mulsd  0xecd(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @calc_sine_factor(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 = call double @calc_linear_factor(double %5, double %6)
store double %7, double* %4
%8 = load double, double* %4
%9 = call double @llvm.fmuladd.f64(double 0x400921FB542FE938, double %8, double 0xBFF921FB542FE938)
%10 = call double @sin(double %9)
%11 = fadd double %10, 1.000000e+00
%12 = fdiv double %11, 2.000000e+00
ret double %12
}

LLVM IR (-O2):
define double @calc_sine_factor(double %0, double %1) {
%3 = tail call double @calc_linear_factor(double %0, double %1)
%4 = tail call double @llvm.fmuladd.f64(double %3, double 0x400921FB542FE938, double 0xBFF921FB542FE938)
%5 = tail call double @sin(double %4)
%6 = fadd double %5, 1.000000e+00
%7 = fmul double %6, 5.000000e-01
ret double %7
}
int test_imm_FBuint32_reg(unsigned int val) {
  return ((val) & (0xFB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FBuint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xfb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_FBuint32_reg(i32 %0) {
%2 = and i32 %0, 251
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
float calc_double_float(float given) { return given * 2.0; }


x86 assembly (clang, -O0):
<calc_double_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_double_float>:
addss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @calc_double_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 2.000000e+00
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @calc_double_float(float %0) {
%2 = fmul float %0, 2.000000e+00
ret float %2
}
int sd_select(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @sd_select() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void callme(void) { printf("do something...\n"); }


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"do something...\00"
define void @callme() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ process_can(int /*<<< orphan*/);
void CAN1_TX_IRQ_Handler(void) { process_can(0); }


x86 assembly (clang, -O0):
<CAN1_TX_IRQ_Handler>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <process_can@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CAN1_TX_IRQ_Handler>:
xor    %edi,%edi
jmp    1030 <process_can@plt>

LLVM IR (-O0):
define void @CAN1_TX_IRQ_Handler() {
%1 = call i32 @process_can(i32 0)
ret void
}

LLVM IR (-O2):
define void @CAN1_TX_IRQ_Handler() {
%1 = tail call i32 @process_can(i32 0)
ret void
}
/* Variables and functions */
int setreuid(int, int);
int sreuid(int a, int b) { return setreuid(a, b); }


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

x86 assembly (clang, -O2):
<sreuid>:
jmp    1030 <setreuid@plt>

LLVM IR (-O0):
define i32 @sreuid(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 @setreuid(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @sreuid(i32 %0, i32 %1) {
%3 = tail call i32 @setreuid(i32 %0, i32 %1)
ret i32 %3
}
void ISRPendSV(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<ISRPendSV>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <ISRPendSV+0x9>
jmp    1109 <ISRPendSV+0x9>

x86 assembly (clang, -O2):
<ISRPendSV>:
jmp    1100 <ISRPendSV>

LLVM IR (-O0):
define void @ISRPendSV() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @ISRPendSV() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
struct mt19937_state {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int mt19937_genrand_int32(struct mt19937_state *);
int32_t mt19937_genrand_int31(struct mt19937_state *rng) {
  return (int32_t)(mt19937_genrand_int32(rng) >> 1);
}


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

x86 assembly (clang, -O2):
<mt19937_genrand_int31>:
push   %rax
call   1030 <mt19937_genrand_int32@plt>
sar    %eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.mt19937_state = type { i32 }
define i32 @mt19937_genrand_int31(%struct.mt19937_state* %0) {
%2 = alloca %struct.mt19937_state*
store %struct.mt19937_state* %0, %struct.mt19937_state** %2
%3 = load %struct.mt19937_state*, %struct.mt19937_state** %2
%4 = call i32 @mt19937_genrand_int32(%struct.mt19937_state* %3)
%5 = ashr i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
%struct.mt19937_state = type { i32 }
define i32 @mt19937_genrand_int31(%struct.mt19937_state* %0) {
%2 = tail call i32 @mt19937_genrand_int32(%struct.mt19937_state* %0)
%3 = ashr i32 %2, 1
ret i32 %3
}
int kvmppc_reset_htab(int shift_hint) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @kvmppc_reset_htab(i32 %0) {
ret i32 0
}
void test16() {
  const char c = '5';
  switch (c) {
  case '6':
    return;
  }
}


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

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

LLVM IR (-O0):
define void @test16() {
%1 = alloca i8
store i8 53, i8* %1
ret void
}

LLVM IR (-O2):
define void @test16() {
ret void
}
void debug_dump_memory_words(const void *mem, int len) {
  *((volatile unsigned int *)((
      ((((((((0xf0000000)) + (4 * 1024 * 1024)) + (4 * 1024 * 1024)) +
          (4 * 1024 * 1024)) +
         (4 * 1024 * 1024)) +
        (4 * 1024 * 1024)) +
       (4 * 1024 * 1024)) +
      12))) = (unsigned int)mem;
  *((volatile unsigned int *)((
      ((((((((0xf0000000)) + (4 * 1024 * 1024)) + (4 * 1024 * 1024)) +
          (4 * 1024 * 1024)) +
         (4 * 1024 * 1024)) +
        (4 * 1024 * 1024)) +
       (4 * 1024 * 1024)) +
      16))) = len;
  *((volatile unsigned int *)((
      ((((((((0xf0000000)) + (4 * 1024 * 1024)) + (4 * 1024 * 1024)) +
          (4 * 1024 * 1024)) +
         (4 * 1024 * 1024)) +
        (4 * 1024 * 1024)) +
       (4 * 1024 * 1024)) +
      28))) = 1;
}


x86 assembly (clang, -O0):
<debug_dump_memory_words>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    $0xf180000c,%eax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    $0xf1800010,%eax
mov    %ecx,(%rax)
mov    $0xf180001c,%eax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_dump_memory_words>:
mov    $0xf180000c,%eax
mov    %edi,(%rax)
mov    %esi,0x4(%rax)
movl   $0x1,0x10(%rax)
ret

LLVM IR (-O0):
define void @debug_dump_memory_words(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 = ptrtoint i8* %5 to i32
store volatile i32 %6, i32* inttoptr (i64 4051697676 to i32*)
%7 = load i32, i32* %4
store volatile i32 %7, i32* inttoptr (i64 4051697680 to i32*)
store volatile i32 1, i32* inttoptr (i64 4051697692 to i32*)
ret void
}

LLVM IR (-O2):
define void @debug_dump_memory_words(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
store volatile i32 %4, i32* inttoptr (i64 4051697676 to i32*)
store volatile i32 %1, i32* inttoptr (i64 4051697680 to i32*)
store volatile i32 1, i32* inttoptr (i64 4051697692 to i32*)
ret void
}
void inc() {
  int i = 0;
  i++;
}


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

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

LLVM IR (-O0):
define void @inc() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
void *child_fn(void *arg) {
  pthread_mutex_unlock((pthread_mutex_t *)arg);
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @child_fn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @pthread_mutex_unlock(i32* %4)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @child_fn(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @pthread_mutex_unlock(i32* %2)
ret i8* null
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(char);
int main() {
  int c;
  do {
    c = getchar();
    if (c == '\n') {
      continue;
    }
    if (c != EOF) {
      putchar('f');
    } else {
      putchar('t');
    }
    putchar('\n');
  } while (c != '1');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jne    1148 <main+0x28>
jmp    117d <main+0x5d>
mov    -0x8(%rbp),%eax
mov    0x2e96(%rip),%rcx
cmp    (%rcx),%eax
je     1169 <main+0x49>
mov    $0x66,%edi
call   1030 <putchar@plt>
jmp    1173 <main+0x53>
mov    $0x74,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x31,-0x8(%rbp)
jne    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%r14
jmp    1144 <main+0x24>
nopl   (%rax)
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x31,%ebx
je     1163 <main+0x43>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     1144 <main+0x24>
mov    %eax,%ebx
mov    $0x74,%edi
cmp    (%r14),%eax
je     1130 <main+0x10>
mov    $0x66,%edi
jmp    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %18, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 10
br i1 %6, label %7, label %8
7: ; preds = %3
br label %18
8: ; preds = %3
%9 = load i32, i32* %2
%10 = load i32, i32* @EOF
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @putchar(i8 signext 102)
br label %16
14: ; preds = %8
%15 = call i32 @putchar(i8 signext 116)
br label %16
16: ; preds = %14, %12
%17 = call i32 @putchar(i8 signext 10)
br label %18
18: ; preds = %16, %7
%19 = load i32, i32* %2
%20 = icmp ne i32 %19, 49
br i1 %20, label %3, label %21
21: ; preds = %18
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
br label %1
1: ; preds = %11, %0
%2 = tail call i32 (...) @getchar()
%3 = icmp eq i32 %2, 10
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %2, %5
%7 = select i1 %6, i8 116, i8 102
%8 = tail call i32 @putchar(i8 signext %7)
%9 = tail call i32 @putchar(i8 signext 10)
%10 = icmp eq i32 %2, 49
br i1 %10, label %12, label %11
11: ; preds = %4, %1
br label %1
12: ; preds = %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void erase_cursor() { printf("\x1b[?25l"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?25l\00"
define void @erase_cursor() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
int sstriping_build_io_for_req(void *vrt_req) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sstriping_build_io_for_req(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
float gen_float_random(void) {
  float a = 5.0;
  return (((float)rand() / (float)(RAND_MAX)) * a);
}


x86 assembly (clang, -O0):
<gen_float_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2eb0(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
mulss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_float_random>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
mulss  0xecb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define float @gen_float_random() {
%1 = alloca float
store float 5.000000e+00, float* %1
%2 = call i64 (...) @rand()
%3 = sitofp i64 %2 to float
%4 = load i64, i64* @RAND_MAX
%5 = sitofp i64 %4 to float
%6 = fdiv float %3, %5
%7 = load float, float* %1
%8 = fmul float %6, %7
ret float %8
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define float @gen_float_random() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to float
%5 = fdiv float %2, %4
%6 = fmul float %5, 5.000000e+00
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int getint() {
  int x;
  scanf("%d", &x);
  return x;
}


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

x86 assembly (clang, -O2):
<getint>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @getint() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t f32(int64_t i) {
  int64_t j = 0, i0;
  while (j < i * i) {
    i0 = i;
    i = i0 + i0 + 1;
    j = i0;
  }
  return i;
}


x86 assembly (clang, -O0):
<f32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
imul   -0x4(%rbp),%ecx
cmp    %ecx,%eax
jge    113d <f32+0x3d>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110e <f32+0xe>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f32>:
mov    %edi,%eax
imul   %edi,%eax
test   %eax,%eax
je     1122 <f32+0x22>
nopl   0x0(%rax)
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
mov    %eax,%ecx
imul   %eax,%ecx
cmp    %ecx,%edi
mov    %eax,%edi
jl     1110 <f32+0x10>
ret
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f32(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %0, %1 ]
%6 = shl nsw i32 %5, 1
%7 = or i32 %6, 1
%8 = mul nsw i32 %7, %7
%9 = icmp slt i32 %5, %8
br i1 %9, label %4, label %10
10: ; preds = %4, %1
%11 = phi i32 [ %0, %1 ], [ %7, %4 ]
ret i32 %11
}
int tx_rollback(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @tx_rollback() {
ret i32 0
}

LLVM IR (-O2):
define i32 @tx_rollback() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t get_unaligned_uint64(const void *p) {
  const struct { uint64_t d; } __attribute__((packed)) *pp = p;
  return pp->d;
}


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

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

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

LLVM IR (-O2):
define i32 @get_unaligned_uint64(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ printf(char *);
int main() {
  fork();
  fork();
  fork();
  printf("Ola\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    $0x0,%al
call   1040 <fork@plt>
mov    $0x0,%al
call   1040 <fork@plt>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [4 x i8] c"Ola\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = tail call i32 (...) @fork()
%3 = tail call i32 (...) @fork()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *append_trail_slash(int /*<<< orphan*/);
int /*<<< orphan*/ getcwd(char *, int);
int /*<<< orphan*/ q_(int /*<<< orphan*/);
char *currentdir(void) {
  char buf[2048];
  return append_trail_slash(q_(getcwd(buf, 2048)));
}


x86 assembly (clang, -O0):
<currentdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x800,%rsp
lea    -0x800(%rbp),%rdi
mov    $0x800,%esi
call   1030 <getcwd@plt>
mov    %eax,%edi
call   1050 <q_@plt>
mov    %eax,%edi
call   1040 <append_trail_slash@plt>
add    $0x800,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<currentdir>:
sub    $0x808,%rsp
mov    %rsp,%rdi
mov    $0x800,%esi
call   1030 <getcwd@plt>
mov    %eax,%edi
call   1050 <q_@plt>
mov    %eax,%edi
call   1040 <append_trail_slash@plt>
add    $0x808,%rsp
ret

LLVM IR (-O0):
define i8* @currentdir() {
%1 = alloca [2048 x i8]
%2 = getelementptr inbounds [2048 x i8], [2048 x i8]* %1, i64 0, i64 0
%3 = call i32 @getcwd(i8* %2, i32 2048)
%4 = call i32 @q_(i32 %3)
%5 = call i8* @append_trail_slash(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @currentdir() {
%1 = alloca [2048 x i8]
%2 = getelementptr inbounds [2048 x i8], [2048 x i8]* %1, i64 0, i64 0
%3 = call i32 @getcwd(i8* %2, i32 2048)
%4 = call i32 @q_(i32 %3)
%5 = call i8* @append_trail_slash(i32 %4)
ret i8* %5
}