xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
void ft_putstr(char const *s) {
  int i;
  i = 0;
  while (s[i])
    write(1, &s[i++], 1);
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115a <ft_putstr+0x4a>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cltq
add    %rax,%rsi
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <write@plt>
jmp    1123 <ft_putstr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
cmpb   $0x0,(%rdi)
je     113c <ft_putstr+0x2c>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_putstr+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @ft_putstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %4
%12 = load i8*, i8** %2
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
%15 = sext i32 %13 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
%17 = call i32 @write(i32 1, i8* %16, i32 1)
br label %4
18: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = add nuw i64 %5, 1
%8 = tail call i32 @write(i32 1, i8* %6, i32 1)
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int f347(int *);
int f348(int *p) { return f347(p); }


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

x86 assembly (clang, -O2):
<f348>:
jmp    1030 <f347@plt>

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

LLVM IR (-O2):
define i32 @f348(i32* %0) {
%2 = tail call i32 @f347(i32* %0)
ret i32 %2
}
/* Variables and functions */
int crypto_verify_16(unsigned char const *, unsigned char *);
int /*<<< orphan*/ poly1305_mac(unsigned char *, unsigned char const *,
                                unsigned long long, unsigned char const *);
int poly1305_mac_verify(const unsigned char *h, const unsigned char *in,
                        unsigned long long inlen, const unsigned char *k) {
  unsigned char correct[16];
  poly1305_mac(correct, in, inlen, k);
  return crypto_verify_16(h, correct);
}


x86 assembly (clang, -O0):
<poly1305_mac_verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <poly1305_mac@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <crypto_verify_16@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poly1305_mac_verify>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <poly1305_mac@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <crypto_verify_16@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @poly1305_mac_verify(i8* %0, i8* %1, i64 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca [16 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i8*, i8** %8
%14 = call i32 @poly1305_mac(i8* %10, i8* %11, i64 %12, i8* %13)
%15 = load i8*, i8** %5
%16 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%17 = call i32 @crypto_verify_16(i8* %15, i8* %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @poly1305_mac_verify(i8* %0, i8* %1, i64 %2, i8* %3) {
%5 = alloca [16 x i8]
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%7 = call i32 @poly1305_mac(i8* %6, i8* %1, i64 %2, i8* %3)
%8 = call i32 @crypto_verify_16(i8* %0, i8* %6)
ret i32 %8
}
/* Variables and functions */
char *calloc(int, int);
int rand();
int /*<<< orphan*/ strcpy(char *, char *);
char *fn102() {
  char *result;
  result = calloc(5 + rand() % 5, 4);
  strcpy((char *)result, "fn102");
  return result;
}


x86 assembly (clang, -O0):
<fn102>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x5,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe9b(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn102>:
push   %rbx
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x5,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
lea    0xe93(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"fn102\00"
define i8* @fn102() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 5
%3 = add nsw i32 %2, 5
%4 = tail call i8* @calloc(i32 %3, i32 4)
%5 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}
int isNumber(char *s) {
  if (*s >= '0' && *s <= '9') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     1134 <isNumber+0x34>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jg     1134 <isNumber+0x34>
movl   $0x1,-0x4(%rbp)
jmp    113b <isNumber+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNumber>:
mov    (%rdi),%cl
add    $0xd0,%cl
xor    %eax,%eax
cmp    $0xa,%cl
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isNumber(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void byCString(const char *x) { printf("byCString(%s)\n", x); }


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

x86 assembly (clang, -O2):
<byCString>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"byCString(%s)\0A\00"
define void @byCString(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *str_date_log(char *buffer_time) {
  time_t rawtime;
  struct tm *timeinfo;
  time(&rawtime);
  timeinfo = localtime(&rawtime);
  strftime(buffer_time, 30, "log_%Y-%m-%d", timeinfo);
  return buffer_time;
}


x86 assembly (clang, -O0):
<str_date_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <time@plt>
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1e,%esi
lea    0xe9a(%rip),%rdx
call   1050 <strftime@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_date_log>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <time@plt>
mov    %r14,%rdi
call   1030 <localtime@plt>
lea    0xead(%rip),%rdx
mov    %rbx,%rdi
mov    $0x1e,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [13 x i8] c"log_%Y-%m-%d\00"
define i8* @str_date_log(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.tm*
store i8* %0, i8** %2
%5 = call i32 @time(i32* %3)
%6 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %6, %struct.tm** %4
%7 = load i8*, i8** %2
%8 = load %struct.tm*, %struct.tm** %4
%9 = call i32 @strftime(i8* %7, i32 30, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %struct.tm* %8)
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [13 x i8] c"log_%Y-%m-%d\00"
define i8* @str_date_log(i8* returned %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @time(i32* %2)
%5 = call %struct.tm* @localtime(i32* %2)
%6 = call i32 @strftime(i8* %0, i32 30, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret i8* %0
}
void ext4_xattr_put_super(struct super_block *sb) {}


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

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

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

LLVM IR (-O2):
%struct.super_block = type opaque
define void @ext4_xattr_put_super(%struct.super_block* nocapture %0) {
ret void
}
/* Variables and functions */
double ldexpk(double, int);
double xldexp(double x, int q) { return ldexpk(x, q); }


x86 assembly (clang, -O0):
<xldexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
call   1030 <ldexpk@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xldexp>:
jmp    1030 <ldexpk@plt>

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

LLVM IR (-O2):
define double @xldexp(double %0, i32 %1) {
%3 = tail call double @ldexpk(double %0, i32 %1)
ret double %3
}
/* Variables and functions */
scalar_t__ foo(int);
int rand();
int main(void) {
  int i;
  float a = 0;
  for (i = 0; i < 1000; i++) {
    a += foo(rand() % 65536);
  }
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    117e <main+0x5e>
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x10000,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1030 <foo@plt>
cvtsi2ss %rax,%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113e <main+0x1e>
cvttss2si -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
mov    $0x3e8,%ebx
nopl   (%rax)
movss  %xmm0,0xc(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
lea    0xffff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffff0000,%ecx
sub    %ecx,%eax
mov    %eax,%edi
call   1030 <foo@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  0xc(%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
movss  0xc(%rsp),%xmm0
add    $0xffffffff,%ebx
jne    1130 <main+0x10>
cvttss2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %3
store i32 0, i32* %2
br label %4
4: ; preds = %14, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 1000
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = call i32 (...) @rand()
%9 = srem i32 %8, 65536
%10 = call i64 @foo(i32 %9)
%11 = sitofp i64 %10 to float
%12 = load float, float* %3
%13 = fadd float %12, %11
store float %13, float* %3
br label %14
14: ; preds = %7
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %4
17: ; preds = %4
%18 = load float, float* %3
%19 = fptosi float %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi float [ 0.000000e+00, %0 ], [ %8, %1 ]
%3 = phi i32 [ 0, %0 ], [ %9, %1 ]
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 65536
%6 = tail call i64 @foo(i32 %5)
%7 = sitofp i64 %6 to float
%8 = fadd float %2, %7
%9 = add nuw nsw i32 %3, 1
%10 = icmp eq i32 %9, 1000
br i1 %10, label %11, label %1
11: ; preds = %1
%12 = fptosi float %8 to i32
ret i32 %12
}
/* Variables and functions */
int get_children();
double simulate(int runs) {
  int boys = 0;
  int girls = 0;
  for (int i = 0; i < runs; i++) {
    girls++;
    boys += get_children() - 1;
  }
  return (1.0 * boys) / girls;
}


x86 assembly (clang, -O0):
<simulate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1163 <simulate+0x53>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <get_children@plt>
sub    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1130 <simulate+0x20>
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xe90(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simulate>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1140 <simulate+0x30>
mov    %edi,%r14d
mov    %edi,%ebp
xor    %ebx,%ebx
nop
xor    %eax,%eax
call   1030 <get_children@plt>
add    %eax,%ebx
add    $0xffffffff,%ebx
add    $0xffffffff,%ebp
jne    1120 <simulate+0x10>
cvtsi2sd %ebx,%xmm0
cvtsi2sd %r14d,%xmm1
divsd  %xmm1,%xmm0
jmp    1148 <simulate+0x38>
movsd  0xeb8(%rip),%xmm0
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define double @simulate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %1
%7 = load i32, i32* %5
%8 = load i32, i32* %2
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
%13 = call i32 (...) @get_children()
%14 = sub nsw i32 %13, 1
%15 = load i32, i32* %3
%16 = add nsw i32 %15, %14
store i32 %16, i32* %3
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = load i32, i32* %3
%22 = sitofp i32 %21 to double
%23 = fmul double 1.000000e+00, %22
%24 = load i32, i32* %4
%25 = sitofp i32 %24 to double
%26 = fdiv double %23, %25
ret double %26
}

LLVM IR (-O2):
define double @simulate(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %9, label %7
3: ; preds = %9
%4 = sitofp i32 %15 to double
%5 = sitofp i32 %0 to double
%6 = fdiv double %4, %5
br label %7
7: ; preds = %3, %1
%8 = phi double [ %6, %3 ], [ 0x7FF8000000000000, %1 ]
ret double %8
9: ; preds = %1, %9
%10 = phi i32 [ %12, %9 ], [ 0, %1 ]
%11 = phi i32 [ %15, %9 ], [ 0, %1 ]
%12 = add nuw nsw i32 %10, 1
%13 = tail call i32 (...) @get_children()
%14 = add i32 %11, -1
%15 = add i32 %14, %13
%16 = icmp eq i32 %12, %0
br i1 %16, label %3, label %9
}
void set_msr_bit(unsigned int msr, int bit) {
  unsigned int mask = 1 << bit;
  __asm__ volatile("rdmsr; or %0, %%eax; wrmsr" ::"r"(mask), "c"(msr)
                   : "eax", "edx");
}


x86 assembly (clang, -O0):
<set_msr_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x4(%rbp),%ecx
rdmsr
or     %esi,%eax
wrmsr
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_msr_bit>:
mov    %esi,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    %edi,%ecx
rdmsr
or     %esi,%eax
wrmsr
ret

LLVM IR (-O0):
define void @set_msr_bit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = shl i32 1, %6
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %3
ret void
}

LLVM IR (-O2):
define void @set_msr_bit(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
tail call void asm sideeffect "rdmsr; or $0, %eax; wrmsr", "r,{cx},~{eax},~{edx},~{dirflag},~{fpsr},~{flags}"(i32 %3, i32 %0)
ret void
}
/* Variables and functions */
char *righttrim(char *, char);
char *rtrimt(char *str) { return righttrim(str, '\t'); }


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

x86 assembly (clang, -O2):
<rtrimt>:
mov    $0x9,%esi
jmp    1030 <righttrim@plt>

LLVM IR (-O0):
define i8* @rtrimt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @righttrim(i8* %3, i8 signext 9)
ret i8* %4
}

LLVM IR (-O2):
define i8* @rtrimt(i8* %0) {
%2 = tail call i8* @righttrim(i8* %0, i8 signext 9)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ cx_prim_err(char *);
void general_err(char *message) { cx_prim_err(message); }


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

x86 assembly (clang, -O2):
<general_err>:
jmp    1030 <cx_prim_err@plt>

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

LLVM IR (-O2):
define void @general_err(i8* %0) {
%2 = tail call i32 @cx_prim_err(i8* %0)
ret void
}
void foo665() {}


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

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

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

LLVM IR (-O2):
define void @foo665() {
ret void
}
char *langRomTypeS1990() { return "S1990"; }


x86 assembly (clang, -O0):
<langRomTypeS1990>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypeS1990>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"S1990\00"
define i8* @langRomTypeS1990() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"S1990\00"
define i8* @langRomTypeS1990() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
double getBit(unsigned char, int /*<<< orphan*/);
void gamma_to_xyz(double g1, double g2, unsigned char T, double x, double y,
                  double z) {
  double etta = 2.0f / (1.0f + g1 * g1 + g2 * g2);
  x = g1 * etta;
  y = g2 * etta;
  z = 2 * (getBit(T, 0) - 0.5);
}


x86 assembly (clang, -O0):
<gamma_to_xyz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %dil,%al
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec3(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe95(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
xor    %esi,%esi
movzbl -0x11(%rbp),%edi
call   1030 <getBit@plt>
movaps %xmm0,%xmm1
movsd  0xe60(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe4c(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gamma_to_xyz>:
xor    %esi,%esi
jmp    1030 <getBit@plt>

LLVM IR (-O0):
define void @gamma_to_xyz(double %0, double %1, i8 zeroext %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca i8
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store double %0, double* %7
store double %1, double* %8
store i8 %2, i8* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%14 = load double, double* %7
%15 = load double, double* %7
%16 = call double @llvm.fmuladd.f64(double %14, double %15, double 1.000000e+00)
%17 = load double, double* %8
%18 = load double, double* %8
%19 = call double @llvm.fmuladd.f64(double %17, double %18, double %16)
%20 = fdiv double 2.000000e+00, %19
store double %20, double* %13
%21 = load double, double* %7
%22 = load double, double* %13
%23 = fmul double %21, %22
store double %23, double* %10
%24 = load double, double* %8
%25 = load double, double* %13
%26 = fmul double %24, %25
store double %26, double* %11
%27 = load i8, i8* %9
%28 = call double @getBit(i8 zeroext %27, i32 0)
%29 = fsub double %28, 5.000000e-01
%30 = fmul double 2.000000e+00, %29
store double %30, double* %12
ret void
}

LLVM IR (-O2):
define void @gamma_to_xyz(double %0, double %1, i8 zeroext %2, double %3, double %4, double %5) {
%7 = tail call double @getBit(i8 zeroext %2, i32 0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ serial;
};
typedef TYPE_1__ XDestroyWindowEvent;

/* Variables and functions */
unsigned long get_XDestroyWindowEvent_serial(void *_p) {
  return (unsigned long)((XDestroyWindowEvent *)_p)->serial;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XDestroyWindowEvent_serial(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XDestroyWindowEvent_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
char *_i2a(unsigned i, char *a, unsigned base) {
  if (i / base > 0)
    a = _i2a(i / base, a, base);
  *a = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"[i % base];
  return a + 1;
}


x86 assembly (clang, -O0):
<_i2a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x14(%rbp)
cmp    $0x0,%eax
jbe    114d <_i2a+0x3d>
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x14(%rbp)
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <_i2a@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x14(%rbp)
mov    %edx,%eax
mov    %eax,%ecx
lea    0xea0(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_i2a>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %edi,%ebp
cmp    %edi,%edx
ja     112d <_i2a+0x1d>
mov    %ebp,%eax
xor    %edx,%edx
div    %ebx
mov    %eax,%edi
mov    %ebx,%edx
call   1030 <_i2a@plt>
mov    %rax,%rsi
mov    %ebp,%eax
xor    %edx,%edx
div    %ebx
lea    0xec6(%rip),%rax
mov    (%rdx,%rax,1),%al
mov    %al,(%rsi)
add    $0x1,%rsi
mov    %rsi,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
define i8* @_i2a(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = udiv i32 %7, %8
%10 = icmp ugt i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %3
%12 = load i32, i32* %4
%13 = load i32, i32* %6
%14 = udiv i32 %12, %13
%15 = load i8*, i8** %5
%16 = load i32, i32* %6
%17 = call i8* @_i2a(i32 %14, i8* %15, i32 %16)
store i8* %17, i8** %5
br label %18
18: ; preds = %11, %3
%19 = load i32, i32* %4
%20 = load i32, i32* %6
%21 = urem i32 %19, %20
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds [37 x i8], [37 x i8]* @.str, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = load i8*, i8** %5
store i8 %24, i8* %25
%26 = load i8*, i8** %5
%27 = getelementptr inbounds i8, i8* %26, i64 1
ret i8* %27
}

LLVM IR (-O2):
@.str = [37 x i8] c"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
define i8* @_i2a(i32 %0, i8* %1, i32 %2) {
%4 = icmp ugt i32 %2, %0
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = udiv i32 %0, %2
%7 = tail call i8* @_i2a(i32 %6, i8* %1, i32 %2)
br label %8
8: ; preds = %5, %3
%9 = phi i8* [ %7, %5 ], [ %1, %3 ]
%10 = urem i32 %0, %2
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds [37 x i8], [37 x i8]* @.str, i64 0, i64 %11
%13 = load i8, i8* %12
store i8 %13, i8* %9
%14 = getelementptr inbounds i8, i8* %9, i64 1
ret i8* %14
}
void RTTimerLRCreate(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTimerLRCreate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ B9600;
int /*<<< orphan*/ CS8;
scalar_t__ logitech_command(int, char *);
int /*<<< orphan*/ setline(int, int /*<<< orphan*/, int /*<<< orphan*/);
int mzp_init(int fd, long *id, long *extra) {
  if (logitech_command(fd, "*X*q"))
    return -1;
  setline(fd, CS8, B9600);
  return 0;
}


x86 assembly (clang, -O0):
<mzp_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
lea    0xec3(%rip),%rsi
call   1030 <logitech_command@plt>
cmp    $0x0,%rax
je     1158 <mzp_init+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <mzp_init+0x59>
mov    -0x8(%rbp),%edi
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
mov    0x2e7d(%rip),%rax
mov    (%rax),%edx
call   1040 <setline@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mzp_init>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rsi
call   1030 <logitech_command@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     113e <mzp_init+0x1e>
pop    %rbx
ret
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
mov    0x2e9a(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
call   1040 <setline@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"*X*q\00"
@CS8 = global i32 0
@B9600 = global i32 0
define i32 @mzp_init(i32 %0, i64* %1, i64* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64*
%7 = alloca i64*
store i32 %0, i32* %5
store i64* %1, i64** %6
store i64* %2, i64** %7
%8 = load i32, i32* %5
%9 = call i64 @logitech_command(i32 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 -1, i32* %4
br label %17
12: ; preds = %3
%13 = load i32, i32* %5
%14 = load i32, i32* @CS8
%15 = load i32, i32* @B9600
%16 = call i32 @setline(i32 %13, i32 %14, i32 %15)
store i32 0, i32* %4
br label %17
17: ; preds = %12, %11
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
@.str = [5 x i8] c"*X*q\00"
@CS8 = global i32 0
@B9600 = global i32 0
define i32 @mzp_init(i32 %0, i64* nocapture readnone %1, i64* nocapture readnone %2) {
%4 = tail call i64 @logitech_command(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @CS8
%8 = load i32, i32* @B9600
%9 = tail call i32 @setline(i32 %0, i32 %7, i32 %8)
br label %10
10: ; preds = %3, %6
%11 = phi i32 [ 0, %6 ], [ -1, %3 ]
ret i32 %11
}
unsigned char LoNibble(unsigned char x) { return (x & 0x0F); }


x86 assembly (clang, -O0):
<LoNibble>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LoNibble>:
mov    %edi,%eax
and    $0xf,%al
ret

LLVM IR (-O0):
define zeroext i8 @LoNibble(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 15
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @LoNibble(i8 zeroext %0) {
%2 = and i8 %0, 15
ret i8 %2
}
void CRYPTO_mem_leaks_cb(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_mem_leaks_cb() {
ret void
}
/* Variables and functions */
int binarySearch(int *, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int arr[] = {4, 7, 9, 12, 20, 45};
  printf("Target at index: %d\n", binarySearch(arr, 0, 5, 10));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
mov    $0xa,%ecx
call   1040 <binarySearch@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x5,%edx
mov    $0xa,%ecx
call   1040 <binarySearch@plt>
lea    0xec2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [6 x i32] [i32 4, i32 7, i32 9, i32 12, i32 20, i32 45]
@.str = [21 x i8] c"Target at index: %d\0A\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @binarySearch(i32* %3, i32 0, i32 5, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [6 x i32] [i32 4, i32 7, i32 9, i32 12, i32 20, i32 45]
@.str = [21 x i8] c"Target at index: %d\0A\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @binarySearch(i32* %3, i32 0, i32 5, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
scalar_t__ alloca(int);
int /*<<< orphan*/ free(char *);
void t11() {
  char *p = (char *)alloca(2);
  free(p);
}


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

x86 assembly (clang, -O2):
<t11>:
push   %rax
mov    $0x2,%edi
call   1040 <alloca@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @t11() {
%1 = alloca i8*
%2 = call i64 @alloca(i32 2)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @free(i8* %4)
ret void
}

LLVM IR (-O2):
define void @t11() {
%1 = tail call i64 @alloca(i32 2)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @free(i8* %2)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
int fileExists(char *fileName) {
  struct stat s;
  return (stat(fileName, &s) == 0);
}


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

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

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fileExists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int fileExists(const char *path) {
  FILE *f = fopen(path, "r");
  if (f)
    fclose(f);
  return f != NULL;
}


x86 assembly (clang, -O0):
<fileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1154 <fileExists+0x34>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileExists>:
push   %rbx
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113d <fileExists+0x1d>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
test   %rbx,%rbx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @fileExists(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 ne i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %4, %1
%7 = zext i1 %3 to i32
ret i32 %7
}
int incr_and_wrap(int val, int min, int max, int incr) {
  int range = max - min + 1;
  return (((val + incr) - min) % range) + min;
}


x86 assembly (clang, -O0):
<incr_and_wrap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
add    -0x10(%rbp),%eax
sub    -0x8(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    %edx,%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<incr_and_wrap>:
mov    %edx,%r8d
sub    %esi,%r8d
add    $0x1,%r8d
sub    %esi,%edi
lea    (%rdi,%rcx,1),%eax
cltd
idiv   %r8d
lea    (%rdx,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @incr_and_wrap(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
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = sub nsw i32 %10, %11
%13 = add nsw i32 %12, 1
store i32 %13, i32* %9
%14 = load i32, i32* %5
%15 = load i32, i32* %8
%16 = add nsw i32 %14, %15
%17 = load i32, i32* %6
%18 = sub nsw i32 %16, %17
%19 = load i32, i32* %9
%20 = srem i32 %18, %19
%21 = load i32, i32* %6
%22 = add nsw i32 %20, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @incr_and_wrap(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub i32 1, %1
%6 = add i32 %5, %2
%7 = sub i32 %0, %1
%8 = add i32 %7, %3
%9 = srem i32 %8, %6
%10 = add nsw i32 %9, %1
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
float value_as_float(uint32_t value) {
  union {
    float f;
    uint32_t i;
  } u = {.i = value};
  return u.f;
}


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

x86 assembly (clang, -O2):
<value_as_float>:
movd   %edi,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @value_as_float(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = bitcast %union.anon* %3 to i32*
%5 = load i32, i32* %2
store i32 %5, i32* %4
%6 = bitcast %union.anon* %3 to float*
%7 = load float, float* %6
ret float %7
}

LLVM IR (-O2):
define float @value_as_float(i32 %0) {
%2 = bitcast i32 %0 to float
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ dhrymain(int);
int /*<<< orphan*/ printf(char *);
int dhrystone_command(int argc, char *argv[]) {
  printf("Running Dhrystone Command!\n");
  dhrymain(1000000);
  printf("Completed Dhrystone\n");
  return (0);
}


x86 assembly (clang, -O0):
<dhrystone_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0xf4240,%edi
call   1040 <dhrymain@plt>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dhrystone_command>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xf4240,%edi
call   1040 <dhrymain@plt>
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Running Dhrystone Command!\0A\00"
@.str.1 = [21 x i8] c"Completed Dhrystone\0A\00"
define i32 @dhrystone_command(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @dhrymain(i32 1000000)
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c"Running Dhrystone Command!\00"
@str.2 = [20 x i8] c"Completed Dhrystone\00"
define i32 @dhrystone_command(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @dhrymain(i32 1000000)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
void pci_rcec_exit(struct pci_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_rcec_exit(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
double cos(double);
double sin(double);
void sincos(double x, double *sinx, double *cosx) {
  *sinx = sin(x);
  *cosx = cos(x);
}


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

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

LLVM IR (-O0):
define void @sincos(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 = call double @sin(double %7)
%9 = load double*, double** %5
store double %8, double* %9
%10 = load double, double* %4
%11 = call double @cos(double %10)
%12 = load double*, double** %6
store double %11, double* %12
ret void
}

LLVM IR (-O2):
define void @sincos(double %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = tail call double @sin(double %0)
store double %4, double* %1
%5 = tail call double @cos(double %0)
store double %5, double* %2
ret void
}
/* Variables and functions */
int bar();
int main() { return bar(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bar()
ret i32 %1
}
void ckAsmCli(void) { __asm__ __volatile__("cli"); }


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

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

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

LLVM IR (-O2):
define void @ckAsmCli() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void test_cimagl(_Complex long double ld) {
  if (cimagl(ld) != cimagl(ld))
    link_failure_cimagl();
}


x86 assembly (clang, -O0):
<test_cimagl>:
push   %rbp
mov    %rsp,%rbp
lea    0x10(%rbp),%rax
fldt   0x10(%rax)
fucomip %st(0),%st
jnp    112f <test_cimagl+0x1f>
jmp    1128 <test_cimagl+0x18>
mov    $0x0,%al
call   1030 <link_failure_cimagl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cimagl>:
fldt   0x18(%rsp)
fucomip %st(0),%st
jp     1119 <test_cimagl+0x9>
ret
xor    %eax,%eax
jmp    1030 <link_failure_cimagl@plt>

LLVM IR (-O0):
define void @test_cimagl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%3 = load x86_fp80, x86_fp80* %2
%4 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%5 = load x86_fp80, x86_fp80* %4
%6 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%7 = load x86_fp80, x86_fp80* %6
%8 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%9 = load x86_fp80, x86_fp80* %8
%10 = fcmp une x86_fp80 %5, %9
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 (...) @link_failure_cimagl()
br label %13
13: ; preds = %11, %1
ret void
}

LLVM IR (-O2):
define void @test_cimagl({ x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 1
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp uno x86_fp80 %3, 0xK00000000000000000000
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_cimagl()
br label %7
7: ; preds = %5, %1
ret void
}
int INHERENT_fork() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @INHERENT_fork() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ __gcov_flush();
scalar_t__ remove(char *);
int main(void) {
  __gcov_flush();
  if (remove("instrprof-gcov-__gcov_flush-multiple.gcda") != 0) {
    return 1;
  }
  __gcov_flush();
  __gcov_flush();
  if (remove("instrprof-gcov-__gcov_flush-multiple.gcda") != 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__gcov_flush@plt>
lea    0xec3(%rip),%rdi
call   1030 <remove@plt>
cmp    $0x0,%rax
je     1158 <main+0x38>
movl   $0x1,-0x4(%rbp)
jmp    118f <main+0x6f>
mov    $0x0,%al
call   1040 <__gcov_flush@plt>
mov    $0x0,%al
call   1040 <__gcov_flush@plt>
lea    0xe93(%rip),%rdi
call   1030 <remove@plt>
cmp    $0x0,%rax
je     1188 <main+0x68>
movl   $0x1,-0x4(%rbp)
jmp    118f <main+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <__gcov_flush@plt>
lea    0xed1(%rip),%rdi
call   1030 <remove@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1143 <main+0x23>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <__gcov_flush@plt>
xor    %eax,%eax
call   1040 <__gcov_flush@plt>
lea    0xea8(%rip),%rdi
call   1030 <remove@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"instrprof-gcov-__gcov_flush-multiple.gcda\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @__gcov_flush()
%3 = call i64 @remove(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 1, i32* %1
br label %13
6: ; preds = %0
%7 = call i32 (...) @__gcov_flush()
%8 = call i32 (...) @__gcov_flush()
%9 = call i64 @remove(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %6
store i32 1, i32* %1
br label %13
12: ; preds = %6
store i32 0, i32* %1
br label %13
13: ; preds = %12, %11, %5
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [42 x i8] c"instrprof-gcov-__gcov_flush-multiple.gcda\00"
define i32 @main() {
%1 = tail call i32 (...) @__gcov_flush()
%2 = tail call i64 @remove(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %0
%5 = tail call i32 (...) @__gcov_flush()
%6 = tail call i32 (...) @__gcov_flush()
%7 = tail call i64 @remove(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %0
%11 = phi i32 [ 1, %0 ], [ %9, %4 ]
ret i32 %11
}