xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ str;

/* Variables and functions */
char *VersionString();
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
char *VersionStringFull(void) {
  static char str[256];
  snprintf(str, sizeof(str),
           "EZQUAKE"
           " %s "
           "("
           "Linux64"
           ")"
           "\n",
           VersionString());
  return str;
}


x86 assembly (clang, -O0):
<VersionStringFull>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <VersionString@plt>
mov    %rax,%rcx
lea    0x2f0b(%rip),%rdi
mov    $0x100,%esi
lea    0xebf(%rip),%rdx
call   1040 <snprintf@plt>
lea    0x2ef3(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<VersionStringFull>:
push   %rbx
xor    %eax,%eax
call   1030 <VersionString@plt>
lea    0x2f11(%rip),%rbx
lea    0xeca(%rip),%rdx
mov    %rbx,%rdi
mov    $0x100,%esi
mov    %rax,%rcx
call   1040 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@VersionStringFull.str = internal global [256 x i8] zeroinitializer
@.str = [22 x i8] c"EZQUAKE %s (Linux64)\0A\00"
define i8* @VersionStringFull() {
%1 = call i8* (...) @VersionString()
%2 = call i32 @snprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @VersionStringFull.str, i64 0, i64 0), i32 256, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @VersionStringFull.str, i64 0, i64 0)
}

LLVM IR (-O2):
@VersionStringFull.str = internal global [256 x i8] zeroinitializer
@.str = [22 x i8] c"EZQUAKE %s (Linux64)\0A\00"
define i8* @VersionStringFull() {
%1 = tail call i8* (...) @VersionString()
%2 = tail call i32 @snprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @VersionStringFull.str, i64 0, i64 0), i32 256, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @VersionStringFull.str, i64 0, i64 0)
}
/* Variables and functions */
int *alloca(int);
int main() {
  int *i = alloca(sizeof(int));
  int *j = alloca(sizeof(int));
  *j = 1;
  for (*i = 10000; *i - *j >= 1; (*i)--) {
    (*j)++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <alloca@plt>
mov    %rax,-0x10(%rbp)
mov    $0x4,%edi
call   1030 <alloca@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x2710,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
sub    (%rcx),%eax
cmp    $0x1,%eax
jl     117f <main+0x6f>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
jmp    114f <main+0x3f>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1030 <alloca@plt>
mov    %rax,%rbx
mov    $0x4,%edi
call   1030 <alloca@plt>
movl   $0x1,(%rax)
movl   $0x2710,(%rbx)
mov    (%rax),%ecx
cmp    $0x270f,%ecx
jg     1152 <main+0x42>
xchg   %ax,%ax
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    (%rbx),%edx
add    $0xffffffff,%edx
mov    %edx,(%rbx)
mov    (%rax),%ecx
cmp    %ecx,%edx
jg     1140 <main+0x30>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @alloca(i32 4)
%2 = tail call i32* @alloca(i32 4)
store i32 1, i32* %2
store i32 10000, i32* %1
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 10000
br i1 %4, label %5, label %12
5: ; preds = %0, %5
%6 = phi i32 [ %10, %5 ], [ %3, %0 ]
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
%8 = load i32, i32* %1
%9 = add nsw i32 %8, -1
store i32 %9, i32* %1
%10 = load i32, i32* %2
%11 = icmp sgt i32 %9, %10
br i1 %11, label %5, label %12
12: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ appendCODE(int /*<<< orphan*/);
int /*<<< orphan*/ makeCODEiadd(int /*<<< orphan*/ *);
void code_iadd() { appendCODE(makeCODEiadd(NULL)); }


x86 assembly (clang, -O0):
<code_iadd>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <makeCODEiadd@plt>
mov    %eax,%edi
call   1030 <appendCODE@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @code_iadd() {
%1 = call i32 @makeCODEiadd(i32* null)
%2 = call i32 @appendCODE(i32 %1)
ret void
}

LLVM IR (-O2):
define void @code_iadd() {
%1 = tail call i32 @makeCODEiadd(i32* null)
%2 = tail call i32 @appendCODE(i32 %1)
ret void
}
/* Variables and functions */
bool nrf52_errata_237(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_237() {
ret i32 0
}
int my_isneg(int n) { return n < 0 ? 1 : 0; }


x86 assembly (clang, -O0):
<my_isneg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @my_isneg(i32 %0) {
%2 = lshr i32 %0, 31
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
scalar_t__ strncmp(char *, char *, int /*<<< orphan*/);
char linetype(char *line, char *code) {
  return (strncmp(line, code, strlen(code)) == 0);
}


x86 assembly (clang, -O0):
<linetype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linetype>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define signext i8 @linetype(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @linetype(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i8
ret i8 %6
}
void call_back_5(void *target, void *routine_ptr) {
  (((void (*)(void *, void *))routine_ptr)(target, target));
}


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

x86 assembly (clang, -O2):
<call_back_5>:
mov    %rsi,%rax
mov    %rdi,%rsi
jmp    *%rax

LLVM IR (-O0):
define void @call_back_5(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to void (i8*, i8*)*
%7 = load i8*, i8** %3
%8 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @call_back_5(i8* %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to void (i8*, i8*)*
tail call void %3(i8* %0, i8* %0)
ret void
}
int g_DUMMY_menu_is_enabled(int menu_id, int item_id) {
  menu_id = menu_id;
  item_id = item_id;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @g_DUMMY_menu_is_enabled(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
store i32 %5, i32* %3
%6 = load i32, i32* %4
store i32 %6, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @g_DUMMY_menu_is_enabled(i32 %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ __glGetMap_size(int /*<<< orphan*/, int /*<<< orphan*/);
GLint __glGetMapdv_size(GLenum target, GLenum query) {
  return __glGetMap_size(target, query);
}


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

x86 assembly (clang, -O2):
<__glGetMapdv_size>:
jmp    1030 <__glGetMap_size@plt>

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

LLVM IR (-O2):
define i32 @__glGetMapdv_size(i32 %0, i32 %1) {
%3 = tail call i32 @__glGetMap_size(i32 %0, i32 %1)
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long time;
};
struct TYPE_4__ {
  TYPE_1__ xmotion;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xmotion_time(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xmotion.time = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xmotion_time>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xmotion_time(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xmotion_time(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int ho_strspn(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *p = " \t\r\nhello";
  printf("%s\n", p + ho_strspn(p, " \t\r\n"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1040 <ho_strspn@plt>
mov    -0x18(%rbp),%rsi
cltq
add    %rax,%rsi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1040 <ho_strspn@plt>
movslq %eax,%rsi
add    %rbx,%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c" \09\0D\0Ahello\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [5 x i8] c" \09\0D\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @ho_strspn(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %3, i64 %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c" \09\0D\0Ahello\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [5 x i8] c" \09\0D\0A\00"
define i32 @main() {
%1 = tail call i32 @ho_strspn(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%2 = sext i32 %1 to i64
%3 = getelementptr inbounds [10 x i8], [10 x i8]* @.str, i64 0, i64 %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ start_walk(char *);
int main(int argc, char **argv) {
  while (--argc > 0) {
    start_walk(*++argv);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1155 <main+0x45>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1030 <start_walk@plt>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1144 <main+0x34>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x8,%rbx
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx),%rdi
call   1030 <start_walk@plt>
add    $0x8,%rbx
add    $0xffffffff,%ebp
cmp    $0x2,%ebp
ja     1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i8** [ %8, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = add nsw i32 %6, -1
%8 = getelementptr inbounds i8*, i8** %5, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @start_walk(i8* %9)
%11 = icmp ugt i32 %6, 2
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SysCtlReset();
void BootActivate(void) { SysCtlReset(); }


x86 assembly (clang, -O0):
<BootActivate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SysCtlReset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<BootActivate>:
xor    %eax,%eax
jmp    1030 <SysCtlReset@plt>

LLVM IR (-O0):
define void @BootActivate() {
%1 = call i32 (...) @SysCtlReset()
ret void
}

LLVM IR (-O2):
define void @BootActivate() {
%1 = tail call i32 (...) @SysCtlReset()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void usage(FILE *f, char *pname) {
  fprintf(f, "Usage: %s left right out\n", pname);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Usage: %s left right out\0A\00"
define void @usage(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 @fprintf(i32* %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Usage: %s left right out\0A\00"
define void @usage(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
void logprintf(int prio, const char *format_str, ...) {}


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

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

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

LLVM IR (-O2):
define void @logprintf(i32 %0, i8* nocapture %1, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ h();
int vg2(void) { h(); }


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

x86 assembly (clang, -O2):
<vg2>:
xor    %eax,%eax
jmp    1030 <h@plt>

LLVM IR (-O0):
define i32 @vg2() {
%1 = alloca i32
%2 = call i32 (...) @h()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @vg2() {
%1 = tail call i32 (...) @h()
ret i32 undef
}
/* Variables and functions */
long double truncl(long double);
long double rintl(long double x) { return truncl(x); }


x86 assembly (clang, -O0):
<rintl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <truncl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rintl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <truncl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @rintl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @llvm.trunc.f80(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @rintl(x86_fp80 %0) {
%2 = tail call x86_fp80 @llvm.trunc.f80(x86_fp80 %0)
ret x86_fp80 %2
}
double dAUX1bp4b(double x) { return 0.0; }


x86 assembly (clang, -O0):
<dAUX1bp4b>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dAUX1bp4b>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @dAUX1bp4b(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @dAUX1bp4b(double %0) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ wNotYet(char *);
char *wPopString();
int /*<<< orphan*/ wPushNumber(int /*<<< orphan*/);
void wBasTally() {
  char *search, *match;
  match = wPopString();
  search = wPopString();
  wNotYet("Tally");
  free(match);
  free(search);
  wPushNumber(0);
}


x86 assembly (clang, -O0):
<wBasTally>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <wPopString@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <wPopString@plt>
mov    %rax,-0x8(%rbp)
lea    0xe9b(%rip),%rdi
call   1060 <wNotYet@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   1050 <wPushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasTally>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <wPopString@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1040 <wPopString@plt>
mov    %rax,%rbx
lea    0xea1(%rip),%rdi
call   1060 <wNotYet@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %edi,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <wPushNumber@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Tally\00"
define void @wBasTally() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* (...) @wPopString()
store i8* %3, i8** %2
%4 = call i8* (...) @wPopString()
store i8* %4, i8** %1
%5 = call i32 @wNotYet(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
%8 = load i8*, i8** %1
%9 = call i32 @free(i8* %8)
%10 = call i32 @wPushNumber(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"Tally\00"
define void @wBasTally() {
%1 = tail call i8* (...) @wPopString()
%2 = tail call i8* (...) @wPopString()
%3 = tail call i32 @wNotYet(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @free(i8* %1)
%5 = tail call i32 @free(i8* %2)
%6 = tail call i32 @wPushNumber(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ pthread_self();
void my_free(void *arg) {
  printf("call destructor for [%lu]\n", pthread_self());
  free(arg);
}


x86 assembly (clang, -O0):
<my_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_free>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"call destructor for [%lu]\0A\00"
define void @my_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @pthread_self()
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"call destructor for [%lu]\0A\00"
define void @my_free(i8* nocapture %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, double *, int);
int /*<<< orphan*/ memset(double *, int /*<<< orphan*/, int);
double stress_funcret_double1(double);
double __attribute__((no)) stress_funcret_deep_double1(double a) {
  double b;
  (void)memcpy(&b, &a, sizeof(a));
  (void)memset(&a, 0, sizeof(a));
  return stress_funcret_double1(b);
}


x86 assembly (clang, -O0):
<stress_funcret_deep_double1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1050 <memcpy@plt>
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
movsd  -0x10(%rbp),%xmm0
call   1040 <stress_funcret_double1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_funcret_deep_double1>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %rsp,%rdi
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x8,%edx
call   1050 <memcpy@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
movsd  (%rsp),%xmm0
call   1040 <stress_funcret_double1@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @stress_funcret_deep_double1(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = call i32 @memcpy(double* %3, double* %2, i32 8)
%5 = call i32 @memset(double* %2, i32 0, i32 8)
%6 = load double, double* %3
%7 = call double @stress_funcret_double1(double %6)
ret double %7
}

LLVM IR (-O2):
define double @stress_funcret_deep_double1(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = bitcast double* %3 to i8*
%5 = call i32 @memcpy(double* %3, double* %2, i32 8)
%6 = call i32 @memset(double* %2, i32 0, i32 8)
%7 = load double, double* %3
%8 = call double @stress_funcret_double1(double %7)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int errno;
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, int);
main() {
  int f = open("xyzzy", O_RDWR);
  printf("errno= %d\n", errno);
  perror("--exiting--");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0x4(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
lea    0xea5(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1040 <open@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"xyzzy\00"
@O_RDWR = global i32 0
@.str.1 = [11 x i8] c"errno= %d\0A\00"
@errno = global i32 0
@.str.2 = [12 x i8] c"--exiting--\00"
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* @O_RDWR
%3 = call i32 @open(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* @errno
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"xyzzy\00"
@O_RDWR = global i32 0
@.str.1 = [11 x i8] c"errno= %d\0A\00"
@errno = global i32 0
@.str.2 = [12 x i8] c"--exiting--\00"
define i32 @main() {
%1 = load i32, i32* @O_RDWR
%2 = tail call i32 @open(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @errno
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int log10(int);
double round(int);
double calculoQtIteracao(double raizA, double raizB, double testeParada) {
  return round((log10(raizB - raizA) - log10(testeParada)) / log10(2));
}


x86 assembly (clang, -O0):
<calculoQtIteracao>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <log10@plt>
mov    %eax,-0x20(%rbp)
cvttsd2si -0x18(%rbp),%edi
call   1040 <log10@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    $0x2,%edi
call   1040 <log10@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <round@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculoQtIteracao>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm2,0x8(%rsp)
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1040 <log10@plt>
mov    %eax,%ebx
cvttsd2si 0x8(%rsp),%edi
call   1040 <log10@plt>
sub    %eax,%ebx
mov    $0x2,%edi
call   1040 <log10@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <round@plt>

LLVM IR (-O0):
define double @calculoQtIteracao(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = load double, double* %4
%9 = fsub double %7, %8
%10 = fptosi double %9 to i32
%11 = call i32 @log10(i32 %10)
%12 = load double, double* %6
%13 = fptosi double %12 to i32
%14 = call i32 @log10(i32 %13)
%15 = sub nsw i32 %11, %14
%16 = call i32 @log10(i32 2)
%17 = sdiv i32 %15, %16
%18 = call double @round(i32 %17)
ret double %18
}

LLVM IR (-O2):
define double @calculoQtIteracao(double %0, double %1, double %2) {
%4 = fsub double %1, %0
%5 = fptosi double %4 to i32
%6 = tail call i32 @log10(i32 %5)
%7 = fptosi double %2 to i32
%8 = tail call i32 @log10(i32 %7)
%9 = sub nsw i32 %6, %8
%10 = tail call i32 @log10(i32 2)
%11 = sdiv i32 %9, %10
%12 = tail call double @round(i32 %11)
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World\n");
  printf("This is an extra line added later\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
@.str.1 = [35 x i8] c"This is an extra line added later\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [12 x i8] c"Hello World\00"
@str.2 = [34 x i8] c"This is an extra line added later\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.2, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ __analyzer_eval(int);
void test_6(int a[10]) {
  __analyzer_eval(a[3] == 42);
  a[3] = 42;
  __analyzer_eval(a[3] == 42);
}


x86 assembly (clang, -O0):
<test_6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x2a,0xc(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__analyzer_eval@plt>
mov    -0x8(%rbp),%rax
movl   $0x2a,0xc(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x2a,0xc(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_6>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmpl   $0x2a,0xc(%rbx)
sete   %dil
call   1030 <__analyzer_eval@plt>
movl   $0x2a,0xc(%rbx)
mov    $0x1,%edi
pop    %rbx
jmp    1030 <__analyzer_eval@plt>

LLVM IR (-O0):
define void @test_6(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 42
%7 = zext i1 %6 to i32
%8 = call i32 @__analyzer_eval(i32 %7)
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 3
store i32 42, i32* %10
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 3
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 42
%15 = zext i1 %14 to i32
%16 = call i32 @__analyzer_eval(i32 %15)
ret void
}

LLVM IR (-O2):
define void @test_6(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 42
%5 = zext i1 %4 to i32
%6 = tail call i32 @__analyzer_eval(i32 %5)
store i32 42, i32* %2
%7 = tail call i32 @__analyzer_eval(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BlankLine();
int /*<<< orphan*/ EmitLibrary();
void ListHeaderFiles(void) {
  EmitLibrary();
  BlankLine();
  BlankLine();
}


x86 assembly (clang, -O0):
<ListHeaderFiles>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <EmitLibrary@plt>
mov    $0x0,%al
call   1040 <BlankLine@plt>
mov    $0x0,%al
call   1040 <BlankLine@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ListHeaderFiles>:
push   %rax
xor    %eax,%eax
call   1030 <EmitLibrary@plt>
xor    %eax,%eax
call   1040 <BlankLine@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <BlankLine@plt>

LLVM IR (-O0):
define void @ListHeaderFiles() {
%1 = call i32 (...) @EmitLibrary()
%2 = call i32 (...) @BlankLine()
%3 = call i32 (...) @BlankLine()
ret void
}

LLVM IR (-O2):
define void @ListHeaderFiles() {
%1 = tail call i32 (...) @EmitLibrary()
%2 = tail call i32 (...) @BlankLine()
%3 = tail call i32 (...) @BlankLine()
ret void
}
/* Variables and functions */
unsigned char USBNRead(int);
void _USBNNackEvent(void) {
  unsigned char event;
  event = USBNRead(0x0E);
}


x86 assembly (clang, -O0):
<_USBNNackEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xe,%edi
call   1030 <USBNRead@plt>
mov    %al,-0x1(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_USBNNackEvent>:
mov    $0xe,%edi
jmp    1030 <USBNRead@plt>

LLVM IR (-O0):
define void @_USBNNackEvent() {
%1 = alloca i8
%2 = call zeroext i8 @USBNRead(i32 14)
store i8 %2, i8* %1
ret void
}

LLVM IR (-O2):
define void @_USBNNackEvent() {
%1 = tail call zeroext i8 @USBNRead(i32 14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ etk_app_main(int, char **);
int /*<<< orphan*/ etk_exit();
int /*<<< orphan*/ etk_init(int, char **);
int /*<<< orphan*/ etk_run();
int main(int argc, char *argv[]) {
  etk_init(argc, argv);
  etk_app_main(argc, argv);
  etk_run();
  etk_exit();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <etk_init@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <etk_app_main@plt>
mov    $0x0,%al
call   1060 <etk_run@plt>
mov    $0x0,%al
call   1030 <etk_exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <etk_init@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <etk_app_main@plt>
xor    %eax,%eax
call   1060 <etk_run@plt>
xor    %eax,%eax
call   1030 <etk_exit@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @etk_init(i32 %6, i8** %7)
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 @etk_app_main(i32 %9, i8** %10)
%12 = call i32 (...) @etk_run()
%13 = call i32 (...) @etk_exit()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @etk_init(i32 %0, i8** %1)
%4 = tail call i32 @etk_app_main(i32 %0, i8** %1)
%5 = tail call i32 (...) @etk_run()
%6 = tail call i32 (...) @etk_exit()
ret i32 0
}
int get_core_id() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_core_id() {
ret i32 0
}
int is_valid_point(double latitude, double longitude) {
  if (latitude > 90 || latitude < -90) {
    return 0;
  }
  if (longitude > 180 || longitude < -180) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_valid_point>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xee5(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1138 <is_valid_point+0x38>
movsd  0xedb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1144 <is_valid_point+0x44>
movl   $0x0,-0x4(%rbp)
jmp    1181 <is_valid_point+0x81>
movsd  -0x18(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     116e <is_valid_point+0x6e>
movsd  0xeb5(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    117a <is_valid_point+0x7a>
movl   $0x0,-0x4(%rbp)
jmp    1181 <is_valid_point+0x81>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_point>:
ucomisd 0xef8(%rip),%xmm0
setbe  %sil
movsd  0xef4(%rip),%xmm2
ucomisd %xmm0,%xmm2
setbe  %cl
ucomisd 0xeed(%rip),%xmm1
setbe  %dl
movsd  0xeea(%rip),%xmm0
ucomisd %xmm1,%xmm0
setbe  %al
and    %dl,%al
and    %sil,%cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_valid_point(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = fcmp ogt double %6, 9.000000e+01
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load double, double* %4
%10 = fcmp olt double %9, -9.000000e+01
br i1 %10, label %11, label %12
11: ; preds = %8, %2
store i32 0, i32* %3
br label %20
12: ; preds = %8
%13 = load double, double* %5
%14 = fcmp ogt double %13, 1.800000e+02
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = load double, double* %5
%17 = fcmp olt double %16, -1.800000e+02
br i1 %17, label %18, label %19
18: ; preds = %15, %12
store i32 0, i32* %3
br label %20
19: ; preds = %15
store i32 1, i32* %3
br label %20
20: ; preds = %19, %18, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @is_valid_point(double %0, double %1) {
%3 = fcmp ule double %0, 9.000000e+01
%4 = fcmp uge double %0, -9.000000e+01
%5 = fcmp ule double %1, 1.800000e+02
%6 = fcmp uge double %1, -1.800000e+02
%7 = and i1 %5, %6
%8 = and i1 %3, %4
%9 = and i1 %8, %7
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ emit_string(char *);
void event_tie() { emit_string("-"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
define void @event_tie() {
%1 = tail call i32 @emit_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
void _infix_operator_mult_i16_i16(signed short lhs, signed short rhs,
                                  signed short *__rval_1) {
  *__rval_1 = lhs * rhs;
}


x86 assembly (clang, -O0):
<_infix_operator_mult_i16_i16>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    %rdx,-0x10(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
imul   %ecx,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_infix_operator_mult_i16_i16>:
imul   %esi,%edi
mov    %di,(%rdx)
ret

LLVM IR (-O0):
define void @_infix_operator_mult_i16_i16(i16 signext %0, i16 signext %1, i16* %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16*
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16* %2, i16** %6
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = load i16, i16* %5
%10 = sext i16 %9 to i32
%11 = mul nsw i32 %8, %10
%12 = trunc i32 %11 to i16
%13 = load i16*, i16** %6
store i16 %12, i16* %13
ret void
}

LLVM IR (-O2):
define void @_infix_operator_mult_i16_i16(i16 signext %0, i16 signext %1, i16* nocapture writeonly %2) {
%4 = mul i16 %1, %0
store i16 %4, i16* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ __syscall(int);
pid_t getpgrp(void) { return __syscall(65); }


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

x86 assembly (clang, -O2):
<getpgrp>:
mov    $0x41,%edi
jmp    1030 <__syscall@plt>

LLVM IR (-O0):
define i32 @getpgrp() {
%1 = call i32 @__syscall(i32 65)
ret i32 %1
}

LLVM IR (-O2):
define i32 @getpgrp() {
%1 = tail call i32 @__syscall(i32 65)
ret i32 %1
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void u16_to_le(unsigned char *x, const uint16_t u) {
  x[0] = (unsigned char)u;
  x[1] = (unsigned char)(u >> 8);
}


x86 assembly (clang, -O0):
<u16_to_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<u16_to_le>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @u16_to_le(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = trunc i32 %5 to i8
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 %6, i8* %8
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8 %11, i8* %13
ret void
}

LLVM IR (-O2):
define void @u16_to_le(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
/* Variables and functions */
int diminuto_ipcl_packet_provider_generic(char const *, int);
int diminuto_ipcl_packet_provider(const char *path) {
  return diminuto_ipcl_packet_provider_generic(path, -1);
}


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

x86 assembly (clang, -O2):
<diminuto_ipcl_packet_provider>:
mov    $0xffffffff,%esi
jmp    1030 <diminuto_ipcl_packet_provider_generic@plt>

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

LLVM IR (-O2):
define i32 @diminuto_ipcl_packet_provider(i8* %0) {
%2 = tail call i32 @diminuto_ipcl_packet_provider_generic(i8* %0, i32 -1)
ret i32 %2
}
int ft_strnlen(char *str, int len) {
  int i;
  i = 0;
  while (str[i] && i < len)
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<ft_strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1138 <ft_strnlen+0x38>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1148 <ft_strnlen+0x48>
jmp    1156 <ft_strnlen+0x56>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <ft_strnlen+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strnlen>:
movslq %esi,%rcx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x1(%rdx),%rax
cmpb   $0x0,(%rdi,%rdx,1)
je     1122 <ft_strnlen+0x22>
cmp    %rcx,%rdx
mov    %rax,%rdx
jl     1110 <ft_strnlen+0x10>
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @ft_strnlen(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %20, %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 = icmp ne i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %6
%15 = load i32, i32* %5
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br label %18
18: ; preds = %14, %6
%19 = phi i1 [ false, %6 ], [ %17, %14 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %6
23: ; preds = %18
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @ft_strnlen(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %11, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
%9 = icmp slt i64 %5, %3
%10 = select i1 %8, i1 %9, i1 false
%11 = add nuw nsw i64 %5, 1
br i1 %10, label %4, label %12
12: ; preds = %4
%13 = trunc i64 %5 to i32
ret i32 %13
}
/* Type definitions */
typedef int type;

/* Variables and functions */
int quotactl(int, char *, int /*<<< orphan*/, int /*<<< orphan*/ *);
int sync_one(int type, char *dev) {
  int qcmd = (((0x800001) << 8) | ((type)&0x00ff));
  return quotactl(qcmd, dev, 0, NULL);
}


x86 assembly (clang, -O0):
<sync_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
or     $0x80000100,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <quotactl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync_one>:
movzbl %dil,%edi
or     $0x80000100,%edi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <quotactl@plt>

LLVM IR (-O0):
define i32 @sync_one(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = and i32 %6, 255
%8 = or i32 -2147483392, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i8*, i8** %4
%11 = call i32 @quotactl(i32 %9, i8* %10, i32 0, i32* null)
ret i32 %11
}

LLVM IR (-O2):
define i32 @sync_one(i32 %0, i8* %1) {
%3 = and i32 %0, 255
%4 = or i32 %3, -2147483392
%5 = tail call i32 @quotactl(i32 %4, i8* %1, i32 0, i32* null)
ret i32 %5
}