xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void right(int n) { printf("%c[%dC", 0x1B, n); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%c[%dC\00"
define void @right(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 %0)
ret void
}
int ErrMax() { return (33); }


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

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

LLVM IR (-O0):
define i32 @ErrMax() {
ret i32 33
}

LLVM IR (-O2):
define i32 @ErrMax() {
ret i32 33
}
/* Variables and functions */
int /*<<< orphan*/ delpidfile();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void handlexitsigs(void) {
  delpidfile();
  exit(0);
}


x86 assembly (clang, -O0):
<handlexitsigs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <delpidfile@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define void @handlexitsigs() {
%1 = call i32 (...) @delpidfile()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @handlexitsigs() {
%1 = tail call i32 (...) @delpidfile()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Shuffle_array(int *, int);
int /*<<< orphan*/ _quick_sort(int *, int /*<<< orphan*/, int);
void quick_sort(int *array, int length) {
  Shuffle_array(array, length);
  _quick_sort(array, 0, length - 1);
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <Shuffle_array@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1040 <_quick_sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <Shuffle_array@plt>
add    $0xffffffff,%ebx
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <_quick_sort@plt>

LLVM IR (-O0):
define void @quick_sort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @Shuffle_array(i32* %5, i32 %6)
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = call i32 @_quick_sort(i32* %8, i32 0, i32 %10)
ret void
}

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1) {
%3 = tail call i32 @Shuffle_array(i32* %0, i32 %1)
%4 = add nsw i32 %1, -1
%5 = tail call i32 @_quick_sort(i32* %0, i32 0, i32 %4)
ret void
}
/* Variables and functions */
scalar_t__ Pop();
int /*<<< orphan*/ Push(scalar_t__);
int CmdAdd(void) {
  Push(Pop() + Pop());
  return 0;
}


x86 assembly (clang, -O0):
<CmdAdd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <Pop@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <Pop@plt>
mov    -0x8(%rbp),%rdi
add    %rax,%rdi
call   1040 <Push@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdAdd>:
push   %rbx
xor    %eax,%eax
call   1030 <Pop@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <Pop@plt>
add    %rax,%rbx
mov    %rbx,%rdi
call   1040 <Push@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @CmdAdd() {
%1 = call i64 (...) @Pop()
%2 = call i64 (...) @Pop()
%3 = add nsw i64 %1, %2
%4 = call i32 @Push(i64 %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @CmdAdd() {
%1 = tail call i64 (...) @Pop()
%2 = tail call i64 (...) @Pop()
%3 = add nsw i64 %2, %1
%4 = tail call i32 @Push(i64 %3)
ret i32 0
}
int jam_is_name_char(char ch) {
  return (((ch >= 'A') && (ch <= 'Z')) || ((ch >= 'a') && (ch <= 'z')) ||
          ((ch >= '0') && (ch <= '9')) || (ch == '_'));
}


x86 assembly (clang, -O0):
<jam_is_name_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1129 <jam_is_name_char+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    1174 <jam_is_name_char+0x74>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1148 <jam_is_name_char+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    1174 <jam_is_name_char+0x74>
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1167 <jam_is_name_char+0x67>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    1174 <jam_is_name_char+0x74>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jam_is_name_char>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
setb   %al
lea    -0x30(%rdi),%ecx
cmp    $0xa,%cl
setb   %cl
cmp    $0x5f,%dil
sete   %dl
or     %cl,%dl
or     %al,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @jam_is_name_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %30, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 122
br i1 %17, label %30, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 48
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 57
br i1 %25, label %30, label %26
26: ; preds = %22, %18
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 95
br label %30
30: ; preds = %26, %22, %14, %6
%31 = phi i1 [ true, %22 ], [ true, %14 ], [ true, %6 ], [ %29, %26 ]
%32 = zext i1 %31 to i32
ret i32 %32
}

LLVM IR (-O2):
define i32 @jam_is_name_char(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = add i8 %0, -48
%6 = icmp ult i8 %5, 10
%7 = or i1 %6, %4
%8 = icmp eq i8 %0, 95
%9 = or i1 %8, %7
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
char *strncat(char *, char const *, size_t);
int DEPLOY_STRNCAT(char *strDest, size_t numberOfElements,
                   const char *strSource, size_t count) {
  char *s = strncat(strDest, strSource, count);
  return (s == strDest) ? 0 : 1;
}


x86 assembly (clang, -O0):
<DEPLOY_STRNCAT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncat@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdx
mov    -0x8(%rbp),%rsi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DEPLOY_STRNCAT>:
push   %rax
mov    %rdx,%rsi
mov    %rcx,%rdx
call   1030 <strncat@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @DEPLOY_STRNCAT(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = load i8*, i8** %5
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i8* @strncat(i8* %10, i8* %11, i64 %12)
store i8* %13, i8** %9
%14 = load i8*, i8** %9
%15 = load i8*, i8** %5
%16 = icmp eq i8* %14, %15
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 0, i32 1
ret i32 %18
}

LLVM IR (-O2):
define i32 @DEPLOY_STRNCAT(i8* %0, i64 %1, i8* nocapture %2, i64 %3) {
%5 = tail call i8* @strncat(i8* dereferenceable(1) %0, i8* %2, i64 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
int main() {
  foo(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ add(int, int);
int /*<<< orphan*/ sub(int, int);
int main(int argc, char *argv[]) {
  add(11, 22);
  sub(11, 22);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xb,%edi
mov    $0x16,%esi
call   1030 <add@plt>
mov    $0xb,%edi
mov    $0x16,%esi
call   1040 <sub@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xb,%edi
mov    $0x16,%esi
call   1030 <add@plt>
mov    $0xb,%edi
mov    $0x16,%esi
call   1040 <sub@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @add(i32 11, i32 22)
%7 = call i32 @sub(i32 11, i32 22)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @add(i32 11, i32 22)
%4 = tail call i32 @sub(i32 11, i32 22)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
#define SIGTERM 128
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ kill(int /*<<< orphan*/, int const);
int /*<<< orphan*/ write_log(char *);
void sig_handler(int signum) {
  switch (signum) {
  case SIGTERM:
    write_log("Received SIGTERM. Stopping.");
    kill(0, SIGTERM);
    exit(EXIT_SUCCESS);
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x80,%eax
jne    1174 <sig_handler+0x44>
jmp    114e <sig_handler+0x1e>
lea    0xeab(%rip),%rdi
call   1030 <write_log@plt>
xor    %edi,%edi
mov    $0x80,%esi
call   1040 <kill@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
jmp    1179 <sig_handler+0x49>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_handler>:
cmp    $0x80,%edi
je     1139 <sig_handler+0x9>
ret
push   %rax
lea    0xebf(%rip),%rdi
call   1030 <write_log@plt>
xor    %edi,%edi
mov    $0x80,%esi
call   1040 <kill@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Received SIGTERM. Stopping.\00"
@EXIT_SUCCESS = global i32 0
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %9 [
i32 128, label %4
]
4: ; preds = %1
%5 = call i32 @write_log(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @kill(i32 0, i32 128)
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
br label %10
10: ; preds = %9
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Received SIGTERM. Stopping.\00"
@EXIT_SUCCESS = global i32 0
define void @sig_handler(i32 %0) {
%2 = icmp eq i32 %0, 128
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = tail call i32 @write_log(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @kill(i32 0, i32 128)
%6 = load i32, i32* @EXIT_SUCCESS
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
unsigned long hashing(char *word) {
  unsigned long hash = 0;
  int c;
  while (c = *word++) {
    hash = hash + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hashing>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1142 <hashing+0x42>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hashing+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashing>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <hashing+0x23>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbq %cl,%rcx
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hashing+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @hashing(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %10, %4 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = sext i8 %5 to i64
%10 = add i64 %7, %9
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i64 [ 0, %1 ], [ %10, %4 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  printf(
      "test_sys_forcewrite"
      ": Not enough arguments, please supply someone else's file to destroy\n");
  char *buf = "Mary had a little lamb, and two helpings of peas and carrots";
  printf("test_sys_forcewrite"
         ": string: %s\n",
         buf);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf25(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xf53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf36(%rip),%rdi
call   1030 <puts@plt>
lea    0xf09(%rip),%rdi
lea    0xec5(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [89 x i8] c"test_sys_forcewrite: Not enough arguments, please supply someone else's file to destroy\0A\00"
@.str.1 = [61 x i8] c"Mary had a little lamb, and two helpings of peas and carrots\00"
@.str.2 = [33 x i8] c"test_sys_forcewrite: string: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0))
store i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0), i8** %5
%7 = load i8*, i8** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [61 x i8] c"Mary had a little lamb, and two helpings of peas and carrots\00"
@.str.2 = [33 x i8] c"test_sys_forcewrite: string: %s\0A\00"
@str = [88 x i8] c"test_sys_forcewrite: Not enough arguments, please supply someone else's file to destroy\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([88 x i8], [88 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
const char *EventHubClient_GetVersionString(void) { return "unknown"; }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"unknown\00"
define i8* @EventHubClient_GetVersionString() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ PSP_protocol_head(int, int);
int /*<<< orphan*/ PSP_serialize_uint8(int);
void PSP_ACK() {
  PSP_protocol_head(201, 1);
  PSP_serialize_uint8(0x01);
}


x86 assembly (clang, -O0):
<PSP_ACK>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc9,%edi
mov    $0x1,%esi
call   1030 <PSP_protocol_head@plt>
mov    $0x1,%edi
call   1040 <PSP_serialize_uint8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PSP_ACK>:
push   %rax
mov    $0xc9,%edi
mov    $0x1,%esi
call   1030 <PSP_protocol_head@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <PSP_serialize_uint8@plt>

LLVM IR (-O0):
define void @PSP_ACK() {
%1 = call i32 @PSP_protocol_head(i32 201, i32 1)
%2 = call i32 @PSP_serialize_uint8(i32 1)
ret void
}

LLVM IR (-O2):
define void @PSP_ACK() {
%1 = tail call i32 @PSP_protocol_head(i32 201, i32 1)
%2 = tail call i32 @PSP_serialize_uint8(i32 1)
ret void
}
__attribute__((no)) __attribute__((optnone)) int test_fact(int a) {
  if (a == 0)
    return 1;
  return test_fact(a - 1) * a;
}


x86 assembly (clang, -O0):
<test_fact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <test_fact+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1143 <test_fact+0x33>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <test_fact@plt>
imul   -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fact>:
push   %rax
mov    %edi,(%rsp)
cmpl   $0x0,(%rsp)
jne    1124 <test_fact+0x14>
movl   $0x1,0x4(%rsp)
jmp    1137 <test_fact+0x27>
mov    (%rsp),%edi
sub    $0x1,%edi
call   1030 <test_fact@plt>
imul   (%rsp),%eax
mov    %eax,0x4(%rsp)
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @test_fact(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %13
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = call i32 @test_fact(i32 %9)
%11 = load i32, i32* %3
%12 = mul nsw i32 %10, %11
store i32 %12, i32* %2
br label %13
13: ; preds = %7, %6
%14 = load i32, i32* %2
ret i32 %14
}
void __init_unison(void) {}


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

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

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

LLVM IR (-O2):
define void @__init_unison() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _assert(int, int);
void testEight(void) {
  _assert((3) == (3), 77);
  _assert((3) != (3), 78);
}


x86 assembly (clang, -O0):
<testEight>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x4d,%esi
call   1030 <_assert@plt>
xor    %edi,%edi
mov    $0x4e,%esi
call   1030 <_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testEight>:
push   %rax
mov    $0x1,%edi
mov    $0x4d,%esi
call   1030 <_assert@plt>
xor    %edi,%edi
mov    $0x4e,%esi
pop    %rax
jmp    1030 <_assert@plt>

LLVM IR (-O0):
define void @testEight() {
%1 = call i32 @_assert(i32 1, i32 77)
%2 = call i32 @_assert(i32 0, i32 78)
ret void
}

LLVM IR (-O2):
define void @testEight() {
%1 = tail call i32 @_assert(i32 1, i32 77)
%2 = tail call i32 @_assert(i32 0, i32 78)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int ffsc(const char *fname) {
  fprintf(stderr, "%s failed in function entry sanity check\n",
          (fname ? fname : "<unknown function namn>"));
  return 0;
}


x86 assembly (clang, -O0):
<ffsc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1140 <ffsc+0x30>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1150 <ffsc+0x40>
lea    0xee3(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1150 <ffsc+0x40>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rdx
lea    0xea2(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffsc>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%eax
test   %rdi,%rdi
lea    0xf06(%rip),%rdx
cmovne %rdi,%rdx
lea    0xed1(%rip),%rsi
mov    %eax,%edi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"%s failed in function entry sanity check\0A\00"
@.str.1 = [24 x i8] c"<unknown function namn>\00"
define i32 @ffsc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i8*, i8** %2
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %6
%10 = phi i8* [ %7, %6 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), %8 ]
%11 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"%s failed in function entry sanity check\0A\00"
@.str.1 = [24 x i8] c"<unknown function namn>\00"
define i32 @ffsc(i8* %0) {
%2 = load i32, i32* @stderr
%3 = icmp eq i8* %0, null
%4 = select i1 %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %0
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int dcloadsyscall(int, char const *);
int unlink(const char *path) {
  if (*(unsigned int *)0x8c004004 == 0xdeadbeef)
    return dcloadsyscall(6, path);
  else
    return -1;
}


x86 assembly (clang, -O0):
<unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    1143 <unlink+0x33>
mov    -0x10(%rbp),%rsi
mov    $0x6,%edi
call   1030 <dcloadsyscall@plt>
mov    %eax,-0x4(%rbp)
jmp    114a <unlink+0x3a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink>:
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    112a <unlink+0x1a>
mov    %rdi,%rsi
mov    $0x6,%edi
jmp    1030 <dcloadsyscall@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @unlink(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%5 = icmp eq i32 %4, -559038737
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i32 @dcloadsyscall(i32 6, i8* %7)
store i32 %8, i32* %2
br label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @unlink(i8* %0) {
%2 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%3 = icmp eq i32 %2, -559038737
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @dcloadsyscall(i32 6, i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ -1, %1 ]
ret i32 %7
}
void Swap(unsigned char *p_byte1, unsigned char *p_byte2) {
  unsigned char swap_byte;
  swap_byte = *p_byte1;
  *p_byte1 = *p_byte2;
  *p_byte2 = swap_byte;
}


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

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

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

LLVM IR (-O2):
define void @Swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
void ECDSA_SIG_new(void) {}


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

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

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

LLVM IR (-O2):
define void @ECDSA_SIG_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void ftnstop(char *msg) {
  if (msg != NULL)
    fprintf(stderr, "%s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<ftnstop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1150 <ftnstop+0x30>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ftnstop>:
push   %rax
test   %rdi,%rdi
je     113e <ftnstop+0x1e>
mov    %rdi,%rdx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @ftnstop(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %5, %1
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @ftnstop(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %3, %1
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int UART_read();
long millis();
int UART_read_timeout(long timeout_ms) {
  int c;
  long t0 = millis();
  while (millis() - t0 < timeout_ms) {
    c = UART_read();
    if (c >= 0) {
      return c;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<UART_read_timeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <millis@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1040 <millis@plt>
sub    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1170 <UART_read_timeout+0x50>
mov    $0x0,%al
call   1030 <UART_read@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     116b <UART_read_timeout+0x4b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <UART_read_timeout+0x57>
jmp    1137 <UART_read_timeout+0x17>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART_read_timeout>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <millis@plt>
mov    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <millis@plt>
sub    %rbx,%rax
cmp    %r14,%rax
jge    115c <UART_read_timeout+0x3c>
xor    %eax,%eax
call   1030 <UART_read@plt>
test   %eax,%eax
js     1140 <UART_read_timeout+0x20>
jmp    1161 <UART_read_timeout+0x41>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @UART_read_timeout(i64 %0) {
%2 = tail call i64 (...) @millis()
br label %3
3: ; preds = %7, %1
%4 = tail call i64 (...) @millis()
%5 = sub nsw i64 %4, %2
%6 = icmp slt i64 %5, %0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = tail call i32 (...) @UART_read()
%9 = icmp sgt i32 %8, -1
br i1 %9, label %10, label %3
10: ; preds = %3, %7
%11 = phi i32 [ %8, %7 ], [ -1, %3 ]
ret i32 %11
}
int zhead_has_fname(const char *p) { return !!(p[3] & 0x08); }


x86 assembly (clang, -O0):
<zhead_has_fname>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x3(%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zhead_has_fname>:
movzbl 0x3(%rdi),%eax
shr    $0x3,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @zhead_has_fname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = and i32 %6, 8
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @zhead_has_fname(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = lshr i8 %3, 3
%5 = and i8 %4, 1
%6 = zext i8 %5 to i32
ret i32 %6
}
/* Variables and functions */
scalar_t__ rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int nondet_signed_int() {
  srand(time(NULL));
  return (signed int)rand();
}


x86 assembly (clang, -O0):
<nondet_signed_int>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nondet_signed_int>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <rand@plt>

LLVM IR (-O0):
define i32 @nondet_signed_int() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
%3 = call i64 (...) @rand()
%4 = trunc i64 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @nondet_signed_int() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i64 (...) @rand()
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __debugfs_init();
int __real_stat(char const *, struct stat *);
int /*<<< orphan*/ printf(char *);
int stat(__const char *__restrict file, struct stat *__restrict info) {
  printf("calling "
         "stat"
         "\n");
  __debugfs_init();
  return (__real_stat(file, info));
}


x86 assembly (clang, -O0):
<stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <__debugfs_init@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <__real_stat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <__debugfs_init@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <__real_stat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [14 x i8] c"calling stat\0A\00"
define i32 @stat(i8* noalias %0, %struct.stat* noalias %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @__debugfs_init()
%7 = load i8*, i8** %3
%8 = load %struct.stat*, %struct.stat** %4
%9 = call i32 @__real_stat(i8* %7, %struct.stat* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@str = [13 x i8] c"calling stat\00"
define i32 @stat(i8* noalias %0, %struct.stat* noalias %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @__debugfs_init()
%5 = tail call i32 @__real_stat(i8* %0, %struct.stat* %1)
ret i32 %5
}
int do_743() { return 743; }


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

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

LLVM IR (-O0):
define i32 @do_743() {
ret i32 743
}

LLVM IR (-O2):
define i32 @do_743() {
ret i32 743
}
/* Variables and functions */
float sqrtf(float);
float t3(float a) { return sqrtf(a); }


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

x86 assembly (clang, -O2):
<t3>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111d <t3+0xd>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

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

LLVM IR (-O2):
define float @t3(float %0) {
%2 = tail call float @sqrtf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test1() { printf("test1\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"test1\00"
define void @test1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int ct_gt_u64(int, int);
uint64_t ct_le_u64(uint64_t x, uint64_t y) { return 1 ^ ct_gt_u64(x, y); }


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

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

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

LLVM IR (-O2):
define i32 @ct_le_u64(i32 %0, i32 %1) {
%3 = tail call i32 @ct_gt_u64(i32 %0, i32 %1)
%4 = xor i32 %3, 1
ret i32 %4
}
void gtk_text_buffer_remove_all_tags() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_remove_all_tags() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ piece(char *, char, char *, int);
int /*<<< orphan*/ stderr;
void piece_bar_or_error(char *d, char *s, int piece_offset) {
  if (!piece(d, '|', s, piece_offset)) {
    fprintf(stderr, "Cannot piece(%d) on (%s)\n", piece_offset, s);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<piece_bar_or_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x7c,%esi
call   1050 <piece@plt>
cmp    $0x0,%eax
jne    1187 <piece_bar_or_error+0x57>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xe88(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<piece_bar_or_error>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
mov    $0x7c,%esi
mov    %rbx,%rdx
mov    %ebp,%ecx
call   1050 <piece@plt>
test   %eax,%eax
je     1152 <piece_bar_or_error+0x22>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
mov    %ebp,%edx
mov    %rbx,%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Cannot piece(%d) on (%s)\0A\00"
define void @piece_bar_or_error(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @piece(i8* %7, i8 signext 124, i8* %8, i32 %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %18, label %12
12: ; preds = %3
%13 = load i32, i32* @stderr
%14 = load i32, i32* %6
%15 = load i8*, i8** %5
%16 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %14, i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Cannot piece(%d) on (%s)\0A\00"
define void @piece_bar_or_error(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @piece(i8* %0, i8 signext 124, i8* %1, i32 %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %1)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char **argv) {
  if (!strcmp(argv[1], "Yan is a noob")) {
    printf("You got that right!");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xebb(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    115f <main+0x3f>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
lea    0xed4(%rip),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    1141 <main+0x21>
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Yan is a noob\00"
@.str.1 = [20 x i8] c"You got that right!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(14) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret i32 0
}
void fc160(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
a : {
  typedef int(*f)[n];
  {
    typedef int(*g)[n];
    goto a;
    0;
  };
  {
    typedef int(*h)[n];
    0;
  };
  ;
  typedef int(*i)[n];
  0;
};
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc160>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc160+0x7>

x86 assembly (clang, -O2):
<fc160>:
jmp    1100 <fc160>

LLVM IR (-O0):
define void @fc160(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %1
%12 = load i32, i32* %2
%13 = zext i32 %12 to i64
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %11
16: ; No predecessors!
%17 = load i32, i32* %2
%18 = zext i32 %17 to i64
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc160(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ sleep_msec(double);
void sleep_sec(double sec) {
  if (sec > 0.0f) {
    sleep_msec(sec * 1000.0f);
  }
}


x86 assembly (clang, -O0):
<sleep_sec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1141 <sleep_sec+0x31>
movsd  0xec9(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <sleep_msec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep_sec>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1127 <sleep_sec+0x17>
mulsd  0xede(%rip),%xmm0
jmp    1030 <sleep_msec@plt>
ret

LLVM IR (-O0):
define void @sleep_sec(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load double, double* %2
%7 = fmul double %6, 1.000000e+03
%8 = call i32 @sleep_msec(double %7)
br label %9
9: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @sleep_sec(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fmul double %0, 1.000000e+03
%5 = tail call i32 @sleep_msec(double %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
double exp(double);
double alphaH(double v) { return 0.07 * exp(-v / 20.0); }


x86 assembly (clang, -O0):
<alphaH>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xec7(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xeab(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alphaH>:
push   %rax
divsd  0xee7(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @alphaH(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = fdiv double %4, 2.000000e+01
%6 = call double @exp(double %5)
%7 = fmul double 7.000000e-02, %6
ret double %7
}

LLVM IR (-O2):
define double @alphaH(double %0) {
%2 = fdiv double %0, -2.000000e+01
%3 = tail call double @exp(double %2)
%4 = fmul double %3, 7.000000e-02
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ sqr(int);
int main(int argc, char *argv[]) {
  int x;
  printf("Enter an integer value: ");
  scanf("%d", &x);
  printf("\nThe square of %d is %ld.\n", x, sqr(x));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <sqr@plt>
mov    -0x18(%rbp),%esi
mov    %eax,%edx
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1040 <sqr@plt>
lea    0xeb6(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Enter an integer value: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"\0AThe square of %d is %ld.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%9 = load i32, i32* %6
%10 = load i32, i32* %6
%11 = call i32 @sqr(i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Enter an integer value: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"\0AThe square of %d is %ld.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @sqr(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}