xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void _fw_echo(const char *var) { printf("%s", var); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @_fw_echo(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int fundamental(int type) { return (type == 7 || type == 8); }


x86 assembly (clang, -O0):
<fundamental>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x7,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <fundamental+0x20>
cmpl   $0x8,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fundamental>:
add    $0xfffffff9,%edi
xor    %eax,%eax
cmp    $0x2,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @fundamental(i32 %0) {
%2 = add i32 %0, -7
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
void PIN_DELAY_SLOW(uint32_t delay) {
  volatile int32_t count;
  count = delay;
  while (--count) {
  }
}


x86 assembly (clang, -O0):
<PIN_DELAY_SLOW>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     112b <PIN_DELAY_SLOW+0x2b>
jmp    1110 <PIN_DELAY_SLOW+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PIN_DELAY_SLOW>:
mov    %rdi,-0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
nop
addq   $0xffffffffffffffff,-0x8(%rsp)
jne    1110 <PIN_DELAY_SLOW+0x10>
ret

LLVM IR (-O0):
define void @PIN_DELAY_SLOW(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
store volatile i64 %4, i64* %3
br label %5
5: ; preds = %9, %1
%6 = load volatile i64, i64* %3
%7 = add nsw i64 %6, -1
store volatile i64 %7, i64* %3
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @PIN_DELAY_SLOW(i64 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store volatile i64 %0, i64* %2
br label %4
4: ; preds = %4, %1
%5 = load volatile i64, i64* %2
%6 = add nsw i64 %5, -1
store volatile i64 %6, i64* %2
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %4
8: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_sleep(int);
int /*<<< orphan*/ initlog(int, char *);
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *imalloc(size_t size) {
  void *m;
  while ((m = malloc(size)) == NULL) {
    initlog((1 | 2), "out of memory");
    do_sleep(5);
  }
  memset(m, 0, size);
  return m;
}


x86 assembly (clang, -O0):
<imalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1183 <imalloc+0x43>
mov    $0x3,%edi
lea    0xe91(%rip),%rsi
call   1030 <initlog@plt>
mov    $0x5,%edi
call   1060 <do_sleep@plt>
jmp    114c <imalloc+0xc>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imalloc>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1187 <imalloc+0x47>
lea    0xea4(%rip),%r15
nopl   0x0(%rax)
mov    $0x3,%edi
mov    %r15,%rsi
call   1030 <initlog@plt>
mov    $0x5,%edi
call   1060 <do_sleep@plt>
mov    %r14,%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     1160 <imalloc+0x20>
mov    %rax,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define i8* @imalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1, %4
%5 = tail call i32 @initlog(i32 3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @do_sleep(i32 5)
%7 = tail call i8* @malloc(i64 %0)
%8 = icmp eq i8* %7, null
br i1 %8, label %4, label %9
9: ; preds = %4, %1
%10 = phi i8* [ %2, %1 ], [ %7, %4 ]
%11 = tail call i32 @memset(i8* %10, i32 0, i64 %0)
ret i8* %10
}
void functie(
    struct {
      int l;
      char c[1];
    } * cmdlin,
    struct {
      int l;
      char c[1];
    } * c1) {}


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

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

LLVM IR (-O0):
%struct.anon = type { i32, [1 x i8] }
%struct.anon.0 = type { i32, [1 x i8] }
define void @functie(%struct.anon* %0, %struct.anon.0* %1) {
%3 = alloca %struct.anon*
%4 = alloca %struct.anon.0*
store %struct.anon* %0, %struct.anon** %3
store %struct.anon.0* %1, %struct.anon.0** %4
ret void
}

LLVM IR (-O2):
%struct.anon = type { i32, [1 x i8] }
%struct.anon.0 = type { i32, [1 x i8] }
define void @functie(%struct.anon* nocapture %0, %struct.anon.0* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
char *getfname(char *);
void doOpenCommand(FILE **f) {
  char *fname;
  *f = NULL;
  fname = getfname("Open file name:");
  if (fname) {
    *f = fopen(fname, "rb");
  };
}


x86 assembly (clang, -O0):
<doOpenCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
lea    0xec2(%rip),%rdi
call   1030 <getfname@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116c <doOpenCommand+0x4c>
mov    -0x10(%rbp),%rdi
lea    0xeb3(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doOpenCommand>:
push   %rbx
mov    %rdi,%rbx
movq   $0x0,(%rdi)
lea    0xece(%rip),%rdi
call   1030 <getfname@plt>
test   %rax,%rax
je     114e <doOpenCommand+0x2e>
lea    0xecd(%rip),%rsi
mov    %rax,%rdi
call   1040 <fopen@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Open file name:\00"
@.str.1 = [3 x i8] c"rb\00"
define void @doOpenCommand(i32** %0) {
%2 = alloca i32**
%3 = alloca i8*
store i32** %0, i32*** %2
%4 = load i32**, i32*** %2
store i32* null, i32** %4
%5 = call i8* @getfname(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32**, i32*** %2
store i32* %10, i32** %11
br label %12
12: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Open file name:\00"
@.str.1 = [3 x i8] c"rb\00"
define void @doOpenCommand(i32** nocapture writeonly %0) {
store i32* null, i32** %0
%2 = tail call i8* @getfname(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32* @fopen(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %5, i32** %0
br label %6
6: ; preds = %4, %1
ret void
}
int main() {
  int d;
  *(unsigned char *)0x5007 = 0x20;
  *(unsigned char *)0x5008 = 0x20;
  do {
    *(unsigned char *)0x5005 ^= 0x20;
    for (d = 0; d < 29000; d++) {
    }
  } while (1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x5007,%eax
movb   $0x20,(%rax)
mov    $0x5008,%eax
movb   $0x20,(%rax)
mov    $0x5005,%eax
movzbl (%rax),%eax
xor    $0x20,%eax
mov    %al,%cl
mov    $0x5005,%eax
mov    %cl,(%rax)
movl   $0x0,-0x8(%rbp)
cmpl   $0x7148,-0x8(%rbp)
jge    1156 <main+0x56>
jmp    1148 <main+0x48>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x36>
jmp    115b <main+0x5b>
mov    $0x1,%al
test   $0x1,%al
jne    111b <main+0x1b>
jmp    116a <main+0x6a>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movb   $0x20,0x5007
20
movb   $0x20,0x5008
20
jmp    1110 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i8 32, i8* inttoptr (i64 20487 to i8*)
store i8 32, i8* inttoptr (i64 20488 to i8*)
br label %3
3: ; preds = %16, %0
%4 = load i8, i8* inttoptr (i64 20485 to i8*)
%5 = zext i8 %4 to i32
%6 = xor i32 %5, 32
%7 = trunc i32 %6 to i8
store i8 %7, i8* inttoptr (i64 20485 to i8*)
store i32 0, i32* %2
br label %8
8: ; preds = %12, %3
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 29000
br i1 %10, label %11, label %15
11: ; preds = %8
br label %12
12: ; preds = %11
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %8
15: ; preds = %8
br label %16
16: ; preds = %15
br i1 true, label %3, label %17
17: ; preds = %16
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
store i8 32, i8* inttoptr (i64 20487 to i8*)
store i8 32, i8* inttoptr (i64 20488 to i8*)
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ i2c_rd(int, int /*<<< orphan*/, int /*<<< orphan*/ *, int);
uint16_t i2c_rd16(int fd, uint16_t reg) {
  uint16_t val;
  i2c_rd(fd, reg, (uint8_t *)&val, 2);
  return val;
}


x86 assembly (clang, -O0):
<i2c_rd16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0xc(%rbp),%rdx
mov    $0x2,%ecx
call   1030 <i2c_rd@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_rd16>:
push   %rax
lea    0x4(%rsp),%rdx
mov    $0x2,%ecx
call   1030 <i2c_rd@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @i2c_rd16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @i2c_rd(i32 %0, i32 %1, i32* %3, i32 2)
%6 = load i32, i32* %3
ret i32 %6
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int encodesym();
uint16_t encodeword(void) {
  uint16_t w;
  w = encodesym();
  w <<= 5;
  w |= encodesym();
  w <<= 5;
  w |= encodesym();
  return w;
}


x86 assembly (clang, -O0):
<encodeword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <encodesym@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <encodesym@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <encodesym@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encodeword>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <encodesym@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <encodesym@plt>
mov    %eax,%ebp
shl    $0xa,%ebx
shl    $0x5,%ebp
or     %ebx,%ebp
xor    %eax,%eax
call   1030 <encodesym@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @encodeword() {
%1 = alloca i32
%2 = call i32 (...) @encodesym()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = shl i32 %3, 5
store i32 %4, i32* %1
%5 = call i32 (...) @encodesym()
%6 = load i32, i32* %1
%7 = or i32 %6, %5
store i32 %7, i32* %1
%8 = load i32, i32* %1
%9 = shl i32 %8, 5
store i32 %9, i32* %1
%10 = call i32 (...) @encodesym()
%11 = load i32, i32* %1
%12 = or i32 %11, %10
store i32 %12, i32* %1
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @encodeword() {
%1 = tail call i32 (...) @encodesym()
%2 = tail call i32 (...) @encodesym()
%3 = shl i32 %1, 10
%4 = shl i32 %2, 5
%5 = or i32 %4, %3
%6 = tail call i32 (...) @encodesym()
%7 = or i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ echoargs(int, char **);
int splitargv(char *, char **);
void splitargs(char *args) {
  int newargc = splitargv(args, NULL);
  char *newargv[newargc + 1];
  splitargv(args, newargv);
  echoargs(newargc, newargv);
}


x86 assembly (clang, -O0):
<splitargs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <splitargv@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rax,8),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,-0x28(%rbp)
mov    %rsi,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <splitargv@plt>
mov    -0x28(%rbp),%rsi
mov    -0xc(%rbp),%edi
call   1040 <echoargs@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<splitargs>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %esi,%esi
call   1030 <splitargv@plt>
mov    %eax,%r15d
lea    0x1(%r15),%eax
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%rbx
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <splitargv@plt>
mov    %r15d,%edi
mov    %rbx,%rsi
call   1040 <echoargs@plt>
lea    -0x18(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @splitargs(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @splitargv(i8* %6, i8** null)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %4
%12 = alloca i8*, i64 %10
store i64 %10, i64* %5
%13 = load i8*, i8** %2
%14 = call i32 @splitargv(i8* %13, i8** %12)
%15 = load i32, i32* %3
%16 = call i32 @echoargs(i32 %15, i8** %12)
%17 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
define void @splitargs(i8* %0) {
%2 = tail call i32 @splitargv(i8* %0, i8** null)
%3 = add nsw i32 %2, 1
%4 = zext i32 %3 to i64
%5 = alloca i8*, i64 %4
%6 = call i32 @splitargv(i8* %0, i8** %5)
%7 = call i32 @echoargs(i32 %2, i8** %5)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int atoi(char *);
int /*<<< orphan*/ benchmark(int);
int main(int argc, char **argv) {
  int num_games_per_point = 10;
  if (argc > 1)
    num_games_per_point = atoi(argv[1]);
  benchmark(num_games_per_point);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1157 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <benchmark@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%eax
mov    $0xa,%edi
cmp    $0x2,%eax
jl     1138 <main+0x18>
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <benchmark@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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
store i32 10, i32* %6
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %6
br label %14
14: ; preds = %9, %2
%15 = load i32, i32* %6
%16 = call i32 @benchmark(i32 %15)
%17 = load i32, i32* @EXIT_SUCCESS
ret i32 %17
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ %7, %4 ], [ 10, %2 ]
%10 = tail call i32 @benchmark(i32 %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}
int pass1_parser(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @pass1_parser() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void medlc_ShowSyntax(FILE *outfile) {
  fprintf(outfile, "-medlc outfilename\n");
}


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

x86 assembly (clang, -O2):
<medlc_ShowSyntax>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x13,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"-medlc outfilename\0A\00"
define void @medlc_ShowSyntax(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"-medlc outfilename\0A\00"
define void @medlc_ShowSyntax(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 19, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void ops_pddlfree(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<ops_pddlfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ops_pddlfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int strsize(char *str, char delim) {
  int i = 0;
  while (*(str + i) != delim)
    i++;
  return i;
}


x86 assembly (clang, -O0):
<strsize>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
je     113b <strsize+0x3b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <strsize+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsize>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
lea    0x1(%rdi),%rcx
cmp    %sil,(%rdi)
mov    %rcx,%rdi
jne    1110 <strsize+0x10>
ret

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

LLVM IR (-O2):
define i32 @strsize(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %8, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, %1
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
ret i32 %10
}
/* Type definitions */
struct rbtree {
  int dummy;
};
struct rbnode {
  int dummy;
};

/* Variables and functions */
struct rbnode *_rb_get_minmax(struct rbtree *, int);
struct rbnode *rb_get_max(struct rbtree *tree) {
  return _rb_get_minmax(tree, 1);
}


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

x86 assembly (clang, -O2):
<rb_get_max>:
mov    $0x1,%esi
jmp    1030 <_rb_get_minmax@plt>

LLVM IR (-O0):
%struct.rbnode = type { i32 }
%struct.rbtree = type { i32 }
define %struct.rbnode* @rb_get_max(%struct.rbtree* %0) {
%2 = alloca %struct.rbtree*
store %struct.rbtree* %0, %struct.rbtree** %2
%3 = load %struct.rbtree*, %struct.rbtree** %2
%4 = call %struct.rbnode* @_rb_get_minmax(%struct.rbtree* %3, i32 1)
ret %struct.rbnode* %4
}

LLVM IR (-O2):
%struct.rbnode = type { i32 }
%struct.rbtree = type { i32 }
define %struct.rbnode* @rb_get_max(%struct.rbtree* %0) {
%2 = tail call %struct.rbnode* @_rb_get_minmax(%struct.rbtree* %0, i32 1)
ret %struct.rbnode* %2
}
/* Variables and functions */
scalar_t__ strncmp(char const *, char const *, size_t);
bool strncmpeq(const char *nameValue, const char *name, size_t nameLen) {
  if (strncmp(nameValue, name, nameLen) == 0 && nameValue[nameLen] == '=')
    return (true);
  return (false);
}


x86 assembly (clang, -O0):
<strncmpeq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1160 <strncmpeq+0x50>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3d,%eax
jne    1160 <strncmpeq+0x50>
movl   $0x1,-0x4(%rbp)
jmp    1167 <strncmpeq+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncmpeq>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1130 <strncmpeq+0x20>
mov    $0x1,%eax
cmpb   $0x3d,(%rbx,%r14,1)
je     1132 <strncmpeq+0x22>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @strncmpeq(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %0, i64 %2
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 61
br i1 %9, label %11, label %10
10: ; preds = %6, %3
br label %11
11: ; preds = %6, %10
%12 = phi i32 [ 0, %10 ], [ 1, %6 ]
ret i32 %12
}
/* Type definitions */
struct lframe {
  int dummy;
};
struct lemon {
  int dummy;
};

/* Variables and functions */
struct lframe *machine_set_pause(struct lemon *, struct lframe *);
struct lframe *lemon_machine_set_pause(struct lemon *lemon,
                                       struct lframe *frame) {
  return machine_set_pause(lemon, frame);
}


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

x86 assembly (clang, -O2):
<lemon_machine_set_pause>:
jmp    1030 <machine_set_pause@plt>

LLVM IR (-O0):
%struct.lemon = type { i32 }
%struct.lframe = type { i32 }
define %struct.lframe* @lemon_machine_set_pause(%struct.lemon* %0, %struct.lframe* %1) {
%3 = alloca %struct.lemon*
%4 = alloca %struct.lframe*
store %struct.lemon* %0, %struct.lemon** %3
store %struct.lframe* %1, %struct.lframe** %4
%5 = load %struct.lemon*, %struct.lemon** %3
%6 = load %struct.lframe*, %struct.lframe** %4
%7 = call %struct.lframe* @machine_set_pause(%struct.lemon* %5, %struct.lframe* %6)
ret %struct.lframe* %7
}

LLVM IR (-O2):
%struct.lemon = type { i32 }
%struct.lframe = type { i32 }
define %struct.lframe* @lemon_machine_set_pause(%struct.lemon* %0, %struct.lframe* %1) {
%3 = tail call %struct.lframe* @machine_set_pause(%struct.lemon* %0, %struct.lframe* %1)
ret %struct.lframe* %3
}
/* Variables and functions */
int send(int, void const *, int, int /*<<< orphan*/);
int vohttpd_send(int sock, const void *data, int size, int type) {
  return send(sock, data, size, 0);
}


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

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

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

LLVM IR (-O2):
define i32 @vohttpd_send(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @send(i32 %0, i8* %1, i32 %2, i32 0)
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
scalar_t__ time(scalar_t__ *);
double fwtime() {
  static time_t time0;
  static int first = 0;
  double tdiff;
  if (first == 0) {
    time0 = time((time_t *)0);
    tdiff = 0.;
    first = 1;
  } else {
    tdiff = (double)(time((time_t *)0) - time0);
  }
  return (tdiff);
}


x86 assembly (clang, -O0):
<fwtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f19(%rip)
jne    114c <fwtime+0x3c>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %rax,0x2efb(%rip)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movl   $0x1,0x2ef1(%rip)
jmp    1166 <fwtime+0x56>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
sub    0x2ed4(%rip),%rax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fwtime>:
push   %rbx
mov    0x2f21(%rip),%bl
xor    %edi,%edi
call   1030 <time@plt>
test   %bl,%bl
je     1130 <fwtime+0x20>
sub    0x2f07(%rip),%rax
cvtsi2sd %rax,%xmm0
pop    %rbx
ret
mov    %rax,0x2ef9(%rip)
movb   $0x1,0x2efa(%rip)
xorps  %xmm0,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
@fwtime.time0 = internal global i64 0
@fwtime.first = internal global i32 0
define double @fwtime() {
%1 = alloca double
%2 = load i32, i32* @fwtime.first
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i64 @time(i64* null)
store i64 %5, i64* @fwtime.time0
store double 0.000000e+00, double* %1
store i32 1, i32* @fwtime.first
br label %11
6: ; preds = %0
%7 = call i64 @time(i64* null)
%8 = load i64, i64* @fwtime.time0
%9 = sub nsw i64 %7, %8
%10 = sitofp i64 %9 to double
store double %10, double* %1
br label %11
11: ; preds = %6, %4
%12 = load double, double* %1
ret double %12
}

LLVM IR (-O2):
@fwtime.time0 = internal unnamed_addr global i64 0
@fwtime.first = internal unnamed_addr global i1 false
define double @fwtime() {
%1 = load i1, i1* @fwtime.first
%2 = tail call i64 @time(i64* null)
br i1 %1, label %4, label %3
3: ; preds = %0
store i64 %2, i64* @fwtime.time0
store i1 true, i1* @fwtime.first
br label %8
4: ; preds = %0
%5 = load i64, i64* @fwtime.time0
%6 = sub nsw i64 %2, %5
%7 = sitofp i64 %6 to double
br label %8
8: ; preds = %4, %3
%9 = phi double [ 0.000000e+00, %3 ], [ %7, %4 ]
ret double %9
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int fact(int);
int sum(int);
__attribute__((section(".entry"))) int16_t
usr_sample(int16_t param, void *vmem_offset, void *cmem_offset) {
  int16_t result;
  if (param <= 7) {
    result = fact(param);
  } else {
    result = sum(param);
  }
  return result;
}


x86 assembly (clang, -O0):
<usr_sample>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x7,-0x4(%rbp)
jg     114d <usr_sample+0x2d>
mov    -0x4(%rbp),%edi
call   1040 <fact@plt>
mov    %eax,-0x1c(%rbp)
jmp    1158 <usr_sample+0x38>
mov    -0x4(%rbp),%edi
call   1030 <sum@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usr_sample>:
cmp    $0x7,%edi
jg     112a <usr_sample+0xa>
jmp    1040 <fact@plt>
jmp    1030 <sum@plt>

LLVM IR (-O0):
define i32 @usr_sample(i32 %0, i8* %1, i8* %2) section ".entry" {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i32, i32* %4
%9 = icmp sle i32 %8, 7
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i32, i32* %4
%12 = call i32 @fact(i32 %11)
store i32 %12, i32* %7
br label %16
13: ; preds = %3
%14 = load i32, i32* %4
%15 = call i32 @sum(i32 %14)
store i32 %15, i32* %7
br label %16
16: ; preds = %13, %10
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @usr_sample(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) section ".entry" {
%4 = icmp slt i32 %0, 8
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @fact(i32 %0)
br label %9
7: ; preds = %3
%8 = tail call i32 @sum(i32 %0)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
int snoopy_output_fileoutput(char const *const, int, char *);
int snoopy_output_devttyoutput(char const *const logMessage, int errorOrMessage,
                               char const *const arg) {
  return snoopy_output_fileoutput(logMessage, errorOrMessage, "/dev/tty");
}


x86 assembly (clang, -O0):
<snoopy_output_devttyoutput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xecf(%rip),%rdx
call   1030 <snoopy_output_fileoutput@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snoopy_output_devttyoutput>:
lea    0xee9(%rip),%rdx
jmp    1030 <snoopy_output_fileoutput@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"/dev/tty\00"
define i32 @snoopy_output_devttyoutput(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = call i32 @snoopy_output_fileoutput(i8* %7, i32 %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 %9
}

LLVM IR (-O2):
@.str = [9 x i8] c"/dev/tty\00"
define i32 @snoopy_output_devttyoutput(i8* %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @snoopy_output_fileoutput(i8* %0, i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
void noop(void *v) { (void)(v); }


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

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

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

LLVM IR (-O2):
define void @noop(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf(char *, int, char const *, int /*<<< orphan*/);
int vsprintf(char *buf, const char *fmt, va_list ap) {
  return vsnprintf(buf, 256, fmt, ap);
}


x86 assembly (clang, -O0):
<vsprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x100,%esi
call   1030 <vsnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsprintf>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0x100,%esi
jmp    1030 <vsnprintf@plt>

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

LLVM IR (-O2):
define i32 @vsprintf(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @vsnprintf(i8* %0, i32 256, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fputs("Usage: unatomappend [-A] file pattern iterations\n", stderr);
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"Usage: unatomappend [-A] file pattern iterations\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [50 x i8] c"Usage: unatomappend [-A] file pattern iterations\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void ff_hevc_put_hevc_qpel_v24_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_v24_10_sse4() {
ret void
}
unsigned long long int diferenca(unsigned long long int a,
                                 unsigned long long int b) {
  if (a > b) {
    return a - b;
  } else {
    return b - a;
  }
}


x86 assembly (clang, -O0):
<diferenca>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    112b <diferenca+0x2b>
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1137 <diferenca+0x37>
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<diferenca>:
mov    %rsi,%rax
sub    %rdi,%rax
neg    %rax
sub    %rdi,%rsi
cmovae %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @diferenca(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = sub i64 %0, %1
%5 = sub i64 %1, %0
%6 = select i1 %3, i64 %4, i64 %5
ret i64 %6
}
void ipc_init(void) {}


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

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

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

LLVM IR (-O2):
define void @ipc_init() {
ret void
}
int Compare(const void *array_pointer_threadindex,
            const void *array_pointer_partnerindex) {
  int x = *((int *)array_pointer_threadindex);
  int y = *((int *)array_pointer_partnerindex);
  if (x < y)
    return -1;
  else if (x == y)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<Compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <Compare+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <Compare+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    114e <Compare+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1155 <Compare+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Compare>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @Compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
unsigned int kdev_major(unsigned int kdev) { return kdev >> 20; }


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

x86 assembly (clang, -O2):
<kdev_major>:
mov    %edi,%eax
shr    $0x14,%eax
ret

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

LLVM IR (-O2):
define i32 @kdev_major(i32 %0) {
%2 = lshr i32 %0, 20
ret i32 %2
}
/* Variables and functions */
int one_sensor_read(char *, int *);
int get_voltage() {
  int result, value;
  result = one_sensor_read("V", &value);
  if (result < 0)
    return result;
  return value;
}


x86 assembly (clang, -O0):
<get_voltage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <one_sensor_read@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1140 <get_voltage+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <get_voltage+0x36>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_voltage>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <one_sensor_read@plt>
test   %eax,%eax
js     112a <get_voltage+0x1a>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"V\00"
define i32 @get_voltage() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @one_sensor_read(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp slt i32 %3, 0
%5 = load i32, i32* %1
%6 = select i1 %4, i32 %3, i32 %5
ret i32 %6
}
/* Variables and functions */
int __builtin_mips_cabs_ule_s(float, float);
int test7(float a, float b) { return __builtin_mips_cabs_ule_s(a, b); }


x86 assembly (clang, -O0):
<test7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <__builtin_mips_cabs_ule_s@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test7>:
jmp    1030 <__builtin_mips_cabs_ule_s@plt>

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

LLVM IR (-O2):
define i32 @test7(float %0, float %1) {
%3 = tail call i32 @__builtin_mips_cabs_ule_s(float %0, float %1)
ret i32 %3
}
int fun340() { return 340; }


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

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

LLVM IR (-O0):
define i32 @fun340() {
ret i32 340
}

LLVM IR (-O2):
define i32 @fun340() {
ret i32 340
}
void yy_1_LinkOptionNameValue(char *yytext, int yyleng) {
  ;
  ;
}


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

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

LLVM IR (-O0):
define void @yy_1_LinkOptionNameValue(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @yy_1_LinkOptionNameValue(i8* nocapture %0, i32 %1) {
ret void
}
main() {
  int a[4];
  __typeof(a) b;
  __typeof(int[4]) c;
  _Static_assert(sizeof(a) + sizeof(b) + sizeof(c) == 3 * 4 * sizeof(int),
                 "array not propagated in __typeof()");
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [4 x i32]
%2 = alloca [4 x i32]
%3 = alloca [4 x i32]
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int isPalindrome(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int test = 1000021;
  printf("%d\n", isPalindrome(test));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @isPalindrome(i32 1000021)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, long);
void write_trailer(FILE *sfp, unsigned sum) {
  fprintf(sfp, "CTM_MAIL END %ld\n", (long)sum);
}


x86 assembly (clang, -O0):
<write_trailer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
mov    %eax,%edx
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_trailer>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"CTM_MAIL END %ld\0A\00"
define void @write_trailer(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 = zext i32 %6 to i64
%8 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i64 %7)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"CTM_MAIL END %ld\0A\00"
define void @write_trailer(i32* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i64 %3)
ret void
}