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

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int fstat(int fd, struct stat *buf) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<fstat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstat>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fstat(i32 %0, %struct.stat* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("Hello MLL! :)\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello MLL! :)\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lcd_cmd(char);
void lcd_goto(int row, int col) {
  row--;
  row &= 0x01;
  row *= 40;
  col--;
  col &= 0x0f;
  char tmp = row | col;
  tmp |= 0x80;
  lcd_cmd(tmp);
}


x86 assembly (clang, -O0):
<lcd_goto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x4(%rbp)
imul   $0x28,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
or     $0x80,%eax
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edi
call   1030 <lcd_cmd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_goto>:
not    %edi
and    $0x1,%edi
shl    $0x3,%edi
lea    (%rdi,%rdi,4),%eax
add    $0xffffffff,%esi
and    $0xf,%esi
or     %eax,%esi
or     $0x80,%sil
movsbl %sil,%edi
jmp    1030 <lcd_cmd@plt>

LLVM IR (-O0):
define void @lcd_goto(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = add nsw i32 %6, -1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = and i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = mul nsw i32 %10, 40
store i32 %11, i32* %3
%12 = load i32, i32* %4
%13 = add nsw i32 %12, -1
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = and i32 %14, 15
store i32 %15, i32* %4
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = or i32 %16, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %5
%20 = load i8, i8* %5
%21 = sext i8 %20 to i32
%22 = or i32 %21, 128
%23 = trunc i32 %22 to i8
store i8 %23, i8* %5
%24 = load i8, i8* %5
%25 = call i32 @lcd_cmd(i8 signext %24)
ret void
}

LLVM IR (-O2):
define void @lcd_goto(i32 %0, i32 %1) {
%3 = and i32 %0, 1
%4 = xor i32 %3, 1
%5 = mul nuw nsw i32 %4, 40
%6 = add i32 %1, 15
%7 = and i32 %6, 15
%8 = or i32 %5, %7
%9 = trunc i32 %8 to i8
%10 = or i8 %9, -128
%11 = tail call i32 @lcd_cmd(i8 signext %10)
ret void
}
int sg_set_binary_mode(int fd) { return fd; }


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

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

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

LLVM IR (-O2):
define i32 @sg_set_binary_mode(i32 returned %0) {
ret i32 %0
}
int f(int b) { return (b >> 1) > 0; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
cmp    $0x2,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 1
%5 = icmp sgt i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp sgt i32 %0, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ mill_fdwait(int, int /*<<< orphan*/, int /*<<< orphan*/,
                               char const *);
void mill_msleep(int64_t deadline, const char *current) {
  mill_fdwait(-1, 0, deadline, current);
}


x86 assembly (clang, -O0):
<mill_msleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <mill_fdwait@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mill_msleep>:
mov    %rsi,%rcx
mov    %edi,%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
jmp    1030 <mill_fdwait@plt>

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

LLVM IR (-O2):
define void @mill_msleep(i32 %0, i8* %1) {
%3 = tail call i32 @mill_fdwait(i32 -1, i32 0, i32 %0, i8* %1)
ret void
}
int isNumber(char c) { return c >= '0' && c <= '9'; }


x86 assembly (clang, -O0):
<isNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isNumber+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNumber>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isNumber(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isNumber(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
const char *onoff(int x) {
  if (x)
    return "On ";
  return "Off";
}


x86 assembly (clang, -O0):
<onoff>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1121 <onoff+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112c <onoff+0x2c>
lea    0xedc(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<onoff>:
test   %edi,%edi
lea    0xefb(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"On \00"
@.str.1 = [4 x i8] c"Off\00"
define i8* @onoff(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int main() {
  char a[4];
  a[0] = 'a';
  a[1] = 'b';
  a[2] = 'c';
  a[3] = 'd';
  if (*((unsigned int *)a) != 0x64636261) {
    _exit(-1);
  }
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x61,-0x8(%rbp)
movb   $0x62,-0x7(%rbp)
movb   $0x63,-0x6(%rbp)
movb   $0x64,-0x5(%rbp)
cmpl   $0x64636261,-0x8(%rbp)
je     1146 <main+0x36>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
store i8 97, i8* %3
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
store i8 98, i8* %4
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
store i8 99, i8* %5
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
store i8 100, i8* %6
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = icmp ne i32 %9, 1684234849
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 @_exit(i32 -1)
unreachable
13: ; preds = %0
%14 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void caml_ojs_iterate_properties() {
  fprintf(stderr,
          "Unimplemented JavaScript primitive caml_ojs_iterate_properties!\n");
  exit(1);
}


x86 assembly (clang, -O0):
<caml_ojs_iterate_properties>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<caml_ojs_iterate_properties>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [65 x i8] c"Unimplemented JavaScript primitive caml_ojs_iterate_properties!\0A\00"
define void @caml_ojs_iterate_properties() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [65 x i8] c"Unimplemented JavaScript primitive caml_ojs_iterate_properties!\0A\00"
define void @caml_ojs_iterate_properties() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
char *tiger_chr(int /*<<< orphan*/);
char *tiger_getchar() { return tiger_chr(getchar()); }


x86 assembly (clang, -O0):
<tiger_getchar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,%edi
call   1040 <tiger_chr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tiger_getchar>:
push   %rax
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <tiger_chr@plt>

LLVM IR (-O0):
define i8* @tiger_getchar() {
%1 = call i32 (...) @getchar()
%2 = call i8* @tiger_chr(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
define i8* @tiger_getchar() {
%1 = tail call i32 (...) @getchar()
%2 = tail call i8* @tiger_chr(i32 %1)
ret i8* %2
}
sub3(i) const int *i;
{}


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

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

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

LLVM IR (-O2):
define i32 @sub3(i32* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char *);
FILE *my_open(const char *name) { return fopen(name, "r+"); }


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

x86 assembly (clang, -O2):
<my_open>:
lea    0xee9(%rip),%rsi
jmp    1030 <fopen@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"r+\00"
define noalias i32* @my_open(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void wt_timeout(int sig) { exit(0); }


x86 assembly (clang, -O0):
<wt_timeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<wt_timeout>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @wt_timeout(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
char *strchr(char const *, int);
int acl_str_index(const char *s, int c) {
  char *str = strchr(s, c);
  if (str)
    return (str - s);
  else
    return -1;
}


x86 assembly (clang, -O0):
<acl_str_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     114d <acl_str_index+0x3d>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    1154 <acl_str_index+0x44>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acl_str_index>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strchr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @acl_str_index(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
void init_variable_array(int len) {
  int x = 2 * len;
  int a[len + x + 1];
  a[len + x + 1] = 0;
}


x86 assembly (clang, -O0):
<init_variable_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    %eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
mov    %edx,%eax
lea    0x1(%rax,%rcx,1),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
lea    0xf(,%rcx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @init_variable_array(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = mul nsw i32 2, %6
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
%11 = add nsw i32 %10, 1
%12 = zext i32 %11 to i64
%13 = call i8* @llvm.stacksave()
store i8* %13, i8** %4
%14 = alloca i32, i64 %12
store i64 %12, i64* %5
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = add nsw i32 %15, %16
%18 = add nsw i32 %17, 1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %14, i64 %19
store i32 0, i32* %20
%21 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
define void @init_variable_array(i32 %0) {
ret void
}
/* Variables and functions */
double ATMtoMB(double);
double ATMtoHPA(double ATM) {
  double HPA = ATMtoMB(ATM);
  return HPA;
}


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

x86 assembly (clang, -O2):
<ATMtoHPA>:
jmp    1030 <ATMtoMB@plt>

LLVM IR (-O0):
define double @ATMtoHPA(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @ATMtoMB(double %4)
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @ATMtoHPA(double %0) {
%2 = tail call double @ATMtoMB(double %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __u16;

/* Variables and functions */
int /*<<< orphan*/ output_char(int /*<<< orphan*/);
void output_oya(__u16 o) { output_char(o); }


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

x86 assembly (clang, -O2):
<output_oya>:
jmp    1030 <output_char@plt>

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

LLVM IR (-O2):
define void @output_oya(i32 %0) {
%2 = tail call i32 @output_char(i32 %0)
ret void
}
/* Variables and functions */
int __set_preferred_primary(char *, int /*<<< orphan*/);
int set_secondary(char **args, int num_args) {
  return __set_preferred_primary(args[0], 0);
}


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

x86 assembly (clang, -O2):
<set_secondary>:
mov    (%rdi),%rdi
xor    %esi,%esi
jmp    1030 <__set_preferred_primary@plt>

LLVM IR (-O0):
define i32 @set_secondary(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 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 @__set_preferred_primary(i8* %7, i32 0)
ret i32 %8
}

LLVM IR (-O2):
define i32 @set_secondary(i8** nocapture %0, i32 %1) {
%3 = load i8*, i8** %0
%4 = tail call i32 @__set_preferred_primary(i8* %3, i32 0)
ret i32 %4
}
__attribute__((no, noclone)) void f8(struct B *p) {
  asm volatile("" : : "g"(p) : "memory");
}


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

x86 assembly (clang, -O2):
<f8>:
mov    %rdi,-0x8(%rsp)
ret

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

LLVM IR (-O2):
%struct.B = type opaque
define void @f8(%struct.B* %0) {
tail call void asm sideeffect "", "imr,~{memory},~{dirflag},~{fpsr},~{flags}"(%struct.B* %0)
ret void
}
/* Type definitions */
struct Loop {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ free(struct Loop *const);
void Loop_delete(struct Loop *const inObj) {
  assert(inObj != NULL);
  free(inObj);
}


x86 assembly (clang, -O0):
<Loop_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Loop_delete>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.Loop = type { i32 }
define void @Loop_delete(%struct.Loop* %0) {
%2 = alloca %struct.Loop*
store %struct.Loop* %0, %struct.Loop** %2
%3 = load %struct.Loop*, %struct.Loop** %2
%4 = icmp ne %struct.Loop* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load %struct.Loop*, %struct.Loop** %2
%8 = call i32 @free(%struct.Loop* %7)
ret void
}

LLVM IR (-O2):
%struct.Loop = type { i32 }
define void @Loop_delete(%struct.Loop* %0) {
%2 = icmp ne %struct.Loop* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @free(%struct.Loop* %0)
ret void
}
/* Variables and functions */
char __bsign(char, char);
signed char intr_wrap_459(signed char p1, signed char p2) {
  return __bsign(p1, p2);
}


x86 assembly (clang, -O0):
<intr_wrap_459>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
movsbl %al,%edi
movsbl -0x2(%rbp),%esi
call   1030 <__bsign@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_459>:
jmp    1030 <__bsign@plt>

LLVM IR (-O0):
define signext i8 @intr_wrap_459(i8 signext %0, i8 signext %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 signext i8 @__bsign(i8 signext %5, i8 signext %6)
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @intr_wrap_459(i8 signext %0, i8 signext %1) {
%3 = tail call signext i8 @__bsign(i8 signext %0, i8 signext %1)
ret i8 %3
}
void linux_look_up_symbols(void) {}


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

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

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

LLVM IR (-O2):
define void @linux_look_up_symbols() {
ret void
}
double MBtoKPA(double MB) {
  double kpa = MB / 10;
  return kpa;
}


x86 assembly (clang, -O0):
<MBtoKPA>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MBtoKPA>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @MBtoKPA(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fdiv double %4, 1.000000e+01
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @MBtoKPA(double %0) {
%2 = fdiv double %0, 1.000000e+01
ret double %2
}
/* Type definitions */
struct Parameters {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_word_sketch(struct Parameters *);
int /*<<< orphan*/ free_word_table(struct Parameters *);
void free_and_clean_step_1(struct Parameters *pParam) {
  free_word_table(pParam);
  free_word_sketch(pParam);
}


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

x86 assembly (clang, -O2):
<free_and_clean_step_1>:
push   %rbx
mov    %rdi,%rbx
call   1030 <free_word_table@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <free_word_sketch@plt>

LLVM IR (-O0):
%struct.Parameters = type { i32 }
define void @free_and_clean_step_1(%struct.Parameters* %0) {
%2 = alloca %struct.Parameters*
store %struct.Parameters* %0, %struct.Parameters** %2
%3 = load %struct.Parameters*, %struct.Parameters** %2
%4 = call i32 @free_word_table(%struct.Parameters* %3)
%5 = load %struct.Parameters*, %struct.Parameters** %2
%6 = call i32 @free_word_sketch(%struct.Parameters* %5)
ret void
}

LLVM IR (-O2):
%struct.Parameters = type { i32 }
define void @free_and_clean_step_1(%struct.Parameters* %0) {
%2 = tail call i32 @free_word_table(%struct.Parameters* %0)
%3 = tail call i32 @free_word_sketch(%struct.Parameters* %0)
ret void
}
int to_code2_glo(unsigned char code) {
  switch (code) {
  case 14:
    return 0;
  case 19:
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<to_code2_glo>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xe,%eax
je     1130 <to_code2_glo+0x30>
jmp    111f <to_code2_glo+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x13,%eax
je     113c <to_code2_glo+0x3c>
jmp    1148 <to_code2_glo+0x48>
movl   $0x0,-0x4(%rbp)
jmp    114f <to_code2_glo+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    114f <to_code2_glo+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_code2_glo>:
xor    %eax,%eax
cmp    $0x13,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @to_code2_glo(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
switch i32 %5, label %8 [
i32 14, label %6
i32 19, label %7
]
6: ; preds = %1
store i32 0, i32* %2
br label %9
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7, %6
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @to_code2_glo(i8 zeroext %0) {
%2 = icmp eq i8 %0, 19
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int main() {
  char *a = "hel  lo///*";
  if (strcmp(a, "hel  lo///*"))
    return 1;
  int b = 3;
  "*/";
  b = 4;
  if (b != 4)
    return 2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xecb(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1150 <main+0x40>
movl   $0x1,-0x4(%rbp)
jmp    117b <main+0x6b>
movl   $0x3,-0x14(%rbp)
movl   $0x4,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
je     1174 <main+0x64>
movl   $0x2,-0x4(%rbp)
jmp    117b <main+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    %rdi,%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"hel lo///*\00"
define i32 @main() {
%1 = tail call i64 @strcmp(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ start_monitor();
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stop_monitor();
int main(int argc, char **argv, char **env) {
  start_monitor();
  fprintf(stderr, "syscall.c test\n");
  stop_monitor();
  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    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <start_monitor@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xe9f(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1040 <stop_monitor@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <start_monitor@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1040 <stop_monitor@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"syscall.c test\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 (...) @start_monitor()
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @stop_monitor()
ret i32 0
}
long extract_nb(insn, invalid)
unsigned long insn;
int *invalid;
{
  long ret;
  ret = (insn >> 11) & 0x1f;
  if (ret == 0)
    ret = 32;
  return ret;
}


x86 assembly (clang, -O0):
<extract_nb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0xb,%rax
and    $0x1f,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    112f <extract_nb+0x2f>
movq   $0x20,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_nb>:
shr    $0xb,%edi
and    $0x1f,%edi
mov    $0x20,%eax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
define i64 @extract_nb(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
%5 = alloca i64
store i64 %0, i64* %3
store i32* %1, i32** %4
%6 = load i64, i64* %3
%7 = lshr i64 %6, 11
%8 = and i64 %7, 31
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i64 32, i64* %5
br label %12
12: ; preds = %11, %2
%13 = load i64, i64* %5
ret i64 %13
}

LLVM IR (-O2):
define i64 @extract_nb(i64 %0, i32* nocapture readnone %1) {
%3 = lshr i64 %0, 11
%4 = and i64 %3, 31
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i64 32, i64 %4
ret i64 %6
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ hubo_daemon_close();
int /*<<< orphan*/ stderr;
char *strerror(int);
void hubo_assert(int result) {
  if (!result) {
    fprintf(stderr, "Assertion failed. code=%d (%s)\n", errno, strerror(errno));
    hubo_daemon_close();
    exit(1);
  }
}


x86 assembly (clang, -O0):
<hubo_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    11a1 <hubo_assert+0x61>
mov    0x2e84(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e70(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    %rax,%rcx
lea    0xe75(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <hubo_daemon_close@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hubo_assert>:
test   %edi,%edi
je     1145 <hubo_assert+0x5>
ret
push   %rbp
push   %rbx
push   %rax
mov    0x2e91(%rip),%rax
mov    (%rax),%ebx
mov    0x2e80(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   1060 <strerror@plt>
lea    0xe98(%rip),%rsi
mov    %ebx,%edi
mov    %ebp,%edx
mov    %rax,%rcx
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <hubo_daemon_close@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Assertion failed. code=%d (%s)\0A\00"
@errno = global i32 0
define void @hubo_assert(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i32, i32* @errno
%8 = load i32, i32* @errno
%9 = call i8* @strerror(i32 %8)
%10 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %9)
%11 = call i32 (...) @hubo_daemon_close()
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Assertion failed. code=%d (%s)\0A\00"
@errno = global i32 0
define void @hubo_assert(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
%7 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
%8 = tail call i32 (...) @hubo_daemon_close()
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret void
}
/* Variables and functions */
int om_bt_power_swap(int);
int om_bt_power_set(int value) {
  int res = om_bt_power_swap(value);
  if (res < 0)
    return res;
  return 0;
}


x86 assembly (clang, -O0):
<om_bt_power_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <om_bt_power_swap@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    113b <om_bt_power_set+0x2b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1142 <om_bt_power_set+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<om_bt_power_set>:
push   %rax
call   1030 <om_bt_power_swap@plt>
mov    %eax,%ecx
sar    $0x1f,%ecx
and    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @om_bt_power_set(i32 %0) {
%2 = tail call i32 @om_bt_power_swap(i32 %0)
%3 = icmp slt i32 %2, 0
%4 = select i1 %3, i32 %2, i32 0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ BootFlashSaveOSSettings();
int /*<<< orphan*/ BootStopUSB();
int /*<<< orphan*/ I2CRebootQuick();
int /*<<< orphan*/ assertWriteEEPROM();
void QuickReboot(void *ignored) {
  assertWriteEEPROM();
  BootFlashSaveOSSettings();
  BootStopUSB();
  I2CRebootQuick();
}


x86 assembly (clang, -O0):
<QuickReboot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <assertWriteEEPROM@plt>
mov    $0x0,%al
call   1040 <BootFlashSaveOSSettings@plt>
mov    $0x0,%al
call   1050 <BootStopUSB@plt>
mov    $0x0,%al
call   1060 <I2CRebootQuick@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuickReboot>:
push   %rax
xor    %eax,%eax
call   1030 <assertWriteEEPROM@plt>
xor    %eax,%eax
call   1040 <BootFlashSaveOSSettings@plt>
xor    %eax,%eax
call   1050 <BootStopUSB@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <I2CRebootQuick@plt>

LLVM IR (-O0):
define void @QuickReboot(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @assertWriteEEPROM()
%4 = call i32 (...) @BootFlashSaveOSSettings()
%5 = call i32 (...) @BootStopUSB()
%6 = call i32 (...) @I2CRebootQuick()
ret void
}

LLVM IR (-O2):
define void @QuickReboot(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @assertWriteEEPROM()
%3 = tail call i32 (...) @BootFlashSaveOSSettings()
%4 = tail call i32 (...) @BootStopUSB()
%5 = tail call i32 (...) @I2CRebootQuick()
ret void
}
int f1(int x) { return x + 1; }


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

x86 assembly (clang, -O2):
<f1>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
void blankStr(char str[]) {
  for (int i = 0; i < 30; i++) {
    str[i] = '\0';
  }
}


x86 assembly (clang, -O0):
<blankStr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1e,-0xc(%rbp)
jge    1133 <blankStr+0x33>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <blankStr+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<blankStr>:
xorps  %xmm0,%xmm0
movups %xmm0,0xe(%rdi)
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @blankStr(i8* nocapture writeonly %0) {
ret void
}
long nelln0(long a) { return -(a != 0); }


x86 assembly (clang, -O0):
<nelln0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<nelln0>:
neg    %rdi
sbb    %rax,%rax
ret

LLVM IR (-O0):
define i64 @nelln0(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
%6 = sub nsw i32 0, %5
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @nelln0(i64 %0) {
%2 = icmp ne i64 %0, 0
%3 = sext i1 %2 to i64
ret i64 %3
}
unsigned int __clz(unsigned int bitvector) {
  unsigned int x = 0;
  while ((!(bitvector & ((unsigned)1 << 31))) && (x < 32)) {
    bitvector <<= 1;
    x++;
  }
  return x;
}


x86 assembly (clang, -O0):
<__clz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x80000000,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    112f <__clz+0x2f>
cmpl   $0x20,-0x8(%rbp)
setb   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113f <__clz+0x3f>
jmp    1156 <__clz+0x56>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <__clz+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__clz>:
test   %edi,%edi
js     1121 <__clz+0x21>
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
add    %edi,%edi
lea    0x1(%rcx),%eax
test   %edi,%edi
js     1120 <__clz+0x20>
cmp    $0x1f,%ecx
mov    %eax,%ecx
jb     1110 <__clz+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @__clz(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %2
%6 = and i32 %5, -2147483648
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %4
%9 = load i32, i32* %3
%10 = icmp ult i32 %9, 32
br label %11
11: ; preds = %8, %4
%12 = phi i1 [ false, %4 ], [ %10, %8 ]
br i1 %12, label %13, label %18
13: ; preds = %11
%14 = load i32, i32* %2
%15 = shl i32 %14, 1
store i32 %15, i32* %2
%16 = load i32, i32* %3
%17 = add i32 %16, 1
store i32 %17, i32* %3
br label %4
18: ; preds = %11
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @__clz(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = shl nuw i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp sgt i32 %6, -1
%9 = icmp ult i32 %4, 31
%10 = select i1 %8, i1 %9, i1 false
br i1 %10, label %3, label %11
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %12
}
int foo2(int y) { return y * 10; }


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

x86 assembly (clang, -O2):
<foo2>:
add    %edi,%edi
lea    (%rdi,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @foo2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 10
ret i32 %4
}

LLVM IR (-O2):
define i32 @foo2(i32 %0) {
%2 = mul nsw i32 %0, 10
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ctest_test_assert_add(int, char *);
int ctest_assert_true(int avalue, char *message) {
  if (avalue == 1) {
    ctest_test_assert_add(0, message);
    return 0;
  }
  ctest_test_assert_add(1, message);
  return -1;
}


x86 assembly (clang, -O0):
<ctest_assert_true>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1140 <ctest_assert_true+0x30>
mov    -0x10(%rbp),%rsi
xor    %edi,%edi
call   1030 <ctest_test_assert_add@plt>
movl   $0x0,-0x4(%rbp)
jmp    1155 <ctest_assert_true+0x45>
mov    -0x10(%rbp),%rsi
mov    $0x1,%edi
call   1030 <ctest_test_assert_add@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctest_assert_true>:
push   %rbx
xor    %eax,%eax
cmp    $0x1,%edi
setne  %al
mov    %eax,%ebx
neg    %ebx
mov    %eax,%edi
call   1030 <ctest_test_assert_add@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ctest_assert_true(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 1
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
%6 = xor i1 %3, true
%7 = sext i1 %6 to i32
%8 = tail call i32 @ctest_test_assert_add(i32 %5, i8* %1)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *skip(char *);
int main() {
  char str[] = "  zhangyifei";
  printf("%s\n", skip(str));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xeca(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xd(%rbp),%rdi
call   1030 <skip@plt>
mov    %rax,%rsi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x6965666979676e,%rax
mov    %rax,0xd(%rsp)
movabs $0x79676e61687a2020,%rax
6e 67 79
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <skip@plt>
lea    0xeba(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.str = [13 x i8] c" zhangyifei\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = call i8* @skip(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
void use_default_colors() {}


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

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

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

LLVM IR (-O2):
define void @use_default_colors() {
ret void
}
/* Variables and functions */
int diminuto_ipc_shutdown(int);
int diminuto_ipc4_shutdown(int fd) { return diminuto_ipc_shutdown(fd); }


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

x86 assembly (clang, -O2):
<diminuto_ipc4_shutdown>:
jmp    1030 <diminuto_ipc_shutdown@plt>

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

LLVM IR (-O2):
define i32 @diminuto_ipc4_shutdown(i32 %0) {
%2 = tail call i32 @diminuto_ipc_shutdown(i32 %0)
ret i32 %2
}
void XSyncValueIsNegative() {}


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

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

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

LLVM IR (-O2):
define void @XSyncValueIsNegative() {
ret void
}