xunge/DecIR huggingface dataset:
int fun142() { return 142; }


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

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

LLVM IR (-O0):
define i32 @fun142() {
ret i32 142
}

LLVM IR (-O2):
define i32 @fun142() {
ret i32 142
}
void PEM_read_bio(void) {}


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

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

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

LLVM IR (-O2):
define void @PEM_read_bio() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_vface_data(int, int, char *, int, char *, char *);
void fgmvwrite_vface_data_(int *nverts, int *facepe, char *oppface,
                           int *oppfacepe, char *cellid, char *nodeids) {
  gmvwrite_vface_data(*nverts, *facepe, oppface, *oppfacepe, cellid, nodeids);
}


x86 assembly (clang, -O0):
<fgmvwrite_vface_data_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <gmvwrite_vface_data@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgmvwrite_vface_data_>:
mov    (%rdi),%edi
mov    (%rsi),%esi
mov    (%rcx),%ecx
jmp    1030 <gmvwrite_vface_data@plt>

LLVM IR (-O0):
define void @fgmvwrite_vface_data_(i32* %0, i32* %1, i8* %2, i32* %3, i8* %4, i8* %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i8*
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i8*
store i32* %0, i32** %7
store i32* %1, i32** %8
store i8* %2, i8** %9
store i32* %3, i32** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %13
%15 = load i32*, i32** %8
%16 = load i32, i32* %15
%17 = load i8*, i8** %9
%18 = load i32*, i32** %10
%19 = load i32, i32* %18
%20 = load i8*, i8** %11
%21 = load i8*, i8** %12
%22 = call i32 @gmvwrite_vface_data(i32 %14, i32 %16, i8* %17, i32 %19, i8* %20, i8* %21)
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_vface_data_(i32* nocapture %0, i32* nocapture %1, i8* %2, i32* nocapture %3, i8* %4, i8* %5) {
%7 = load i32, i32* %0
%8 = load i32, i32* %1
%9 = load i32, i32* %3
%10 = tail call i32 @gmvwrite_vface_data(i32 %7, i32 %8, i8* %2, i32 %9, i8* %4, i8* %5)
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  while (x > 0) {
    x = y;
    y = y - 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1151 <main+0x41>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
override_options() {}


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

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

LLVM IR (-O0):
define i32 @override_options() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @override_options() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
void gen_code(const char *name, const char *ext, char *code) {
  strcpy(code, name);
  strcat(code, ext);
}


x86 assembly (clang, -O0):
<gen_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_code>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%rsi
mov    %rdx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strcat@plt>

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

LLVM IR (-O2):
define void @gen_code(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strcpy(i8* %2, i8* %0)
%5 = tail call i32 @strcat(i8* %2, i8* %1)
ret void
}
void wcs_setAll(ncoord, nelem, first) int ncoord, nelem;
double *first;
{
  double v0, *vp;
  v0 = *first;
  for (vp = first + nelem; vp < first + ncoord * nelem; vp += nelem) {
    *vp = v0;
  }
}


x86 assembly (clang, -O0):
<wcs_setAll>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%edx
imul   -0x8(%rbp),%edx
movslq %edx,%rdx
shl    $0x3,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jae    1177 <wcs_setAll+0x77>
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    112e <wcs_setAll+0x2e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcs_setAll>:
imul   %esi,%edi
cmp    %esi,%edi
jle    112c <wcs_setAll+0x2c>
movsd  (%rdx),%xmm0
movslq %esi,%rax
movslq %edi,%rcx
lea    (%rdx,%rcx,8),%rcx
lea    (%rdx,%rax,8),%rdx
shl    $0x3,%rax
nopl   (%rax)
movsd  %xmm0,(%rdx)
add    %rax,%rdx
cmp    %rcx,%rdx
jb     1120 <wcs_setAll+0x20>
ret

LLVM IR (-O0):
define void @wcs_setAll(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
%7 = alloca double
%8 = alloca double*
store i32 %0, i32* %4
store i32 %1, i32* %5
store double* %2, double** %6
%9 = load double*, double** %6
%10 = load double, double* %9
store double %10, double* %7
%11 = load double*, double** %6
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
store double* %14, double** %8
br label %15
15: ; preds = %27, %3
%16 = load double*, double** %8
%17 = load double*, double** %6
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = mul nsw i32 %18, %19
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %17, i64 %21
%23 = icmp ult double* %16, %22
br i1 %23, label %24, label %32
24: ; preds = %15
%25 = load double, double* %7
%26 = load double*, double** %8
store double %25, double* %26
br label %27
27: ; preds = %24
%28 = load i32, i32* %5
%29 = load double*, double** %8
%30 = sext i32 %28 to i64
%31 = getelementptr inbounds double, double* %29, i64 %30
store double* %31, double** %8
br label %15
32: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @wcs_setAll(i32 %0, i32 %1, double* %2) {
%4 = load double, double* %2
%5 = sext i32 %1 to i64
%6 = mul nsw i32 %1, %0
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds double, double* %2, i64 %7
%9 = icmp sgt i32 %6, %1
br i1 %9, label %10, label %16
10: ; preds = %3
%11 = getelementptr inbounds double, double* %2, i64 %5
br label %12
12: ; preds = %10, %12
%13 = phi double* [ %14, %12 ], [ %11, %10 ]
store double %4, double* %13
%14 = getelementptr inbounds double, double* %13, i64 %5
%15 = icmp ult double* %14, %8
br i1 %15, label %12, label %16
16: ; preds = %12, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rightDropAtPos(int);
int /*<<< orphan*/ writeDebugStreamLine(char *);
void rightOuterCrate3() {
  writeDebugStreamLine("Crate 3");
  rightDropAtPos(2);
}


x86 assembly (clang, -O0):
<rightOuterCrate3>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <writeDebugStreamLine@plt>
mov    $0x2,%edi
call   1040 <rightDropAtPos@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightOuterCrate3>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <writeDebugStreamLine@plt>
mov    $0x2,%edi
pop    %rax
jmp    1040 <rightDropAtPos@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Crate 3\00"
define void @rightOuterCrate3() {
%1 = call i32 @writeDebugStreamLine(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @rightDropAtPos(i32 2)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"Crate 3\00"
define void @rightOuterCrate3() {
%1 = tail call i32 @writeDebugStreamLine(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @rightDropAtPos(i32 2)
ret void
}
/* Variables and functions */
int fcntl(int, int, int);
int octave_fcntl_wrapper(int fd, int cmd, int arg) {
  return fcntl(fd, cmd, arg);
}


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

x86 assembly (clang, -O2):
<octave_fcntl_wrapper>:
jmp    1030 <fcntl@plt>

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

LLVM IR (-O2):
define i32 @octave_fcntl_wrapper(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @fcntl(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
int main() {
  char a, b;
  a = 10;
  b = 0;
  char temp;
  temp = a;
  a = b;
  b = temp;
  ;
  printf("%d %d\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0xa,-0x5(%rbp)
movb   $0x0,-0x6(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x7(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0x6(%rbp)
mov    -0x5(%rbp),%al
lea    0xebd(%rip),%rdi
movsbl %al,%esi
movsbl -0x6(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext 0, i8 signext 10)
ret i32 0
}
/* Variables and functions */
double lgamma(double);
double logfac(int n) {
  double y, x;
  x = (double)(n + 1);
  y = lgamma(x);
  return (y);
}


x86 assembly (clang, -O0):
<logfac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <lgamma@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logfac>:
add    $0x1,%edi
cvtsi2sd %edi,%xmm0
jmp    1030 <lgamma@plt>

LLVM IR (-O0):
define double @logfac(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
%7 = sitofp i32 %6 to double
store double %7, double* %4
%8 = load double, double* %4
%9 = call double @lgamma(double %8)
store double %9, double* %3
%10 = load double, double* %3
ret double %10
}

LLVM IR (-O2):
define double @logfac(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = sitofp i32 %2 to double
%4 = tail call double @lgamma(double %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ decide(int /*<<< orphan*/);
int /*<<< orphan*/ get_input();
int /*<<< orphan*/ print_decisions(int /*<<< orphan*/);
int main(void) {
  print_decisions(decide(get_input()));
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <get_input@plt>
mov    %eax,%edi
call   1040 <decide@plt>
mov    %eax,%edi
call   1030 <print_decisions@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @get_input()
%2 = tail call i32 @decide(i32 %1)
%3 = tail call i32 @print_decisions(i32 %2)
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t swap_bytes(uint16_t n) {
  uint16_t res;
  res = ((n << 8) & 0xFF00) + (n >> 8);
  return res;
}


x86 assembly (clang, -O0):
<swap_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
and    $0xff00,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_bytes>:
mov    %edi,%eax
shl    $0x8,%eax
movzwl %ax,%eax
sar    $0x8,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @swap_bytes(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 %4, 8
%6 = and i32 %5, 65280
%7 = load i32, i32* %2
%8 = ashr i32 %7, 8
%9 = add nsw i32 %6, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @swap_bytes(i32 %0) {
%2 = shl i32 %0, 8
%3 = and i32 %2, 65280
%4 = ashr i32 %0, 8
%5 = add nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void quiz1() {
  float f = 3;
  char *p = "I am string";
  printf("%c\n", *p);
  printf("%f\n", f);
}


x86 assembly (clang, -O0):
<quiz1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x40400000,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cvtsi2ss %eax,%xmm0
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quiz1>:
push   %rax
lea    0xef0(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
movss  0xed0(%rip),%xmm0
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"I am string\00"
@.str.1 = [4 x i8] c"%c\0A\00"
@.str.2 = [4 x i8] c"%f\0A\00"
define void @quiz1() {
%1 = alloca float
%2 = alloca i8*
store float 3.000000e+00, float* %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sitofp i8 %4 to float
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %5)
%7 = load float, float* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), float %7)
ret void
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%c\0A\00"
@.str.2 = [4 x i8] c"%f\0A\00"
define void @quiz1() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float 7.300000e+01)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), float 3.000000e+00)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("Programming in c");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Programming in c\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Programming in c\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
char *malloc(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *mystrdup(char *str) {
  char *copy = malloc((strlen(str) + 1) * sizeof(char));
  if (copy == NULL) {
    perror("malloc");
    abort();
  }
  strcpy(copy, str);
  return copy;
}


x86 assembly (clang, -O0):
<mystrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1197 <mystrdup+0x47>
lea    0xe75(%rip),%rdi
call   1070 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <strlen@plt>
lea    0x1(%rax),%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     1182 <mystrdup+0x32>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe77(%rip),%rdi
call   1070 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"malloc\00"
define i8* @mystrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 1
%9 = trunc i64 %8 to i32
%10 = call i8* @malloc(i32 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %1
%17 = load i8*, i8** %3
%18 = load i8*, i8** %2
%19 = call i32 @strcpy(i8* %17, i8* %18)
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
define i8* @mystrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %1
%10 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Type definitions */
typedef int off_t;

/* Variables and functions */
scalar_t__ syscall(int, int, int, int, int *, int);
off_t lseek(int fd, off_t offset, int whence) {
  off_t result;
  return syscall(140, fd, offset >> 32, offset, &result, whence) ? -1 : result;
}


x86 assembly (clang, -O0):
<lseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x20,%ecx
sar    %cl,%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r9d
mov    $0x8c,%edi
lea    -0x10(%rbp),%r8
call   1030 <syscall@plt>
cmp    $0x0,%rax
je     115a <lseek+0x4a>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1160 <lseek+0x50>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lseek>:
push   %rax
mov    %esi,%ecx
mov    %edi,%esi
lea    0x4(%rsp),%r8
mov    $0x8c,%edi
mov    %edx,%r9d
call   1030 <syscall@plt>
neg    %rax
sbb    %eax,%eax
or     0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = ashr i32 %9, 32
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i64 @syscall(i32 140, i32 %8, i32 %10, i32 %11, i32* %7, i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %3
br label %18
16: ; preds = %3
%17 = load i32, i32* %7
br label %18
18: ; preds = %16, %15
%19 = phi i32 [ -1, %15 ], [ %17, %16 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i64 @syscall(i32 140, i32 %0, i32 poison, i32 %1, i32* %4, i32 %2)
%7 = icmp eq i64 %6, 0
%8 = load i32, i32* %4
%9 = select i1 %7, i32 %8, i32 -1
ret i32 %9
}
/* Variables and functions */
long double sinh(long double);
long double fun_sinh(long double a) { return sinh(a); }


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

x86 assembly (clang, -O2):
<fun_sinh>:
jmp    1030 <sinh@plt>

LLVM IR (-O0):
define x86_fp80 @fun_sinh(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @sinh(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @fun_sinh(x86_fp80 %0) {
%2 = tail call x86_fp80 @sinh(x86_fp80 %0)
ret x86_fp80 %2
}
putchar(int __c) {}


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

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

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

LLVM IR (-O2):
define i32 @putchar(i32 %0) {
ret i32 undef
}
double linear_interp(double x, double lx, double ux, double ly, double uy) {
  return ((x - lx) / (ux - lx) * (uy - ly) + ly);
}


x86 assembly (clang, -O0):
<linear_interp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm2
subsd  -0x20(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_interp>:
subsd  %xmm1,%xmm0
subsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
subsd  %xmm3,%xmm4
mulsd  %xmm4,%xmm0
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @linear_interp(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %6
%12 = load double, double* %7
%13 = fsub double %11, %12
%14 = load double, double* %8
%15 = load double, double* %7
%16 = fsub double %14, %15
%17 = fdiv double %13, %16
%18 = load double, double* %10
%19 = load double, double* %9
%20 = fsub double %18, %19
%21 = load double, double* %9
%22 = call double @llvm.fmuladd.f64(double %17, double %20, double %21)
ret double %22
}

LLVM IR (-O2):
define double @linear_interp(double %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %0, %1
%7 = fsub double %2, %1
%8 = fdiv double %6, %7
%9 = fsub double %4, %3
%10 = tail call double @llvm.fmuladd.f64(double %8, double %9, double %3)
ret double %10
}
int fun1086() { return 1086; }


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

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

LLVM IR (-O0):
define i32 @fun1086() {
ret i32 1086
}

LLVM IR (-O2):
define i32 @fun1086() {
ret i32 1086
}
__attribute__((no)) int jjj() {
  int ans;
  asm("jjj_label: .globl jjj_label");
  ans = kkk() + 1;
  asm("jjj_label2: .globl jjj_label2");
  return ans;
}


x86 assembly (clang, -O0):
<jjj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp

x86 assembly (clang, -O2):
<jjj>:
push   %rax

LLVM IR (-O0):
define i32 @jjj() {
%1 = alloca i32
%2 = call i32 (...) @kkk()
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @jjj() {
tail call void asm sideeffect "jjj_label: .globl jjj_label", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (...) @kkk()
%2 = add nsw i32 %1, 1
tail call void asm sideeffect "jjj_label2: .globl jjj_label2", "~{dirflag},~{fpsr},~{flags}"()
ret i32 %2
}
int increment(int i) {
  static int j = 0;
  j++;
  return i + j;
}


x86 assembly (clang, -O0):
<increment>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2f17(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f0e(%rip)
mov    -0x4(%rbp),%eax
add    0x2f05(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<increment>:
mov    0x2f1e(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f15(%rip)
add    %edi,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
@increment.j = internal global i32 0
define i32 @increment(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @increment.j
%4 = add nsw i32 %3, 1
store i32 %4, i32* @increment.j
%5 = load i32, i32* %2
%6 = load i32, i32* @increment.j
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
@increment.j = internal unnamed_addr global i32 0
define i32 @increment(i32 %0) {
%2 = load i32, i32* @increment.j
%3 = add nsw i32 %2, 1
store i32 %3, i32* @increment.j
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void error_fatal(int code, char *obj, char *msg) {
  fprintf(stderr, "%s: %s", obj, msg);
  fflush(stderr);
  fflush(stdout);
  exit(code);
}


x86 assembly (clang, -O0):
<error_fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xea5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x4(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<error_fatal>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%ebp
mov    0x2e9e(%rip),%rbx
mov    (%rbx),%edi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    %ebp,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"%s: %s\00"
@stdout = global i32 0
define void @error_fatal(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
%11 = load i32, i32* @stderr
%12 = call i32 @fflush(i32 %11)
%13 = load i32, i32* @stdout
%14 = call i32 @fflush(i32 %13)
%15 = load i32, i32* %4
%16 = call i32 @exit(i32 %15)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"%s: %s\00"
@stdout = global i32 0
define void @error_fatal(i32 %0, i8* %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fflush(i32 %6)
%8 = load i32, i32* @stdout
%9 = tail call i32 @fflush(i32 %8)
%10 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ s(int *);
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int a, b = 0xfe, c = 0xef;
  a = b + c;
  b = 3;
  c = 5;
  s(&a);
  test_assert(a == 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfe,-0xc(%rbp)
movl   $0xef,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <s@plt>
cmpl   $0x8,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <test_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1ed,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <s@plt>
xor    %edi,%edi
cmpl   $0x8,0x4(%rsp)
sete   %dil
call   1040 <test_assert@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 254, i32* %3
store i32 239, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
store i32 %7, i32* %2
store i32 3, i32* %3
store i32 5, i32* %4
%8 = call i32 @s(i32* %2)
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 8
%11 = zext i1 %10 to i32
%12 = call i32 @test_assert(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 493, i32* %1
%3 = call i32 @s(i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 8
%6 = zext i1 %5 to i32
%7 = call i32 @test_assert(i32 %6)
ret i32 0
}
void foo_1_2_2_1_1_2_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_1_1_2_2_1_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void f2() { foo(); }


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

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

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

LLVM IR (-O2):
define void @f2() {
%1 = tail call i32 (...) @foo()
ret void
}
/* Variables and functions */
double df(double);
double f(double);
int fabs(double);
double newton(double x0) {
  double x = x0, oldx;
  do {
    oldx = x;
    x = x - f(x) / df(x);
  } while (fabs(x - oldx) > 1e-6);
  return x;
}


x86 assembly (clang, -O0):
<newton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <f@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <df@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe57(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1147 <newton+0x17>
movsd  -0x10(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newton>:
sub    $0x18,%rsp
movsd  %xmm0,(%rsp)
nopl   0x0(%rax)
movsd  (%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1030 <f@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <df@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  (%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
subsd  0x8(%rsp),%xmm0
call   1040 <fabs@plt>
test   %eax,%eax
jg     1140 <newton+0x10>
movsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @newton(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
store double %5, double* %3
br label %6
6: ; preds = %15, %1
%7 = load double, double* %3
store double %7, double* %4
%8 = load double, double* %3
%9 = load double, double* %3
%10 = call double @f(double %9)
%11 = load double, double* %3
%12 = call double @df(double %11)
%13 = fdiv double %10, %12
%14 = fsub double %8, %13
store double %14, double* %3
br label %15
15: ; preds = %6
%16 = load double, double* %3
%17 = load double, double* %4
%18 = fsub double %16, %17
%19 = call i32 @fabs(double %18)
%20 = sitofp i32 %19 to double
%21 = fcmp ogt double %20, 0x3EB0C6F7A0B5ED8D
br i1 %21, label %6, label %22
22: ; preds = %15
%23 = load double, double* %3
ret double %23
}

LLVM IR (-O2):
define double @newton(double %0) {
br label %2
2: ; preds = %2, %1
%3 = phi double [ %0, %1 ], [ %7, %2 ]
%4 = tail call double @f(double %3)
%5 = tail call double @df(double %3)
%6 = fdiv double %4, %5
%7 = fsub double %3, %6
%8 = fsub double %7, %3
%9 = tail call i32 @fabs(double %8)
%10 = icmp sgt i32 %9, 0
br i1 %10, label %2, label %11
11: ; preds = %2
ret double %7
}
void finish_switch(struct pib_switch *sw) {}


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

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

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

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


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

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

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

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


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

x86 assembly (clang, -O2):
<gettid_cache_delete>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @gettid_cache_delete(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
double test3(double a, double b, double c) { return -(a + b * c); }


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
mulsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
xorpd  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @test3(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call double @llvm.fmuladd.f64(double %8, double %9, double %7)
%11 = fneg double %10
ret double %11
}

LLVM IR (-O2):
define double @test3(double %0, double %1, double %2) {
%4 = tail call double @llvm.fmuladd.f64(double %1, double %2, double %0)
%5 = fneg double %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ debug_error(char *, char const *, char *);
char *strerror(int);
void debug_perror(const char *function, int err) {
  char *strer = strerror(err);
  debug_error("Function: %s, %s\n", function, strer);
}


x86 assembly (clang, -O0):
<debug_perror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <strerror@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xeb6(%rip),%rdi
call   1040 <debug_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_perror>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <strerror@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <debug_error@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Function: %s, %s\0A\00"
define void @debug_perror(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i8* @strerror(i32 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %3
%9 = load i8*, i8** %5
%10 = call i32 @debug_error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Function: %s, %s\0A\00"
define void @debug_perror(i8* %0, i32 %1) {
%3 = tail call i8* @strerror(i32 %1)
%4 = tail call i32 @debug_error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
ret void
}
int test_imm_F3uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xF3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F3uint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0xf3,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F3uint64_lowword_mem>:
testb  $0xf3,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F3uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 243
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_F3uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 243
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void whichtable(char **pfmt) { --*pfmt; }


x86 assembly (clang, -O0):
<whichtable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<whichtable>:
addq   $0xffffffffffffffff,(%rdi)
ret

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

LLVM IR (-O2):
define void @whichtable(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr inbounds i8, i8* %2, i64 -1
store i8* %3, i8** %0
ret void
}
int int_to_bits_alt(int value) {
  unsigned int uvalue = *(unsigned *)&value;
  int bits = 0;
  while (uvalue != 0) {
    if (uvalue & 1) {
      bits += 1;
    }
    uvalue >>= 1;
  }
  return bits;
}


x86 assembly (clang, -O0):
<int_to_bits_alt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1144 <int_to_bits_alt+0x44>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1136 <int_to_bits_alt+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1114 <int_to_bits_alt+0x14>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_bits_alt>:
xor    %eax,%eax
test   %edi,%edi
je     1120 <int_to_bits_alt+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <int_to_bits_alt+0x10>
ret

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

LLVM IR (-O2):
define i32 @int_to_bits_alt(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %4, %6
%8 = lshr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ console_putchar(char const);
void console_putstring(const char *s) {
  while (*s) {
    console_putchar(*s);
    s++;
  }
}


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

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

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

LLVM IR (-O2):
define void @console_putstring(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @console_putchar(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
void vsub(float const *src1, float const *src2, float *dst) {
  {
    *(dst + 0) = (float)(*(src1 + 0) - *(src2 + 0));
    *(dst + 1) = (float)(*(src1 + 1) - *(src2 + 1));
    *(dst + 2) = (float)(*(src1 + 2) - *(src2 + 2));
    return;
  }
}


x86 assembly (clang, -O0):
<vsub>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsub>:
movss  (%rdi),%xmm0
subss  (%rsi),%xmm0
movss  %xmm0,(%rdx)
movss  0x4(%rdi),%xmm0
subss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdx)
movss  0x8(%rdi),%xmm0
subss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdx)
ret

LLVM IR (-O0):
define void @vsub(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %4
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %5
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fsub float %9, %12
%14 = load float*, float** %6
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %5
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fsub float %18, %21
%23 = load float*, float** %6
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %4
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float*, float** %5
%29 = getelementptr inbounds float, float* %28, i64 2
%30 = load float, float* %29
%31 = fsub float %27, %30
%32 = load float*, float** %6
%33 = getelementptr inbounds float, float* %32, i64 2
store float %31, float* %33
ret void
}

LLVM IR (-O2):
define void @vsub(float* nocapture %0, float* nocapture %1, float* nocapture writeonly %2) {
%4 = load float, float* %0
%5 = load float, float* %1
%6 = fsub float %4, %5
store float %6, float* %2
%7 = getelementptr inbounds float, float* %0, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 1
%10 = load float, float* %9
%11 = fsub float %8, %10
%12 = getelementptr inbounds float, float* %2, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %0, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %1, i64 2
%16 = load float, float* %15
%17 = fsub float %14, %16
%18 = getelementptr inbounds float, float* %2, i64 2
store float %17, float* %18
ret void
}