xunge/DecIR huggingface dataset:
int main(void) {
  const float PI = 3.141592;
  *((float *)&PI) = 2;
  float gleitZahl;
  float floatVariable = 3.14;
  float floatVariable2 = -1.234E-6;
  int zahl1, zahl2 = 12;
  char zeichen1 = 'A';
  zahl1 = 52;
  zeichen1 = zeichen1 + 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movss  0xef9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xee8(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xed7(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xec6(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movl   $0xc,-0x1c(%rbp)
movb   $0x41,-0x1d(%rbp)
movl   $0x34,-0x18(%rbp)
movsbl -0x1d(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x1d(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
store i32 0, i32* %1
store float 0x400921FB00000000, float* %2
store float 2.000000e+00, float* %2
store float 0x40091EB860000000, float* %4
store float 0xBEB4B3FD60000000, float* %5
store i32 12, i32* %7
store i8 65, i8* %8
store i32 52, i32* %6
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = add nsw i32 %10, 1
%12 = trunc i32 %11 to i8
store i8 %12, i8* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int LexIsBinDigit(char c) {
  if (c == '0' || c == '1') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<LexIsBinDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
je     1124 <LexIsBinDigit+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x31,%eax
jne    1130 <LexIsBinDigit+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <LexIsBinDigit+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LexIsBinDigit>:
and    $0xfe,%dil
xor    %eax,%eax
cmp    $0x30,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @LexIsBinDigit(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 48
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 49
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 1, i32* %2
br label %13
12: ; preds = %7
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @LexIsBinDigit(i8 signext %0) {
%2 = and i8 %0, -2
%3 = icmp eq i8 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *pl_trim_whitespaces(char *);
char *strchr(char *, char);
char *parse_field(char *line) {
  char *its;
  its = strchr(line, '=');
  if (!its)
    return line;
  its++;
  return pl_trim_whitespaces(its);
}


x86 assembly (clang, -O0):
<parse_field>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3d,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1156 <parse_field+0x36>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116f <parse_field+0x4f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <pl_trim_whitespaces@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_field>:
push   %rbx
mov    %rdi,%rbx
mov    $0x3d,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1140 <parse_field+0x20>
add    $0x1,%rax
mov    %rax,%rdi
pop    %rbx
jmp    1040 <pl_trim_whitespaces@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @parse_field(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 61)
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = tail call i8* @pl_trim_whitespaces(i8* %5)
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %6, %4 ], [ %0, %1 ]
ret i8* %8
}
double sum_double(double a, double b) { return a + b; }


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

x86 assembly (clang, -O2):
<sum_double>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sum_double(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @sum_double(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void ssa_iw_sockets_close(int skfd) { close(skfd); }


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

x86 assembly (clang, -O2):
<ssa_iw_sockets_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @ssa_iw_sockets_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ isnan(long double);
int isinf_ld(long double x) { return !isnan(x) && isnan(x - x); }


x86 assembly (clang, -O0):
<isinf_ld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <isnan@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    1158 <isinf_ld+0x48>
fldt   -0x10(%rbp)
fld    %st(0)
fsubp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <isnan@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isinf_ld>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x1c(%rsp)
fstpt  (%rsp)
call   1030 <isnan@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <isinf_ld+0x25>
add    $0x28,%rsp
ret
fldt   0x1c(%rsp)
fsub   %st,%st(0)
fstpt  (%rsp)
call   1030 <isnan@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @isinf_ld(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @isnan(x86_fp80 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = load x86_fp80, x86_fp80* %2
%8 = load x86_fp80, x86_fp80* %2
%9 = fsub x86_fp80 %7, %8
%10 = call i64 @isnan(x86_fp80 %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %6, %1
%13 = phi i1 [ false, %1 ], [ %11, %6 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @isinf_ld(x86_fp80 %0) {
%2 = tail call i64 @isnan(x86_fp80 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = fsub x86_fp80 %0, %0
%6 = tail call i64 @isnan(x86_fp80 %5)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int openit();
int /*<<< orphan*/ write(int, unsigned char *, int);
void set(int addr, unsigned char val) {
  unsigned char msg[3];
  int fd;
  fd = openit();
  msg[0] = addr;
  msg[1] = addr >> 8;
  msg[2] = val;
  write(fd, msg, 3);
  close(fd);
}


x86 assembly (clang, -O0):
<set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    $0x0,%al
call   1050 <openit@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0x7(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x6(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%r14d
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <openit@plt>
mov    %eax,%ebp
mov    %bl,0xd(%rsp)
mov    %bh,0xe(%rsp)
mov    %r14b,0xf(%rsp)
lea    0xd(%rsp),%rsi
mov    %eax,%edi
mov    $0x3,%edx
call   1030 <write@plt>
mov    %ebp,%edi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <close@plt>

LLVM IR (-O0):
define void @set(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca [3 x i8]
%6 = alloca i32
store i32 %0, i32* %3
store i8 %1, i8* %4
%7 = call i32 (...) @openit()
store i32 %7, i32* %6
%8 = load i32, i32* %3
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
store i8 %9, i8* %10
%11 = load i32, i32* %3
%12 = ashr i32 %11, 8
%13 = trunc i32 %12 to i8
%14 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 1
store i8 %13, i8* %14
%15 = load i8, i8* %4
%16 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 2
store i8 %15, i8* %16
%17 = load i32, i32* %6
%18 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%19 = call i32 @write(i32 %17, i8* %18, i32 3)
%20 = load i32, i32* %6
%21 = call i32 @close(i32 %20)
ret void
}

LLVM IR (-O2):
define void @set(i32 %0, i8 zeroext %1) {
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%5 = tail call i32 (...) @openit()
%6 = trunc i32 %0 to i8
store i8 %6, i8* %4
%7 = lshr i32 %0, 8
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 1
store i8 %8, i8* %9
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 2
store i8 %1, i8* %10
%11 = call i32 @write(i32 %5, i8* %4, i32 3)
%12 = tail call i32 @close(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
extern void Bar1(int one) { printf(" Hello from Bar1: one = %d!\n ", one); }


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

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

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

LLVM IR (-O2):
@.str = [30 x i8] c" Hello from Bar1: one = %d!\0A \00"
define void @Bar1(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ brb_listen();
int main() {
  brb_listen();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @brb_listen()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @brb_listen()
ret i32 0
}
/* Variables and functions */
int g(int);
int main() {
  int x = 0;
  int a = 0;
  int b = 0;
  if (x == 0) {
    a = 0;
    b = 5;
  } else {
    a = 10;
    b = 15;
  }
  if (a > b) {
    x = 1;
  } else {
    x = 2;
  }
  a = 55;
  a = g(55);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1151 <main+0x41>
movl   $0x0,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
jmp    115f <main+0x4f>
movl   $0xa,-0xc(%rbp)
movl   $0xf,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1177 <main+0x67>
movl   $0x1,-0x8(%rbp)
jmp    117e <main+0x6e>
movl   $0x2,-0x8(%rbp)
movl   $0x37,-0xc(%rbp)
mov    $0x37,%edi
call   1030 <g@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @g(i32 55)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ slip_flush();
int /*<<< orphan*/ slip_outbuf(int);
void slip_end(void) {
  slip_outbuf(0xC0);
  slip_flush();
}


x86 assembly (clang, -O0):
<slip_end>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc0,%edi
call   1030 <slip_outbuf@plt>
mov    $0x0,%al
call   1040 <slip_flush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<slip_end>:
push   %rax
mov    $0xc0,%edi
call   1030 <slip_outbuf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <slip_flush@plt>

LLVM IR (-O0):
define void @slip_end() {
%1 = call i32 @slip_outbuf(i32 192)
%2 = call i32 (...) @slip_flush()
ret void
}

LLVM IR (-O2):
define void @slip_end() {
%1 = tail call i32 @slip_outbuf(i32 192)
%2 = tail call i32 (...) @slip_flush()
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISREG(int /*<<< orphan*/);
int stat(char *, struct stat *);
int myls_is_reg_file(char *filename) {
  struct stat filename_stat;
  if (stat(filename, &filename_stat) == -1) {
    return -1;
  }
  return S_ISREG(filename_stat.st_mode);
}


x86 assembly (clang, -O0):
<myls_is_reg_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    114e <myls_is_reg_file+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <myls_is_reg_file+0x39>
mov    -0x18(%rbp),%edi
call   1040 <S_ISREG@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myls_is_reg_file>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     1137 <myls_is_reg_file+0x17>
mov    (%rsp),%edi
pop    %rax
jmp    1040 <S_ISREG@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @myls_is_reg_file(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @S_ISREG(i32 %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @myls_is_reg_file(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @S_ISREG(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ -1, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ _c_setbyte(int);
void PUSH_DS() {
  ;
  _c_setbyte(0x1e);
  ;
}


x86 assembly (clang, -O0):
<PUSH_DS>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1e,%edi
call   1030 <_c_setbyte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PUSH_DS>:
mov    $0x1e,%edi
jmp    1030 <_c_setbyte@plt>

LLVM IR (-O0):
define void @PUSH_DS() {
%1 = call i32 @_c_setbyte(i32 30)
ret void
}

LLVM IR (-O2):
define void @PUSH_DS() {
%1 = tail call i32 @_c_setbyte(i32 30)
ret void
}
int cmpint(const void *i1, const void *i2) {
  if (*(int *)i1 < *(int *)i2) {
    return -1;
  } else if (*(int *)i1 == *(int *)i2) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<cmpint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    112a <cmpint+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <cmpint+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    1148 <cmpint+0x48>
movl   $0x0,-0x4(%rbp)
jmp    114f <cmpint+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpint>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmpint(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 i32*
%8 = load i32, i32* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = icmp slt i32 %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %24
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to i32*
%17 = load i32, i32* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to i32*
%20 = load i32, i32* %19
%21 = icmp eq i32 %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 0, i32* %3
br label %24
23: ; preds = %14
store i32 1, i32* %3
br label %24
24: ; preds = %23, %22, %13
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @cmpint(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int main() {
  int i = 10;
  char buf[128] = {0};
  sprintf(buf, "'i=%d'", i);
  printf("buf=%s\n", buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%edx
lea    0xe93(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x90(%rbp),%rsi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xea7(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%edx
call   1040 <sprintf@plt>
lea    0xe97(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"'i=%d'\00"
@.str.1 = [8 x i8] c"buf=%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [128 x i8]
store i32 0, i32* %1
store i32 10, i32* %2
%4 = bitcast [128 x i8]* %3 to i8*
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"'i=%d'\00"
@.str.1 = [8 x i8] c"buf=%s\0A\00"
define i32 @main() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 10)
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ endstop_ISR_worker();
void endstop_ISR(void) { endstop_ISR_worker(); }


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

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

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

LLVM IR (-O2):
define void @endstop_ISR() {
%1 = tail call i32 (...) @endstop_ISR_worker()
ret void
}
/* Variables and functions */
int vec3_len(double *);
int /*<<< orphan*/ vec3_scale2(double *, int);
void vec3_normalize1(double *v1) { vec3_scale2(v1, 1 / vec3_len(v1)); }


x86 assembly (clang, -O0):
<vec3_normalize1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <vec3_len@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
mov    %eax,%esi
call   1040 <vec3_scale2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_normalize1>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec3_len@plt>
lea    0x1(%rax),%ecx
xor    %esi,%esi
cmp    $0x3,%ecx
cmovb  %eax,%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <vec3_scale2@plt>

LLVM IR (-O0):
define void @vec3_normalize1(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double*, double** %2
%5 = call i32 @vec3_len(double* %4)
%6 = sdiv i32 1, %5
%7 = call i32 @vec3_scale2(double* %3, i32 %6)
ret void
}

LLVM IR (-O2):
define void @vec3_normalize1(double* %0) {
%2 = tail call i32 @vec3_len(double* %0)
%3 = add i32 %2, 1
%4 = icmp ult i32 %3, 3
%5 = select i1 %4, i32 %2, i32 0
%6 = tail call i32 @vec3_scale2(double* %0, i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int isfile(const char *filename) {
  FILE *stream;
  stream = fopen(filename, "r");
  if (stream == NULL) {
    return (0);
  }
  fclose(stream);
  return (1);
}


x86 assembly (clang, -O0):
<isfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1157 <isfile+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1167 <isfile+0x47>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isfile>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <isfile+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @isfile(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
f() {
  int lvl1 = 0;
  for (int lvl2 = 0; lvl2 < 5; lvl2++) {
    int lvl3 = 2;
    printf("lvl2=%d\n", lvl2);
  }
  return lvl1;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1154 <f+0x44>
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <f+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"lvl2=%d\0A\00"
define i32 @f() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD_CTX;

/* Variables and functions */
int /*<<< orphan*/ NID_sha256;
int jksengine_digests_final(int /*<<< orphan*/ *, unsigned char *,
                            int /*<<< orphan*/);
int jksengine_sha256_final(EVP_MD_CTX *ctx, unsigned char *md) {
  ;
  return (jksengine_digests_final(ctx, md, NID_sha256));
}


x86 assembly (clang, -O0):
<jksengine_sha256_final>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
call   1030 <jksengine_digests_final@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jksengine_sha256_final>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
jmp    1030 <jksengine_digests_final@plt>

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

LLVM IR (-O2):
@NID_sha256 = global i32 0
define i32 @jksengine_sha256_final(i32* %0, i8* %1) {
%3 = load i32, i32* @NID_sha256
%4 = tail call i32 @jksengine_digests_final(i32* %0, i8* %1, i32 %3)
ret i32 %4
}
void rng_drand_init(struct anon$18 *rngh) { rng_urand_init(rngh); }


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

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

LLVM IR (-O0):
%"struct.anon$18" = type opaque
define void @rng_drand_init(%"struct.anon$18"* %0) {
%2 = alloca %"struct.anon$18"*
store %"struct.anon$18"* %0, %"struct.anon$18"** %2
%3 = load %"struct.anon$18"*, %"struct.anon$18"** %2
%4 = call i32 (%"struct.anon$18"*, ...) bitcast (i32 (...)* @rng_urand_init to i32 (%"struct.anon$18"*, ...)*)(%"struct.anon$18"* %3)
ret void
}

LLVM IR (-O2):
%"struct.anon$18" = type opaque
define void @rng_drand_init(%"struct.anon$18"* %0) {
%2 = tail call i32 (%"struct.anon$18"*, ...) bitcast (i32 (...)* @rng_urand_init to i32 (%"struct.anon$18"*, ...)*)(%"struct.anon$18"* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sleep(int);
void sleep_4_secs() {
  sleep(4);
  puts("SLEPT");
}


x86 assembly (clang, -O0):
<sleep_4_secs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1040 <sleep@plt>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep_4_secs>:
push   %rax
mov    $0x4,%edi
call   1040 <sleep@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"SLEPT\00"
define void @sleep_4_secs() {
%1 = call i32 @sleep(i32 4)
%2 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"SLEPT\00"
define void @sleep_4_secs() {
%1 = tail call i32 @sleep(i32 4)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void *zalloc(int sz) {
  void *p = malloc(sz);
  if (p)
    memset(p, 0, sz);
  return p;
}


x86 assembly (clang, -O0):
<zalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1150 <zalloc+0x30>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zalloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113e <zalloc+0x1e>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @zalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i32 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dvariancewd(int, int, double *, int);
int main() {
  double x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  double v = stdlib_strided_dvariancewd(N, 1, x, stride);
  printf("sample variance: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
movl   $0x4,-0x44(%rbp)
movl   $0x2,-0x48(%rbp)
mov    -0x44(%rbp),%edi
lea    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%ecx
mov    $0x1,%esi
call   1050 <stdlib_strided_dvariancewd@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdx
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x2,%ecx
call   1040 <stdlib_strided_dvariancewd@plt>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [22 x i8] c"sample variance: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x double]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dvariancewd(i32 %6, i32 1, double* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [22 x i8] c"sample variance: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dvariancewd(i32 4, i32 1, double* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
void def_fn0(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ AUDIO_SELECT_SOURCE;
scalar_t__ ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int audioSelectSource(int fd, audio_stream_source_t source) {
  int ans;
  if ((ans = ioctl(fd, AUDIO_SELECT_SOURCE, source) < 0)) {
    perror("AUDIO SELECT SOURCE: ");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<audioSelectSource>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
setl   %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x10(%rbp)
test   $0x1,%al
jne    1161 <audioSelectSource+0x41>
jmp    1179 <audioSelectSource+0x59>
lea    0xe98(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <audioSelectSource+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audioSelectSource>:
push   %rax
mov    %esi,%edx
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     113d <audioSelectSource+0x1d>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@AUDIO_SELECT_SOURCE = global i32 0
@.str = [22 x i8] c"AUDIO SELECT SOURCE: \00"
define i32 @audioSelectSource(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* @AUDIO_SELECT_SOURCE
%9 = load i32, i32* %5
%10 = call i64 @ioctl(i32 %7, i32 %8, i32 %9)
%11 = icmp slt i64 %10, 0
%12 = zext i1 %11 to i32
store i32 %12, i32* %6
br i1 %11, label %13, label %15
13: ; preds = %2
%14 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %13
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@AUDIO_SELECT_SOURCE = global i32 0
@.str = [22 x i8] c"AUDIO SELECT SOURCE: \00"
define i32 @audioSelectSource(i32 %0, i32 %1) {
%3 = load i32, i32* @AUDIO_SELECT_SOURCE
%4 = tail call i64 @ioctl(i32 %0, i32 %3, i32 %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int write(int, char *, int);
void doBeep(void) {
  int rc;
  (void)rc;
  rc = write(1, "\7", 1);
}


x86 assembly (clang, -O0):
<doBeep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edx
lea    0xedc(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doBeep>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\07\00"
define void @doBeep() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
store i32 %3, i32* %1
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\07\00"
define void @doBeep() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() { printf("Usage: mktime [-d] [outputfile] inputfile\n"); }


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"Usage: mktime [-d] [outputfile] inputfile\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [42 x i8] c"Usage: mktime [-d] [outputfile] inputfile\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret void
}
int from_naf(int x) {
  int mask = 1;
  int carry = 0;
  while (mask) {
    x ^= carry;
    if (carry ^ x & mask) {
      mask <<= 1;
      carry = x & mask;
    }
    mask <<= 1;
    carry <<= 1;
  }
  return x;
}


x86 assembly (clang, -O0):
<from_naf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1165 <from_naf+0x65>
mov    -0xc(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    -0x8(%rbp),%ecx
xor    %ecx,%eax
cmp    $0x0,%eax
je     114e <from_naf+0x4e>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <from_naf+0x15>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_naf>:
mov    %edi,%eax
mov    $0x1,%edx
xor    %r8d,%r8d
nopw   0x0(%rax,%rax,1)
xor    %r8d,%eax
mov    %eax,%esi
and    %edx,%esi
lea    (%rdx,%rdx,1),%edi
mov    %eax,%ecx
and    %edi,%ecx
cmp    %esi,%r8d
cmove  %edx,%edi
cmove  %r8d,%ecx
add    %edi,%edi
add    %ecx,%ecx
mov    %ecx,%r8d
mov    %edi,%edx
test   %edi,%edi
jne    1110 <from_naf+0x10>
ret

LLVM IR (-O0):
define i32 @from_naf(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %24, %1
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %29
8: ; preds = %5
%9 = load i32, i32* %4
%10 = load i32, i32* %2
%11 = xor i32 %10, %9
store i32 %11, i32* %2
%12 = load i32, i32* %4
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = and i32 %13, %14
%16 = xor i32 %12, %15
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %8
%19 = load i32, i32* %3
%20 = shl i32 %19, 1
store i32 %20, i32* %3
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = and i32 %21, %22
store i32 %23, i32* %4
br label %24
24: ; preds = %18, %8
%25 = load i32, i32* %3
%26 = shl i32 %25, 1
store i32 %26, i32* %3
%27 = load i32, i32* %4
%28 = shl i32 %27, 1
store i32 %28, i32* %4
br label %5
29: ; preds = %5
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @from_naf(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %14, %2 ]
%4 = phi i32 [ 1, %1 ], [ %13, %2 ]
%5 = phi i32 [ %0, %1 ], [ %6, %2 ]
%6 = xor i32 %3, %5
%7 = and i32 %6, %4
%8 = icmp eq i32 %3, %7
%9 = shl i32 %4, 1
%10 = and i32 %6, %9
%11 = select i1 %8, i32 %4, i32 %9
%12 = select i1 %8, i32 %3, i32 %10
%13 = shl i32 %11, 1
%14 = shl i32 %12, 1
%15 = icmp eq i32 %13, 0
br i1 %15, label %16, label %2
16: ; preds = %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ simple_fill();
int main(int argc, char *argv[]) {
  simple_fill();
  return 0;
}


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    $0x0,%al
call   1030 <simple_fill@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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 = call i32 (...) @simple_fill()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @simple_fill()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int dump_list_part_elems(void *elem) {
  printf("%d\n", *((int *)elem));
  return (0);
}


x86 assembly (clang, -O0):
<dump_list_part_elems>:
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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @dump_list_part_elems(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
int SAXPY(int n, int a, int x, int y) {
  int i;
  for (i = 0; i < n; i++)
    y = a * x + y;
  return y;
}


x86 assembly (clang, -O0):
<SAXPY>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    113e <SAXPY+0x3e>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <SAXPY+0x17>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SAXPY>:
imul   %edx,%esi
imul   %edi,%esi
xor    %eax,%eax
test   %edi,%edi
cmovg  %esi,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @SAXPY(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 0, i32* %9
br label %10
10: ; preds = %20, %4
%11 = load i32, i32* %9
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %23
14: ; preds = %10
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = mul nsw i32 %15, %16
%18 = load i32, i32* %8
%19 = add nsw i32 %17, %18
store i32 %19, i32* %8
br label %20
20: ; preds = %14
%21 = load i32, i32* %9
%22 = add nsw i32 %21, 1
store i32 %22, i32* %9
br label %10
23: ; preds = %10
%24 = load i32, i32* %8
ret i32 %24
}

LLVM IR (-O2):
define i32 @SAXPY(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %0, 0
%6 = mul i32 %2, %1
%7 = mul i32 %6, %0
%8 = select i1 %5, i32 %7, i32 0
%9 = add i32 %8, %3
ret i32 %9
}
void init_check() {}


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

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

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

LLVM IR (-O2):
define void @init_check() {
ret void
}
/* Variables and functions */
int exp(double);
int sqrt(int);
double PDF_0(double x) {
  return (1 / sqrt(2 * 3.14159265359)) * exp(-(x * x) / 2);
}


x86 assembly (clang, -O0):
<PDF_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x6,%edi
call   1040 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe93(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PDF_0>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    $0x6,%edi
call   1040 <sqrt@plt>
lea    0x1(%rax),%ecx
xor    %ebx,%ebx
cmp    $0x3,%ecx
cmovb  %eax,%ebx
movsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm0
mulsd  0xeae(%rip),%xmm0
call   1030 <exp@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @PDF_0(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @sqrt(i32 6)
%4 = sdiv i32 1, %3
%5 = load double, double* %2
%6 = load double, double* %2
%7 = fmul double %5, %6
%8 = fneg double %7
%9 = fdiv double %8, 2.000000e+00
%10 = call i32 @exp(double %9)
%11 = mul nsw i32 %4, %10
%12 = sitofp i32 %11 to double
ret double %12
}

LLVM IR (-O2):
define double @PDF_0(double %0) {
%2 = tail call i32 @sqrt(i32 6)
%3 = add i32 %2, 1
%4 = icmp ult i32 %3, 3
%5 = select i1 %4, i32 %2, i32 0
%6 = fneg double %0
%7 = fmul double %6, %0
%8 = fmul double %7, 5.000000e-01
%9 = tail call i32 @exp(double %8)
%10 = mul nsw i32 %5, %9
%11 = sitofp i32 %10 to double
ret double %11
}