xunge/DecIR huggingface dataset:
int compare(void *first, void *second) {
  int *f = first;
  int *s = second;
  return *f - *s;
}


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

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

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *p = malloc(size);
  if (p == NULL) {
    fprintf(stderr, "[!] malloc failed (returned NULL).\n");
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <xmalloc+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

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

/* Variables and functions */
int /*<<< orphan*/ PRIO_PROCESS;
int /*<<< orphan*/ SYS_gettid;
int setpriority(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ syscall(int /*<<< orphan*/);
int set_nice_level(int level) {
  pid_t tid;
  tid = syscall(SYS_gettid);
  return setpriority(PRIO_PROCESS, tid, level);
}


x86 assembly (clang, -O0):
<set_nice_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
call   1040 <syscall@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
call   1030 <setpriority@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_nice_level>:
push   %rbx
mov    %edi,%ebx
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
call   1040 <syscall@plt>
mov    0x2ea0(%rip),%rcx
mov    (%rcx),%edi
mov    %eax,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <setpriority@plt>

LLVM IR (-O0):
@SYS_gettid = global i32 0
@PRIO_PROCESS = global i32 0
define i32 @set_nice_level(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @SYS_gettid
%5 = call i32 @syscall(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* @PRIO_PROCESS
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = call i32 @setpriority(i32 %6, i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
@SYS_gettid = global i32 0
@PRIO_PROCESS = global i32 0
define i32 @set_nice_level(i32 %0) {
%2 = load i32, i32* @SYS_gettid
%3 = tail call i32 @syscall(i32 %2)
%4 = load i32, i32* @PRIO_PROCESS
%5 = tail call i32 @setpriority(i32 %4, i32 %3, i32 %0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ os_puts(char *);
void supcon_putc(unsigned char c) {
  char buffer[2];
  buffer[0] = c;
  buffer[1] = 0;
  os_puts(buffer);
}


x86 assembly (clang, -O0):
<supcon_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x3(%rbp)
movb   $0x0,-0x2(%rbp)
lea    -0x3(%rbp),%rdi
call   1030 <os_puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<supcon_putc>:
push   %rax
mov    %dil,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x6(%rsp),%rdi
call   1030 <os_puts@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @supcon_putc(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca [2 x i8]
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %4, i8* %5
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 0, i8* %6
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%8 = call i32 @os_puts(i8* %7)
ret void
}

LLVM IR (-O2):
define void @supcon_putc(i8 zeroext %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 %0, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 0, i8* %4
%5 = call i32 @os_puts(i8* %3)
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int cmp_words(const void *word1, const void *word2) {
  return strcmp(*(char **)word1, *(char **)word2);
}


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

x86 assembly (clang, -O2):
<cmp_words>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @cmp_words(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmp_words(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ srand(int);
void u_random(int seed) { srand(seed); }


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

x86 assembly (clang, -O2):
<u_random>:
jmp    1030 <srand@plt>

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

LLVM IR (-O2):
define void @u_random(i32 %0) {
%2 = tail call i32 @srand(i32 %0)
ret void
}
int XwcTextEscapement() {}


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

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

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

LLVM IR (-O2):
define i32 @XwcTextEscapement() {
ret i32 undef
}
/* Type definitions */
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
size_t strftime(char *, size_t, char const *, struct tm const *);
size_t strftime_l(char *restrict s, size_t n, const char *restrict f,
                  const struct tm *restrict tm, locale_t l) {
  return strftime(s, n, f, tm);
}


x86 assembly (clang, -O0):
<strftime_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <strftime@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strftime_l>:
jmp    1030 <strftime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define i64 @strftime_l(i8* noalias %0, i64 %1, i8* noalias %2, %struct.tm* noalias %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca %struct.tm*
%10 = alloca i32
store i8* %0, i8** %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store %struct.tm* %3, %struct.tm** %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i8*, i8** %8
%14 = load %struct.tm*, %struct.tm** %9
%15 = call i64 @strftime(i8* %11, i64 %12, i8* %13, %struct.tm* %14)
ret i64 %15
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i64 @strftime_l(i8* noalias %0, i64 %1, i8* noalias %2, %struct.tm* noalias %3, i32 %4) {
%6 = tail call i64 @strftime(i8* %0, i64 %1, i8* %2, %struct.tm* %3)
ret i64 %6
}
void foo061(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo061(i32 %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct kvm_msrs {
  TYPE_1__ *entries;
};
typedef int /*<<< orphan*/ __u64;
struct TYPE_2__ {
  int /*<<< orphan*/ data;
};

/* Variables and functions */
__u64 msr_get(void *data) {
  struct kvm_msrs *msrs = (struct kvm_msrs *)data;
  return msrs->entries[0].data;
}


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

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

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

LLVM IR (-O2):
%struct.TYPE_2__ = type { i32 }
define i32 @msr_get(i8* nocapture %0) {
%2 = bitcast i8* %0 to %struct.TYPE_2__**
%3 = load %struct.TYPE_2__*, %struct.TYPE_2__** %2
%4 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %3, i64 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
char *strdup(char const *);
char *xstrdup(const char *s) {
  char *ret = NULL;
  if (!s)
    return NULL;
  ret = strdup(s);
  if (!ret)
    die("Out of memory; strdup failed");
  return ret;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114c <xstrdup+0x2c>
movq   $0x0,-0x8(%rbp)
jmp    1178 <xstrdup+0x58>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1170 <xstrdup+0x50>
lea    0xe95(%rip),%rdi
call   1030 <die@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rax
test   %rdi,%rdi
je     113e <xstrdup+0x1e>
call   1040 <strdup@plt>
test   %rax,%rax
je     1132 <xstrdup+0x12>
pop    %rcx
ret
lea    0xec7(%rip),%rdi
call   1030 <die@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Out of memory; strdup failed\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* null, i8** %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i8* null, i8** %2
br label %17
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i8* @strdup(i8* %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %15, label %13
13: ; preds = %8
%14 = call i32 @die(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %8
%16 = load i8*, i8** %4
store i8* %16, i8** %2
br label %17
17: ; preds = %15, %7
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@.str = [29 x i8] c"Out of memory; strdup failed\00"
define noalias i8* @xstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @die(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %3, %6, %1
%9 = phi i8* [ null, %1 ], [ null, %6 ], [ %4, %3 ]
ret i8* %9
}
int main() { const char *name = __PRETTY_FUNCTION__; }


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

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

LLVM IR (-O0):
@__PRETTY_FUNCTION__.main = [11 x i8] c"int main()\00"
define i32 @main() {
%1 = alloca i8*
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__PRETTY_FUNCTION__.main, i64 0, i64 0), i8** %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
void *osd_alloc_executable(size_t size) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @osd_alloc_executable(i64 %0) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ DrawTextlnw145(char const *, unsigned long);
void drawtextlnw(const char *s, unsigned long cfg) { DrawTextlnw145(s, cfg); }


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

x86 assembly (clang, -O2):
<drawtextlnw>:
jmp    1030 <DrawTextlnw145@plt>

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

LLVM IR (-O2):
define void @drawtextlnw(i8* %0, i64 %1) {
%3 = tail call i32 @DrawTextlnw145(i8* %0, i64 %1)
ret void
}
/* Type definitions */
typedef int clockid_t;

/* Variables and functions */
int /*<<< orphan*/ close(unsigned int);
void phc_close(clockid_t clkid) {
  if (clkid == -1)
    return;
  close(((unsigned int)~((clkid) >> 3)));
}


x86 assembly (clang, -O0):
<phc_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    112a <phc_close+0x1a>
jmp    1138 <phc_close+0x28>
mov    -0x4(%rbp),%edi
sar    $0x3,%edi
xor    $0xffffffff,%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phc_close>:
cmp    $0xffffffff,%edi
je     111f <phc_close+0xf>
sar    $0x3,%edi
not    %edi
jmp    1030 <close@plt>
ret

LLVM IR (-O0):
define void @phc_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = ashr i32 %7, 3
%9 = xor i32 %8, -1
%10 = call i32 @close(i32 %9)
br label %11
11: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @phc_close(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = ashr i32 %0, 3
%5 = xor i32 %4, -1
%6 = tail call i32 @close(i32 %5)
br label %7
7: ; preds = %1, %3
ret void
}
/* Variables and functions */
int ax2qu(double *, double *, int);
int ho2ax(double *, double *, int);
int ho2qu(double *ho, double *qu, int p) {
  double ax[4];
  int trash;
  trash = ho2ax(ho, ax, p);
  trash = ax2qu(ax, qu, p);
  return 1;
}


x86 assembly (clang, -O0):
<ho2qu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <ho2ax@plt>
mov    %eax,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ax2qu@plt>
mov    %eax,-0x44(%rbp)
mov    $0x1,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ho2qu>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rsp,%r15
mov    %r15,%rsi
call   1040 <ho2ax@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <ax2qu@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @ho2qu(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
%7 = alloca [4 x double]
%8 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%9 = load double*, double** %4
%10 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%11 = load i32, i32* %6
%12 = call i32 @ho2ax(double* %9, double* %10, i32 %11)
store i32 %12, i32* %8
%13 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%14 = load double*, double** %5
%15 = load i32, i32* %6
%16 = call i32 @ax2qu(double* %13, double* %14, i32 %15)
store i32 %16, i32* %8
ret i32 1
}

LLVM IR (-O2):
define i32 @ho2qu(double* %0, double* %1, i32 %2) {
%4 = alloca [4 x double]
%5 = bitcast [4 x double]* %4 to i8*
%6 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%7 = call i32 @ho2ax(double* %0, double* %6, i32 %2)
%8 = call i32 @ax2qu(double* %6, double* %1, i32 %2)
ret i32 1
}
/* Variables and functions */
char *corta_string(char *);
int longitud_string(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char *s = "Campos verdes";
  if (longitud_string(s) > 1) {
    s = corta_string(s);
    printf("%s\n", s);
  } else
    printf("error\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <longitud_string@plt>
cmp    $0x1,%eax
jle    1180 <main+0x50>
mov    -0x10(%rbp),%rdi
call   1040 <corta_string@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118e <main+0x5e>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <longitud_string@plt>
cmp    $0x2,%eax
jl     1153 <main+0x23>
lea    0xeb7(%rip),%rdi
call   1040 <corta_string@plt>
mov    %rax,%rdi
jmp    115a <main+0x2a>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Campos verdes\00"
@str = [6 x i8] c"error\00"
define i32 @main() {
%1 = tail call i32 @longitud_string(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = icmp sgt i32 %1, 1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i8* @corta_string(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i8* [ %4, %3 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), %0 ]
%7 = tail call i32 @puts(i8* dereferenceable(1) %6)
ret i32 0
}
void mhandle_mark_corrupt(void *eff_ptr, unsigned long eff_size) {
  unsigned long i;
  char *as_char = eff_ptr;
  for (i = 0; i < 2; i++)
    as_char[i] = 0x5a;
  for (i = 0; i < 2; i++)
    as_char[eff_size - 2 + i] = 0xa5;
}


x86 assembly (clang, -O0):
<mhandle_mark_corrupt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x2,-0x18(%rbp)
jae    1144 <mhandle_mark_corrupt+0x44>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x5a,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111c <mhandle_mark_corrupt+0x1c>
movq   $0x0,-0x18(%rbp)
cmpq   $0x2,-0x18(%rbp)
jae    117c <mhandle_mark_corrupt+0x7c>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x2,%rcx
add    -0x18(%rbp),%rcx
movb   $0xa5,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    114c <mhandle_mark_corrupt+0x4c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mhandle_mark_corrupt>:
movw   $0x5a5a,(%rdi)
movw   $0xa5a5,-0x2(%rsi,%rdi,1)
ret

LLVM IR (-O0):
define void @mhandle_mark_corrupt(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
store i8* %7, i8** %6
store i64 0, i64* %5
br label %8
8: ; preds = %15, %2
%9 = load i64, i64* %5
%10 = icmp ult i64 %9, 2
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i8*, i8** %6
%13 = load i64, i64* %5
%14 = getelementptr inbounds i8, i8* %12, i64 %13
store i8 90, i8* %14
br label %15
15: ; preds = %11
%16 = load i64, i64* %5
%17 = add i64 %16, 1
store i64 %17, i64* %5
br label %8
18: ; preds = %8
store i64 0, i64* %5
br label %19
19: ; preds = %29, %18
%20 = load i64, i64* %5
%21 = icmp ult i64 %20, 2
br i1 %21, label %22, label %32
22: ; preds = %19
%23 = load i8*, i8** %6
%24 = load i64, i64* %4
%25 = sub i64 %24, 2
%26 = load i64, i64* %5
%27 = add i64 %25, %26
%28 = getelementptr inbounds i8, i8* %23, i64 %27
store i8 -91, i8* %28
br label %29
29: ; preds = %22
%30 = load i64, i64* %5
%31 = add i64 %30, 1
store i64 %31, i64* %5
br label %19
32: ; preds = %19
ret void
}

LLVM IR (-O2):
define void @mhandle_mark_corrupt(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i16*
store i16 23130, i16* %3
%4 = add i64 %1, -2
%5 = getelementptr i8, i8* %0, i64 %4
%6 = bitcast i8* %5 to i16*
store i16 -23131, i16* %6
ret void
}
/* Type definitions */
struct _reent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _free_r(struct _reent *r, void *p) { free(p); }


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

x86 assembly (clang, -O2):
<_free_r>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct._reent = type { i32 }
define void @_free_r(%struct._reent* %0, i8* %1) {
%3 = alloca %struct._reent*
%4 = alloca i8*
store %struct._reent* %0, %struct._reent** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
%struct._reent = type { i32 }
define void @_free_r(%struct._reent* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
char *format_char(char *buf, char *end, int c) {
  if (buf < end) {
    if (buf + 1 == end) {
      *buf++ = 0;
    } else {
      *buf++ = (char)c;
      *buf = 0;
    }
  }
  return buf;
}


x86 assembly (clang, -O0):
<format_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1168 <format_char+0x68>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
cmp    -0x10(%rbp),%rax
jne    1146 <format_char+0x46>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
jmp    1163 <format_char+0x63>
mov    -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    1168 <format_char+0x68>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_char>:
mov    %rdi,%rax
cmp    %rsi,%rdi
jae    1121 <format_char+0x21>
lea    0x1(%rax),%rcx
cmp    %rsi,%rcx
je     1118 <format_char+0x18>
mov    %dl,(%rax)
mov    %rcx,%rsi
jmp    111b <format_char+0x1b>
mov    %rax,%rcx
movb   $0x0,(%rcx)
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i8* @format_char(i8* writeonly %0, i8* readnone %1, i32 %2) {
%4 = icmp ult i8* %0, %1
br i1 %4, label %5, label %13
5: ; preds = %3
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = icmp eq i8* %6, %1
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = trunc i32 %2 to i8
store i8 %9, i8* %0
br label %10
10: ; preds = %5, %8
%11 = phi i8* [ %6, %8 ], [ %0, %5 ]
%12 = phi i8* [ %6, %8 ], [ %1, %5 ]
store i8 0, i8* %11
br label %13
13: ; preds = %10, %3
%14 = phi i8* [ %0, %3 ], [ %12, %10 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void output_function_json_pre() { printf("[\n"); }


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

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

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

LLVM IR (-O2):
@str = [2 x i8] c"[\00"
define void @output_function_json_pre() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_ADint32_mem(int *val) {
  return ((*val) & (0xAD << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_ADint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 173
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ reverse(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char s[10];
  int i;
  printf("Enter String : ");
  scanf("%s", s);
  printf("the original string is=%s\n", s);
  reverse(s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xe(%rbp),%rsi
lea    0xeb8(%rip),%rdi
call   1050 <scanf@plt>
lea    -0xe(%rbp),%rsi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xe(%rbp),%rdi
call   1030 <reverse@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec6(%rip),%rdi
lea    0x6(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
lea    0xeb5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Enter String : \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [27 x i8] c"the original string is=%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%10 = call i32 @reverse(i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Enter String : \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [27 x i8] c"the original string is=%s\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%6 = call i32 @reverse(i8* %2)
ret i32 0
}
void srp_wait_for_pending(void) { return; }


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

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

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

LLVM IR (-O2):
define void @srp_wait_for_pending() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug_dump_tokens();
int /*<<< orphan*/ tokenize(char *);
int main(int argc, char *argv[]) {
  tokenize("This is a test 2 + 2 = 5 erry day");
  debug_dump_tokens();
  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)
lea    0xec3(%rip),%rdi
call   1040 <tokenize@plt>
mov    $0x0,%al
call   1030 <debug_dump_tokens@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c"This is a test 2 + 2 = 5 erry day\00"
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 = call i32 @tokenize(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @debug_dump_tokens()
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"This is a test 2 + 2 = 5 erry day\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @tokenize(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @debug_dump_tokens()
ret i32 0
}
int now() {
  union foo {
    int i;
    double d;
  };
  int x;
  double y;
  void hack(union foo);
  union foo u;
}


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

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

LLVM IR (-O0):
%union.foo = type { double }
define i32 @now() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca %union.foo
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @now() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ create_command(int, int /*<<< orphan*/, int, int, int);
int /*<<< orphan*/ send_command();
int wait_for_ack(int, int);
int camera_init(int color_type, int preview_res, int snapshot_res) {
  create_command(0x01, 0, color_type, preview_res, snapshot_res);
  send_command();
  return wait_for_ack(100000, 0x01);
}


x86 assembly (clang, -O0):
<camera_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    $0x1,%edi
xor    %esi,%esi
call   1050 <create_command@plt>
mov    $0x0,%al
call   1040 <send_command@plt>
mov    $0x186a0,%edi
mov    $0x1,%esi
call   1030 <wait_for_ack@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<camera_init>:
push   %rax
mov    %edx,%r8d
mov    %esi,%ecx
mov    %edi,%edx
mov    $0x1,%edi
xor    %esi,%esi
call   1050 <create_command@plt>
xor    %eax,%eax
call   1040 <send_command@plt>
mov    $0x186a0,%edi
mov    $0x1,%esi
pop    %rax
jmp    1030 <wait_for_ack@plt>

LLVM IR (-O0):
define i32 @camera_init(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @create_command(i32 1, i32 0, i32 %7, i32 %8, i32 %9)
%11 = call i32 (...) @send_command()
%12 = call i32 @wait_for_ack(i32 100000, i32 1)
ret i32 %12
}

LLVM IR (-O2):
define i32 @camera_init(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @create_command(i32 1, i32 0, i32 %0, i32 %1, i32 %2)
%5 = tail call i32 (...) @send_command()
%6 = tail call i32 @wait_for_ack(i32 100000, i32 1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void integer_to_c(int i) { printf("%d\n", i); }


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

x86 assembly (clang, -O2):
<integer_to_c>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void write_nvram(loff_t *ppos) {
  unsigned int i;
  *ppos = i;
  assert(*ppos == i);
}


x86 assembly (clang, -O0):
<write_nvram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @write_nvram(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32, i32* %3
%5 = load i32*, i32** %2
store i32 %4, i32* %5
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = load i32, i32* %3
%9 = icmp eq i32 %7, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret void
}

LLVM IR (-O2):
define void @write_nvram(i32* nocapture readnone %0) {
%2 = tail call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ltr_int_closeWiiCom();
int ltr_int_tracker_close() {
  ltr_int_closeWiiCom();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @ltr_int_tracker_close() {
%1 = call i32 (...) @ltr_int_closeWiiCom()
ret i32 0
}

LLVM IR (-O2):
define i32 @ltr_int_tracker_close() {
%1 = tail call i32 (...) @ltr_int_closeWiiCom()
ret i32 0
}
int match(const void *key1, const void *key2) {
  return *(int *)key1 == *(int *)key2 ? 1 : 0;
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @match(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @match(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int _dos_getftime(int fd, unsigned *date, unsigned *time) {
  unsigned int ret, carry;
  asm volatile("int $0x21; sbb %0, %0"
               : "=r"(carry), "=a"(ret), "=c"(*time), "=d"(*date)
               : "a"(0x5700), "b"(fd));
  return carry ? ret : 0;
}


x86 assembly (clang, -O0):
<_dos_getftime>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0xc(%rbp),%ebx
mov    $0x5700,%eax
int    $0x21
sbb    %r8d,%r8d
mov    %eax,%edi
mov    -0x38(%rbp),%rax
mov    %ecx,%esi
mov    -0x30(%rbp),%rcx
mov    %r8d,-0x28(%rbp)
mov    %edi,-0x24(%rbp)
mov    %esi,(%rcx)
mov    %edx,(%rax)
cmpl   $0x0,-0x28(%rbp)
je     1159 <_dos_getftime+0x59>
mov    -0x24(%rbp),%eax
mov    %eax,-0x3c(%rbp)
jmp    1163 <_dos_getftime+0x63>
xor    %eax,%eax
mov    %eax,-0x3c(%rbp)
jmp    1163 <_dos_getftime+0x63>
mov    -0x3c(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dos_getftime>:
push   %rbx
mov    %rdx,%r8
mov    %edi,%ebx
mov    $0x5700,%eax
int    $0x21
sbb    %edi,%edi
mov    %ecx,(%r8)
mov    %edx,(%rsi)
test   %edi,%edi
cmove  %edi,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_dos_getftime(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%9 = load i32*, i32** %6
%10 = load i32*, i32** %5
%11 = load i32, i32* %4
%12 = call { i32, i32, i32, i32 } asm sideeffect "int $$0x21; sbb $0, $0", "=r,={ax},={cx},={dx},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 22272, i32 %11)
%13 = extractvalue { i32, i32, i32, i32 } %12, 0
%14 = extractvalue { i32, i32, i32, i32 } %12, 1
%15 = extractvalue { i32, i32, i32, i32 } %12, 2
%16 = extractvalue { i32, i32, i32, i32 } %12, 3
store i32 %13, i32* %8
store i32 %14, i32* %7
store i32 %15, i32* %9
store i32 %16, i32* %10
%17 = load i32, i32* %8
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %3
%20 = load i32, i32* %7
br label %22
21: ; preds = %3
br label %22
22: ; preds = %21, %19
%23 = phi i32 [ %20, %19 ], [ 0, %21 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @_dos_getftime(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = tail call { i32, i32, i32, i32 } asm sideeffect "int $$0x21; sbb $0, $0", "=r,={ax},={cx},={dx},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 22272, i32 %0)
%5 = extractvalue { i32, i32, i32, i32 } %4, 0
%6 = extractvalue { i32, i32, i32, i32 } %4, 1
%7 = extractvalue { i32, i32, i32, i32 } %4, 2
%8 = extractvalue { i32, i32, i32, i32 } %4, 3
store i32 %7, i32* %2
store i32 %8, i32* %1
%9 = icmp eq i32 %5, 0
%10 = select i1 %9, i32 0, i32 %6
ret i32 %10
}
unsigned int url_version() { return ((0 << 16) | (0 << 8) | (1)); }


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

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

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

LLVM IR (-O2):
define i32 @url_version() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void div_m32(unsigned int *m32) {
  put8(0xF7);
  put8(0x35);
  put32((unsigned int)(m32));
}


x86 assembly (clang, -O0):
<div_m32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xf7,%edi
call   1030 <put8@plt>
mov    $0x35,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_m32>:
push   %rbx
mov    %rdi,%rbx
mov    $0xf7,%edi
call   1030 <put8@plt>
mov    $0x35,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @div_m32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @put8(i32 247)
%4 = call i32 @put8(i32 53)
%5 = load i32*, i32** %2
%6 = ptrtoint i32* %5 to i32
%7 = call i32 @put32(i32 %6)
ret void
}

LLVM IR (-O2):
define void @div_m32(i32* %0) {
%2 = tail call i32 @put8(i32 247)
%3 = tail call i32 @put8(i32 53)
%4 = ptrtoint i32* %0 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @put32(i32 %5)
ret void
}
void OBJ_sn2nid(void) {}


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

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

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

LLVM IR (-O2):
define void @OBJ_sn2nid() {
ret void
}
/* Variables and functions */
scalar_t__ css_is_space(char const);
void skip_spaces(const char **pp) {
  const char *p;
  p = *pp;
  while (css_is_space(*p))
    p++;
  *pp = p;
}


x86 assembly (clang, -O0):
<skip_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <css_is_space@plt>
cmp    $0x0,%rax
je     114e <skip_spaces+0x3e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1127 <skip_spaces+0x17>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_spaces>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rbx
add    $0xffffffffffffffff,%rbx
xchg   %ax,%ax
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <css_is_space@plt>
test   %rax,%rax
jne    1120 <skip_spaces+0x10>
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @skip_spaces(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %3, %1
%4 = phi i8* [ %2, %1 ], [ %8, %3 ]
%5 = load i8, i8* %4
%6 = tail call i64 @css_is_space(i8 signext %5)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %7, label %9, label %3
9: ; preds = %3
store i8* %4, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *, int, int, int, int, int);
void decrara(int top, int left, int bottom, int right, int attr) {
  do_csi("%d;%d;%d;%d;%d$t", top, left, bottom, right, attr);
}


x86 assembly (clang, -O0):
<decrara>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
lea    0xec0(%rip),%rdi
call   1030 <do_csi@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrara>:
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xedd(%rip),%rdi
jmp    1030 <do_csi@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%d;%d;%d;%d;%d$t\00"
define void @decrara(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @do_csi(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %13, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%d;%d;%d;%d;%d$t\00"
define void @decrara(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @do_csi(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}
/* Type definitions */
typedef int *__m128;

/* Variables and functions */
int __attribute__((__always___, __nodebug__)) _mm_cvttss_si32(__m128 a) {
  return a[0];
}


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

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

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

LLVM IR (-O2):
define i32 @_mm_cvttss_si32(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}