xunge/DecIR huggingface dataset:
/* Variables and functions */
int power(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n = 2;
  printf("%d", power(2, 10));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @power(i32 2, i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int PAPI_library_init(int);
void papif_library_init_(int *check) { *check = PAPI_library_init(*check); }


x86 assembly (clang, -O0):
<papif_library_init_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <PAPI_library_init@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_library_init_>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_library_init@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_library_init_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @PAPI_library_init(i32 %2)
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *malloc(size_t);
void *memmalloc(size_t size) {
  void *mem;
  if (size == 0)
    return NULL;
  mem = malloc(size);
  assert(mem != NULL);
  return mem;
}


x86 assembly (clang, -O0):
<memmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <memmalloc+0x24>
movq   $0x0,-0x8(%rbp)
jmp    116b <memmalloc+0x4b>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memmalloc>:
push   %rbx
test   %rdi,%rdi
je     113e <memmalloc+0x1e>
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
jmp    1140 <memmalloc+0x20>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @memmalloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %16
8: ; preds = %1
%9 = load i64, i64* %3
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i8*, i8** %4
store i8* %15, i8** %2
br label %16
16: ; preds = %8, %7
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
define noalias i8* @memmalloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i64 %0)
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %9
}
int xfs_init_procfs(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xfs_init_procfs() {
ret i32 0
}
/* Variables and functions */
int domaincmp_dir(char const *, char const *, int);
int domaincmp(const char *a, const char *b) { return domaincmp_dir(a, b, 1); }


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

x86 assembly (clang, -O2):
<domaincmp>:
mov    $0x1,%edx
jmp    1030 <domaincmp_dir@plt>

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

LLVM IR (-O2):
define i32 @domaincmp(i8* %0, i8* %1) {
%3 = tail call i32 @domaincmp_dir(i8* %0, i8* %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ glutPostRedisplay();
void Key(unsigned char key, int x, int y) {
  switch (key) {
  case 27:
    exit(1);
  }
  glutPostRedisplay();
}


x86 assembly (clang, -O0):
<Key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    114e <Key+0x2e>
jmp    1144 <Key+0x24>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    $0x0,%al
call   1030 <glutPostRedisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Key>:
cmp    $0x1b,%dil
je     112d <Key+0xd>
xor    %eax,%eax
jmp    1030 <glutPostRedisplay@plt>
push   %rax
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @Key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
]
9: ; preds = %3
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %3
%12 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
define void @Key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %3
%8 = tail call i32 (...) @glutPostRedisplay()
ret void
}
void isr_empty(void) {}


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

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

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

LLVM IR (-O2):
define void @isr_empty() {
ret void
}
unsigned int IntActiveIrqNumGet(void) {
  return ((*((volatile unsigned int *)((0x48200000) + (0x40)))) & (0x0000007F));
}


x86 assembly (clang, -O0):
<IntActiveIrqNumGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x48200040,%eax
mov    (%rax),%eax
and    $0x7f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntActiveIrqNumGet>:
mov    0x48200040,%eax
and    $0x7f,%eax
ret

LLVM IR (-O0):
define i32 @IntActiveIrqNumGet() {
%1 = load volatile i32, i32* inttoptr (i64 1210056768 to i32*)
%2 = and i32 %1, 127
ret i32 %2
}

LLVM IR (-O2):
define i32 @IntActiveIrqNumGet() {
%1 = load volatile i32, i32* inttoptr (i64 1210056768 to i32*)
%2 = and i32 %1, 127
ret i32 %2
}
void pp() { int a; }


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

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

LLVM IR (-O0):
define void @pp() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @pp() {
ret void
}
/* Variables and functions */
scalar_t__ isdigit(char);
int getint(char **s) {
  int i;
  for (i = 0; isdigit(**s); (*s)++)
    i = 10 * i + (**s - '0');
  return i;
}


x86 assembly (clang, -O0):
<getint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1165 <getint+0x55>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
movsbl (%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1123 <getint+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getint>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1154 <getint+0x44>
nopl   0x0(%rax)
lea    (%rbx,%rbx,4),%eax
mov    (%r14),%rcx
movsbl (%rcx),%edx
lea    (%rdx,%rax,2),%ebx
add    $0xffffffd0,%ebx
lea    0x1(%rcx),%rax
mov    %rax,(%r14)
movsbl 0x1(%rcx),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
jne    1130 <getint+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @getint(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = tail call i64 @isdigit(i8 signext %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %1, %6
%7 = phi i32 [ %13, %6 ], [ 0, %1 ]
%8 = mul nsw i32 %7, 10
%9 = load i8*, i8** %0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = add i32 %8, -48
%13 = add i32 %12, %11
%14 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %14, i8** %0
%15 = load i8, i8* %14
%16 = tail call i64 @isdigit(i8 signext %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %6
18: ; preds = %6, %1
%19 = phi i32 [ 0, %1 ], [ %13, %6 ]
ret i32 %19
}
int anno_bisestile(int giorno, int mese, int anno) {
  int esito;
  if ((anno % 4) != 0) {
    esito = 1;
    if ((giorno == 29) && (mese == 2)) {
      esito = 0;
    }
  } else {
    esito = 2;
  }
  return (esito);
}


x86 assembly (clang, -O0):
<anno_bisestile>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1148 <anno_bisestile+0x48>
movl   $0x1,-0x10(%rbp)
cmpl   $0x1d,-0x4(%rbp)
jne    1143 <anno_bisestile+0x43>
cmpl   $0x2,-0x8(%rbp)
jne    1143 <anno_bisestile+0x43>
movl   $0x0,-0x10(%rbp)
jmp    114f <anno_bisestile+0x4f>
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<anno_bisestile>:
xor    $0x1d,%edi
xor    $0x2,%esi
xor    %ecx,%ecx
or     %edi,%esi
setne  %cl
test   $0x3,%dl
mov    $0x2,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @anno_bisestile(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = srem i32 %8, 4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %3
store i32 1, i32* %7
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 29
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* %5
%16 = icmp eq i32 %15, 2
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 0, i32* %7
br label %18
18: ; preds = %17, %14, %11
br label %20
19: ; preds = %3
store i32 2, i32* %7
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @anno_bisestile(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %2, 3
%5 = icmp eq i32 %4, 0
%6 = icmp ne i32 %0, 29
%7 = icmp ne i32 %1, 2
%8 = or i1 %6, %7
%9 = zext i1 %8 to i32
%10 = select i1 %5, i32 2, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ pthread_join(int /*<<< orphan*/, int /*<<< orphan*/ *);
void *tf1(void *arg) {
  pthread_join((pthread_t)arg, NULL);
  exit(42);
}


x86 assembly (clang, -O0):
<tf1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_join@plt>
mov    $0x2a,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<tf1>:
push   %rax
xor    %esi,%esi
call   1040 <pthread_join@plt>
mov    $0x2a,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i8* @tf1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = call i32 @pthread_join(i32 %4, i32* null)
%6 = call i32 @exit(i32 42)
unreachable
}

LLVM IR (-O2):
define noalias i8* @tf1(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @pthread_join(i32 %3, i32* null)
%5 = tail call i32 @exit(i32 42)
unreachable
}
char *SkipWhitespace(char *data, int *linesSkipped) {
  int c;
  while ((c = *data) <= ' ') {
    if (!c) {
      return ((void *)0);
    }
    if (c == '\n') {
      *linesSkipped += 1;
    }
    data++;
  }
  return data;
}


x86 assembly (clang, -O0):
<SkipWhitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x20,%eax
jg     115c <SkipWhitespace+0x5c>
cmpl   $0x0,-0x1c(%rbp)
jne    1136 <SkipWhitespace+0x36>
movq   $0x0,-0x8(%rbp)
jmp    1164 <SkipWhitespace+0x64>
cmpl   $0xa,-0x1c(%rbp)
jne    114b <SkipWhitespace+0x4b>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <SkipWhitespace+0xc>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SkipWhitespace>:
mov    %rdi,%rax
mov    (%rdi),%cl
cmp    $0x20,%cl
jle    1120 <SkipWhitespace+0x20>
ret
nopl   0x0(%rax,%rax,1)
addl   $0x1,(%rsi)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    $0x21,%cl
jge    110a <SkipWhitespace+0xa>
cmp    $0xa,%cl
je     1110 <SkipWhitespace+0x10>
test   %cl,%cl
jne    1113 <SkipWhitespace+0x13>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @SkipWhitespace(i8* %0, i32* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp slt i8 %3, 33
br i1 %4, label %5, label %15
5: ; preds = %2, %11
%6 = phi i8 [ %13, %11 ], [ %3, %2 ]
%7 = phi i8* [ %12, %11 ], [ %0, %2 ]
switch i8 %6, label %11 [
i8 0, label %15
i8 10, label %8
]
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %11
11: ; preds = %5, %8
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp slt i8 %13, 33
br i1 %14, label %5, label %15
15: ; preds = %5, %11, %2
%16 = phi i8* [ %0, %2 ], [ %12, %11 ], [ null, %5 ]
ret i8* %16
}
void stop_normal() {
  for (int i = 0; i < 100; i++)
    ;
}


x86 assembly (clang, -O0):
<stop_normal>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1128 <stop_normal+0x28>
jmp    111a <stop_normal+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <stop_normal+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @stop_normal() {
ret void
}
float drive_encoder_to_degrees(int encoder_value) {
  return (encoder_value * (360.0 / 1308));
}


x86 assembly (clang, -O0):
<drive_encoder_to_degrees>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<drive_encoder_to_degrees>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @drive_encoder_to_degrees(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 0x3FD19D5B98A919D6
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @drive_encoder_to_degrees(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 0x3FD19D5B98A919D6
%4 = fptrunc double %3 to float
ret float %4
}
__attribute__((no, noclone)) void baz() { asm(""); }


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

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

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

LLVM IR (-O2):
define void @baz() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void f() {
  long x = 0;
  char *y = (char *)&x;
  char c = y[0] + y[1] + y[2];
  short *z = (short *)&x;
  short s = z[0] + z[1];
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
add    %ecx,%eax
mov    %al,-0x11(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movswl (%rax),%eax
mov    -0x20(%rbp),%rcx
movswl 0x2(%rcx),%ecx
add    %ecx,%eax
mov    %ax,-0x22(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f() {
%1 = alloca i64
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i16*
%5 = alloca i16
store i64 0, i64* %1
%6 = bitcast i64* %1 to i8*
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = add nsw i32 %10, %14
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = add nsw i32 %15, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %3
%22 = bitcast i64* %1 to i16*
store i16* %22, i16** %4
%23 = load i16*, i16** %4
%24 = getelementptr inbounds i16, i16* %23, i64 0
%25 = load i16, i16* %24
%26 = sext i16 %25 to i32
%27 = load i16*, i16** %4
%28 = getelementptr inbounds i16, i16* %27, i64 1
%29 = load i16, i16* %28
%30 = sext i16 %29 to i32
%31 = add nsw i32 %26, %30
%32 = trunc i32 %31 to i16
store i16 %32, i16* %5
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int factorial2(int);
int main() {
  int result_factorial;
  result_factorial = factorial2(1);
  assert(result_factorial == 1);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @factorial2(i32 1)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @factorial2(i32 1)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
struct eb_root {
  int dummy;
};
struct eb128_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ eb128_compose_264(int /*<<< orphan*/ const,
                                     int /*<<< orphan*/ const);
struct eb128_node *eb128_lookup_ge(struct eb_root *, int /*<<< orphan*/);
struct eb128_node *eb128_lookup_ge_264(struct eb_root *root, const uint64_t lo,
                                       const uint64_t hi) {
  return eb128_lookup_ge(root, eb128_compose_264(lo, hi));
}


x86 assembly (clang, -O0):
<eb128_lookup_ge_264>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <eb128_compose_264@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <eb128_lookup_ge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eb128_lookup_ge_264>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
mov    %edx,%esi
call   1030 <eb128_compose_264@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <eb128_lookup_ge@plt>

LLVM IR (-O0):
%struct.eb128_node = type { i32 }
%struct.eb_root = type { i32 }
define %struct.eb128_node* @eb128_lookup_ge_264(%struct.eb_root* %0, i32 %1, i32 %2) {
%4 = alloca %struct.eb_root*
%5 = alloca i32
%6 = alloca i32
store %struct.eb_root* %0, %struct.eb_root** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.eb_root*, %struct.eb_root** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @eb128_compose_264(i32 %8, i32 %9)
%11 = call %struct.eb128_node* @eb128_lookup_ge(%struct.eb_root* %7, i32 %10)
ret %struct.eb128_node* %11
}

LLVM IR (-O2):
%struct.eb128_node = type { i32 }
%struct.eb_root = type { i32 }
define %struct.eb128_node* @eb128_lookup_ge_264(%struct.eb_root* %0, i32 %1, i32 %2) {
%4 = tail call i32 @eb128_compose_264(i32 %1, i32 %2)
%5 = tail call %struct.eb128_node* @eb128_lookup_ge(%struct.eb_root* %0, i32 %4)
ret %struct.eb128_node* %5
}
/* Variables and functions */
int /*<<< orphan*/ ParsedPMinisock_cache_invalidate();
void ParsedPMinisock_cache_destroy(void) { ParsedPMinisock_cache_invalidate(); }


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

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

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

LLVM IR (-O2):
define void @ParsedPMinisock_cache_destroy() {
%1 = tail call i32 (...) @ParsedPMinisock_cache_invalidate()
ret void
}
int ukvm_gdb_supported(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @ukvm_gdb_supported() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ PPCMMU(int, void *, void *, int /*<<< orphan*/);
void MmuDbgInit(int deviceType, int devicePort) {
  PPCMMU(0x200, (void *)deviceType, (void *)devicePort, 0);
}


x86 assembly (clang, -O0):
<MmuDbgInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rsi
movslq -0x8(%rbp),%rdx
mov    $0x200,%edi
xor    %ecx,%ecx
call   1030 <PPCMMU@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MmuDbgInit>:
movslq %edi,%rax
movslq %esi,%rdx
mov    $0x200,%edi
mov    %rax,%rsi
xor    %ecx,%ecx
jmp    1030 <PPCMMU@plt>

LLVM IR (-O0):
define void @MmuDbgInit(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 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = call i32 @PPCMMU(i32 512, i8* %7, i8* %10, i32 0)
ret void
}

LLVM IR (-O2):
define void @MmuDbgInit(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = inttoptr i64 %3 to i8*
%5 = sext i32 %1 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @PPCMMU(i32 512, i8* %4, i8* %6, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_make_secure_dir() {
  printf("NOT IMPLEMENTED:"
         "pa_make_secure_dir"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [35 x i8] c"NOT IMPLEMENTED:pa_make_secure_dir\00"
define i32 @pa_make_secure_dir() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int uname(struct utsname *buf) { return -1; }


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

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

LLVM IR (-O0):
%struct.utsname = type opaque
define i32 @uname(%struct.utsname* %0) {
%2 = alloca %struct.utsname*
store %struct.utsname* %0, %struct.utsname** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.utsname = type opaque
define i32 @uname(%struct.utsname* nocapture readnone %0) {
ret i32 -1
}
void considerCautiousMode() {}


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

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

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

LLVM IR (-O2):
define void @considerCautiousMode() {
ret void
}
double pathcon_nm2_sign(double x) { return x < 0 ? -1 : x > 0 ? 1 : x; }


x86 assembly (clang, -O0):
<pathcon_nm2_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <pathcon_nm2_sign+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <pathcon_nm2_sign+0x61>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <pathcon_nm2_sign+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <pathcon_nm2_sign+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathcon_nm2_sign>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm2,%xmm1
movsd  0xed2(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @pathcon_nm2_sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load double, double* %2
br label %12
12: ; preds = %10, %9
%13 = phi double [ 1.000000e+00, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi double [ -1.000000e+00, %5 ], [ %13, %12 ]
ret double %15
}

LLVM IR (-O2):
define double @pathcon_nm2_sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
unsigned bitCount_fun_int(int x) {
  unsigned r = x & 1;
  for (x = x >> 1 & 0x7fffffff; x; x >>= 1)
    r += x & 1;
  return r;
}


x86 assembly (clang, -O0):
<bitCount_fun_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
and    $0x7fffffff,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1142 <bitCount_fun_int+0x42>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111e <bitCount_fun_int+0x1e>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitCount_fun_int>:
mov    %edi,%eax
and    $0x1,%eax
cmp    $0x2,%edi
jb     1120 <bitCount_fun_int+0x20>
mov    %edi,%ecx
nopl   0x0(%rax)
shr    %ecx
mov    %ecx,%edx
and    $0x1,%edx
add    %edx,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <bitCount_fun_int+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitCount_fun_int(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp ult i32 %0, 2
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %9, %4 ], [ %2, %1 ]
%7 = lshr i32 %5, 1
%8 = and i32 %7, 1
%9 = add i32 %8, %6
%10 = icmp ult i32 %5, 4
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ %2, %1 ], [ %9, %4 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ encode_uint32(int /*<<< orphan*/ *, int);
void encode_uint64(uint8_t *dst, const uint64_t src) {
  uint32_t upper = (uint32_t)(src >> 32);
  encode_uint32(dst, upper);
  uint32_t lower = (uint32_t)src & 0xFFFFFFFF;
  encode_uint32(dst + 4, lower);
}


x86 assembly (clang, -O0):
<encode_uint64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <encode_uint32@plt>
mov    -0xc(%rbp),%eax
and    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
mov    -0x14(%rbp),%esi
call   1030 <encode_uint32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_uint64>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <encode_uint32@plt>
add    $0x10,%rbx
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <encode_uint32@plt>

LLVM IR (-O0):
define void @encode_uint64(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = ashr i32 %7, 32
store i32 %8, i32* %5
%9 = load i32*, i32** %3
%10 = load i32, i32* %5
%11 = call i32 @encode_uint32(i32* %9, i32 %10)
%12 = load i32, i32* %4
%13 = and i32 %12, -1
store i32 %13, i32* %6
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 4
%16 = load i32, i32* %6
%17 = call i32 @encode_uint32(i32* %15, i32 %16)
ret void
}

LLVM IR (-O2):
define void @encode_uint64(i32* %0, i32 %1) {
%3 = tail call i32 @encode_uint32(i32* %0, i32 poison)
%4 = getelementptr inbounds i32, i32* %0, i64 4
%5 = tail call i32 @encode_uint32(i32* %4, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ puts(char *);
int main() {
  puts("Begin!");
  fflush(NULL);
  execl("/bin/date", "date", "+%s", NULL);
  perror("execl()");
  exit(1);
  puts("End!");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <fflush@plt>
lea    0xe8c(%rip),%rdi
lea    0xe8a(%rip),%rsi
lea    0xe88(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1070 <execl@plt>
lea    0xe7c(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <fflush@plt>
lea    0xe9c(%rip),%rdi
lea    0xe9a(%rip),%rsi
lea    0xe98(%rip),%rdx
xor    %ecx,%ecx
call   1070 <execl@plt>
lea    0xe8e(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Begin!\00"
@.str.1 = [10 x i8] c"/bin/date\00"
@.str.2 = [5 x i8] c"date\00"
@.str.3 = [4 x i8] c"+%s\00"
@.str.4 = [8 x i8] c"execl()\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @fflush(i32* null)
%4 = call i32 @execl(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32* null)
%5 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"Begin!\00"
@.str.1 = [10 x i8] c"/bin/date\00"
@.str.2 = [5 x i8] c"date\00"
@.str.3 = [4 x i8] c"+%s\00"
@.str.4 = [8 x i8] c"execl()\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @fflush(i32* null)
%3 = tail call i32 @execl(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32* null)
%4 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int *malloc(int);
int *new_integer_ptr() {
  int *newInt = malloc(sizeof(int));
  *newInt = 222;
  return newInt;
}


x86 assembly (clang, -O0):
<new_integer_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xde,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_integer_ptr>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
movl   $0xde,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i32* @new_integer_ptr() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 4)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
store i32 222, i32* %3
%4 = load i32*, i32** %1
ret i32* %4
}

LLVM IR (-O2):
define noalias i32* @new_integer_ptr() {
%1 = tail call i32* @malloc(i32 4)
store i32 222, i32* %1
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void check(int *addr, int val) { assert(*addr == val); }


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
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):
<check>:
xor    %eax,%eax
cmp    %esi,(%rdi)
sete   %al
mov    %eax,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @check(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* %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %6, %7
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret void
}

LLVM IR (-O2):
define void @check(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, %1
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mem_mv(void *, void *, int);
void halp_print_scroll(void) {
  mem_mv((void *)(0xb8000 + ((1) * 80 + (0)) * 2),
         (void *)(0xb8000 + ((0) * 80 + (0)) * 2), (80 * 24) * 2);
}


x86 assembly (clang, -O0):
<halp_print_scroll>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb80a0,%edi
mov    $0xb8000,%esi
mov    $0xf00,%edx
call   1030 <mem_mv@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<halp_print_scroll>:
mov    $0xb80a0,%edi
mov    $0xb8000,%esi
mov    $0xf00,%edx
jmp    1030 <mem_mv@plt>

LLVM IR (-O0):
define void @halp_print_scroll() {
%1 = call i32 @mem_mv(i8* inttoptr (i64 753824 to i8*), i8* inttoptr (i64 753664 to i8*), i32 3840)
ret void
}

LLVM IR (-O2):
define void @halp_print_scroll() {
%1 = tail call i32 @mem_mv(i8* inttoptr (i64 753824 to i8*), i8* inttoptr (i64 753664 to i8*), i32 3840)
ret void
}
void hw_init(void) {}


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

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

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

LLVM IR (-O2):
define void @hw_init() {
ret void
}
int memory_write_access() { return 200; }


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

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

LLVM IR (-O0):
define i32 @memory_write_access() {
ret i32 200
}

LLVM IR (-O2):
define i32 @memory_write_access() {
ret i32 200
}
/* Type definitions */
struct timeval {
  long long tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long microtime_() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return ((long long)tv.tv_sec) * 1000000 + tv.tv_usec;
}


x86 assembly (clang, -O0):
<microtime_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<microtime_>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%rax
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @microtime_() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = mul nsw i64 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = add nsw i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @microtime_() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ exit(int);
int _div(int x, int y, void *garb) {
  if (y == 0) {
    error("error: division by zero exception\n");
    exit(1);
  }
  return x / y - (x / y < 0 && x % y != 0);
}


x86 assembly (clang, -O0):
<_div>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1152 <_div+0x32>
lea    0xebd(%rip),%rdi
call   1030 <error@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
jge    1183 <_div+0x63>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x11(%rbp),%cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_div>:
test   %esi,%esi
je     1137 <_div+0x17>
mov    %edi,%eax
cltd
idiv   %esi
neg    %edx
sbb    %ecx,%ecx
mov    %eax,%edx
sar    $0x1f,%edx
and    %ecx,%edx
add    %edx,%eax
ret
push   %rax
lea    0xec1(%rip),%rdi
call   1030 <error@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"error: division by zero exception\0A\00"
define i32 @_div(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = call i32 @error(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = sdiv i32 %13, %14
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = sdiv i32 %16, %17
%19 = icmp slt i32 %18, 0
br i1 %19, label %20, label %25
20: ; preds = %12
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = srem i32 %21, %22
%24 = icmp ne i32 %23, 0
br label %25
25: ; preds = %20, %12
%26 = phi i1 [ false, %12 ], [ %24, %20 ]
%27 = zext i1 %26 to i32
%28 = sub nsw i32 %15, %27
ret i32 %28
}

LLVM IR (-O2):
@.str = [35 x i8] c"error: division by zero exception\0A\00"
define i32 @_div(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = tail call i32 @error(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %3
%9 = sdiv i32 %0, %1
%10 = srem i32 %0, %1
%11 = icmp slt i32 %9, 0
%12 = icmp ne i32 %10, 0
%13 = sext i1 %12 to i32
%14 = select i1 %11, i32 %13, i32 0
%15 = add i32 %14, %9
ret i32 %15
}
char *sysRfidget() {}


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

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

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

LLVM IR (-O2):
define noalias i8* @sysRfidget() {
ret i8* undef
}
void DMA1_Channel7_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @DMA1_Channel7_IRQHandler() {
ret void
}
/* Variables and functions */
int strlen(char *);
int port_get_utf8_converted_system_message_length(char *system_message) {
  return strlen(system_message) + 1;
}


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

x86 assembly (clang, -O2):
<port_get_utf8_converted_system_message_length>:
push   %rax
call   1030 <strlen@plt>
add    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @port_get_utf8_converted_system_message_length(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_6805(void) { DeinitFields(); }


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

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

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

LLVM IR (-O2):
define void @SwitchFrom_6805() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}
void pthread_mutexattr_setpshared() {}


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

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

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

LLVM IR (-O2):
define void @pthread_mutexattr_setpshared() {
ret void
}
const char *AES_options(void) { return "aes(partial)"; }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"aes(partial)\00"
define i8* @AES_options() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [13 x i8] c"aes(partial)\00"
define i8* @AES_options() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}
int fun782() { return 782; }


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

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

LLVM IR (-O0):
define i32 @fun782() {
ret i32 782
}

LLVM IR (-O2):
define i32 @fun782() {
ret i32 782
}