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

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
struct timespec tsTOD() {
  struct timespec timeOfDay;
  clock_gettime(CLOCK_MONOTONIC, &timeOfDay);
  return (timeOfDay);
}


x86 assembly (clang, -O0):
<tsTOD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsTOD>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @tsTOD() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @tsTOD() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
scalar_t__ isspace(char);
char *strchr(char *, char);
void trim_end(char *s) {
  char *p = strchr(s, '\0');
  while (p > s && isspace(p[-1]))
    --p;
  *p = '\0';
  return;
}


x86 assembly (clang, -O0):
<trim_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmp    -0x8(%rbp),%rcx
mov    %al,-0x11(%rbp)
jbe    1165 <trim_end+0x45>
mov    -0x10(%rbp),%rax
movsbl -0x1(%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1175 <trim_end+0x55>
jmp    1186 <trim_end+0x66>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    113b <trim_end+0x1b>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_end>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %rax,%r15
add    %r14,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rbx
cmp    %r14,%r15
jbe    115a <trim_end+0x3a>
lea    -0x1(%rbx),%r15
movsbl -0x1(%rbx),%edi
call   1040 <isspace@plt>
test   %rax,%rax
jne    1140 <trim_end+0x20>
movb   $0x0,(%rbx)
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @trim_end(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = getelementptr i8, i8* %0, i64 %2
br label %4
4: ; preds = %7, %1
%5 = phi i8* [ %3, %1 ], [ %8, %7 ]
%6 = icmp ugt i8* %5, %0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %5, i64 -1
%9 = load i8, i8* %8
%10 = tail call i64 @isspace(i8 signext %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %7
store i8 0, i8* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int *calloc(int, int);
int main(void) {
  int *ro = calloc(2, sizeof(int));
  assert(ro[0] == 0);
  assert(ro[1] == 0);
  ro[0] = 3;
  assert(ro[1] != 3);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x2,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
cmpl   $0x0,(%rax)
sete   %dil
call   1040 <assert@plt>
mov    0x4(%rbx),%ebx
xor    %edi,%edi
test   %ebx,%ebx
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmp    $0x3,%ebx
setne  %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = call i32* @calloc(i32 2, i32 4)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32*, i32** %1
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32*, i32** %1
%16 = getelementptr inbounds i32, i32* %15, i64 0
store i32 3, i32* %16
%17 = load i32*, i32** %1
%18 = getelementptr inbounds i32, i32* %17, i64 1
%19 = load i32, i32* %18
%20 = icmp ne i32 %19, 3
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @calloc(i32 2, i32 4)
%2 = load i32, i32* %1
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = getelementptr inbounds i32, i32* %1, i64 1
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = icmp ne i32 %7, 3
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ kputc(char const);
int puts(const char *s) {
  for (; *s; s++)
    kputc(*s);
  kputc('\n');
  kputc('\0');
  return 0;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <puts+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <kputc@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <puts+0xc>
mov    $0xa,%edi
call   1030 <kputc@plt>
xor    %edi,%edi
call   1030 <kputc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <kputc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
mov    $0xa,%edi
call   1030 <kputc@plt>
xor    %edi,%edi
call   1030 <kputc@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @kputc(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = tail call i32 @kputc(i8 signext 10)
%13 = tail call i32 @kputc(i8 signext 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ pread64(int, void *, size_t, int /*<<< orphan*/);
ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset) {
  return pread64(fd, buf, count, offset);
}


x86 assembly (clang, -O0):
<__libc_pread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <pread64@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__libc_pread>:
jmp    1030 <pread64@plt>

LLVM IR (-O0):
define i32 @__libc_pread(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = load i32, i32* %8
%13 = call i32 @pread64(i32 %9, i8* %10, i64 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @__libc_pread(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @pread64(i32 %0, i8* %1, i64 %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
int main() {
  setuid(0);
  system("/home/pi/EpocArmPi/main.sh");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"/home/pi/EpocArmPi/main.sh\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @setuid(i32 0)
%3 = call i32 @system(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"/home/pi/EpocArmPi/main.sh\00"
define i32 @main() {
%1 = tail call i32 @setuid(i32 0)
%2 = tail call i32 @system(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  scalar_t__ pAppData;
  int /*<<< orphan*/ (*xDlError)(TYPE_1__ *, int, char *);
};
typedef TYPE_1__ sqlite3_vfs;

/* Variables and functions */
int /*<<< orphan*/ stub1(TYPE_1__ *, int, char *);
void memDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg) {
  ((sqlite3_vfs *)((pVfs)->pAppData))
      ->xDlError(((sqlite3_vfs *)((pVfs)->pAppData)), nByte, zErrMsg);
}


x86 assembly (clang, -O0):
<memDlError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x8(%rax),%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memDlError>:
mov    (%rdi),%rdi
mov    0x8(%rdi),%rax
jmp    *%rax

LLVM IR (-O0):
%struct.TYPE_4__ = type { i64, i32 (%struct.TYPE_4__*, i32, i8*)* }
define void @memDlError(%struct.TYPE_4__* %0, i32 %1, i8* %2) {
%4 = alloca %struct.TYPE_4__*
%5 = alloca i32
%6 = alloca i8*
store %struct.TYPE_4__* %0, %struct.TYPE_4__** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = load i64, i64* %8
%10 = inttoptr i64 %9 to %struct.TYPE_4__*
%11 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 1
%12 = load i32 (%struct.TYPE_4__*, i32, i8*)*, i32 (%struct.TYPE_4__*, i32, i8*)** %11
%13 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%14 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %13, i32 0, i32 0
%15 = load i64, i64* %14
%16 = inttoptr i64 %15 to %struct.TYPE_4__*
%17 = load i32, i32* %5
%18 = load i8*, i8** %6
%19 = call i32 %12(%struct.TYPE_4__* %16, i32 %17, i8* %18)
ret void
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i64, i32 (%struct.TYPE_4__*, i32, i8*)* }
define void @memDlError(%struct.TYPE_4__* nocapture %0, i32 %1, i8* %2) {
%4 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 0
%5 = load i64, i64* %4
%6 = inttoptr i64 %5 to %struct.TYPE_4__*
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i64 0, i32 1
%8 = load i32 (%struct.TYPE_4__*, i32, i8*)*, i32 (%struct.TYPE_4__*, i32, i8*)** %7
%9 = tail call i32 %8(%struct.TYPE_4__* %6, i32 %1, i8* %2)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int string_match(const void *data1, const void *data2) {
  if (strcmp((char *)data1, (char *)data2) == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<string_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1143 <string_match+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <string_match+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_match>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @string_match(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** %4
%7 = load i8*, i8** %5
%8 = call i64 @strcmp(i8* %6, i8* %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @string_match(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void foo714() {}


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

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

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

LLVM IR (-O2):
define void @foo714() {
ret void
}
void mem_put_le32(char *mem, unsigned int val) {
  mem[0] = val;
  mem[1] = val >> 8;
  mem[2] = val >> 16;
  mem[3] = val >> 24;
}


x86 assembly (clang, -O0):
<mem_put_le32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_put_le32>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @mem_put_le32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = trunc i32 %5 to i8
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 %6, i8* %8
%9 = load i32, i32* %4
%10 = lshr i32 %9, 8
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8 %11, i8* %13
%14 = load i32, i32* %4
%15 = lshr i32 %14, 16
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 2
store i8 %16, i8* %18
%19 = load i32, i32* %4
%20 = lshr i32 %19, 24
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 3
store i8 %21, i8* %23
ret void
}

LLVM IR (-O2):
define void @mem_put_le32(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
char const *dlerror();
const char *SEC_OSAL_dlerror(void) { return dlerror(); }


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

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

LLVM IR (-O0):
define i8* @SEC_OSAL_dlerror() {
%1 = call i8* (...) @dlerror()
ret i8* %1
}

LLVM IR (-O2):
define i8* @SEC_OSAL_dlerror() {
%1 = tail call i8* (...) @dlerror()
ret i8* %1
}
/* Type definitions */
struct item {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ item_free(struct item *);
struct item *receive();
void *receiver_t(void *data) {
  struct item *i = receive();
  item_free(i);
  return 0;
}


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

x86 assembly (clang, -O2):
<receiver_t>:
push   %rax
xor    %eax,%eax
call   1030 <receive@plt>
mov    %rax,%rdi
call   1040 <item_free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.item = type { i32 }
define i8* @receiver_t(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.item*
store i8* %0, i8** %2
%4 = call %struct.item* (...) @receive()
store %struct.item* %4, %struct.item** %3
%5 = load %struct.item*, %struct.item** %3
%6 = call i32 @item_free(%struct.item* %5)
ret i8* null
}

LLVM IR (-O2):
%struct.item = type { i32 }
define noalias i8* @receiver_t(i8* nocapture readnone %0) {
%2 = tail call %struct.item* (...) @receive()
%3 = tail call i32 @item_free(%struct.item* %2)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
int PulseF3(int trig) {
  char com1, data;
  int stat = 0;
  BNCIO(46);
  BNCIO(3);
  BNCIO(0);
  return (stat);
}


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

x86 assembly (clang, -O2):
<PulseF3>:
push   %rax
mov    $0x2e,%edi
call   1030 <BNCIO@plt>
mov    $0x3,%edi
call   1030 <BNCIO@plt>
xor    %edi,%edi
call   1030 <BNCIO@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @PulseF3(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %5
%6 = call i32 @BNCIO(i32 46)
%7 = call i32 @BNCIO(i32 3)
%8 = call i32 @BNCIO(i32 0)
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @PulseF3(i32 %0) {
%2 = tail call i32 @BNCIO(i32 46)
%3 = tail call i32 @BNCIO(i32 3)
%4 = tail call i32 @BNCIO(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ signal(int, void (*)(int));
void catch_signal(int signum, void (*handler)(int)) { signal(signum, handler); }


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

x86 assembly (clang, -O2):
<catch_signal>:
jmp    1030 <signal@plt>

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

LLVM IR (-O2):
define void @catch_signal(i32 %0, void (i32)* %1) {
%3 = tail call i32 @signal(i32 %0, void (i32)* %1)
ret void
}
void add_render_message_renderer(struct render_message *render_message) {}


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

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

LLVM IR (-O0):
%struct.render_message = type opaque
define void @add_render_message_renderer(%struct.render_message* %0) {
%2 = alloca %struct.render_message*
store %struct.render_message* %0, %struct.render_message** %2
ret void
}

LLVM IR (-O2):
%struct.render_message = type opaque
define void @add_render_message_renderer(%struct.render_message* nocapture %0) {
ret void
}
/* Variables and functions */
int isprint(int);
int isgraph(int ch) {
  if (ch == ' ') {
    return 0;
  }
  return isprint(ch);
}


x86 assembly (clang, -O0):
<isgraph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jne    1131 <isgraph+0x21>
movl   $0x0,-0x4(%rbp)
jmp    113c <isgraph+0x2c>
mov    -0x8(%rbp),%edi
call   1030 <isprint@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgraph>:
cmp    $0x20,%edi
jne    1118 <isgraph+0x8>
xor    %eax,%eax
ret
jmp    1030 <isprint@plt>

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

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = icmp eq i32 %0, 32
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @isprint(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fit(char *, int);
int /*<<< orphan*/ puts(char *);
int main(void) {
  char mesg[] = "Things should be as simple as possible,"
                " but not simpler.";
  puts(mesg);
  fit(mesg, 38);
  puts(mesg);
  puts("Let's look at some more of the string.");
  puts(mesg + 39);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x39,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
call   1030 <puts@plt>
lea    -0x40(%rbp),%rdi
mov    $0x26,%esi
call   1050 <fit@plt>
lea    -0x40(%rbp),%rdi
call   1030 <puts@plt>
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
lea    -0x40(%rbp),%rdi
add    $0x27,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
movups 0xefd(%rip),%xmm0
movups %xmm0,0x29(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb0(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x26,%esi
call   1040 <fit@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
lea    0x27(%rsp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.mesg = [57 x i8] c"Things should be as simple as possible, but not simpler.\00"
@.str = [39 x i8] c"Let's look at some more of the string.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [57 x i8]
store i32 0, i32* %1
%3 = bitcast [57 x i8]* %2 to i8*
%4 = getelementptr inbounds [57 x i8], [57 x i8]* %2, i64 0, i64 0
%5 = call i32 @puts(i8* %4)
%6 = getelementptr inbounds [57 x i8], [57 x i8]* %2, i64 0, i64 0
%7 = call i32 @fit(i8* %6, i32 38)
%8 = getelementptr inbounds [57 x i8], [57 x i8]* %2, i64 0, i64 0
%9 = call i32 @puts(i8* %8)
%10 = call i32 @puts(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%11 = getelementptr inbounds [57 x i8], [57 x i8]* %2, i64 0, i64 0
%12 = getelementptr inbounds i8, i8* %11, i64 39
%13 = call i32 @puts(i8* %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.mesg = [57 x i8] c"Things should be as simple as possible, but not simpler.\00"
@.str = [39 x i8] c"Let's look at some more of the string.\00"
define i32 @main() {
%1 = alloca [57 x i8]
%2 = getelementptr inbounds [57 x i8], [57 x i8]* %1, i64 0, i64 0
%3 = call i32 @puts(i8* %2)
%4 = call i32 @fit(i8* %2, i32 38)
%5 = call i32 @puts(i8* %2)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [57 x i8], [57 x i8]* %1, i64 0, i64 39
%8 = call i32 @puts(i8* %7)
ret i32 0
}
unsigned long shift_23_bit_feedback_register() {
  static unsigned long register_23 = 1;
  unsigned long new_bit;
  new_bit = (register_23 & 0x01) ^ ((register_23 & 0x20) >> 5);
  register_23 = register_23 >> 1;
  register_23 = register_23 | (new_bit << 22);
  return (register_23);
}


x86 assembly (clang, -O0):
<shift_23_bit_feedback_register>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f15(%rip),%rax
and    $0x1,%rax
mov    0x2f0a(%rip),%rcx
and    $0x20,%rcx
shr    $0x5,%rcx
xor    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    0x2ef4(%rip),%rax
shr    $0x1,%rax
mov    %rax,0x2ee9(%rip)
mov    0x2ee2(%rip),%rax
mov    -0x8(%rbp),%rcx
shl    $0x16,%rcx
or     %rcx,%rax
mov    %rax,0x2ed0(%rip)
mov    0x2ec9(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_23_bit_feedback_register>:
mov    0x2f19(%rip),%rcx
mov    %ecx,%eax
shr    $0x5,%eax
xor    %ecx,%eax
shr    %rcx
and    $0x1,%eax
shl    $0x16,%rax
or     %rcx,%rax
mov    %rax,0x2efe(%rip)
ret

LLVM IR (-O0):
@shift_23_bit_feedback_register.register_23 = internal global i64 1
define i64 @shift_23_bit_feedback_register() {
%1 = alloca i64
%2 = load i64, i64* @shift_23_bit_feedback_register.register_23
%3 = and i64 %2, 1
%4 = load i64, i64* @shift_23_bit_feedback_register.register_23
%5 = and i64 %4, 32
%6 = lshr i64 %5, 5
%7 = xor i64 %3, %6
store i64 %7, i64* %1
%8 = load i64, i64* @shift_23_bit_feedback_register.register_23
%9 = lshr i64 %8, 1
store i64 %9, i64* @shift_23_bit_feedback_register.register_23
%10 = load i64, i64* @shift_23_bit_feedback_register.register_23
%11 = load i64, i64* %1
%12 = shl i64 %11, 22
%13 = or i64 %10, %12
store i64 %13, i64* @shift_23_bit_feedback_register.register_23
%14 = load i64, i64* @shift_23_bit_feedback_register.register_23
ret i64 %14
}

LLVM IR (-O2):
@shift_23_bit_feedback_register.register_23 = internal unnamed_addr global i64 1
define i64 @shift_23_bit_feedback_register() {
%1 = load i64, i64* @shift_23_bit_feedback_register.register_23
%2 = lshr i64 %1, 5
%3 = xor i64 %2, %1
%4 = lshr i64 %1, 1
%5 = shl i64 %3, 22
%6 = and i64 %5, 4194304
%7 = or i64 %6, %4
store i64 %7, i64* @shift_23_bit_feedback_register.register_23
ret i64 %7
}
unsigned hash_responder_key(const void *key) {
  const unsigned char *str = key;
  unsigned int hash = 0;
  int i;
  for (i = 0; str[i] != 0; i++) {
    hash = 37 * hash + str[i];
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash_responder_key>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1156 <hash_responder_key+0x56>
imul   $0x25,-0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111e <hash_responder_key+0x1e>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_responder_key>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <hash_responder_key+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,8),%edx
lea    (%rax,%rdx,4),%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_responder_key+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_responder_key(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = zext i8 %6 to i32
%9 = mul i32 %7, 37
%10 = add i32 %9, %8
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr,
          "usage: %s [-V] [-n] [-e] [-r[r]] [-f[f[f]]] [-a|-s subdb] dbpath\n",
          prog);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [66 x i8] c"usage: %s [-V] [-n] [-e] [-r[r]] [-f[f[f]]] [-a|-s subdb] dbpath\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [66 x i8] c"usage: %s [-V] [-n] [-e] [-r[r]] [-f[f[f]]] [-a|-s subdb] dbpath\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
double grams_to_lbs(int grams) { return grams / 453.6; }


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

x86 assembly (clang, -O2):
<grams_to_lbs>:
cvtsi2sd %edi,%xmm0
divsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @grams_to_lbs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 4.536000e+02
ret double %5
}

LLVM IR (-O2):
define double @grams_to_lbs(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fdiv double %2, 4.536000e+02
ret double %3
}
void printstring(const char *str) {}


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

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

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

LLVM IR (-O2):
define void @printstring(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  int i;
  char line[81];
  void readLine(char *buffer);
  for (i = 0; i < 3; ++i) {
    readLine(line);
    printf("%s\n\n", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1167 <main+0x47>
lea    -0x60(%rbp),%rdi
call   1040 <readLine@plt>
lea    -0x60(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <readLine@plt>
lea    0xec7(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <readLine@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <readLine@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s\0A\0A\00"
define i32 @main() {
%1 = alloca [81 x i8]
%2 = getelementptr inbounds [81 x i8], [81 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ script_new_line();
void script_mssg_off(void) { script_new_line(); }


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

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

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

LLVM IR (-O2):
define void @script_mssg_off() {
%1 = tail call i32 (...) @script_new_line()
ret void
}
const char *CFilterFactoryName(void *arg) {
  (void)arg;
  return "foo";
}


x86 assembly (clang, -O0):
<CFilterFactoryName>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define i8* @CFilterFactoryName(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
__attribute__((no)) int test1(int a, int b) {
  if (a == 1)
    return b;
  return 0;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111f <test1+0x1f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <test1+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
xor    %eax,%eax
cmp    $0x1,%edi
cmove  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @test1(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
%4 = select i1 %3, i32 %1, i32 0
ret i32 %4
}
char *strptime(const char *s, const char *format, struct tm *tm) {}


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

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

LLVM IR (-O0):
%struct.tm = type opaque
define i8* @strptime(i8* %0, i8* %1, %struct.tm* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct.tm*
store i8* %0, i8** %5
store i8* %1, i8** %6
store %struct.tm* %2, %struct.tm** %7
%8 = load i8*, i8** %4
ret i8* %8
}

LLVM IR (-O2):
%struct.tm = type opaque
define noalias i8* @strptime(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct.tm* nocapture readnone %2) {
ret i8* undef
}
unsigned xrop3_26_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = S & T;
  stk2 = D | stk3;
  stk1 = T ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_26_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_26_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %7
%25 = and i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %5
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %7
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %7
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %6
%41 = and i32 %39, %40
%42 = or i32 %38, %41
%43 = load i32, i32* %5
%44 = load i32, i32* %7
%45 = and i32 %43, %44
%46 = or i32 %42, %45
ret i32 %46
}

LLVM IR (-O2):
define i32 @xrop3_26_1_1(i8 zeroext %0, i8 zeroext %1) {
ret i32 255
}
int termios_tcflowono(int fd) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @termios_tcflowono(i32 %0) {
ret i32 1
}
qv(a) { return a < 'a'; }


x86 assembly (clang, -O0):
<qv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qv>:
xor    %eax,%eax
cmp    $0x61,%edi
setl   %al
ret

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

LLVM IR (-O2):
define i32 @qv(i32 %0) {
%2 = icmp slt i32 %0, 97
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ MAP_PRIVATE;
int /*<<< orphan*/ PROT_NONE;
int /*<<< orphan*/ mmap(int /*<<< orphan*/, int, int /*<<< orphan*/,
                        int /*<<< orphan*/, int /*<<< orphan*/,
                        int /*<<< orphan*/);
int /*<<< orphan*/ munmap(int /*<<< orphan*/, int);
int main() {
  for (int i = 0; i < 1000 * 1000; i++)
    munmap(mmap(0, i + 1, PROT_NONE, MAP_PRIVATE, 0, 0), i + 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xf4240,-0x8(%rbp)
jge    1184 <main+0x64>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    0x2e7f(%rip),%rax
mov    (%rax),%ecx
xor    %r9d,%r9d
mov    %r9d,%edi
mov    %r9d,%r8d
call   1030 <mmap@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
call   1040 <munmap@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x1,%ebx
mov    0x2ebf(%rip),%r14
mov    0x2ea0(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14),%edx
mov    (%r15),%ecx
xor    %edi,%edi
mov    %ebx,%esi
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1040 <munmap@plt>
add    $0x1,%ebx
cmp    $0xf4241,%ebx
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@PROT_NONE = global i32 0
@MAP_PRIVATE = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %15, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 1000000
br i1 %5, label %6, label %18
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
%9 = load i32, i32* @PROT_NONE
%10 = load i32, i32* @MAP_PRIVATE
%11 = call i32 @mmap(i32 0, i32 %8, i32 %9, i32 %10, i32 0, i32 0)
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
%14 = call i32 @munmap(i32 %11, i32 %13)
br label %15
15: ; preds = %6
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %3
18: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@PROT_NONE = global i32 0
@MAP_PRIVATE = global i32 0
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %4, %2 ]
%4 = add nuw nsw i32 %3, 1
%5 = load i32, i32* @PROT_NONE
%6 = load i32, i32* @MAP_PRIVATE
%7 = tail call i32 @mmap(i32 0, i32 %4, i32 %5, i32 %6, i32 0, i32 0)
%8 = tail call i32 @munmap(i32 %7, i32 %4)
%9 = icmp eq i32 %4, 1000000
br i1 %9, label %1, label %2
}
/* Variables and functions */
double DSlater_1S_3S(double, double, double);
double DSlater_3S_1S(double rij, double xii, double xij) {
  return DSlater_1S_3S(rij, xij, xii);
}


x86 assembly (clang, -O0):
<DSlater_3S_1S>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
call   1030 <DSlater_1S_3S@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DSlater_3S_1S>:
movaps %xmm1,%xmm3
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
jmp    1030 <DSlater_1S_3S@plt>

LLVM IR (-O0):
define double @DSlater_3S_1S(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = load double, double* %5
%10 = call double @DSlater_1S_3S(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @DSlater_3S_1S(double %0, double %1, double %2) {
%4 = tail call double @DSlater_1S_3S(double %0, double %2, double %1)
ret double %4
}
/* Type definitions */
struct stddev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct stddev *);
void stddev_free(struct stddev *sd) { free(sd); }


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

x86 assembly (clang, -O2):
<stddev_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.stddev = type { i32 }
define void @stddev_free(%struct.stddev* %0) {
%2 = alloca %struct.stddev*
store %struct.stddev* %0, %struct.stddev** %2
%3 = load %struct.stddev*, %struct.stddev** %2
%4 = call i32 @free(%struct.stddev* %3)
ret void
}

LLVM IR (-O2):
%struct.stddev = type { i32 }
define void @stddev_free(%struct.stddev* nocapture %0) {
%2 = tail call i32 @free(%struct.stddev* %0)
ret void
}
void rop3_17_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = *D | S;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_17_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_17_1_0>:
xor    (%rdi),%sil
not    %sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_17_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %7
%15 = load i8, i8* %7
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %7
%19 = load i8, i8* %7
%20 = zext i8 %19 to i32
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = xor i32 %22, -1
%24 = and i32 %20, %23
%25 = load i8*, i8** %4
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = and i32 %27, %29
%31 = or i32 %24, %30
%32 = trunc i32 %31 to i8
%33 = load i8*, i8** %4
store i8 %32, i8* %33
ret void
}

LLVM IR (-O2):
define void @rop3_17_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = xor i8 %5, -1
store i8 %6, i8* %0
ret void
}