xunge/DecIR huggingface dataset:
void sig_child(int sig) {}


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

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

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

LLVM IR (-O2):
define void @sig_child(i32 %0) {
ret void
}
double cos(double x) { return x; }


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

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

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

LLVM IR (-O2):
define double @cos(double returned %0) {
ret double %0
}
int enclave_fork() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @enclave_fork() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void r_free(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<r_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):
<r_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @r_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int ls(char *args) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ls(i8* nocapture readnone %0) {
ret i32 0
}
signed long int meat_time_offset_minutes(int const i_minutes) {
  return i_minutes;
}


x86 assembly (clang, -O0):
<meat_time_offset_minutes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<meat_time_offset_minutes>:
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @meat_time_offset_minutes(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @meat_time_offset_minutes(i32 %0) {
%2 = sext i32 %0 to i64
ret i64 %2
}
void(writeb)(unsigned char b, void volatile *addr) {
  unsigned char volatile *mem_3;
  {
    mem_3 = (unsigned char volatile *)addr;
    (*mem_3) = (unsigned char volatile)b;
    return;
  }
}


x86 assembly (clang, -O0):
<writeb>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeb>:
mov    %dil,(%rsi)
ret

LLVM IR (-O0):
define void @writeb(i8 zeroext %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** %4
store i8* %6, i8** %5
%7 = load i8, i8* %3
%8 = load i8*, i8** %5
store volatile i8 %7, i8* %8
ret void
}

LLVM IR (-O2):
define void @writeb(i8 zeroext %0, i8* %1) {
store volatile i8 %0, i8* %1
ret void
}
void func_c() {
  int i;
  for (i = 0; i < (1000 * 1000); i++) {
  }
}


x86 assembly (clang, -O0):
<func_c>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xf4240,-0x4(%rbp)
jge    112b <func_c+0x2b>
jmp    111d <func_c+0x1d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <func_c+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @func_c() {
ret void
}
char cgetc(i)
int i __attribute__((__unused__));
{ return (getchar()); }


x86 assembly (clang, -O0):
<cgetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @cgetc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getchar()
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @cgetc(i32 %0) {
%2 = tail call i32 (...) @getchar()
%3 = trunc i32 %2 to i8
ret i8 %3
}
int instr_util_shgethi(unsigned int val) {
  return (int)(short int)((val >> 16) & 0xffff);
}


x86 assembly (clang, -O0):
<instr_util_shgethi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0xffff,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<instr_util_shgethi>:
mov    %edi,%eax
sar    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @instr_util_shgethi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 16
%5 = and i32 %4, 65535
%6 = trunc i32 %5 to i16
%7 = sext i16 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @instr_util_shgethi(i32 %0) {
%2 = ashr i32 %0, 16
ret i32 %2
}
/* Variables and functions */
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *ret = malloc(size);
  if (ret == NULL)
    while (1)
      ;
  return ret;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113e <xmalloc+0x2e>
jmp    1139 <xmalloc+0x29>
jmp    1139 <xmalloc+0x29>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     1120 <xmalloc+0x10>
pop    %rcx
ret
nopl   (%rax)
jmp    1120 <xmalloc+0x10>

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

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %5
4: ; preds = %1, %4
br label %4
5: ; preds = %1
ret i8* %2
}
unsigned int foo(void) {
  unsigned int a = 0;
  unsigned int b;
  asm volatile("" : "=r"(b) : "0"(0));
  a += b;
  asm volatile("" : "=r"(b) : "0"(0));
  a += b;
  asm volatile("" : "=r"(b) : "0"(0));
  a += b;
  asm volatile("" : "=r"(b) : "0"(0));
  a += b;
  return a;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
xor    %ecx,%ecx
xor    %edx,%edx
add    %ecx,%edx
xor    %ecx,%ecx
add    %edx,%ecx
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 asm sideeffect "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 0)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %1
%6 = add i32 %5, %4
store i32 %6, i32* %1
%7 = call i32 asm sideeffect "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 0)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %1
%10 = add i32 %9, %8
store i32 %10, i32* %1
%11 = call i32 asm sideeffect "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 0)
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = load i32, i32* %1
%14 = add i32 %13, %12
store i32 %14, i32* %1
%15 = call i32 asm sideeffect "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 0)
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = load i32, i32* %1
%18 = add i32 %17, %16
store i32 %18, i32* %1
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 asm sideeffect "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 0)
%2 = tail call i32 asm sideeffect "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 0)
%3 = add i32 %2, %1
%4 = tail call i32 asm sideeffect "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 0)
%5 = add i32 %3, %4
%6 = tail call i32 asm sideeffect "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 0)
%7 = add i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) { fprintf(stderr, "Usage: %% %s <number>", prog); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Usage: %% %s <number>\00"
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 ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Usage: %% %s <number>\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void prune_alias_gt_Ok(int x) {
  int a[1];
  if (x > x) {
    a[1] = 0;
  }
}


x86 assembly (clang, -O0):
<prune_alias_gt_Ok>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    111a <prune_alias_gt_Ok+0x1a>
movl   $0x0,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @prune_alias_gt_Ok(i32 %0) {
%2 = alloca i32
%3 = alloca [1 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = icmp sgt i32 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 1
store i32 0, i32* %8
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @prune_alias_gt_Ok(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
struct passwd {
  char *pw_name;
};

/* Variables and functions */
struct passwd *getpwuid(int /*<<< orphan*/);
char *get_user_name(uid_t uid) {
  struct passwd *pw = getpwuid(uid);
  if (!pw)
    return "?";
  return pw->pw_name;
}


x86 assembly (clang, -O0):
<get_user_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1142 <get_user_name+0x32>
lea    0xec7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114d <get_user_name+0x3d>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_user_name>:
push   %rax
call   1030 <getpwuid@plt>
test   %rax,%rax
je     1120 <get_user_name+0x10>
mov    (%rax),%rax
pop    %rcx
ret
lea    0xed9(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i8* }
@.str = [2 x i8] c"?\00"
define i8* @get_user_name(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.passwd*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call %struct.passwd* @getpwuid(i32 %5)
store %struct.passwd* %6, %struct.passwd** %4
%7 = load %struct.passwd*, %struct.passwd** %4
%8 = icmp ne %struct.passwd* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2
br label %14
10: ; preds = %1
%11 = load %struct.passwd*, %struct.passwd** %4
%12 = getelementptr inbounds %struct.passwd, %struct.passwd* %11, i32 0, i32 0
%13 = load i8*, i8** %12
store i8* %13, i8** %2
br label %14
14: ; preds = %10, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
@.str = [2 x i8] c"?\00"
define i8* @get_user_name(i32 %0) {
%2 = tail call %struct.passwd* @getpwuid(i32 %0)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%6 = load i8*, i8** %5
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %8
}
void exch(int *a, int *b) {
  int p = *a;
  *a = *b;
  *b = p;
}


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

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

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

LLVM IR (-O2):
define void @exch(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int /*<<< orphan*/, int);
int /*<<< orphan*/ flipdd(int);
void flipdd_test(void **state) {
  assert_int_equal(flipdd(0x0101010101010101ul), 0x00000000000000FFul);
  assert_int_equal(flipdd(0x0202020202020202ul), 0x000000000000FF00ul);
}


x86 assembly (clang, -O0):
<flipdd_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1010101,%edi
call   1040 <flipdd@plt>
mov    %eax,%edi
mov    $0xff,%esi
call   1030 <assert_int_equal@plt>
mov    $0x2020202,%edi
call   1040 <flipdd@plt>
mov    %eax,%edi
mov    $0xff00,%esi
call   1030 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flipdd_test>:
push   %rax
mov    $0x1010101,%edi
call   1040 <flipdd@plt>
mov    %eax,%edi
mov    $0xff,%esi
call   1030 <assert_int_equal@plt>
mov    $0x2020202,%edi
call   1040 <flipdd@plt>
mov    %eax,%edi
mov    $0xff00,%esi
pop    %rax
jmp    1030 <assert_int_equal@plt>

LLVM IR (-O0):
define void @flipdd_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @flipdd(i32 16843009)
%4 = call i32 @assert_int_equal(i32 %3, i32 255)
%5 = call i32 @flipdd(i32 33686018)
%6 = call i32 @assert_int_equal(i32 %5, i32 65280)
ret void
}

LLVM IR (-O2):
define void @flipdd_test(i8** nocapture readnone %0) {
%2 = tail call i32 @flipdd(i32 16843009)
%3 = tail call i32 @assert_int_equal(i32 %2, i32 255)
%4 = tail call i32 @flipdd(i32 33686018)
%5 = tail call i32 @assert_int_equal(i32 %4, i32 65280)
ret void
}
void foo806(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo806(i32 %0) {
ret void
}
/* Variables and functions */
char *b64enc_buf(char const *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strlen(char const *);
extern char *b64enc(const char *message, int nonl) {
  return b64enc_buf(message, strlen(message), nonl);
}


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

x86 assembly (clang, -O2):
<b64enc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <b64enc_buf@plt>

LLVM IR (-O0):
define i8* @b64enc(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 i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = load i32, i32* %4
%9 = call i8* @b64enc_buf(i8* %5, i32 %7, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @b64enc(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i8* @b64enc_buf(i8* %0, i32 %3, i32 %1)
ret i8* %4
}
int random(void) { return 0xdead; }


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

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

LLVM IR (-O0):
define i32 @random() {
ret i32 57005
}

LLVM IR (-O2):
define i32 @random() {
ret i32 57005
}
/* Variables and functions */
int /*<<< orphan*/ get_curr_thread_env();
int /*<<< orphan*/ yield_env(int /*<<< orphan*/);
void coroutine_yield_context() { yield_env(get_curr_thread_env()); }


x86 assembly (clang, -O0):
<coroutine_yield_context>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_curr_thread_env@plt>
mov    %eax,%edi
call   1040 <yield_env@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<coroutine_yield_context>:
push   %rax
xor    %eax,%eax
call   1030 <get_curr_thread_env@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <yield_env@plt>

LLVM IR (-O0):
define void @coroutine_yield_context() {
%1 = call i32 (...) @get_curr_thread_env()
%2 = call i32 @yield_env(i32 %1)
ret void
}

LLVM IR (-O2):
define void @coroutine_yield_context() {
%1 = tail call i32 (...) @get_curr_thread_env()
%2 = tail call i32 @yield_env(i32 %1)
ret void
}
int first_space(char *str) {
  int ctr = 0;
  while (str && str[ctr] != ' ') {
    ctr++;
  }
  return ctr;
}


x86 assembly (clang, -O0):
<first_space>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1134 <first_space+0x34>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1144 <first_space+0x44>
jmp    1152 <first_space+0x52>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <first_space+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_space>:
test   %rdi,%rdi
je     111d <first_space+0x1d>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x20,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <first_space+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @first_space(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 32
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  {
    state[0UL] = input[0UL] + 1373777115U;
    local1 = 0UL;
    while (local1 < 0U) {
      state[local1] = state[0UL] & state[local1];
      local1++;
    }
    output[0UL] = (state[0UL] << 13U) | (state[0UL] >> 19U);
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x51e22cdb,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jae    114a <RandomFunc+0x4a>
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%eax
and    -0x14(%rbp,%rax,4),%ecx
mov    -0x18(%rbp),%eax
mov    %ecx,-0x14(%rbp,%rax,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1121 <RandomFunc+0x21>
mov    -0x14(%rbp),%ecx
shl    $0xd,%ecx
mov    -0x14(%rbp),%eax
shr    $0x13,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0x51e22cdb,%eax
add    (%rdi),%eax
rol    $0xd,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = add i32 %9, 1373777115
%11 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %10, i32* %11
store i32 0, i32* %6
br label %12
12: ; preds = %15, %2
%13 = load i32, i32* %6
%14 = icmp ult i32 %13, 0
br i1 %14, label %15, label %28
15: ; preds = %12
%16 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%17 = load i32, i32* %16
%18 = load i32, i32* %6
%19 = zext i32 %18 to i64
%20 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = and i32 %17, %21
%23 = load i32, i32* %6
%24 = zext i32 %23 to i64
%25 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %24
store i32 %22, i32* %25
%26 = load i32, i32* %6
%27 = add i32 %26, 1
store i32 %27, i32* %6
br label %12
28: ; preds = %12
%29 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%30 = load i32, i32* %29
%31 = shl i32 %30, 13
%32 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%33 = load i32, i32* %32
%34 = lshr i32 %33, 19
%35 = or i32 %31, %34
%36 = load i32*, i32** %4
%37 = getelementptr inbounds i32, i32* %36, i64 0
store i32 %35, i32* %37
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = add i32 %3, 1373777115
%5 = tail call i32 @llvm.fshl.i32(i32 %4, i32 %4, i32 13)
store i32 %5, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void uninivar_printf(void) {
  char *format;
  int i;
  (void)printf("x");
  (void)printf(format, i);
  (void)printf(format, 1);
}


x86 assembly (clang, -O0):
<uninivar_printf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninivar_printf>:
push   %rax
mov    $0x78,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%esi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
define void @uninivar_printf() {
%1 = tail call i32 @putchar(i32 120)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) undef, i32 undef)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) undef, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
void readRefreshRateSetPacket(uint8_t *data, uint16_t *refresh_rate) {
  (*refresh_rate) = ntohs(*((uint16_t *)(data + 1)));
}


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

x86 assembly (clang, -O2):
<readRefreshRateSetPacket>:
push   %rbx
mov    %rsi,%rbx
mov    0x4(%rdi),%edi
call   1030 <ntohs@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @readRefreshRateSetPacket(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 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %6
%8 = call i32 @ntohs(i32 %7)
%9 = load i32*, i32** %4
store i32 %8, i32* %9
ret void
}

LLVM IR (-O2):
define void @readRefreshRateSetPacket(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = tail call i32 @ntohs(i32 %4)
store i32 %5, i32* %1
ret void
}
/* Variables and functions */
int check(char *);
int /*<<< orphan*/ printf(char *);
int main(int ac, char **av) {
  int ret;
  if (ac != 2)
    return -1;
  ret = check(av[1]);
  if (ret == 0)
    printf("Win\n");
  else
    printf("fail\n");
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     114c <main+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1189 <main+0x69>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <check@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1177 <main+0x57>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
jmp    1183 <main+0x63>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffffff,%ebx
cmp    $0x2,%edi
jne    114f <main+0x2f>
mov    0x8(%rsi),%rdi
call   1040 <check@plt>
mov    %eax,%ebx
test   %eax,%eax
lea    0xec6(%rip),%rax
lea    0xeba(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"Win\0A\00"
@.str.1 = [6 x i8] c"fail\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %23
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @check(i8* %13)
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %10
%18 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %21
19: ; preds = %10
%20 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %19, %17
%22 = load i32, i32* %6
store i32 %22, i32* %3
br label %23
23: ; preds = %21, %9
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@str = [5 x i8] c"fail\00"
@str.2 = [4 x i8] c"Win\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @check(i8* %6)
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0)
%10 = tail call i32 @puts(i8* dereferenceable(1) %9)
br label %11
11: ; preds = %4, %2
%12 = phi i32 [ -1, %2 ], [ %7, %4 ]
ret i32 %12
}
void ASN1_TIME_to_generalizedtime(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_TIME_to_generalizedtime() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_help(void) {
  puts("\n"
       "usage:\n"
       "svz <if-stmt> [do <do-stmt> [else <else-stmt>]] [-- stmt ..]\n"
       "\n"
       "This is the grammar:\n"
       "\n"
       "  if-stmt   := stmt\n"
       "  do-stmt   := stmt\n"
       "  else-stmt := stmt\n"
       "\n"
       "\n"
       "  stmt := { stmt }\n"
       "  stmt |= stmt and stmt\n"
       "  stmt |= stmt or stmt\n"
       "  stmt |= -<function>\n"
       "\n"
       "  available <function>s are:\n"
       "  pid <argument>\n"
       "    TRUE if <argument> is an existing pid, otherwise FALSE\n"
       "\n"
       "  echo <argument> [<argument 2> [..]] $\n"
       "    Echoes all arguments, is always TRUE.\n"
       "\n"
       "  exec <path> [<argument> [<argument 2> [..]]] $\n"
       "    Executes <path> with argument list. Is TRUE if execution returns "
       "status 0, otherwise FALSE.\n");
}


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

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

LLVM IR (-O0):
@.str = [578 x i8] c"\0Ausage:\0Asvz <if-stmt> [do <do-stmt> [else <else-stmt>]] [-- stmt ..]\0A\0AThis is the grammar:\0A\0A if-stmt := stmt\0A do-stmt := stmt\0A else-stmt := stmt\0A\0A\0A stmt := { stmt }\0A stmt |= stmt and stmt\0A stmt |= stmt or stmt\0A stmt |= -<function>\0A\0A available <function>s are:\0A pid <argument>\0A TRUE if <argument> is an existing pid, otherwise FALSE\0A\0A echo <argument> [<argument 2> [..]] $\0A Echoes all arguments, is always TRUE.\0A\0A exec <path> [<argument> [<argument 2> [..]]] $\0A Executes <path> with argument list. Is TRUE if execution returns status 0, otherwise FALSE.\0A\00"
define void @print_help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([578 x i8], [578 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [578 x i8] c"\0Ausage:\0Asvz <if-stmt> [do <do-stmt> [else <else-stmt>]] [-- stmt ..]\0A\0AThis is the grammar:\0A\0A if-stmt := stmt\0A do-stmt := stmt\0A else-stmt := stmt\0A\0A\0A stmt := { stmt }\0A stmt |= stmt and stmt\0A stmt |= stmt or stmt\0A stmt |= -<function>\0A\0A available <function>s are:\0A pid <argument>\0A TRUE if <argument> is an existing pid, otherwise FALSE\0A\0A echo <argument> [<argument 2> [..]] $\0A Echoes all arguments, is always TRUE.\0A\0A exec <path> [<argument> [<argument 2> [..]]] $\0A Executes <path> with argument list. Is TRUE if execution returns status 0, otherwise FALSE.\0A\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([578 x i8], [578 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_cmp();
int /*<<< orphan*/ e_izpy();
void e_cmp_izpy() {
  e_izpy();
  e_cmp();
}


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

x86 assembly (clang, -O2):
<e_cmp_izpy>:
push   %rax
xor    %eax,%eax
call   1030 <e_izpy@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <e_cmp@plt>

LLVM IR (-O0):
define void @e_cmp_izpy() {
%1 = call i32 (...) @e_izpy()
%2 = call i32 (...) @e_cmp()
ret void
}

LLVM IR (-O2):
define void @e_cmp_izpy() {
%1 = tail call i32 (...) @e_izpy()
%2 = tail call i32 (...) @e_cmp()
ret void
}
void I422ToRGB24Row_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @I422ToRGB24Row_SSSE3() {
ret void
}
void RTStrToInt32Full(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrToInt32Full() {
ret void
}
/* Variables and functions */
int bitn(int, int);
int fa(unsigned int i) { return bitn(0x2C79, (int)i); }


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

x86 assembly (clang, -O2):
<fa>:
mov    %edi,%esi
mov    $0x2c79,%edi
jmp    1030 <bitn@plt>

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

LLVM IR (-O2):
define i32 @fa(i32 %0) {
%2 = tail call i32 @bitn(i32 11385, i32 %0)
ret i32 %2
}
void add_to_swapped_list(struct page *__unused) {}


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

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

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

LLVM IR (-O2):
%struct.page = type opaque
define void @add_to_swapped_list(%struct.page* nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef unsigned long long uint64_t;

/* Variables and functions */
uint64_t be32_lget(const uint8_t *addr) {
  uint64_t val = 0;
  val += ((unsigned long long)(addr[0]) << ((3) * 8));
  val += ((unsigned long long)(addr[1]) << ((2) * 8));
  val += ((unsigned long long)(addr[2]) << ((1) * 8));
  val += ((unsigned long long)(addr[3]) << ((0) * 8));
  return val;
}


x86 assembly (clang, -O0):
<be32_lget>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x18,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
shl    $0x10,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
shl    $0x8,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
shl    $0x0,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<be32_lget>:
mov    (%rdi),%rax
mov    0x8(%rdi),%rcx
shl    $0x18,%rax
shl    $0x10,%rcx
add    %rax,%rcx
mov    0x10(%rdi),%rax
shl    $0x8,%rax
add    %rcx,%rax
add    0x18(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @be32_lget(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
store i64* %0, i64** %2
store i64 0, i64* %3
%4 = load i64*, i64** %2
%5 = getelementptr inbounds i64, i64* %4, i64 0
%6 = load i64, i64* %5
%7 = shl i64 %6, 24
%8 = load i64, i64* %3
%9 = add i64 %8, %7
store i64 %9, i64* %3
%10 = load i64*, i64** %2
%11 = getelementptr inbounds i64, i64* %10, i64 1
%12 = load i64, i64* %11
%13 = shl i64 %12, 16
%14 = load i64, i64* %3
%15 = add i64 %14, %13
store i64 %15, i64* %3
%16 = load i64*, i64** %2
%17 = getelementptr inbounds i64, i64* %16, i64 2
%18 = load i64, i64* %17
%19 = shl i64 %18, 8
%20 = load i64, i64* %3
%21 = add i64 %20, %19
store i64 %21, i64* %3
%22 = load i64*, i64** %2
%23 = getelementptr inbounds i64, i64* %22, i64 3
%24 = load i64, i64* %23
%25 = shl i64 %24, 0
%26 = load i64, i64* %3
%27 = add i64 %26, %25
store i64 %27, i64* %3
%28 = load i64, i64* %3
ret i64 %28
}

LLVM IR (-O2):
define i64 @be32_lget(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = shl i64 %2, 24
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = shl i64 %5, 16
%7 = add i64 %6, %3
%8 = getelementptr inbounds i64, i64* %0, i64 2
%9 = load i64, i64* %8
%10 = shl i64 %9, 8
%11 = add i64 %7, %10
%12 = getelementptr inbounds i64, i64* %0, i64 3
%13 = load i64, i64* %12
%14 = add i64 %11, %13
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned long);
void msleep(unsigned long msec) { usleep(msec * 1000); }


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

x86 assembly (clang, -O2):
<msleep>:
imul   $0x3e8,%rdi,%rdi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @msleep(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 1000
%5 = call i32 @usleep(i64 %4)
ret void
}

LLVM IR (-O2):
define void @msleep(i64 %0) {
%2 = mul i64 %0, 1000
%3 = tail call i32 @usleep(i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, ...);
void print_range(unsigned int l, unsigned int u) {
  if (l == u)
    printf("%u ", l);
  else
    printf("%u:%u ", l, u);
}


x86 assembly (clang, -O0):
<print_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1140 <print_range+0x30>
mov    -0x4(%rbp),%esi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1154 <print_range+0x44>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_range>:
mov    %esi,%edx
mov    %edi,%esi
cmp    %edx,%edi
jne    1126 <print_range+0x16>
lea    0xee4(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xed3(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%u \00"
@.str.1 = [7 x i8] c"%u:%u \00"
define void @print_range(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %8
6: ; preds = %2
%7 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %1)
br label %8
8: ; preds = %6, %4
ret void
}
void RTHeapSimpleGetHeapSize(void) {}


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

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

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

LLVM IR (-O2):
define void @RTHeapSimpleGetHeapSize() {
ret void
}
int powerTwo(int x) {
  int ris;
  if (x == 0)
    ris = 1;
  else
    ris = powerTwo(x - 1) * 2;
  return ris;
}


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

x86 assembly (clang, -O2):
<powerTwo>:
test   %edi,%edi
je     1124 <powerTwo+0x14>
push   %rax
add    $0xffffffff,%edi
call   1030 <powerTwo@plt>
add    %eax,%eax
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @powerTwo(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %8, %5 ], [ 1, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i32 @powerTwo(i32 %6)
%8 = shl nsw i32 %7, 1
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ uart_putc(int /*<<< orphan*/);
void uart_puts(char *s) {
  while (*s)
    uart_putc(*s++);
}


x86 assembly (clang, -O0):
<uart_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <uart_puts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <uart_putc@plt>
jmp    111c <uart_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @uart_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @uart_putc(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello world.\n");
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [13 x i8] c"hello world.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_usage(const char *name) { printf("Usage: %s firmware\n", name); }


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

x86 assembly (clang, -O2):
<print_usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [20 x i8] c"Usage: %s firmware\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void do_process_task(void (*task_loop)(void)) { task_loop(); }


x86 assembly (clang, -O0):
<do_process_task>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_process_task>:
jmp    *%rdi

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

LLVM IR (-O2):
define void @do_process_task(void ()* nocapture %0) {
tail call void %0()
ret void
}
/* Variables and functions */
int htonl(int);
int send(int, char *, int, int /*<<< orphan*/);
int sendInteger(int socketfd, int toSend) {
  toSend = htonl(toSend);
  return send(socketfd, (char *)&toSend, sizeof(int), 0);
}


x86 assembly (clang, -O0):
<sendInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <htonl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendInteger>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %esi,%edi
call   1040 <htonl@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %ebx,%edi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sendInteger(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 = call i32 @htonl(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %3
%8 = bitcast i32* %4 to i8*
%9 = call i32 @send(i32 %7, i8* %8, i32 4, i32 0)
ret i32 %9
}

LLVM IR (-O2):
define i32 @sendInteger(i32 %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @htonl(i32 %1)
store i32 %4, i32* %3
%5 = bitcast i32* %3 to i8*
%6 = call i32 @send(i32 %0, i8* %5, i32 4, i32 0)
ret i32 %6
}