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

/* Variables and functions */
int base64_stream_decode_avx2(struct base64_state *state, const char *src,
                              size_t srclen, char *out, size_t *outlen) {
  ((void)(state));
  ((void)(src));
  ((void)(srclen));
  ((void)(out));
  ((void)(outlen));
  return -1;
}


x86 assembly (clang, -O0):
<base64_stream_decode_avx2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.base64_state = type { i32 }
define i32 @base64_stream_decode_avx2(%struct.base64_state* nocapture readnone %0, i8* nocapture readnone %1, i64 %2, i8* nocapture readnone %3, i64* nocapture readnone %4) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ be64toh(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void const *, int);
uint64_t unpack_from_be64(const void *v) {
  uint64_t u;
  memcpy(&u, v, sizeof(uint64_t));
  return be64toh(u);
}


x86 assembly (clang, -O0):
<unpack_from_be64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0xc(%rbp),%edi
call   1030 <be64toh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_from_be64>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    0x4(%rsp),%edi
call   1030 <be64toh@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @unpack_from_be64(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
%6 = call i32 @be64toh(i32 %5)
ret i32 %6
}
int my_add(int nb1, int nb2) {
  int result;
  result = nb1 + nb2;
  return (result);
}


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

x86 assembly (clang, -O2):
<my_add>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @my_add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
scalar_t__ EISDIR;
scalar_t__ *__errno_location();
int rmdir(char const *);
scalar_t__ unlink(char const *);
int remove(const char *filename) {
  if (unlink(filename)) {
    if ((*__errno_location()) == EISDIR)
      return rmdir(filename);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <unlink@plt>
cmp    $0x0,%rax
je     1186 <remove+0x56>
mov    $0x0,%al
call   1030 <__errno_location@plt>
mov    (%rax),%rax
mov    0x2e88(%rip),%rcx
cmp    (%rcx),%rax
jne    117a <remove+0x4a>
mov    -0x10(%rbp),%rdi
call   1050 <rmdir@plt>
mov    %eax,-0x4(%rbp)
jmp    118d <remove+0x5d>
movl   $0xffffffff,-0x4(%rbp)
jmp    118d <remove+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove>:
push   %rbx
mov    %rdi,%rbx
call   1040 <unlink@plt>
test   %rax,%rax
je     1162 <remove+0x32>
xor    %eax,%eax
call   1030 <__errno_location@plt>
mov    (%rax),%rcx
mov    0x2e99(%rip),%rdx
mov    $0xffffffff,%eax
cmp    (%rdx),%rcx
jne    1164 <remove+0x34>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <rmdir@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EISDIR = global i64 0
define i32 @remove(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @unlink(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = call i64* (...) @__errno_location()
%9 = load i64, i64* %8
%10 = load i64, i64* @EISDIR
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = load i8*, i8** %3
%14 = call i32 @rmdir(i8* %13)
store i32 %14, i32* %2
br label %17
15: ; preds = %7
store i32 -1, i32* %2
br label %17
16: ; preds = %1
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15, %12
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@EISDIR = global i64 0
define i32 @remove(i8* nocapture %0) {
%2 = tail call i64 @unlink(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i64* (...) @__errno_location()
%6 = load i64, i64* %5
%7 = load i64, i64* @EISDIR
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @rmdir(i8* %0)
br label %11
11: ; preds = %1, %4, %9
%12 = phi i32 [ %10, %9 ], [ -1, %4 ], [ 0, %1 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ is_blankchar(char);
char *until_wordend(char *s) {
  while (!is_blankchar(*s) && *s != '\0')
    s++;
  return s;
}


x86 assembly (clang, -O0):
<until_wordend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_blankchar@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    1148 <until_wordend+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1158 <until_wordend+0x48>
jmp    1169 <until_wordend+0x59>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <until_wordend+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<until_wordend>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%edi
nopw   0x0(%rax,%rax,1)
call   1030 <is_blankchar@plt>
test   %eax,%eax
jne    1138 <until_wordend+0x28>
cmpb   $0x0,(%rbx)
je     1138 <until_wordend+0x28>
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
jmp    1120 <until_wordend+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @until_wordend(i8* %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @is_blankchar(i8 signext %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %1, %9
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = tail call i32 @is_blankchar(i8 signext %11)
%13 = icmp eq i32 %12, 0
br i1 %13, label %5, label %14
14: ; preds = %5, %9, %1
%15 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %5 ]
ret i8* %15
}
int main() {
  struct header {
    int one;
    int *two;
    int three;
  } * h;
  char *p;
  char *v = (char *)malloc(sizeof(struct header) + 4);
  h = (struct header *)v;
  h->one = 5;
  p = (char *)(h + 1);
  p++;
  p--;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1c,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x10(%rbp),%rax
add    $0x18,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.header = type { i32, i32*, i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.header*
%3 = alloca i8*
%4 = alloca i8*
store i32 0, i32* %1
%5 = call i8* @malloc(i64 28)
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to %struct.header*
store %struct.header* %7, %struct.header** %2
%8 = load %struct.header*, %struct.header** %2
%9 = getelementptr inbounds %struct.header, %struct.header* %8, i32 0, i32 0
store i32 5, i32* %9
%10 = load %struct.header*, %struct.header** %2
%11 = getelementptr inbounds %struct.header, %struct.header* %10, i64 1
%12 = bitcast %struct.header* %11 to i8*
store i8* %12, i8** %3
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 -1
store i8* %16, i8** %3
ret i32 0
}

LLVM IR (-O2):
%struct.header = type { i32, i32*, i32 }
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
g() {
  struct {
    int i;
    struct {
      int j, k;
    } a;
  } x = {1, 2, 3};
  if (x.i != 1 || x.a.j != 2 || x.a.k != 3)
    abort();
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x10(%rbp)
jne    114a <g+0x3a>
cmpl   $0x2,-0xc(%rbp)
jne    114a <g+0x3a>
cmpl   $0x3,-0x8(%rbp)
je     1151 <g+0x41>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i32, %struct.anon.0 }
%struct.anon.0 = type { i32, i32 }
@__const.g.x = %struct.anon { i32 1, %struct.anon.0 { i32 2, i32 3 } }
define i32 @g() {
%1 = alloca i32
%2 = alloca %struct.anon
%3 = bitcast %struct.anon* %2 to i8*
%4 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 1
br i1 %6, label %17, label %7
7: ; preds = %0
%8 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
%9 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = icmp ne i32 %10, 2
br i1 %11, label %17, label %12
12: ; preds = %7
%13 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
%14 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %13, i32 0, i32 1
%15 = load i32, i32* %14
%16 = icmp ne i32 %15, 3
br i1 %16, label %17, label %19
17: ; preds = %12, %7, %0
%18 = call i32 (...) @abort()
unreachable
19: ; preds = %12
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
define i32 @g() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ NoDepE_func();
void NoDepF_func() {
  static int firstcall = 1;
  if (firstcall) {
    firstcall = 0;
    NoDepE_func();
  }
}


x86 assembly (clang, -O0):
<NoDepF_func>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f0d(%rip)
je     1132 <NoDepF_func+0x22>
movl   $0x0,0x2efd(%rip)
mov    $0x0,%al
call   1030 <NoDepE_func@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<NoDepF_func>:
cmpb   $0x0,0x2f15(%rip)
je     111a <NoDepF_func+0xa>
ret
movb   $0x1,0x2f0b(%rip)
xor    %eax,%eax
jmp    1030 <NoDepE_func@plt>

LLVM IR (-O0):
@NoDepF_func.firstcall = internal global i32 1
define void @NoDepF_func() {
%1 = load i32, i32* @NoDepF_func.firstcall
%2 = icmp ne i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
store i32 0, i32* @NoDepF_func.firstcall
%4 = call i32 (...) @NoDepE_func()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@NoDepF_func.firstcall = internal unnamed_addr global i1 false
define void @NoDepF_func() {
%1 = load i1, i1* @NoDepF_func.firstcall
br i1 %1, label %4, label %2
2: ; preds = %0
store i1 true, i1* @NoDepF_func.firstcall
%3 = tail call i32 (...) @NoDepE_func()
br label %4
4: ; preds = %2, %0
ret void
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t length = 0;
  for (; str[length] != '\0'; length++)
    ;
  return length;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     113b <strlen+0x3b>
jmp    112a <strlen+0x2a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ oom();
void *realloc(void *, size_t);
void *realloce(void *ptr, size_t newsize) {
  void *ret;
  ret = realloc(ptr, newsize);
  if (!ret)
    oom();
  return ret;
}


x86 assembly (clang, -O0):
<realloce>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <realloce+0x33>
mov    $0x0,%al
call   1030 <oom@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realloce>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <realloce+0x15>
xor    %eax,%eax
call   1030 <oom@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @realloce(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 (...) @oom()
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @realloce(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @oom()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int strcmp(char *, char *);
int compareChar(void *p1, void *p2) {
  char *c1 = (char *)p1;
  char *c2 = (char *)p2;
  return strcmp(c1, c2);
}


x86 assembly (clang, -O0):
<compareChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
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),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareChar>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @compareChar(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
int msm_use_iommu(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @msm_use_iommu() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ main_a_b();
int main(void) {
  main_a_b();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @main_a_b()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @main_a_b()
ret i32 0
}
/* Variables and functions */
float __nv_rsqrtf(float);
float rsqrtf(float __a) { return __nv_rsqrtf(__a); }


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

x86 assembly (clang, -O2):
<rsqrtf>:
jmp    1030 <__nv_rsqrtf@plt>

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

LLVM IR (-O2):
define float @rsqrtf(float %0) {
%2 = tail call float @__nv_rsqrtf(float %0)
ret float %2
}
/* Variables and functions */
int interface();
int main() { return interface(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @interface()
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @interface()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ dlopen(int /*<<< orphan*/, int /*<<< orphan*/);
main() { dlopen(0, 0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <dlopen@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <dlopen@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @dlopen(i32 0, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @dlopen(i32 0, i32 0)
ret i32 0
}
int cmp(const void *a, const void *b) {
  if (*(unsigned long *)b > *(unsigned long *)a)
    return 1;
  if (*(unsigned long *)b < *(unsigned long *)a)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
jbe    112c <cmp+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <cmp+0x53>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
jae    114c <cmp+0x4c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <cmp+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rsi),%rax
mov    (%rdi),%rcx
cmp    %rcx,%rax
sbb    %edx,%edx
cmp    %rcx,%rax
mov    $0x1,%eax
cmovbe %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %0 to i64*
%6 = load i64, i64* %5
%7 = icmp ugt i64 %4, %6
%8 = icmp ult i64 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Type definitions */
struct ether_addr {
  int dummy;
};

/* Variables and functions */
int memcmp(struct ether_addr const *, struct ether_addr const *, int);
int iw_ether_cmp(const struct ether_addr *eth1, const struct ether_addr *eth2) {
  return memcmp(eth1, eth2, sizeof(*eth1));
}


x86 assembly (clang, -O0):
<iw_ether_cmp>:
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    $0x4,%edx
call   1030 <memcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iw_ether_cmp>:
mov    $0x4,%edx
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
%struct.ether_addr = type { i32 }
define i32 @iw_ether_cmp(%struct.ether_addr* %0, %struct.ether_addr* %1) {
%3 = tail call i32 @memcmp(%struct.ether_addr* %0, %struct.ether_addr* %1, i32 4)
ret i32 %3
}
/* Variables and functions */
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
int main() {
#pragma omp parallel
  {
    int ID = omp_get_thread_num();
    printf(" hello(%d) ", ID);
    printf(" world(%d) \n", ID);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c" hello(%d) \00"
@.str.1 = [13 x i8] c" world(%d) \0A\00"
define i32 @main() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
unsigned long check_stack(unsigned long *);
unsigned long check_stack_start(unsigned long *base) {
  unsigned long i;
  unsigned long from, to;
  to = check_stack(&from);
  *base = from;
  for (i = from; i < to; i += 4) {
    *(long *)i = 0xdeadbeef;
  }
  return to;
}


x86 assembly (clang, -O0):
<check_stack_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <check_stack@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1167 <check_stack_start+0x57>
mov    -0x10(%rbp),%rax
mov    $0xdeadbeef,%ecx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    113c <check_stack_start+0x2c>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_stack_start>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
call   1030 <check_stack@plt>
mov    0x8(%rsp),%rcx
mov    %rcx,(%rbx)
cmp    %rax,%rcx
jae    114c <check_stack_start+0x3c>
mov    $0xdeadbeef,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rdx,(%rcx)
add    $0x4,%rcx
cmp    %rax,%rcx
jb     1140 <check_stack_start+0x30>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @check_stack_start(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %2
%6 = call i64 @check_stack(i64* %4)
store i64 %6, i64* %5
%7 = load i64, i64* %4
%8 = load i64*, i64** %2
store i64 %7, i64* %8
%9 = load i64, i64* %4
store i64 %9, i64* %3
br label %10
10: ; preds = %17, %1
%11 = load i64, i64* %3
%12 = load i64, i64* %5
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %20
14: ; preds = %10
%15 = load i64, i64* %3
%16 = inttoptr i64 %15 to i64*
store i64 3735928559, i64* %16
br label %17
17: ; preds = %14
%18 = load i64, i64* %3
%19 = add i64 %18, 4
store i64 %19, i64* %3
br label %10
20: ; preds = %10
%21 = load i64, i64* %5
ret i64 %21
}

LLVM IR (-O2):
define i64 @check_stack_start(i64* nocapture writeonly %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i64 @check_stack(i64* %2)
%5 = load i64, i64* %2
store i64 %5, i64* %0
%6 = icmp ult i64 %5, %4
br i1 %6, label %7, label %12
7: ; preds = %1, %7
%8 = phi i64 [ %10, %7 ], [ %5, %1 ]
%9 = inttoptr i64 %8 to i64*
store i64 3735928559, i64* %9
%10 = add i64 %8, 4
%11 = icmp ult i64 %10, %4
br i1 %11, label %7, label %12
12: ; preds = %7, %1
ret i64 %4
}
/* Type definitions */
typedef unsigned int uint64_t;

/* Variables and functions */
uint64_t rotate_right(uint64_t v, unsigned k) {
  return (v >> k) | (v << (64 - k));
}


x86 assembly (clang, -O0):
<rotate_right>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x40,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate_right>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
neg    %cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotate_right(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = lshr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 64, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotate_right(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub i32 64, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int __strcmp(char const *, char const *);
int strcmp(const char *s1, const char *s2) { return __strcmp(s1, s2); }


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

x86 assembly (clang, -O2):
<strcmp>:
jmp    1030 <__strcmp@plt>

LLVM IR (-O0):
define i32 @strcmp(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 @__strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = tail call i32 @__strcmp(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
unsigned long long __builtin_cmpb(unsigned long long, unsigned long long);
unsigned long long int do_compare(unsigned long long int a,
                                  unsigned long long int b) {
  return __builtin_cmpb(a, b);
}


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

x86 assembly (clang, -O2):
<do_compare>:
jmp    1030 <__builtin_cmpb@plt>

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

LLVM IR (-O2):
define i64 @do_compare(i64 %0, i64 %1) {
%3 = tail call i64 @__builtin_cmpb(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int isspace(int);
int addr_list_sep(int c) { return isspace(c); }


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

x86 assembly (clang, -O2):
<addr_list_sep>:
jmp    1030 <isspace@plt>

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

LLVM IR (-O2):
define i32 @addr_list_sep(i32 %0) {
%2 = tail call i32 @isspace(i32 %0)
ret i32 %2
}
/* Variables and functions */
void *calloc(int, size_t);
void *zmalloc(size_t size) { return calloc(1, size); }


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

x86 assembly (clang, -O2):
<zmalloc>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define i8* @zmalloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ __print_float(double);
int main() {
  __print_float(-5.67);
  __print_float(+3.98);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee1(%rip),%xmm0
call   1030 <__print_float@plt>
movsd  0xecc(%rip),%xmm0
call   1030 <__print_float@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
call   1030 <__print_float@plt>
movsd  0xee2(%rip),%xmm0
call   1030 <__print_float@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @__print_float(double -5.670000e+00)
%3 = call i32 @__print_float(double 3.980000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_float(double -5.670000e+00)
%2 = tail call i32 @__print_float(double 3.980000e+00)
ret i32 0
}
void libsoc_pwm_debug(const char *func, unsigned int chip, unsigned int pwm,
                      char *format, ...) {}


x86 assembly (clang, -O0):
<libsoc_pwm_debug>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @libsoc_pwm_debug(i8* %0, i32 %1, i32 %2, i8* %3, ...) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
ret void
}

LLVM IR (-O2):
define void @libsoc_pwm_debug(i8* nocapture %0, i32 %1, i32 %2, i8* nocapture %3, ...) {
ret void
}
/* Variables and functions */
int stu__expr(int);
int /*<<< orphan*/ stu__nexttoken();
int stu__nexpr(int p) {
  stu__nexttoken();
  return stu__expr(p);
}


x86 assembly (clang, -O0):
<stu__nexpr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <stu__nexttoken@plt>
mov    -0x4(%rbp),%edi
call   1040 <stu__expr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stu__nexpr>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <stu__nexttoken@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <stu__expr@plt>

LLVM IR (-O0):
define i32 @stu__nexpr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @stu__nexttoken()
%4 = load i32, i32* %2
%5 = call i32 @stu__expr(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @stu__nexpr(i32 %0) {
%2 = tail call i32 (...) @stu__nexttoken()
%3 = tail call i32 @stu__expr(i32 %0)
ret i32 %3
}
adr0adr1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if ((*((unsigned char *)10000000)) <= (*((unsigned char *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adr0adr1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0x989680,%eax
movzbl (%rax),%eax
mov    $0xa98ac7,%ecx
movzbl (%rcx),%ecx
cmp    %ecx,%eax
jg     1142 <adr0adr1+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1149 <adr0adr1+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0adr1>:
mov    0x989680,%cl
xor    %eax,%eax
cmp    0xa98ac7,%cl
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @adr0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
%7 = load i8, i8* inttoptr (i64 10000000 to i8*)
%8 = load i8, i8* inttoptr (i64 11111111 to i8*)
%9 = icmp ule i8 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
struct v4l2_format {
  int dummy;
};
typedef int __u32;

/* Variables and functions */
scalar_t__ V4L2_FIELD_HAS_T_OR_B(int /*<<< orphan*/);
int /*<<< orphan*/ v4l_format_g_field(struct v4l2_format const *);
int v4l_format_g_height(struct v4l2_format const *);
__u32 v4l_format_g_frame_height(const struct v4l2_format *fmt) {
  __u32 height = v4l_format_g_height(fmt);
  if (V4L2_FIELD_HAS_T_OR_B(v4l_format_g_field(fmt)))
    return height * 2;
  return height;
}


x86 assembly (clang, -O0):
<v4l_format_g_frame_height>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <v4l_format_g_height@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <v4l_format_g_field@plt>
mov    %eax,%edi
call   1030 <V4L2_FIELD_HAS_T_OR_B@plt>
cmp    $0x0,%rax
je     1170 <v4l_format_g_frame_height+0x40>
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1176 <v4l_format_g_frame_height+0x46>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v4l_format_g_frame_height>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <v4l_format_g_height@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <v4l_format_g_field@plt>
mov    %eax,%edi
call   1030 <V4L2_FIELD_HAS_T_OR_B@plt>
test   %rax,%rax
setne  %cl
shl    %cl,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.v4l2_format = type { i32 }
define i32 @v4l_format_g_frame_height(%struct.v4l2_format* %0) {
%2 = alloca i32
%3 = alloca %struct.v4l2_format*
%4 = alloca i32
store %struct.v4l2_format* %0, %struct.v4l2_format** %3
%5 = load %struct.v4l2_format*, %struct.v4l2_format** %3
%6 = call i32 @v4l_format_g_height(%struct.v4l2_format* %5)
store i32 %6, i32* %4
%7 = load %struct.v4l2_format*, %struct.v4l2_format** %3
%8 = call i32 @v4l_format_g_field(%struct.v4l2_format* %7)
%9 = call i64 @V4L2_FIELD_HAS_T_OR_B(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* %4
%13 = mul nsw i32 %12, 2
store i32 %13, i32* %2
br label %16
14: ; preds = %1
%15 = load i32, i32* %4
store i32 %15, i32* %2
br label %16
16: ; preds = %14, %11
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
%struct.v4l2_format = type { i32 }
define i32 @v4l_format_g_frame_height(%struct.v4l2_format* %0) {
%2 = tail call i32 @v4l_format_g_height(%struct.v4l2_format* %0)
%3 = tail call i32 @v4l_format_g_field(%struct.v4l2_format* %0)
%4 = tail call i64 @V4L2_FIELD_HAS_T_OR_B(i32 %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
%7 = shl nsw i32 %2, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ test_check_user_token();
int /*<<< orphan*/ test_filter_printf();
int /*<<< orphan*/ test_get_user_cfgfile_path();
int main(void) {
  test_filter_printf();
  test_get_user_cfgfile_path();
  test_check_user_token();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_filter_printf@plt>
mov    $0x0,%al
call   1050 <test_get_user_cfgfile_path@plt>
mov    $0x0,%al
call   1040 <test_check_user_token@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_filter_printf@plt>
xor    %eax,%eax
call   1050 <test_get_user_cfgfile_path@plt>
xor    %eax,%eax
call   1040 <test_check_user_token@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_filter_printf()
%3 = call i32 (...) @test_get_user_cfgfile_path()
%4 = call i32 (...) @test_check_user_token()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_filter_printf()
%2 = tail call i32 (...) @test_get_user_cfgfile_path()
%3 = tail call i32 (...) @test_check_user_token()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ drv_generic_i2c_close();
int drv_Newhaven_close(void) {
  drv_generic_i2c_close();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @drv_Newhaven_close() {
%1 = tail call i32 (...) @drv_generic_i2c_close()
ret i32 0
}
void os_finish_with_sample(void) {}


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

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

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

LLVM IR (-O2):
define void @os_finish_with_sample() {
ret void
}
unsigned int sector_size_bits(unsigned int size) {
  unsigned int bits = 8;
  do {
    bits++;
    size >>= 1;
  } while (size > 256);
  return bits;
}


x86 assembly (clang, -O0):
<sector_size_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
ja     110e <sector_size_bits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sector_size_bits>:
mov    $0x8,%eax
mov    %edi,%ecx
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
shr    %ecx
cmp    $0x201,%edi
mov    %ecx,%edi
ja     1110 <sector_size_bits+0x10>
ret

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

LLVM IR (-O2):
define i32 @sector_size_bits(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %6, %2 ]
%4 = phi i32 [ 8, %1 ], [ %5, %2 ]
%5 = add nuw nsw i32 %4, 1
%6 = lshr i32 %3, 1
%7 = icmp ugt i32 %3, 513
br i1 %7, label %2, label %8
8: ; preds = %2
ret i32 %5
}
char foo(void) { return '1'; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x31,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    $0x31,%al
ret

LLVM IR (-O0):
define signext i8 @foo() {
ret i8 49
}

LLVM IR (-O2):
define signext i8 @foo() {
ret i8 49
}
double __attribute__((no)) foo(void) { return 16441577472.0; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @foo() {
ret double 0x420E9FF480000000
}

LLVM IR (-O2):
define double @foo() {
ret double 0x420E9FF480000000
}
int fz_is_big_endian(void) {
  static const int one = 1;
  return *(char *)&one == 0;
}


x86 assembly (clang, -O0):
<fz_is_big_endian>:
push   %rbp
mov    %rsp,%rbp
movsbl 0xef5(%rip),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@fz_is_big_endian.one = internal constant i32 1
define i32 @fz_is_big_endian() {
%1 = load i8, i8* bitcast (i32* @fz_is_big_endian.one to i8*)
%2 = sext i8 %1 to i32
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @fz_is_big_endian() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void *tfn1(void *arg) {
  printf("new thread\n");
  sleep(10);
}


x86 assembly (clang, -O0):
<tfn1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1040 <sleep@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tfn1>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
pop    %rax
jmp    1040 <sleep@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"new thread\0A\00"
define i8* @tfn1(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @sleep(i32 10)
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
@str = [11 x i8] c"new thread\00"
define noalias i8* @tfn1(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 10)
ret i8* undef
}
/* Variables and functions */
double fmod(double, double);
double moog(double x) {
  const double u = fmod(x + 4.71238898038468985769, 6.28318530717958647693);
  return (u < 3.14159265358979323846)
             ? -(u / 3.14159265358979323846)
             : ((u - 3.14159265358979323846) * 2.0 / 3.14159265358979323846 -
                1.0);
}


x86 assembly (clang, -O0):
<moog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
call   1030 <fmod@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xebc(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1181 <moog+0x71>
movsd  -0x10(%rbp),%xmm0
movsd  0xea4(%rip),%xmm1
divsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    11bb <moog+0xab>
movsd  -0x10(%rbp),%xmm0
movsd  0xe72(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe86(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe5a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe66(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<moog>:
push   %rax
addsd  0xee7(%rip),%xmm0
movsd  0xee7(%rip),%xmm1
call   1030 <fmod@plt>
movsd  0xee2(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    113e <moog+0x2e>
divsd  0xedc(%rip),%xmm0
pop    %rax
ret
addsd  0xed2(%rip),%xmm0
addsd  %xmm0,%xmm0
divsd  0xebe(%rip),%xmm0
addsd  0xec6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @moog(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fadd double %4, 0x4012D97C7F3321D2
%6 = call double @fmod(double %5, double 0x401921FB54442D18)
store double %6, double* %3
%7 = load double, double* %3
%8 = fcmp olt double %7, 0x400921FB54442D18
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load double, double* %3
%11 = fdiv double %10, 0x400921FB54442D18
%12 = fneg double %11
br label %19
13: ; preds = %1
%14 = load double, double* %3
%15 = fsub double %14, 0x400921FB54442D18
%16 = fmul double %15, 2.000000e+00
%17 = fdiv double %16, 0x400921FB54442D18
%18 = fsub double %17, 1.000000e+00
br label %19
19: ; preds = %13, %9
%20 = phi double [ %12, %9 ], [ %18, %13 ]
ret double %20
}

LLVM IR (-O2):
define double @moog(double %0) {
%2 = fadd double %0, 0x4012D97C7F3321D2
%3 = tail call double @fmod(double %2, double 0x401921FB54442D18)
%4 = fcmp olt double %3, 0x400921FB54442D18
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = fdiv double %3, 0xC00921FB54442D18
br label %12
7: ; preds = %1
%8 = fadd double %3, 0xC00921FB54442D18
%9 = fmul double %8, 2.000000e+00
%10 = fdiv double %9, 0x400921FB54442D18
%11 = fadd double %10, -1.000000e+00
br label %12
12: ; preds = %7, %5
%13 = phi double [ %6, %5 ], [ %11, %7 ]
ret double %13
}