xunge/DecIR huggingface dataset:
/* Variables and functions */
bool nrf51_errata_8(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_8() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ output(char *);
void printUptimeInfo(const char *cmd) {
  (void)cmd;
  output("System uptime\t0\t0\ts\n");
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"System uptime\090\090\09s\0A\00"
define void @printUptimeInfo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @output(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"System uptime\090\090\09s\0A\00"
define void @printUptimeInfo(i8* nocapture readnone %0) {
%2 = tail call i32 @output(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
void g_logv() {}


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

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

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

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

/* Variables and functions */
int fflush(FILE *stream __attribute__((unused))) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fflush(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int main() {
  putchar('C');
  putchar('\n');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x43,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x43,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @putchar(i8 signext 67)
%2 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext 67)
%2 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
double energyConsumptionBill(double kwh) {
  double bill = 20.00;
  kwh -= 45;
  if (kwh > 0)
    bill += 0.50 * kwh;
  return bill;
}


x86 assembly (clang, -O0):
<energyConsumptionBill>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xedd(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    115d <energyConsumptionBill+0x5d>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xec0(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<energyConsumptionBill>:
addsd  0xef8(%rip),%xmm0
movsd  0xef8(%rip),%xmm2
mulsd  %xmm0,%xmm2
movsd  0xef4(%rip),%xmm3
addsd  %xmm3,%xmm2
xorpd  %xmm1,%xmm1
cmpltsd %xmm0,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm3,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @energyConsumptionBill(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 2.000000e+01, double* %3
%4 = load double, double* %2
%5 = fsub double %4, 4.500000e+01
store double %5, double* %2
%6 = load double, double* %2
%7 = fcmp ogt double %6, 0.000000e+00
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load double, double* %2
%10 = load double, double* %3
%11 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %9, double %10)
store double %11, double* %3
br label %12
12: ; preds = %8, %1
%13 = load double, double* %3
ret double %13
}

LLVM IR (-O2):
define double @energyConsumptionBill(double %0) {
%2 = fadd double %0, -4.500000e+01
%3 = fcmp ogt double %2, 0.000000e+00
%4 = tail call double @llvm.fmuladd.f64(double %2, double 5.000000e-01, double 2.000000e+01)
%5 = select i1 %3, double %4, double 2.000000e+01
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ BUILD_BUG();
void put_huge_zero_page(void) { BUILD_BUG(); }


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

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

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

LLVM IR (-O2):
define void @put_huge_zero_page() {
%1 = tail call i32 (...) @BUILD_BUG()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __attribute__((constructor)) libtest1_ctor(void) {
  printf("libtest1: constructor!\n");
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"libtest1: constructor!\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @libtest1_ctor, i8* null }]
define void @libtest1_ctor() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @libtest1_ctor, i8* null }]
@str = [23 x i8] c"libtest1: constructor!\00"
define void @libtest1_ctor() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *calloc(size_t size) {
  void *mem = malloc(size);
  memset(mem, 0, size);
  return mem;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @calloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
char *config_disp_str(char *str) { return (str == NULL) ? "" : str; }


x86 assembly (clang, -O0):
<config_disp_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1123 <config_disp_str+0x23>
lea    0xee6(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    112b <config_disp_str+0x2b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_disp_str>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @config_disp_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = load i8*, i8** %2
br label %8
8: ; preds = %6, %5
%9 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %5 ], [ %7, %6 ]
ret i8* %9
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @config_disp_str(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
int wpas_wps_scan_pbc_overlap(struct wpa_supplicant *wpa_s,
                              struct wpa_scan_res *selected,
                              struct wpa_ssid *ssid) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
%struct.wpa_scan_res = type opaque
%struct.wpa_ssid = type opaque
define i32 @wpas_wps_scan_pbc_overlap(%struct.wpa_supplicant* %0, %struct.wpa_scan_res* %1, %struct.wpa_ssid* %2) {
%4 = alloca %struct.wpa_supplicant*
%5 = alloca %struct.wpa_scan_res*
%6 = alloca %struct.wpa_ssid*
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %4
store %struct.wpa_scan_res* %1, %struct.wpa_scan_res** %5
store %struct.wpa_ssid* %2, %struct.wpa_ssid** %6
ret i32 0
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
%struct.wpa_scan_res = type opaque
%struct.wpa_ssid = type opaque
define i32 @wpas_wps_scan_pbc_overlap(%struct.wpa_supplicant* nocapture readnone %0, %struct.wpa_scan_res* nocapture readnone %1, %struct.wpa_ssid* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void bar(int x) { assert(x != 3 && "x cannot be 3"); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x3,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1134 <bar+0x24>
mov    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    1134 <bar+0x24>
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
xor    %eax,%eax
cmp    $0x3,%edi
setne  %al
mov    %eax,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"x cannot be 3\00"
define void @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 3
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
%7 = phi i1 [ false, %1 ], [ true, %5 ]
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret void
}

LLVM IR (-O2):
define void @bar(i32 %0) {
%2 = icmp ne i32 %0, 3
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xae() {
  Assert_real((iscntrl(174) == 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_iscntrl.c",
              875, ("iscntrl should be 0 for 0xae"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xae>:
push   %rax
mov    $0xae,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x36b,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xae\00"
define void @t_iscntrl_0xae() {
%1 = call i64 @iscntrl(i32 174)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 875, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xae\00"
define void @t_iscntrl_0xae() {
%1 = tail call i64 @iscntrl(i32 174)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 875, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void CRC_CalculateCRC16Table(void) {}


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

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

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

LLVM IR (-O2):
define void @CRC_CalculateCRC16Table() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glk_exit();
void glk_main() { glk_exit(); }


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

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

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

LLVM IR (-O2):
define void @glk_main() {
%1 = tail call i32 (...) @glk_exit()
ret void
}
char lexer_char_upper(char c) {
  if (c >= 'a' && c <= 'z')
    return (char)('A' + (c - 'a'));
  return c;
}


x86 assembly (clang, -O0):
<lexer_char_upper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     1136 <lexer_char_upper+0x36>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     1136 <lexer_char_upper+0x36>
movsbl -0x2(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    113c <lexer_char_upper+0x3c>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lexer_char_upper>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @lexer_char_upper(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 97
%15 = add nsw i32 65, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
br label %19
17: ; preds = %7, %1
%18 = load i8, i8* %3
store i8 %18, i8* %2
br label %19
19: ; preds = %17, %11
%20 = load i8, i8* %2
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @lexer_char_upper(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
void XLookupString() {}


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

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

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

LLVM IR (-O2):
define void @XLookupString() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_sndfile_write_channel_map() {
  printf("NOT IMPLEMENTED:"
         "pa_sndfile_write_channel_map"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"NOT IMPLEMENTED:pa_sndfile_write_channel_map\0A\00"
define i32 @pa_sndfile_write_channel_map() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [45 x i8] c"NOT IMPLEMENTED:pa_sndfile_write_channel_map\00"
define i32 @pa_sndfile_write_channel_map() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
float *(wcheck_float_ptr)(float *to_check) { return to_check; }


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

x86 assembly (clang, -O2):
<wcheck_float_ptr>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define float* @wcheck_float_ptr(float* readnone returned %0) {
ret float* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ s;
typedef int /*<<< orphan*/ d;
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  double d;
  int array[5];
  struct {
    short a;
    char c;
  } s;
  printf("double: %2lu\n", sizeof(d));
  printf("array:  %2lu\n", sizeof(array));
  printf("s:      %2lu\n", sizeof(s));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xee1(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x14,%esi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i16, i8 }
@.str = [14 x i8] c"double: %2lu\0A\00"
@.str.1 = [14 x i8] c"array: %2lu\0A\00"
@.str.2 = [14 x i8] c"s: %2lu\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca [5 x i32]
%3 = alloca %struct.anon
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 8)
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 20)
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 4)
ret i32 0
}

LLVM IR (-O2):
%struct.anon = type { i16, i8 }
@.str = [14 x i8] c"double: %2lu\0A\00"
@.str.1 = [14 x i8] c"array: %2lu\0A\00"
@.str.2 = [14 x i8] c"s: %2lu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 20)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 4)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int int16_t;

/* Variables and functions */
int ldsw_be_p(const void *ptr) {
  const uint8_t *b = ptr;
  return (int16_t)((b[0] << 8) | b[1]);
}


x86 assembly (clang, -O0):
<ldsw_be_p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
or     0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldsw_be_p>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ldsw_be_p(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = shl i32 %8, 8
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = or i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @ldsw_be_p(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int ellipseExtent(float, float *);
float inverseEllipseExtent(float angle, float *axisLengths) {
  float inverseAxisLengths[2];
  inverseAxisLengths[0] = 1 / axisLengths[0];
  inverseAxisLengths[1] = 1 / axisLengths[1];
  return 1 / ellipseExtent(angle, inverseAxisLengths);
}


x86 assembly (clang, -O0):
<inverseEllipseExtent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  0xed3(%rip),%xmm0
divss  (%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  0xebe(%rip),%xmm0
divss  0x4(%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
lea    -0x18(%rbp),%rdi
call   1030 <ellipseExtent@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inverseEllipseExtent>:
push   %rax
movss  0xee7(%rip),%xmm1
movaps %xmm1,%xmm2
divss  (%rdi),%xmm2
movss  %xmm2,(%rsp)
divss  0x4(%rdi),%xmm1
movss  %xmm1,0x4(%rsp)
mov    %rsp,%rdi
call   1030 <ellipseExtent@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @inverseEllipseExtent(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
%5 = alloca [2 x float]
store float %0, float* %3
store float* %1, float** %4
%6 = load float*, float** %4
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = fdiv float 1.000000e+00, %8
%10 = getelementptr inbounds [2 x float], [2 x float]* %5, i64 0, i64 0
store float %9, float* %10
%11 = load float*, float** %4
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = fdiv float 1.000000e+00, %13
%15 = getelementptr inbounds [2 x float], [2 x float]* %5, i64 0, i64 1
store float %14, float* %15
%16 = load float, float* %3
%17 = getelementptr inbounds [2 x float], [2 x float]* %5, i64 0, i64 0
%18 = call i32 @ellipseExtent(float %16, float* %17)
%19 = sdiv i32 1, %18
%20 = sitofp i32 %19 to float
ret float %20
}

LLVM IR (-O2):
define float @inverseEllipseExtent(float %0, float* nocapture %1) {
%3 = alloca [2 x float]
%4 = bitcast [2 x float]* %3 to i8*
%5 = load float, float* %1
%6 = fdiv float 1.000000e+00, %5
%7 = getelementptr inbounds [2 x float], [2 x float]* %3, i64 0, i64 0
store float %6, float* %7
%8 = getelementptr inbounds float, float* %1, i64 1
%9 = load float, float* %8
%10 = fdiv float 1.000000e+00, %9
%11 = getelementptr inbounds [2 x float], [2 x float]* %3, i64 0, i64 1
store float %10, float* %11
%12 = call i32 @ellipseExtent(float %0, float* %7)
%13 = add i32 %12, 1
%14 = icmp ult i32 %13, 3
%15 = select i1 %14, i32 %12, i32 0
%16 = sitofp i32 %15 to float
ret float %16
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_gr_dump_image() { exit(1); }


x86 assembly (clang, -O0):
<caml_gr_dump_image>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_gr_dump_image>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_gr_dump_image() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_gr_dump_image() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
void ClosePlatformDependentStuff(void) {}


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

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

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

LLVM IR (-O2):
define void @ClosePlatformDependentStuff() {
ret void
}
/* Variables and functions */
int send_nmt(int, int, int /*<<< orphan*/);
int init_can_nodes(int sock) { return send_nmt(sock, 0x01, 0); }


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

x86 assembly (clang, -O2):
<init_can_nodes>:
mov    $0x1,%esi
xor    %edx,%edx
jmp    1030 <send_nmt@plt>

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

LLVM IR (-O2):
define i32 @init_can_nodes(i32 %0) {
%2 = tail call i32 @send_nmt(i32 %0, i32 1, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *, int);
int /*<<< orphan*/ printf(char *, int, char *);
int main(void) {
  int number = 123456;
  char string[25];
  itoa(number, string, 10);
  printf("integer=%d string=%s\n", number, string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1e240,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0xa,%edx
call   1040 <itoa@plt>
mov    -0x8(%rbp),%esi
lea    -0x30(%rbp),%rdx
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    $0x1e240,%edi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1040 <itoa@plt>
lea    0xebf(%rip),%rdi
mov    $0x1e240,%esi
mov    %rbx,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"integer=%d string=%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [25 x i8]
store i32 0, i32* %1
store i32 123456, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%6 = call i32 @itoa(i32 %4, i8* %5, i32 10)
%7 = load i32, i32* %2
%8 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"integer=%d string=%s\0A\00"
define i32 @main() {
%1 = alloca [25 x i8]
%2 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%3 = call i32 @itoa(i32 123456, i8* %2, i32 10)
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 123456, i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ default_settings();
int /*<<< orphan*/ load_settings();
void init_system() {
  default_settings();
  load_settings();
}


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

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

LLVM IR (-O0):
define void @init_system() {
%1 = call i32 (...) @default_settings()
%2 = call i32 (...) @load_settings()
ret void
}

LLVM IR (-O2):
define void @init_system() {
%1 = tail call i32 (...) @default_settings()
%2 = tail call i32 (...) @load_settings()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void f4(int *a) { printf("f4: %d\n", *a); }


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

x86 assembly (clang, -O2):
<f4>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"f4: %d\0A\00"
define void @f4(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
scalar_t__ jump();
int main(void) {
  if (jump())
    goto mid;
  foo();
  for (int i = 0; i < 10; ++i) {
  mid:
    foo();
  }
  return 0;
  foo();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <jump@plt>
cmp    $0x0,%rax
je     1145 <main+0x25>
jmp    1162 <main+0x42>
mov    $0x0,%al
call   1030 <foo@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1177 <main+0x57>
jmp    1162 <main+0x42>
mov    $0x0,%al
call   1030 <foo@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1153 <main+0x33>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <jump@plt>
test   %rax,%rax
jne    113b <main+0x1b>
xor    %eax,%eax
call   1030 <foo@plt>
cmp    $0x9,%ebx
jg     1147 <main+0x27>
xor    %eax,%eax
call   1030 <foo@plt>
add    $0x1,%ebx
jmp    1136 <main+0x16>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @jump()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = tail call i32 (...) @foo()
br label %5
5: ; preds = %8, %3
%6 = phi i32 [ %11, %8 ], [ 0, %3 ]
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %12
8: ; preds = %5, %0
%9 = phi i32 [ undef, %0 ], [ %6, %5 ]
%10 = tail call i32 (...) @foo()
%11 = add nsw i32 %9, 1
br label %5
12: ; preds = %5
ret i32 0
}
int byteorder() {
  unsigned long x;
  unsigned char *p;
  x = 0x01020304;
  p = (unsigned char *)&x;
  switch (*p) {
  case 1:
    return (4321);
  case 4:
    return (1234);
  default:
    return (0);
  }
}


x86 assembly (clang, -O0):
<byteorder>:
push   %rbp
mov    %rsp,%rbp
movq   $0x1020304,-0x10(%rbp)
01
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x1,%eax
je     113d <byteorder+0x3d>
jmp    112c <byteorder+0x2c>
mov    -0x1c(%rbp),%eax
sub    $0x4,%eax
je     1149 <byteorder+0x49>
jmp    1155 <byteorder+0x55>
movl   $0x10e1,-0x4(%rbp)
jmp    115c <byteorder+0x5c>
movl   $0x4d2,-0x4(%rbp)
jmp    115c <byteorder+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @byteorder() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i8*
store i64 16909060, i64* %2
%4 = bitcast i64* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
switch i32 %7, label %10 [
i32 1, label %8
i32 4, label %9
]
8: ; preds = %0
store i32 4321, i32* %1
br label %11
9: ; preds = %0
store i32 1234, i32* %1
br label %11
10: ; preds = %0
store i32 0, i32* %1
br label %11
11: ; preds = %10, %9, %8
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @byteorder() {
ret i32 1234
}
/* Variables and functions */
int /*<<< orphan*/ files_ls(int, char *, int /*<<< orphan*/);
void cmd_ls(int idx, char *par) { files_ls(idx, par, 0); }


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

x86 assembly (clang, -O2):
<cmd_ls>:
xor    %edx,%edx
jmp    1030 <files_ls@plt>

LLVM IR (-O0):
define void @cmd_ls(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 = call i32 @files_ls(i32 %5, i8* %6, i32 0)
ret void
}

LLVM IR (-O2):
define void @cmd_ls(i32 %0, i8* %1) {
%3 = tail call i32 @files_ls(i32 %0, i8* %1, i32 0)
ret void
}
__attribute__((always_)) void kmemcheck_mark_uninitialized(void *address,
                                                           unsigned int n) {}


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

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

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

LLVM IR (-O2):
define void @kmemcheck_mark_uninitialized(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
char *foo_strcpy(char *, char const *);
scalar_t__ foo_strlen(char const *);
char *malloc(scalar_t__);
char *foo_strdup(const char *src) {
  char *out = malloc(foo_strlen(src) + 1);
  return out ? foo_strcpy(out, src) : NULL;
}


x86 assembly (clang, -O0):
<foo_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <foo_strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1176 <foo_strdup+0x46>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <foo_strcpy@plt>
mov    %rax,-0x18(%rbp)
jmp    1181 <foo_strdup+0x51>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1181 <foo_strdup+0x51>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_strdup>:
push   %rbx
mov    %rdi,%rbx
call   1050 <foo_strlen@plt>
lea    0x1(%rax),%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     1153 <foo_strdup+0x23>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <foo_strcpy@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @foo_strdup(i8* %0) {
%2 = tail call i64 @foo_strlen(i8* %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i8* @foo_strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %1, %6
%9 = phi i8* [ %7, %6 ], [ null, %1 ]
ret i8* %9
}
void ConsoleC$Console$input(char *arg_0x8579730) {
  StressTestC$Console$input(arg_0x8579730);
  StreamC$Console$input(arg_0x8579730);
  StackC$Console$input(arg_0x8579730);
  ChunkStorageC$Console$input(arg_0x8579730);
  RootDirectoryM$Console$input(arg_0x8579730);
  CheckpointC$Console$input(arg_0x8579730);
}


x86 assembly (clang, -O0):
<ConsoleC$Console$input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <StressTestC$Console$input@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1070 <StreamC$Console$input@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1060 <StackC$Console$input@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <ChunkStorageC$Console$input@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <RootDirectoryM$Console$input@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1080 <CheckpointC$Console$input@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConsoleC$Console$input>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <StressTestC$Console$input@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <StreamC$Console$input@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <StackC$Console$input@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <ChunkStorageC$Console$input@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <RootDirectoryM$Console$input@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1080 <CheckpointC$Console$input@plt>

LLVM IR (-O0):
define void @"ConsoleC$Console$input"(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @"StressTestC$Console$input" to i32 (i8*, ...)*)(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @"StreamC$Console$input" to i32 (i8*, ...)*)(i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @"StackC$Console$input" to i32 (i8*, ...)*)(i8* %7)
%9 = load i8*, i8** %2
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @"ChunkStorageC$Console$input" to i32 (i8*, ...)*)(i8* %9)
%11 = load i8*, i8** %2
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @"RootDirectoryM$Console$input" to i32 (i8*, ...)*)(i8* %11)
%13 = load i8*, i8** %2
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @"CheckpointC$Console$input" to i32 (i8*, ...)*)(i8* %13)
ret void
}

LLVM IR (-O2):
define void @"ConsoleC$Console$input"(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @"StressTestC$Console$input" to i32 (i8*, ...)*)(i8* %0)
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @"StreamC$Console$input" to i32 (i8*, ...)*)(i8* %0)
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @"StackC$Console$input" to i32 (i8*, ...)*)(i8* %0)
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @"ChunkStorageC$Console$input" to i32 (i8*, ...)*)(i8* %0)
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @"RootDirectoryM$Console$input" to i32 (i8*, ...)*)(i8* %0)
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @"CheckpointC$Console$input" to i32 (i8*, ...)*)(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double rand();
bool random_drop(double probability) {
  return rand() < probability * ((double)RAND_MAX + 1.0);
}


x86 assembly (clang, -O0):
<random_drop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
mov    0x2eb5(%rip),%rax
cvtsi2sdq (%rax),%xmm2
movsd  0xec0(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_drop>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
addsd  0xecf(%rip),%xmm1
mulsd  (%rsp),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i32 @random_drop(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @rand()
%4 = load double, double* %2
%5 = load i64, i64* @RAND_MAX
%6 = sitofp i64 %5 to double
%7 = fadd double %6, 1.000000e+00
%8 = fmul double %4, %7
%9 = fcmp olt double %3, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i32 @random_drop(double %0) {
%2 = tail call double (...) @rand()
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fadd double %4, 1.000000e+00
%6 = fmul double %5, %0
%7 = fcmp olt double %2, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int split_huge_page_to_list(struct page *page, struct list_head *list) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.page = type opaque
%struct.list_head = type opaque
define i32 @split_huge_page_to_list(%struct.page* nocapture readnone %0, %struct.list_head* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
char *getenv(char const *);
const char *getvar(const char *env) {
  const char *var = getenv(env);
  return (var ? var : "");
}


x86 assembly (clang, -O0):
<getvar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1141 <getvar+0x31>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1151 <getvar+0x41>
lea    0xeb8(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1151 <getvar+0x41>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getvar>:
push   %rax
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xee0(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @getvar(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @getenv(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %8
%12 = phi i8* [ %9, %8 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %10 ]
ret i8* %12
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @getvar(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %2
ret i8* %4
}
/* Type definitions */
struct stddev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ stddev_add(struct stddev *, int);
int /*<<< orphan*/ stddev_remove(struct stddev *, int);
void stddev_modify(struct stddev *sd, int old_value, int new_value) {
  stddev_remove(sd, old_value);
  stddev_add(sd, new_value);
}


x86 assembly (clang, -O0):
<stddev_modify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <stddev_remove@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <stddev_add@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stddev = type { i32 }
define void @stddev_modify(%struct.stddev* %0, i32 %1, i32 %2) {
%4 = alloca %struct.stddev*
%5 = alloca i32
%6 = alloca i32
store %struct.stddev* %0, %struct.stddev** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.stddev*, %struct.stddev** %4
%8 = load i32, i32* %5
%9 = call i32 @stddev_remove(%struct.stddev* %7, i32 %8)
%10 = load %struct.stddev*, %struct.stddev** %4
%11 = load i32, i32* %6
%12 = call i32 @stddev_add(%struct.stddev* %10, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.stddev = type { i32 }
define void @stddev_modify(%struct.stddev* %0, i32 %1, i32 %2) {
%4 = tail call i32 @stddev_remove(%struct.stddev* %0, i32 %1)
%5 = tail call i32 @stddev_add(%struct.stddev* %0, i32 %2)
ret void
}
int membase_init(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @membase_init() {
ret i32 1
}

LLVM IR (-O2):
define i32 @membase_init() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ O_NDELAY;
int fcntl_fl_off(int, int /*<<< orphan*/);
int nonblock_off(int fd) { return fcntl_fl_off(fd, O_NDELAY); }


x86 assembly (clang, -O0):
<nonblock_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl_fl_off@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nonblock_off>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fcntl_fl_off@plt>

LLVM IR (-O0):
@O_NDELAY = global i32 0
define i32 @nonblock_off(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @O_NDELAY
%5 = call i32 @fcntl_fl_off(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@O_NDELAY = global i32 0
define i32 @nonblock_off(i32 %0) {
%2 = load i32, i32* @O_NDELAY
%3 = tail call i32 @fcntl_fl_off(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ throw_illegal_instruction();
void _ea_illegal(void) { throw_illegal_instruction(); }


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

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

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

LLVM IR (-O2):
define void @_ea_illegal() {
%1 = tail call i32 (...) @throw_illegal_instruction()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void exitfunc3(void) {
  printf("Executing exitfunc3.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<exitfunc3>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc3>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Executing exitfunc3.\0A\00"
define void @exitfunc3() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [21 x i8] c"Executing exitfunc3.\00"
define void @exitfunc3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void zpodd_on_suspend(struct ata_device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.ata_device = type opaque
define void @zpodd_on_suspend(%struct.ata_device* nocapture %0) {
ret void
}