xunge/DecIR huggingface dataset:
/* Variables and functions */
int PATH_MAX;
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ getcwd(char *, int);
void get_full_path(char *out_path, char *rel_path) {
  char tmp[PATH_MAX];
  getcwd(tmp, PATH_MAX);
  chdir(rel_path);
  getcwd(out_path, PATH_MAX);
  chdir(tmp);
}


x86 assembly (clang, -O0):
<get_full_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x28(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%esi
call   1040 <getcwd@plt>
mov    -0x10(%rbp),%rdi
call   1030 <chdir@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e72(%rip),%rax
mov    (%rax),%esi
call   1040 <getcwd@plt>
mov    -0x28(%rbp),%rdi
call   1030 <chdir@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_full_path>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    0x2eb8(%rip),%r12
mov    (%r12),%esi
mov    %rsp,%rbx
mov    %rsi,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1040 <getcwd@plt>
mov    %r15,%rdi
call   1030 <chdir@plt>
mov    (%r12),%esi
mov    %r14,%rdi
call   1040 <getcwd@plt>
mov    %rbx,%rdi
call   1030 <chdir@plt>
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@PATH_MAX = global i32 0
define void @get_full_path(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i32, i32* @PATH_MAX
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca i8, i64 %8
store i64 %8, i64* %6
%11 = load i32, i32* @PATH_MAX
%12 = call i32 @getcwd(i8* %10, i32 %11)
%13 = load i8*, i8** %4
%14 = call i32 @chdir(i8* %13)
%15 = load i8*, i8** %3
%16 = load i32, i32* @PATH_MAX
%17 = call i32 @getcwd(i8* %15, i32 %16)
%18 = call i32 @chdir(i8* %10)
%19 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
define void @get_full_path(i8* %0, i8* %1) {
%3 = load i32, i32* @PATH_MAX
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @getcwd(i8* %5, i32 %3)
%7 = call i32 @chdir(i8* %1)
%8 = load i32, i32* @PATH_MAX
%9 = call i32 @getcwd(i8* %0, i32 %8)
%10 = call i32 @chdir(i8* %5)
ret void
}
double reduc(x)
double x;
{
  double t;
  double ldexp(), floor();
  t = ldexp(x, 4);
  t = floor(t);
  t = ldexp(t, -4);
  return (t);
}


x86 assembly (clang, -O0):
<reduc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x4,%edi
call   1030 <ldexp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0xfffffffc,%edi
call   1030 <ldexp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reduc>:
push   %rax
mov    $0x4,%edi
call   1030 <ldexp@plt>
call   1040 <floor@plt>
mov    $0xfffffffc,%edi
pop    %rax
jmp    1030 <ldexp@plt>

LLVM IR (-O0):
define double @reduc(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @ldexp(double %4, i32 4)
store double %5, double* %3
%6 = load double, double* %3
%7 = call double @llvm.floor.f64(double %6)
store double %7, double* %3
%8 = load double, double* %3
%9 = call double @ldexp(double %8, i32 -4)
store double %9, double* %3
%10 = load double, double* %3
ret double %10
}

LLVM IR (-O2):
define double @reduc(double %0) {
%2 = tail call double @ldexp(double %0, i32 4)
%3 = tail call double @llvm.floor.f64(double %2)
%4 = tail call double @ldexp(double %3, i32 -4)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __setpgid(int pid, int pgid) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__setpgid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__setpgid>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__setpgid(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__setpgid(i32 %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
int empty_c() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @empty_c() {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int hsp_subevent_hs_command_get_value_length(const uint8_t *event) {
  return event[3];
}


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

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

LLVM IR (-O0):
define i32 @hsp_subevent_hs_command_get_value_length(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hsp_subevent_hs_command_get_value_length(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
void __longjmp14(jmp_buf env, int val) {}


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

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

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

LLVM IR (-O2):
define void @__longjmp14(i32 %0, i32 %1) {
ret void
}
void power_init(void) {}


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

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

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

LLVM IR (-O2):
define void @power_init() {
ret void
}
void telldusClose() {}


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

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

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

LLVM IR (-O2):
define void @telldusClose() {
ret void
}
int btrfs_run_sanity_tests(void) { return 0; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ stat(char *, struct stat *);
int fexists(char *path) {
  struct stat sb;
  return !stat(path, &sb);
}


x86 assembly (clang, -O0):
<fexists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fexists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fexists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void asn1_do_lock(void) {}


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

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

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

LLVM IR (-O2):
define void @asn1_do_lock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(int *, int *, int);
void memmove_good3() {
  int arr1[10];
  int arr2[20];
  memmove(arr2, arr1, 20);
}


x86 assembly (clang, -O0):
<memmove_good3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x80(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x14,%edx
call   1030 <memmove@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memmove_good3>:
sub    $0x88,%rsp
lea    0x30(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x14,%edx
call   1030 <memmove@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
define void @memmove_good3() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = call i32 @memmove(i32* %3, i32* %4, i32 20)
ret void
}

LLVM IR (-O2):
define void @memmove_good3() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [20 x i32]* %2 to i8*
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = call i32 @memmove(i32* %5, i32* %6, i32 20)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x6a() {
  Assert_real((isbdigit(106) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              535, ("isbdigit should be 0 for j"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0x6a>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6a,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x217,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0x6a>:
push   %rax
mov    $0x6a,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x217,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for j\00"
define void @t_isbdigit_0x6a() {
%1 = call i64 @isbdigit(i32 106)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 535, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for j\00"
define void @t_isbdigit_0x6a() {
%1 = tail call i64 @isbdigit(i32 106)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 535, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int fl_fwrite(unsigned char *, int, int, void *);
int fl_fputc(int c, void *f) {
  unsigned char data = (unsigned char)c;
  int res;
  res = fl_fwrite(&data, 1, 1, f);
  if (res == 1)
    return c;
  else
    return res;
}


x86 assembly (clang, -O0):
<fl_fputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x11(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fl_fwrite@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
jne    1151 <fl_fputc+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <fl_fputc+0x47>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fl_fputc>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rcx
mov    %edi,%ebx
mov    %bl,0xf(%rsp)
lea    0xf(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fl_fwrite@plt>
cmp    $0x1,%eax
cmove  %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fl_fputc(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
%8 = load i32, i32* %4
%9 = trunc i32 %8 to i8
store i8 %9, i8* %6
%10 = load i8*, i8** %5
%11 = call i32 @fl_fwrite(i8* %6, i32 1, i32 1, i8* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = load i32, i32* %4
store i32 %15, i32* %3
br label %18
16: ; preds = %2
%17 = load i32, i32* %7
store i32 %17, i32* %3
br label %18
18: ; preds = %16, %14
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @fl_fputc(i32 %0, i8* %1) {
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = call i32 @fl_fwrite(i8* %3, i32 1, i32 1, i8* %1)
%6 = icmp eq i32 %5, 1
%7 = select i1 %6, i32 %0, i32 %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
void err(char *msg) {
  fflush(NULL);
  printf(msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <fflush@plt>
mov    -0x8(%rbp),%rdi
call   1030 <printf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<err>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <fflush@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @fflush(i32* null)
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @err(i8* nocapture %0) {
%2 = tail call i32 @fflush(i32* null)
%3 = tail call i32 @printf(i8* dereferenceable(1) %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
float *mat4_assign_mat2(float *result, float *m) {
  result[0] = m[0];
  result[1] = m[1];
  result[4] = m[2];
  result[5] = m[3];
  return result;
}


x86 assembly (clang, -O0):
<mat4_assign_mat2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x14(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat4_assign_mat2>:
mov    %rdi,%rax
movss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
movss  %xmm0,0x10(%rdi)
movss  0xc(%rsi),%xmm0
movss  %xmm0,0x14(%rdi)
ret

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

LLVM IR (-O2):
define float* @mat4_assign_mat2(float* returned writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
store float %3, float* %0
%4 = getelementptr inbounds float, float* %1, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %0, i64 1
store float %5, float* %6
%7 = getelementptr inbounds float, float* %1, i64 2
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %0, i64 4
store float %8, float* %9
%10 = getelementptr inbounds float, float* %1, i64 3
%11 = load float, float* %10
%12 = getelementptr inbounds float, float* %0, i64 5
store float %11, float* %12
ret float* %0
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void test_invalid_clause() {
  int i;
#pragma omp parallel
#pragma omp sections foo bar
  {
    foo();
#pragma omp section nowait
    ;
  }
}


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

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

LLVM IR (-O0):
define void @test_invalid_clause() {
%1 = alloca i32
%2 = call i32 (...) @foo()
ret void
}

LLVM IR (-O2):
define void @test_invalid_clause() {
%1 = tail call i32 (...) @foo()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_eq(int, int);
void test_assert_eq_int_fail(void) {
  int x = 3;
  int y = 6;
  assert_eq(x, y / 3);
}


x86 assembly (clang, -O0):
<test_assert_eq_int_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1030 <assert_eq@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_assert_eq_int_fail>:
mov    $0x3,%edi
mov    $0x2,%esi
jmp    1030 <assert_eq@plt>

LLVM IR (-O0):
define void @test_assert_eq_int_fail() {
%1 = alloca i32
%2 = alloca i32
store i32 3, i32* %1
store i32 6, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 3
%6 = call i32 @assert_eq(i32 %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @test_assert_eq_int_fail() {
%1 = tail call i32 @assert_eq(i32 3, i32 2)
ret void
}
int length_before_newline(char *str) {
  int i;
  i = 0;
  while (str[i] != '\n' && str[i] != '\0')
    ++i;
  return (i);
}


x86 assembly (clang, -O0):
<length_before_newline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0xd(%rbp)
je     113e <length_before_newline+0x3e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114e <length_before_newline+0x4e>
jmp    115c <length_before_newline+0x5c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <length_before_newline+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length_before_newline>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1123 <length_before_newline+0x23>
cmp    $0xa,%cl
je     1123 <length_before_newline+0x23>
add    $0x1,%rax
jmp    1110 <length_before_newline+0x10>
ret

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

LLVM IR (-O2):
define i32 @length_before_newline(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i64 [ %7, %6 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 10, label %8
i8 0, label %8
]
6: ; preds = %2
%7 = add nuw i64 %3, 1
br label %2
8: ; preds = %2, %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
void arch_halt() {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<arch_halt>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <arch_halt+0x9>
jmp    1109 <arch_halt+0x9>

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

LLVM IR (-O0):
define void @arch_halt() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @arch_halt() {
br label %1
1: ; preds = %1, %0
br label %1
}
int bbdn_docexist(int socketha, char subname[], char documenturi[],
                  unsigned int lastmodified) {
  return 0;
}


x86 assembly (clang, -O0):
<bbdn_docexist>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @bbdn_docexist(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ factorial(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
int main(void) {
  int num;
  printf("Dame el numero para analizar \n");
  scanf("%d", &num);
  factorial(num);
  system("PAUSE");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1050 <printf@plt>
lea    0xec4(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1030 <factorial@plt>
lea    0xeaf(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <factorial@plt>
lea    0xe95(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Dame el numero para analizar \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @factorial(i32 %4)
%6 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [6 x i8] c"PAUSE\00"
@str = [30 x i8] c"Dame el numero para analizar \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @factorial(i32 %5)
%7 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __rcu_read_lock();
__attribute__((always_)) void rcu_read_lock(void) {
  __rcu_read_lock();
  (void)0;
  do {
  } while (0);
}


x86 assembly (clang, -O0):
<rcu_read_lock>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <__rcu_read_lock@plt>
jmp    1120 <rcu_read_lock+0x10>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rcu_read_lock() {
%1 = call i32 (...) @__rcu_read_lock()
br label %2
2: ; preds = %0
br label %3
3: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @rcu_read_lock() {
%1 = tail call i32 (...) @__rcu_read_lock()
ret void
}
void foo(char *p) {
  long unsigned int s = ~(long unsigned int)0;
  *p = 0;
  __builtin_memset(p + 1, 0, s);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @foo(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 -1, i64* %3
%4 = load i8*, i8** %2
store i8 0, i8* %4
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i64, i64* %3
ret void
}

LLVM IR (-O2):
define void @foo(i8* nocapture writeonly %0) {
store i8 0, i8* %0
ret void
}
int match(s1, s2)
register char *s1, *s2;
{
  while (*s2 != 0) {
    if (*s1++ != *s2++)
      return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1159 <match+0x59>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1154 <match+0x54>
movl   $0x0,-0x4(%rbp)
jmp    1160 <match+0x60>
jmp    110c <match+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
test   %cl,%cl
je     1127 <match+0x27>
lea    0x1(%rax),%rdx
cmp    %cl,(%rdi,%rax,1)
mov    %rdx,%rax
je     1110 <match+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @match(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %9, %8 ]
%5 = phi i8* [ %1, %2 ], [ %11, %8 ]
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = load i8, i8* %4
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = icmp eq i8 %10, %6
br i1 %12, label %3, label %13
13: ; preds = %3, %8
%14 = phi i32 [ 0, %8 ], [ 1, %3 ]
ret i32 %14
}
int MUSIC_SongPlaying(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @MUSIC_SongPlaying() {
ret i32 0
}
int get_internal_parallelism(void) { return 32; }


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

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

LLVM IR (-O0):
define i32 @get_internal_parallelism() {
ret i32 32
}

LLVM IR (-O2):
define i32 @get_internal_parallelism() {
ret i32 32
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ BUFSIZ;
int /*<<< orphan*/ _IOFBF;
int /*<<< orphan*/ _IONBF;
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void setbuf(FILE *stream, char *buf) {
  (void)setvbuf(stream, buf, buf != NULL ? _IOFBF : _IONBF, BUFSIZ);
}


x86 assembly (clang, -O0):
<setbuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114c <setbuf+0x3c>
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
jmp    1158 <setbuf+0x48>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    0x2e6e(%rip),%rax
mov    (%rax),%ecx
call   1030 <setvbuf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbuf>:
test   %rsi,%rsi
jne    111e <setbuf+0xe>
mov    0x2ecc(%rip),%rax
jmp    1125 <setbuf+0x15>
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
mov    0x2eaa(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <setvbuf@plt>

LLVM IR (-O0):
@_IOFBF = global i32 0
@_IONBF = global i32 0
@BUFSIZ = global i32 0
define void @setbuf(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* @_IOFBF
br label %13
11: ; preds = %2
%12 = load i32, i32* @_IONBF
br label %13
13: ; preds = %11, %9
%14 = phi i32 [ %10, %9 ], [ %12, %11 ]
%15 = load i32, i32* @BUFSIZ
%16 = call i32 @setvbuf(i32* %5, i8* %6, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
@_IOFBF = global i32 0
@_IONBF = global i32 0
@BUFSIZ = global i32 0
define void @setbuf(i32* nocapture %0, i8* %1) {
%3 = icmp eq i8* %1, null
%4 = load i32, i32* @_IOFBF
%5 = load i32, i32* @_IONBF
%6 = select i1 %3, i32 %5, i32 %4
%7 = load i32, i32* @BUFSIZ
%8 = tail call i32 @setvbuf(i32* %0, i8* %1, i32 %6, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void HeapFree(void *ptr) { free(ptr); }


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

LLVM IR (-O0):
define void @HeapFree(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 @HeapFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void rop3_183_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ T;
  stk1 = S & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


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

x86 assembly (clang, -O2):
<rop3_183_1_0>:
not    %sil
or     %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_183_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %1, -1
%6 = or i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int a;
  char *x;
  x = (char *)&a;
  a = 512;
  x[0] = 1;
  x[1] = 2;
  printf("%dn", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x200,-0x14(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x1,(%rax)
mov    -0x20(%rbp),%rax
movb   $0x2,0x1(%rax)
mov    -0x14(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%dn\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast i32* %6 to i8*
store i8* %8, i8** %7
store i32 512, i32* %6
%9 = load i8*, i8** %7
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 1, i8* %10
%11 = load i8*, i8** %7
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8 2, i8* %12
%13 = load i32, i32* %6
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%dn\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 513)
ret i32 0
}
void TextDisplaySetBarText(int barnum, const char *str) {}


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

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

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

LLVM IR (-O2):
define void @TextDisplaySetBarText(i32 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("SailFish -> Ultra-Light, Ultra-Fast Web Server\n");
  printf("Usage: sailfish port\n");
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0b(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"SailFish -> Ultra-Light, Ultra-Fast Web Server\0A\00"
@.str.1 = [22 x i8] c"Usage: sailfish port\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [47 x i8] c"SailFish -> Ultra-Light, Ultra-Fast Web Server\00"
@str.2 = [21 x i8] c"Usage: sailfish port\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.2, i64 0, i64 0))
ret void
}
unsigned char b_serial_recv(void) {
  unsigned char chr;
  asm volatile("call 0x00100128" : "=a"(chr));
  return chr;
}


x86 assembly (clang, -O0):
<b_serial_recv>:
push   %rbp
mov    %rsp,%rbp
call   100128 <completed.0+0xfc108>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_serial_recv>:
call   100128 <completed.0+0xfc108>
ret

LLVM IR (-O0):
define zeroext i8 @b_serial_recv() {
%1 = alloca i8
%2 = call i8 asm sideeffect "call 0x00100128", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i8 %2, i8* %1
%3 = load i8, i8* %1
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @b_serial_recv() {
%1 = tail call i8 asm sideeffect "call 0x00100128", "={ax},~{dirflag},~{fpsr},~{flags}"()
ret i8 %1
}
int symchar(int c) {
  if ((c >= 'a') && (c <= 'z'))
    return (1);
  if ((c >= 'A') && (c <= 'Z'))
    return (1);
  if ((c >= '0') && (c <= '9'))
    return (1);
  if (c == '_')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<symchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1127 <symchar+0x27>
cmpl   $0x7a,-0x8(%rbp)
jg     1127 <symchar+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1184 <symchar+0x84>
cmpl   $0x41,-0x8(%rbp)
jl     1147 <symchar+0x47>
cmpl   $0x5a,-0x8(%rbp)
jg     1147 <symchar+0x47>
movl   $0x1,-0x4(%rbp)
jmp    1184 <symchar+0x84>
cmpl   $0x30,-0x8(%rbp)
jl     1167 <symchar+0x67>
cmpl   $0x39,-0x8(%rbp)
jg     1167 <symchar+0x67>
movl   $0x1,-0x4(%rbp)
jmp    1184 <symchar+0x84>
cmpl   $0x5f,-0x8(%rbp)
jne    117d <symchar+0x7d>
movl   $0x1,-0x4(%rbp)
jmp    1184 <symchar+0x84>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @symchar(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = add i32 %0, -48
%6 = icmp ult i32 %5, 10
%7 = or i1 %6, %4
%8 = icmp eq i32 %0, 95
%9 = or i1 %8, %7
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ PIN_INT5_DriverIRQHandler();
__attribute__((weak)) void PIN_INT5_IRQHandler(void) {
  PIN_INT5_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @PIN_INT5_IRQHandler() {
%1 = call i32 (...) @PIN_INT5_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @PIN_INT5_IRQHandler() {
%1 = tail call i32 (...) @PIN_INT5_DriverIRQHandler()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
struct sha3_ctx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cryptonite_sha3_finalize_with_pad_byte(struct sha3_ctx *,
                                                          int);
int /*<<< orphan*/ cryptonite_sha3_output(struct sha3_ctx *,
                                          int /*<<< orphan*/ *, int);
void cryptonite_sha3_finalize(struct sha3_ctx *ctx, uint32_t hashlen,
                              uint8_t *out) {
  cryptonite_sha3_finalize_with_pad_byte(ctx, 0x06);
  cryptonite_sha3_output(ctx, out, hashlen / 8);
}


x86 assembly (clang, -O0):
<cryptonite_sha3_finalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x6,%esi
call   1030 <cryptonite_sha3_finalize_with_pad_byte@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1040 <cryptonite_sha3_output@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cryptonite_sha3_finalize>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebx
mov    %rdi,%r15
mov    $0x6,%esi
call   1030 <cryptonite_sha3_finalize_with_pad_byte@plt>
lea    0x7(%rbx),%edx
test   %ebx,%ebx
cmovns %ebx,%edx
sar    $0x3,%edx
mov    %r15,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <cryptonite_sha3_output@plt>

LLVM IR (-O0):
%struct.sha3_ctx = type { i32 }
define void @cryptonite_sha3_finalize(%struct.sha3_ctx* %0, i32 %1, i32* %2) {
%4 = alloca %struct.sha3_ctx*
%5 = alloca i32
%6 = alloca i32*
store %struct.sha3_ctx* %0, %struct.sha3_ctx** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load %struct.sha3_ctx*, %struct.sha3_ctx** %4
%8 = call i32 @cryptonite_sha3_finalize_with_pad_byte(%struct.sha3_ctx* %7, i32 6)
%9 = load %struct.sha3_ctx*, %struct.sha3_ctx** %4
%10 = load i32*, i32** %6
%11 = load i32, i32* %5
%12 = sdiv i32 %11, 8
%13 = call i32 @cryptonite_sha3_output(%struct.sha3_ctx* %9, i32* %10, i32 %12)
ret void
}

LLVM IR (-O2):
%struct.sha3_ctx = type { i32 }
define void @cryptonite_sha3_finalize(%struct.sha3_ctx* %0, i32 %1, i32* %2) {
%4 = tail call i32 @cryptonite_sha3_finalize_with_pad_byte(%struct.sha3_ctx* %0, i32 6)
%5 = sdiv i32 %1, 8
%6 = tail call i32 @cryptonite_sha3_output(%struct.sha3_ctx* %0, i32* %2, i32 %5)
ret void
}
/* Variables and functions */
unsigned int round(double);
unsigned int lat2y(double lat) { return round((lat + 90.0) * 65535.0 / 180.0); }


x86 assembly (clang, -O0):
<lat2y>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec2(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <round@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lat2y>:
addsd  0xee8(%rip),%xmm0
mulsd  0xee8(%rip),%xmm0
divsd  0xee8(%rip),%xmm0
jmp    1030 <round@plt>

LLVM IR (-O0):
define i32 @lat2y(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 9.000000e+01
%5 = fmul double %4, 6.553500e+04
%6 = fdiv double %5, 1.800000e+02
%7 = call i32 @round(double %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @lat2y(double %0) {
%2 = fadd double %0, 9.000000e+01
%3 = fmul double %2, 6.553500e+04
%4 = fdiv double %3, 1.800000e+02
%5 = tail call i32 @round(double %4)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ be16toh(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void const *, int);
uint16_t unpack_from_be16(const void *v) {
  uint16_t u;
  memcpy(&u, v, sizeof(uint16_t));
  return be16toh(u);
}


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

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

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

LLVM IR (-O2):
define i32 @unpack_from_be16(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
%6 = call i32 @be16toh(i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ cgets(char *, int);
char *fgets(char *s, int bufsize, void *f) {
  cgets(s, bufsize);
  return s;
}


x86 assembly (clang, -O0):
<fgets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <cgets@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgets>:
push   %rbx
mov    %rdi,%rbx
call   1030 <cgets@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @fgets(i8* returned %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @cgets(i8* %0, i32 %1)
ret i8* %0
}