xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(int rc) {
  fprintf(stderr,
          "usage: doc_loadipl [-?hvf] [-e offset] <mtd-device> <ipl-binary>\n\n"
          "\t-v\tprint version and exit\n"
          "\t-e offset\tget ECC from sector at offset bytes\n"
          "\t-h?\tprint this usage\n"
          "\t-f\tdo not write to mtd device, out to stdout\n");
  exit(rc);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [209 x i8] c"usage: doc_loadipl [-?hvf] [-e offset] <mtd-device> <ipl-binary>\0A\0A\09-v\09print version and exit\0A\09-e offset\09get ECC from sector at offset bytes\0A\09-h?\09print this usage\0A\09-f\09do not write to mtd device, out to stdout\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([209 x i8], [209 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [209 x i8] c"usage: doc_loadipl [-?hvf] [-e offset] <mtd-device> <ipl-binary>\0A\0A\09-v\09print version and exit\0A\09-e offset\09get ECC from sector at offset bytes\0A\09-h?\09print this usage\0A\09-f\09do not write to mtd device, out to stdout\0A\00"
define void @usage(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([209 x i8], [209 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ ctime(int /*<<< orphan*/ *);
char *strdup(int /*<<< orphan*/);
size_t strlen(char *);
char *print_proc_time(time_t time) {
  char *stime;
  size_t len = 0;
  stime = strdup(ctime(&time));
  len = strlen(stime);
  if (stime[len - 1] == '\n')
    stime[len - 1] = '\0';
  return stime;
}


x86 assembly (clang, -O0):
<print_proc_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <ctime@plt>
mov    %eax,%edi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    118d <print_proc_time+0x5d>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_proc_time>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <ctime@plt>
mov    %eax,%edi
call   1050 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strlen@plt>
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1161 <print_proc_time+0x31>
movb   $0x0,-0x1(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @print_proc_time(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @ctime(i32* %2)
%4 = call i8* @strdup(i32 %3)
%5 = call i64 @strlen(i8* dereferenceable(1) %4)
%6 = add i64 %5, -1
%7 = getelementptr inbounds i8, i8* %4, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %11
10: ; preds = %1
store i8 0, i8* %7
br label %11
11: ; preds = %10, %1
ret i8* %4
}
/* Type definitions */
struct pri {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct pri *);
void __pri_free_tei(struct pri *p) { free(p); }


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

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

LLVM IR (-O2):
%struct.pri = type { i32 }
define void @__pri_free_tei(%struct.pri* nocapture %0) {
%2 = tail call i32 @free(%struct.pri* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void *thread_func(void *arg) {
  int i;
  for (i = 0; i < 120; i++)
    sleep(1);
  return NULL;
}


x86 assembly (clang, -O0):
<thread_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x78,-0xc(%rbp)
jge    1145 <thread_func+0x35>
mov    $0x1,%edi
call   1030 <sleep@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <thread_func+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_func>:
push   %rbx
mov    $0x78,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <sleep@plt>
add    $0xffffffff,%ebx
jne    1120 <thread_func+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @thread_func(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 120
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = call i32 @sleep(i32 1)
br label %9
9: ; preds = %7
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @thread_func(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %5, %2 ]
%4 = tail call i32 @sleep(i32 1)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 120
br i1 %6, label %7, label %2
7: ; preds = %2
ret i8* null
}
/* Type definitions */
struct xdp_md {
  int dummy;
};

/* Variables and functions */
int XDP_PASS;
__attribute__((section("xdp_dummy"), used)) int
xdp_dummy_prog(struct xdp_md *ctx) {
  return XDP_PASS;
}


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

x86 assembly (clang, -O2):
<xdp_dummy_prog>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.xdp_md = type { i32 }
@XDP_PASS = global i32 0
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (%struct.xdp_md*)* @xdp_dummy_prog to i8*)], section "llvm.metadata"
define i32 @xdp_dummy_prog(%struct.xdp_md* %0) section "xdp_dummy" {
%2 = alloca %struct.xdp_md*
store %struct.xdp_md* %0, %struct.xdp_md** %2
%3 = load i32, i32* @XDP_PASS
ret i32 %3
}

LLVM IR (-O2):
%struct.xdp_md = type { i32 }
@XDP_PASS = global i32 0
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (%struct.xdp_md*)* @xdp_dummy_prog to i8*)], section "llvm.metadata"
define i32 @xdp_dummy_prog(%struct.xdp_md* nocapture readnone %0) section "xdp_dummy" {
%2 = load i32, i32* @XDP_PASS
ret i32 %2
}
void rtc_sysfs_del_device(struct rtc_device *rtc) {}


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

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

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

LLVM IR (-O2):
%struct.rtc_device = type opaque
define void @rtc_sysfs_del_device(%struct.rtc_device* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dbg_break();
void gdb_arch_registers(void) { dbg_break(); }


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

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

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

LLVM IR (-O2):
define void @gdb_arch_registers() {
%1 = tail call i32 (...) @dbg_break()
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int i;
  int up;
  i = __VERIFIER_nondet_int();
  up = 0;
  while (0 <= i && i <= 10) {
    if (i == 10) {
      up = 0;
    }
    if (i == 0) {
      up = 1;
    }
    if (up == 1) {
      i = i + 1;
    } else {
      i = i - 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x8(%rbp),%ecx
mov    %al,-0xd(%rbp)
jg     114a <main+0x3a>
cmpl   $0xa,-0x8(%rbp)
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    115a <main+0x4a>
jmp    11a2 <main+0x92>
cmpl   $0xa,-0x8(%rbp)
jne    116b <main+0x5b>
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    117c <main+0x6c>
movl   $0x1,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1194 <main+0x84>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    119d <main+0x8d>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
char *bgbv86_ralloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *bgbv86_rstrdup(char *str) {
  char *t;
  t = bgbv86_ralloc(strlen(str) + 1);
  strcpy(t, str);
  return (t);
}


x86 assembly (clang, -O0):
<bgbv86_rstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <bgbv86_ralloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bgbv86_rstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <bgbv86_ralloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @bgbv86_rstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @bgbv86_ralloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @bgbv86_rstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @bgbv86_ralloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int VpuReadReg(int);
int /*<<< orphan*/ VpuWriteReg(int, int /*<<< orphan*/);
int vpu_InterruptHandler(void) {
  int status;
  status = VpuReadReg(0x174);
  ;
  VpuWriteReg(0x174, 0);
  return 0;
}


x86 assembly (clang, -O0):
<vpu_InterruptHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x174,%edi
call   1030 <VpuReadReg@plt>
mov    %eax,-0x4(%rbp)
mov    $0x174,%edi
xor    %esi,%esi
call   1040 <VpuWriteReg@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vpu_InterruptHandler>:
push   %rax
mov    $0x174,%edi
call   1030 <VpuReadReg@plt>
mov    $0x174,%edi
xor    %esi,%esi
call   1040 <VpuWriteReg@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @vpu_InterruptHandler() {
%1 = alloca i32
%2 = call i32 @VpuReadReg(i32 372)
store i32 %2, i32* %1
%3 = call i32 @VpuWriteReg(i32 372, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @vpu_InterruptHandler() {
%1 = tail call i32 @VpuReadReg(i32 372)
%2 = tail call i32 @VpuWriteReg(i32 372, i32 0)
ret i32 0
}
/* Variables and functions */
int add(int, int);
int func(int a, int b) { return add(a, b) + 1; }


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

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

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

LLVM IR (-O2):
define i32 @func(i32 %0, i32 %1) {
%3 = tail call i32 @add(i32 %0, i32 %1)
%4 = add nsw i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int a = 7;
  a = a + 1 >> 2;
  printf("%d", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x7,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
sar    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x2,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
int test_unsignedlong() {
  int i;
  unsigned long sums[2] = {0};
#pragma acc parallel loop
  for (i = 0; i < 8192; i++) {
#pragma acc atomic
    sums[0]++;
#pragma acc atomic
    ++sums[1];
  }
  for (i = 0; i < 2; i++) {
    if (sums[i] != (8192)) {
      return i + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<test_unsignedlong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2000,-0x8(%rbp)
jge    1162 <test_unsignedlong+0x52>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <test_unsignedlong+0x1f>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11a7 <test_unsignedlong+0x97>
movslq -0x8(%rbp),%rax
cmpq   $0x2000,-0x20(%rbp,%rax,8)
je     1194 <test_unsignedlong+0x84>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11ae <test_unsignedlong+0x9e>
jmp    1199 <test_unsignedlong+0x89>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1169 <test_unsignedlong+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_unsignedlong() {
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *my_strdup(char *s) {
  char *p;
  p = (char *)malloc(strlen(s) + 1);
  if (p != NULL)
    strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<my_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <my_strdup+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <my_strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @my_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @strcpy(i8* %12, i8* %13)
br label %15
15: ; preds = %11, %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @my_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ emit_andimm(int, int, int);
void do_rhash(int rs, int rh) { emit_andimm(rs, 0xf8, rh); }


x86 assembly (clang, -O0):
<do_rhash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0xf8,%esi
call   1030 <emit_andimm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_rhash>:
mov    %esi,%edx
mov    $0xf8,%esi
jmp    1030 <emit_andimm@plt>

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

LLVM IR (-O2):
define void @do_rhash(i32 %0, i32 %1) {
%3 = tail call i32 @emit_andimm(i32 %0, i32 248, i32 %1)
ret void
}
unsigned xrop3_201_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T | D;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


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

x86 assembly (clang, -O2):
<xrop3_201_1_1>:
or     %esi,%edi
mov    %edi,%eax
not    %eax
shl    $0x8,%eax
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_201_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = zext i8 %3 to i32
%5 = xor i32 %4, -1
%6 = shl nsw i32 %5, 8
%7 = or i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int eg_indirect_table_set(unsigned int, int, unsigned int, int, unsigned int *);
int eg_sc_table_set(unsigned int dev_id, unsigned int index,
                    unsigned int *pentry) {
  if ((index < 0) || (index > 31)) {
    return -1;
  }
  return eg_indirect_table_set(dev_id, 2, index, 4, pentry);
}


x86 assembly (clang, -O0):
<eg_sc_table_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jb     1136 <eg_sc_table_set+0x26>
cmpl   $0x1f,-0xc(%rbp)
jbe    1142 <eg_sc_table_set+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <eg_sc_table_set+0x4e>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%r8
mov    $0x2,%esi
mov    $0x4,%ecx
call   1030 <eg_indirect_table_set@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eg_sc_table_set>:
cmp    $0x1f,%esi
jbe    111b <eg_sc_table_set+0xb>
mov    $0xffffffff,%eax
ret
mov    %rdx,%r8
mov    %esi,%edx
mov    $0x2,%esi
mov    $0x4,%ecx
jmp    1030 <eg_indirect_table_set@plt>

LLVM IR (-O0):
define i32 @eg_sc_table_set(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%8 = load i32, i32* %6
%9 = icmp ult i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %3
%11 = load i32, i32* %6
%12 = icmp ugt i32 %11, 31
br i1 %12, label %13, label %14
13: ; preds = %10, %3
store i32 -1, i32* %4
br label %19
14: ; preds = %10
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = load i32*, i32** %7
%18 = call i32 @eg_indirect_table_set(i32 %15, i32 2, i32 %16, i32 4, i32* %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %14, %13
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @eg_sc_table_set(i32 %0, i32 %1, i32* %2) {
%4 = icmp ugt i32 %1, 31
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @eg_indirect_table_set(i32 %0, i32 2, i32 %1, i32 4, i32* %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ -1, %3 ]
ret i32 %8
}
long double test_nexttowardl(long double x, long double y) {
  return __builtin_nexttowardl(x, y);
}


x86 assembly (clang, -O0):
<test_nexttowardl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <nexttowardl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_nexttowardl>:
jmp    1030 <nexttowardl@plt>

LLVM IR (-O0):
define x86_fp80 @test_nexttowardl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = call x86_fp80 @nexttowardl(x86_fp80 %5, x86_fp80 %6)
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @test_nexttowardl(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 @nexttowardl(x86_fp80 %0, x86_fp80 %1)
ret x86_fp80 %3
}
int qsort_cmp__VEC_VAL2(const void *x, const void *y) {
  if (*((double *)x) > *((double *)y))
    return (-1);
  else
    return (*((double *)x) < *((double *)y));
}


x86 assembly (clang, -O0):
<qsort_cmp__VEC_VAL2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    112e <qsort_cmp__VEC_VAL2+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    114d <qsort_cmp__VEC_VAL2+0x4d>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_cmp__VEC_VAL2>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
ucomisd %xmm1,%xmm0
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @qsort_cmp__VEC_VAL2(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to double*
%11 = load double, double* %10
%12 = fcmp ogt double %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %23
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to double*
%17 = load double, double* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to double*
%20 = load double, double* %19
%21 = fcmp olt double %17, %20
%22 = zext i1 %21 to i32
store i32 %22, i32* %3
br label %23
23: ; preds = %14, %13
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @qsort_cmp__VEC_VAL2(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ogt double %4, %6
%8 = fcmp olt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void handle_41(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_41(i32 %0) {
ret void
}
double mixr2spechum(double mixr) {
  double spechum;
  spechum = mixr / (mixr + 1.0);
  return (spechum);
}


x86 assembly (clang, -O0):
<mixr2spechum>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mixr2spechum>:
movsd  0xef8(%rip),%xmm1
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @mixr2spechum(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double %4, %6
store double %7, double* %3
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
define double @mixr2spechum(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fdiv double %0, %2
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void sayHelloTo(char who[]) { printf("Hello, %s!", who); }


x86 assembly (clang, -O0):
<sayHelloTo>:
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):
<sayHelloTo>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"Hello, %s!\00"
define void @sayHelloTo(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct lifo {
  int dummy;
};

/* Variables and functions */
double pop(struct lifo *);
double opr_div(struct lifo *stack) {
  double op1, op2;
  op1 = pop(stack);
  op2 = pop(stack);
  return op2 / op1;
}


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

x86 assembly (clang, -O2):
<opr_div>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <pop@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <pop@plt>
divsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.lifo = type { i32 }
define double @opr_div(%struct.lifo* %0) {
%2 = alloca %struct.lifo*
%3 = alloca double
%4 = alloca double
store %struct.lifo* %0, %struct.lifo** %2
%5 = load %struct.lifo*, %struct.lifo** %2
%6 = call double @pop(%struct.lifo* %5)
store double %6, double* %3
%7 = load %struct.lifo*, %struct.lifo** %2
%8 = call double @pop(%struct.lifo* %7)
store double %8, double* %4
%9 = load double, double* %4
%10 = load double, double* %3
%11 = fdiv double %9, %10
ret double %11
}

LLVM IR (-O2):
%struct.lifo = type { i32 }
define double @opr_div(%struct.lifo* %0) {
%2 = tail call double @pop(%struct.lifo* %0)
%3 = tail call double @pop(%struct.lifo* %0)
%4 = fdiv double %3, %2
ret double %4
}
/* Variables and functions */
float cos(float);
float sin(float);
void from_polar_to_cartesian(float *y, float *x) {
  y[0] = x[0] * cos(x[1]);
  y[1] = x[0] * sin(x[1]);
}


x86 assembly (clang, -O0):
<from_polar_to_cartesian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
mulss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
mulss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_polar_to_cartesian>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movss  (%rsi),%xmm0
movss  %xmm0,0x4(%rsp)
movss  0x4(%rsi),%xmm0
call   1040 <cos@plt>
mulss  0x4(%rsp),%xmm0
movss  %xmm0,(%r14)
movss  (%rbx),%xmm0
movss  %xmm0,0x4(%rsp)
movss  0x4(%rbx),%xmm0
call   1030 <sin@plt>
mulss  0x4(%rsp),%xmm0
movss  %xmm0,0x4(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @from_polar_to_cartesian(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** %4
%9 = getelementptr inbounds float, float* %8, i64 1
%10 = load float, float* %9
%11 = call float @cos(float %10)
%12 = fmul float %7, %11
%13 = load float*, float** %3
%14 = getelementptr inbounds float, float* %13, i64 0
store float %12, float* %14
%15 = load float*, float** %4
%16 = getelementptr inbounds float, float* %15, i64 0
%17 = load float, float* %16
%18 = load float*, float** %4
%19 = getelementptr inbounds float, float* %18, i64 1
%20 = load float, float* %19
%21 = call float @sin(float %20)
%22 = fmul float %17, %21
%23 = load float*, float** %3
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
ret void
}

LLVM IR (-O2):
define void @from_polar_to_cartesian(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = getelementptr inbounds float, float* %1, i64 1
%5 = load float, float* %4
%6 = tail call float @cos(float %5)
%7 = fmul float %3, %6
store float %7, float* %0
%8 = load float, float* %1
%9 = load float, float* %4
%10 = tail call float @sin(float %9)
%11 = fmul float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
ret void
}
void uart_init(void) {
  (*(volatile unsigned *)0x56000070) |= 0xa0;
  (*(volatile unsigned *)0x50000004) = 0x5;
  (*(volatile unsigned *)0x50000028) = 26;
  (*(volatile unsigned *)0x50000000) = 0x3;
}


x86 assembly (clang, -O0):
<uart_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x56000070,%eax
mov    (%rax),%ecx
or     $0xa0,%ecx
mov    $0x56000070,%eax
mov    %ecx,(%rax)
mov    $0x50000004,%eax
movl   $0x5,(%rax)
mov    $0x50000028,%eax
movl   $0x1a,(%rax)
mov    $0x50000000,%eax
movl   $0x3,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_init>:
orl    $0xa0,0x56000070
movl   $0x5,0x50000004
movl   $0x1a,0x50000028
movl   $0x3,0x50000000
ret

LLVM IR (-O0):
define void @uart_init() {
%1 = load volatile i32, i32* inttoptr (i64 1442840688 to i32*)
%2 = or i32 %1, 160
store volatile i32 %2, i32* inttoptr (i64 1442840688 to i32*)
store volatile i32 5, i32* inttoptr (i64 1342177284 to i32*)
store volatile i32 26, i32* inttoptr (i64 1342177320 to i32*)
store volatile i32 3, i32* inttoptr (i64 1342177280 to i32*)
ret void
}

LLVM IR (-O2):
define void @uart_init() {
%1 = load volatile i32, i32* inttoptr (i64 1442840688 to i32*)
%2 = or i32 %1, 160
store volatile i32 %2, i32* inttoptr (i64 1442840688 to i32*)
store volatile i32 5, i32* inttoptr (i64 1342177284 to i32*)
store volatile i32 26, i32* inttoptr (i64 1342177320 to i32*)
store volatile i32 3, i32* inttoptr (i64 1342177280 to i32*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int16_t;

/* Variables and functions */
u_int16_t read_short(u_int16_t *addr) { return *addr; }


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

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

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

LLVM IR (-O2):
define i32 @read_short(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int strcmp(char const *, char const *);
int bintree_streq(void *current, void *added) {
  return strcmp((const char *)added, (const char *)current);
}


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

x86 assembly (clang, -O2):
<bintree_streq>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @bintree_streq(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* dereferenceable(1) %0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
scalar_t__ pthread_self();
void handler(void *arg) {
  printf("[%u] is cancelled.\n", (unsigned)pthread_self());
  pthread_mutex_t *pm = (pthread_mutex_t *)arg;
  pthread_mutex_unlock(pm);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <pthread_mutex_unlock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <pthread_mutex_unlock@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"[%u] is cancelled.\0A\00"
define void @handler(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i64 (...) @pthread_self()
%5 = trunc i64 %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %3
%9 = load i32*, i32** %3
%10 = call i32 @pthread_mutex_unlock(i32* %9)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"[%u] is cancelled.\0A\00"
define void @handler(i8* %0) {
%2 = tail call i64 (...) @pthread_self()
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = bitcast i8* %0 to i32*
%6 = tail call i32 @pthread_mutex_unlock(i32* %5)
ret void
}
int heynow() {
  long long int x = 10LL;
  unsigned long long int y = 9ULL;
  __complex__ float c, d, e;
  float f;
  c = 10.0 + 3.0fi;
  d = ~c;
  f = __real__ c;
  f = __imag__ d;
}


x86 assembly (clang, -O0):
<heynow>:
push   %rbp
mov    %rsp,%rbp
movq   $0xa,-0x10(%rbp)
movq   $0x9,-0x18(%rbp)
movss  0xee8(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  0xed7(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x20(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm1,-0x28(%rbp)
movss  %xmm0,-0x24(%rbp)
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @heynow() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca { float, float }
%5 = alloca { float, float }
%6 = alloca { float, float }
%7 = alloca float
store i64 10, i64* %2
store i64 9, i64* %3
%8 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%9 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
store float 1.000000e+01, float* %8
store float 3.000000e+00, float* %9
%10 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%11 = load float, float* %10
%12 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
%13 = load float, float* %12
%14 = fneg float %13
%15 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 0
%16 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 1
store float %11, float* %15
store float %14, float* %16
%17 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%18 = load float, float* %17
store float %18, float* %7
%19 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 1
%20 = load float, float* %19
store float %20, float* %7
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
define i32 @heynow() {
ret i32 undef
}
/* Variables and functions */
int __raw_readw(int);
int /*<<< orphan*/ __raw_writeb(int, int);
int /*<<< orphan*/ __raw_writew(int, int);
void mmcif_update_progress(int nr) {
  __raw_writew(__raw_readw(0xa4050158) & ~(1 << 1), 0xa4050158);
  __raw_writeb(1 << (nr - 1), 0xa405012c);
}


x86 assembly (clang, -O0):
<mmcif_update_progress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xa4050158,%edi
call   1040 <__raw_readw@plt>
mov    %eax,%edi
and    $0xfffffffd,%edi
mov    $0xa4050158,%esi
call   1030 <__raw_writew@plt>
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edi
shl    %cl,%edi
mov    $0xa405012c,%esi
call   1050 <__raw_writeb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmcif_update_progress>:
push   %rbx
mov    %edi,%ebx
mov    $0xa4050158,%edi
call   1040 <__raw_readw@plt>
and    $0xfffffffd,%eax
mov    %eax,%edi
mov    $0xa4050158,%esi
call   1030 <__raw_writew@plt>
add    $0xff,%bl
mov    $0x1,%edi
mov    %ebx,%ecx
shl    %cl,%edi
mov    $0xa405012c,%esi
pop    %rbx
jmp    1050 <__raw_writeb@plt>

LLVM IR (-O0):
define void @mmcif_update_progress(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @__raw_readw(i32 -1543175848)
%4 = and i32 %3, -3
%5 = call i32 @__raw_writew(i32 %4, i32 -1543175848)
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 1
%8 = shl i32 1, %7
%9 = call i32 @__raw_writeb(i32 %8, i32 -1543175892)
ret void
}

LLVM IR (-O2):
define void @mmcif_update_progress(i32 %0) {
%2 = tail call i32 @__raw_readw(i32 -1543175848)
%3 = and i32 %2, -3
%4 = tail call i32 @__raw_writew(i32 %3, i32 -1543175848)
%5 = add nsw i32 %0, -1
%6 = shl nuw i32 1, %5
%7 = tail call i32 @__raw_writeb(i32 %6, i32 -1543175892)
ret void
}
/* Variables and functions */
size_t next_capacity(size_t min_capacity) {
  size_t capacity = 128;
  while (capacity < min_capacity)
    capacity = capacity + capacity / 2;
  return capacity;
}


x86 assembly (clang, -O0):
<next_capacity>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x80,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1136 <next_capacity+0x36>
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <next_capacity+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_capacity>:
mov    $0x80,%eax
cmp    $0x81,%rdi
jb     112e <next_capacity+0x2e>
mov    $0x80,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rax,%rcx
shr    %rcx
add    %rcx,%rax
cmp    %rdi,%rax
jb     1120 <next_capacity+0x20>
ret

LLVM IR (-O0):
define i64 @next_capacity(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 128, i64* %3
br label %4
4: ; preds = %8, %1
%5 = load i64, i64* %3
%6 = load i64, i64* %2
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = load i64, i64* %3
%10 = load i64, i64* %3
%11 = udiv i64 %10, 2
%12 = add i64 %9, %11
store i64 %12, i64* %3
br label %4
13: ; preds = %4
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
define i64 @next_capacity(i64 %0) {
%2 = icmp ugt i64 %0, 128
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 128, %1 ]
%5 = lshr i64 %4, 1
%6 = add i64 %5, %4
%7 = icmp ult i64 %6, %0
br i1 %7, label %3, label %8
8: ; preds = %3, %1
%9 = phi i64 [ 128, %1 ], [ %6, %3 ]
ret i64 %9
}
void PrintSlotLengthTest(void *theEnv, const char *logicalName,
                         void *theValue) {}


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

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

LLVM IR (-O0):
define void @PrintSlotLengthTest(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @PrintSlotLengthTest(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int fibmap_main(int, char **);
int main(int argc, char **argv) { return fibmap_main(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <fibmap_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @fibmap_main(i32 %0, i8** %1)
ret i32 %3
}