xunge/DecIR huggingface dataset:
int vfs_dq_transfer(struct inode *inode, struct iattr *iattr) { return 0; }


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

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

LLVM IR (-O0):
%struct.inode = type opaque
%struct.iattr = type opaque
define i32 @vfs_dq_transfer(%struct.inode* %0, %struct.iattr* %1) {
%3 = alloca %struct.inode*
%4 = alloca %struct.iattr*
store %struct.inode* %0, %struct.inode** %3
store %struct.iattr* %1, %struct.iattr** %4
ret i32 0
}

LLVM IR (-O2):
%struct.inode = type opaque
%struct.iattr = type opaque
define i32 @vfs_dq_transfer(%struct.inode* nocapture readnone %0, %struct.iattr* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
char jm_getch_(int /*<<< orphan*/);
char jm_getch(void) { return jm_getch_(0); }


x86 assembly (clang, -O0):
<jm_getch>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <jm_getch_@plt>
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @jm_getch() {
%1 = call signext i8 @jm_getch_(i32 0)
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @jm_getch() {
%1 = tail call signext i8 @jm_getch_(i32 0)
ret i8 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
int main() {
  char n, m;
  n = 'a';
  m = 'c';
  printf("%c%c", n, m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x61,-0x5(%rbp)
movb   $0x63,-0x6(%rbp)
mov    -0x5(%rbp),%al
lea    0xecf(%rip),%rdi
movsbl %al,%esi
movsbl -0x6(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x61,%esi
mov    $0x63,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%c%c\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext 97, i8 signext 99)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void store16(uint8_t *b, uint16_t i) { memcpy(b, &i, 2); }


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

x86 assembly (clang, -O2):
<store16>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @store16(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 = call i32 @memcpy(i32* %5, i32* %4, i32 2)
ret void
}

LLVM IR (-O2):
define void @store16(i32* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @memcpy(i32* %0, i32* %3, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void error(char *msg) {
  fprintf(stderr, "%s: %s", msg, strerror(errno));
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeac(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"%s: %s\00"
@errno = global i32 0
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"%s: %s\00"
@errno = global i32 0
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
double sin(double x) {
  __asm__ __volatile__("fldl %0;"
                       "fsin;"
                       "fstpl %0"
                       : "+m"(x));
  return x;
}


x86 assembly (clang, -O0):
<sin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
fldl   -0x8(%rbp)
fsin
fstpl  -0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sin>:
movsd  %xmm0,-0x8(%rsp)
fldl   -0x8(%rsp)
fsin
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @sin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
ret double %3
}

LLVM IR (-O2):
define double @sin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
ret double %3
}
void SSMR3GetS16(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3GetS16() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send();
void *sender_t(void *data) {
  send();
  return 0;
}


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

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

LLVM IR (-O0):
define i8* @sender_t(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @send()
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @sender_t(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @send()
ret i8* null
}
/* Type definitions */
typedef unsigned int uint8_t;

/* Variables and functions */
void clr_bit(uint8_t *block_group, int index) {
  *block_group &= ~(1u << index);
}


x86 assembly (clang, -O0):
<clr_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
and    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clr_bit>:
mov    %esi,%ecx
mov    $0xfffffffe,%eax
rol    %cl,%eax
and    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @clr_bit(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = xor i32 %6, -1
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = and i32 %9, %7
store i32 %10, i32* %8
ret void
}

LLVM IR (-O2):
define void @clr_bit(i32* nocapture %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = load i32, i32* %0
%6 = and i32 %5, %4
store i32 %6, i32* %0
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ rax;

/* Variables and functions */
int /*<<< orphan*/ cpuid(int, int *, int *, int *, int *);
bool cpuid_enable_ExtendedClockMod(void) {
  uint64_t rax, rbx, rcx, rdx;
  int leaf = 6;
  cpuid(leaf, &rax, &rbx, &rcx, &rdx);
  if ((((uint64_t)(rax) &
        ((((uint64_t)1 << (((5)) - ((5)) + 1)) - 1) << ((5)))) >>
       (5)) == 1) {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<cpuid_enable_ExtendedClockMod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x6,-0x18(%rbp)
mov    -0x18(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <cpuid@plt>
mov    -0x8(%rbp),%eax
and    $0x20,%eax
sar    $0x5,%eax
cmp    $0x1,%eax
jne    1155 <cpuid_enable_ExtendedClockMod+0x45>
movl   $0x1,-0x4(%rbp)
jmp    115c <cpuid_enable_ExtendedClockMod+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_enable_ExtendedClockMod>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    $0x6,%edi
call   1030 <cpuid@plt>
mov    0x8(%rsp),%eax
shr    $0x5,%eax
and    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @cpuid_enable_ExtendedClockMod() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 6, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @cpuid(i32 %7, i32* %2, i32* %3, i32* %4, i32* %5)
%9 = load i32, i32* %2
%10 = and i32 %9, 32
%11 = ashr i32 %10, 5
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %0
store i32 1, i32* %1
br label %15
14: ; preds = %0
store i32 0, i32* %1
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @cpuid_enable_ExtendedClockMod() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @cpuid(i32 6, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %1
%11 = lshr i32 %10, 5
%12 = and i32 %11, 1
ret i32 %12
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ send_event;
};
typedef TYPE_1__ XMapRequestEvent;

/* Variables and functions */
int get_XMapRequestEvent_send_event(void *_p) {
  return (int)((XMapRequestEvent *)_p)->send_event;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XMapRequestEvent_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ calculateRawUBXChecksum(unsigned char *, int);
int /*<<< orphan*/ errExit(char *);
int write(int, char *, int);
int pollMsg(char *msg, int len, int fd, int ntry) {
  int n;
  calculateRawUBXChecksum((unsigned char *)msg, len);
  if ((n = write(fd, msg, len)) < 0)
    errExit("write");
  return (0);
}


x86 assembly (clang, -O0):
<pollMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <calculateRawUBXChecksum@plt>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    1178 <pollMsg+0x48>
lea    0xe8d(%rip),%rdi
call   1040 <errExit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pollMsg>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1050 <calculateRawUBXChecksum@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <write@plt>
test   %eax,%eax
jns    115e <pollMsg+0x2e>
lea    0xea7(%rip),%rdi
call   1040 <errExit@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"write\00"
define i32 @pollMsg(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @calculateRawUBXChecksum(i8* %10, i32 %11)
%13 = load i32, i32* %7
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = call i32 @write(i32 %13, i8* %14, i32 %15)
store i32 %16, i32* %9
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %4
%19 = call i32 @errExit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %18, %4
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"write\00"
define i32 @pollMsg(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @calculateRawUBXChecksum(i8* %0, i32 %1)
%6 = tail call i32 @write(i32 %2, i8* %0, i32 %1)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @errExit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printVersion(char thisApp[]) {
  printf("%s version 1.0\n", thisApp);
  printf("Copyright (C) 2017 Tabacchi Consulting, "
         "<support@tabacchiconsulting.com>\n");
}


x86 assembly (clang, -O0):
<printVersion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printVersion>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed7(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"%s version 1.0\0A\00"
@.str.1 = [74 x i8] c"Copyright (C) 2017 Tabacchi Consulting, <support@tabacchiconsulting.com>\0A\00"
define void @printVersion(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%s version 1.0\0A\00"
@str = [73 x i8] c"Copyright (C) 2017 Tabacchi Consulting, <support@tabacchiconsulting.com>\00"
define void @printVersion(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i;
  int j;
  int k;
  if (!(i == 0 && j == 0))
    return 0;
  while (i <= k) {
    i++;
    j = j + 1;
  }
  assert(j == i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1133 <main+0x23>
cmpl   $0x0,-0xc(%rbp)
je     113f <main+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1181 <main+0x71>
jmp    1144 <main+0x34>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1167 <main+0x57>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <main+0x34>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct StackNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ peek(struct StackNode *);
int /*<<< orphan*/ pop(struct StackNode **);
int /*<<< orphan*/ push(struct StackNode **, int);
int main() {
  struct StackNode *root = NULL;
  peek(root);
  push(&root, 10);
  push(&root, 20);
  push(&root, 30);
  pop(&root);
  peek(root);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <peek@plt>
lea    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1050 <push@plt>
lea    -0x10(%rbp),%rdi
mov    $0x14,%esi
call   1050 <push@plt>
lea    -0x10(%rbp),%rdi
mov    $0x1e,%esi
call   1050 <push@plt>
lea    -0x10(%rbp),%rdi
call   1040 <pop@plt>
mov    -0x10(%rbp),%rdi
call   1030 <peek@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
xor    %edi,%edi
call   1030 <peek@plt>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <push@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1050 <push@plt>
mov    %rbx,%rdi
mov    $0x1e,%esi
call   1050 <push@plt>
mov    %rbx,%rdi
call   1040 <pop@plt>
mov    0x8(%rsp),%rdi
call   1030 <peek@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.StackNode = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.StackNode*
store i32 0, i32* %1
store %struct.StackNode* null, %struct.StackNode** %2
%3 = load %struct.StackNode*, %struct.StackNode** %2
%4 = call i32 @peek(%struct.StackNode* %3)
%5 = call i32 @push(%struct.StackNode** %2, i32 10)
%6 = call i32 @push(%struct.StackNode** %2, i32 20)
%7 = call i32 @push(%struct.StackNode** %2, i32 30)
%8 = call i32 @pop(%struct.StackNode** %2)
%9 = load %struct.StackNode*, %struct.StackNode** %2
%10 = call i32 @peek(%struct.StackNode* %9)
ret i32 0
}

LLVM IR (-O2):
%struct.StackNode = type { i32 }
define i32 @main() {
%1 = alloca %struct.StackNode*
%2 = bitcast %struct.StackNode** %1 to i8*
store %struct.StackNode* null, %struct.StackNode** %1
%3 = tail call i32 @peek(%struct.StackNode* null)
%4 = call i32 @push(%struct.StackNode** %1, i32 10)
%5 = call i32 @push(%struct.StackNode** %1, i32 20)
%6 = call i32 @push(%struct.StackNode** %1, i32 30)
%7 = call i32 @pop(%struct.StackNode** %1)
%8 = load %struct.StackNode*, %struct.StackNode** %1
%9 = call i32 @peek(%struct.StackNode* %8)
ret i32 0
}
void strcpy_func(char *dst, char *src) {
  while (*dst++ = *src++)
    ;
}


x86 assembly (clang, -O0):
<strcpy_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <strcpy_func+0x3b>
jmp    110c <strcpy_func+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy_func>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcpy_func+0x10>
ret

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

LLVM IR (-O2):
define void @strcpy_func(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage_on_failure() {
  fprintf(stderr, "ERROR: Invalid arguments!!!\n");
  fprintf(stderr, "  Usage: fakeClick x_pos y_pos\n");
  fprintf(stderr, "         where x_pos & y_pos both >= 0\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage_on_failure>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage_on_failure>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xede(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"ERROR: Invalid arguments!!!\0A\00"
@.str.1 = [32 x i8] c" Usage: fakeClick x_pos y_pos\0A\00"
@.str.2 = [40 x i8] c" where x_pos & y_pos both >= 0\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage_on_failure() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"ERROR: Invalid arguments!!!\0A\00"
@.str.1 = [32 x i8] c" Usage: fakeClick x_pos y_pos\0A\00"
@.str.2 = [40 x i8] c" where x_pos & y_pos both >= 0\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage_on_failure() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/
Atm128Rfa1Uart1InterruptsP__Uart1Interrupts__disableTxInterrupt();
void Atm128Rfa1SerialP__Uart1Interrupts__disableTxInterrupt(void) {
  Atm128Rfa1Uart1InterruptsP__Uart1Interrupts__disableTxInterrupt();
}


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

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

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

LLVM IR (-O2):
define void @Atm128Rfa1SerialP__Uart1Interrupts__disableTxInterrupt() {
%1 = tail call i32 (...) @Atm128Rfa1Uart1InterruptsP__Uart1Interrupts__disableTxInterrupt()
ret void
}
/* Variables and functions */
int i2c_smbus_read_byte(int);
int wiringPiI2CRead(int fd) { return i2c_smbus_read_byte(fd); }


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

x86 assembly (clang, -O2):
<wiringPiI2CRead>:
jmp    1030 <i2c_smbus_read_byte@plt>

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

LLVM IR (-O2):
define i32 @wiringPiI2CRead(i32 %0) {
%2 = tail call i32 @i2c_smbus_read_byte(i32 %0)
ret i32 %2
}
/* Variables and functions */
char *strstr(char *, char const *);
void stopAtSubstring(char *s, const char *toremove) {
  char *temp = strstr(s, toremove);
  if (temp != NULL) {
    temp[0] = '\0';
    temp = NULL;
  }
}


x86 assembly (clang, -O0):
<stopAtSubstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114b <stopAtSubstring+0x3b>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
movq   $0x0,-0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stopAtSubstring>:
push   %rax
call   1030 <strstr@plt>
test   %rax,%rax
je     111e <stopAtSubstring+0xe>
movb   $0x0,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @stopAtSubstring(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** %4
%8 = call i8* @strstr(i8* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 0, i8* %13
store i8* null, i8** %5
br label %14
14: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
define void @stopAtSubstring(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %2
store i8 0, i8* %3
br label %6
6: ; preds = %5, %2
ret void
}
unsigned char f15(unsigned char x, int y) {
  return (x << y) | (x >> (8 * sizeof(unsigned char) - y));
}


x86 assembly (clang, -O0):
<f15>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
movslq -0x8(%rbp),%rsi
mov    $0x8,%ecx
sub    %rsi,%rcx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f15>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @f15(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 %6, %7
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = sub i64 8, %12
%14 = trunc i64 %13 to i32
%15 = ashr i32 %10, %14
%16 = or i32 %8, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @f15(i8 zeroext %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = tail call i8 @llvm.fshl.i8(i8 %0, i8 %0, i8 %3)
ret i8 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int store_line(const char *line, void *data) {
  FILE *f = data;
  if (line[0] == '#')
    return 0;
  fprintf(f, "%s", line);
  return 0;
}


x86 assembly (clang, -O0):
<store_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    1144 <store_line+0x34>
movl   $0x0,-0x4(%rbp)
jmp    115f <store_line+0x4f>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xead(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_line>:
push   %rax
cmpb   $0x23,(%rdi)
je     111b <store_line+0xb>
call   1030 <fputs@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @store_line(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %6
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 35
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 0, i32* %3
br label %19
15: ; preds = %2
%16 = load i32*, i32** %6
%17 = load i8*, i8** %4
%18 = call i32 @fprintf(i32* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %17)
store i32 0, i32* %3
br label %19
19: ; preds = %15, %14
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @store_line(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 35
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = bitcast i8* %1 to i32*
%7 = tail call i32 @fputs(i8* %0, i32* %6)
br label %8
8: ; preds = %2, %5
ret i32 0
}
/* Variables and functions */
float M_PI;
int cos(float);
float ANTweenTimingFunctionSineInOut(float time, float begin, float change,
                                     float duration) {
  return -change / 2 * (cos(M_PI * time / duration) - 1) + begin;
}


x86 assembly (clang, -O0):
<ANTweenTimingFunctionSineInOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xeba(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    0x2e92(%rip),%rax
movss  (%rax),%xmm0
mulss  -0x4(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
call   1030 <cos@plt>
movss  -0x14(%rbp),%xmm0
sub    $0x1,%eax
cvtsi2ss %eax,%xmm2
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ANTweenTimingFunctionSineInOut>:
push   %rax
movss  %xmm1,0x4(%rsp)
mulss  0xee1(%rip),%xmm2
movss  %xmm2,(%rsp)
mov    0x2ebd(%rip),%rax
mulss  (%rax),%xmm0
divss  %xmm3,%xmm0
call   1030 <cos@plt>
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define float @ANTweenTimingFunctionSineInOut(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %7
%10 = fneg float %9
%11 = fdiv float %10, 2.000000e+00
%12 = load float, float* @M_PI
%13 = load float, float* %5
%14 = fmul float %12, %13
%15 = load float, float* %8
%16 = fdiv float %14, %15
%17 = call i32 @cos(float %16)
%18 = sub nsw i32 %17, 1
%19 = sitofp i32 %18 to float
%20 = load float, float* %6
%21 = call float @llvm.fmuladd.f32(float %11, float %19, float %20)
ret float %21
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define float @ANTweenTimingFunctionSineInOut(float %0, float %1, float %2, float %3) {
%5 = fmul float %2, -5.000000e-01
%6 = load float, float* @M_PI
%7 = fmul float %6, %0
%8 = fdiv float %7, %3
%9 = tail call i32 @cos(float %8)
%10 = add nsw i32 %9, -1
%11 = sitofp i32 %10 to float
%12 = tail call float @llvm.fmuladd.f32(float %5, float %11, float %1)
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ test_create_trie_node();
int /*<<< orphan*/ test_search_node();
int main(int argc, char **argv) {
  test_create_trie_node();
  test_search_node();
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @test_create_trie_node()
%6 = call i32 (...) @test_search_node()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_create_trie_node()
%4 = tail call i32 (...) @test_search_node()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ tolower(char);
void strToLower(char *str) {
  char c;
  do {
    c = *(str);
    *(str++) = tolower(c);
  } while (c != 0);
}


x86 assembly (clang, -O0):
<strToLower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
movsbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jne    111c <strToLower+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strToLower>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
movsbl (%rbx),%ebp
mov    %ebp,%edi
call   1030 <tolower@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %ebp,%ebp
jne    1120 <strToLower+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @strToLower(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i32 @tolower(i8 signext %4)
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %6, i8* %3
%8 = icmp eq i8 %4, 0
br i1 %8, label %9, label %2
9: ; preds = %2
ret void
}
int clock60ToDeg(int clockVal) {
  if (clockVal >= 60)
    clockVal = clockVal - 60;
  return 90 - (6 * clockVal);
}


x86 assembly (clang, -O0):
<clock60ToDeg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x3c,-0x4(%rbp)
jl     111a <clock60ToDeg+0x1a>
mov    -0x4(%rbp),%eax
sub    $0x3c,%eax
mov    %eax,-0x4(%rbp)
imul   $0x6,-0x4(%rbp),%ecx
mov    $0x5a,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock60ToDeg>:
lea    -0x3c(%rdi),%eax
cmp    $0x3c,%edi
cmovl  %edi,%eax
add    %eax,%eax
lea    (%rax,%rax,2),%ecx
mov    $0x5a,%eax
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @clock60ToDeg(i32 %0) {
%2 = icmp sgt i32 %0, 59
%3 = add nsw i32 %0, -60
%4 = select i1 %2, i32 %3, i32 %0
%5 = mul i32 %4, -6
%6 = add i32 %5, 90
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR70_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR70_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR70_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(int);
void ft_print_numbers(void) {
  int i;
  i = '0';
  while (i <= '9') {
    ft_putchar(i);
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_print_numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x30,-0x4(%rbp)
cmpl   $0x39,-0x4(%rbp)
jg     113f <ft_print_numbers+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <ft_putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <ft_print_numbers+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_print_numbers>:
push   %rax
mov    $0x30,%edi
call   1030 <ft_putchar@plt>
mov    $0x31,%edi
call   1030 <ft_putchar@plt>
mov    $0x32,%edi
call   1030 <ft_putchar@plt>
mov    $0x33,%edi
call   1030 <ft_putchar@plt>
mov    $0x34,%edi
call   1030 <ft_putchar@plt>
mov    $0x35,%edi
call   1030 <ft_putchar@plt>
mov    $0x36,%edi
call   1030 <ft_putchar@plt>
mov    $0x37,%edi
call   1030 <ft_putchar@plt>
mov    $0x38,%edi
call   1030 <ft_putchar@plt>
mov    $0x39,%edi
pop    %rax
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_print_numbers() {
%1 = alloca i32
store i32 48, i32* %1
br label %2
2: ; preds = %5, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 57
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @ft_putchar(i32 %6)
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @ft_print_numbers() {
%1 = tail call i32 @ft_putchar(i32 48)
%2 = tail call i32 @ft_putchar(i32 49)
%3 = tail call i32 @ft_putchar(i32 50)
%4 = tail call i32 @ft_putchar(i32 51)
%5 = tail call i32 @ft_putchar(i32 52)
%6 = tail call i32 @ft_putchar(i32 53)
%7 = tail call i32 @ft_putchar(i32 54)
%8 = tail call i32 @ft_putchar(i32 55)
%9 = tail call i32 @ft_putchar(i32 56)
%10 = tail call i32 @ft_putchar(i32 57)
ret void
}
/* Type definitions */
struct keyBundle {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ free(struct keyBundle *);
void kb_destroy(struct keyBundle *kb) {
  assert(kb != NULL);
  free(kb);
}


x86 assembly (clang, -O0):
<kb_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kb_destroy>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.keyBundle = type { i32 }
define void @kb_destroy(%struct.keyBundle* %0) {
%2 = alloca %struct.keyBundle*
store %struct.keyBundle* %0, %struct.keyBundle** %2
%3 = load %struct.keyBundle*, %struct.keyBundle** %2
%4 = icmp ne %struct.keyBundle* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load %struct.keyBundle*, %struct.keyBundle** %2
%8 = call i32 @free(%struct.keyBundle* %7)
ret void
}

LLVM IR (-O2):
%struct.keyBundle = type { i32 }
define void @kb_destroy(%struct.keyBundle* %0) {
%2 = icmp ne %struct.keyBundle* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @free(%struct.keyBundle* %0)
ret void
}
int secure_storage_nand_write(char *buf, unsigned int len) { return -1; }


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

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

LLVM IR (-O0):
define i32 @secure_storage_nand_write(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i32 -1
}

LLVM IR (-O2):
define i32 @secure_storage_nand_write(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
int f2(int y, int x) {
  int a = x | y;
  return x & a;
}


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

x86 assembly (clang, -O2):
<f2>:
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @f2(i32 %0, i32 returned %1) {
ret i32 %1
}
int ft_isupper(int c) { return ('A' <= c && c <= 'Z'); }


x86 assembly (clang, -O0):
<ft_isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x41,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1124 <ft_isupper+0x24>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 65, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ft_isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_6Auint16_mem(unsigned short *val) {
  return ((*val) & (0x6A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Auint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 106
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ call_drv_get_status(unsigned long *, unsigned long *,
                                       unsigned long *);
int /*<<< orphan*/ read_from_proc_sbsa_msg();
int call_drv_wait_for_completion() {
  unsigned long int arg0, arg1, arg2;
  arg0 = 0x40000000;
  while (arg0 == 0x40000000) {
    call_drv_get_status(&arg0, &arg1, &arg2);
    read_from_proc_sbsa_msg();
  }
  return arg1;
}


x86 assembly (clang, -O0):
<call_drv_wait_for_completion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x40000000,-0x8(%rbp)
40
cmpq   $0x40000000,-0x8(%rbp)
40
jne    115b <call_drv_wait_for_completion+0x3b>
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <call_drv_get_status@plt>
mov    $0x0,%al
call   1040 <read_from_proc_sbsa_msg@plt>
jmp    1130 <call_drv_wait_for_completion+0x10>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_drv_wait_for_completion>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
movq   $0x40000000,0x8(%rsp)
lea    0x8(%rsp),%r14
lea    0x10(%rsp),%r15
lea    0x18(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <call_drv_get_status@plt>
xor    %eax,%eax
call   1040 <read_from_proc_sbsa_msg@plt>
cmpq   $0x40000000,0x8(%rsp)
je     1150 <call_drv_wait_for_completion+0x30>
mov    0x10(%rsp),%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @call_drv_wait_for_completion() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = bitcast i64* %1 to i8*
%5 = bitcast i64* %2 to i8*
%6 = bitcast i64* %3 to i8*
store i64 1073741824, i64* %1
br label %7
7: ; preds = %0, %7
%8 = call i32 @call_drv_get_status(i64* %1, i64* %2, i64* %3)
%9 = call i32 (...) @read_from_proc_sbsa_msg()
%10 = load i64, i64* %1
%11 = icmp eq i64 %10, 1073741824
br i1 %11, label %7, label %12
12: ; preds = %7
%13 = load i64, i64* %2
%14 = trunc i64 %13 to i32
ret i32 %14
}
void ath9k_cmn_debug_stat_rx(struct ath_rx_stats *rxstats,
                             struct ath_rx_status *rs) {}


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

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

LLVM IR (-O0):
%struct.ath_rx_stats = type opaque
%struct.ath_rx_status = type opaque
define void @ath9k_cmn_debug_stat_rx(%struct.ath_rx_stats* %0, %struct.ath_rx_status* %1) {
%3 = alloca %struct.ath_rx_stats*
%4 = alloca %struct.ath_rx_status*
store %struct.ath_rx_stats* %0, %struct.ath_rx_stats** %3
store %struct.ath_rx_status* %1, %struct.ath_rx_status** %4
ret void
}

LLVM IR (-O2):
%struct.ath_rx_stats = type opaque
%struct.ath_rx_status = type opaque
define void @ath9k_cmn_debug_stat_rx(%struct.ath_rx_stats* nocapture %0, %struct.ath_rx_status* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void test_sqlite_1(void) {
  assert(0 && "ERROR: dbi:sqlite3 support not compiled in!");
}


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

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

LLVM IR (-O0):
define void @test_sqlite_1() {
%1 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @test_sqlite_1() {
%1 = tail call i32 @assert(i32 0)
ret void
}