xunge/DecIR huggingface dataset:
double Theta(v)
double v[3];
{
  double th;
  th = (double)acos((double)v[0]);
  th = th * 180.0 / 3.14159;
  if (v[1] < 0.0)
    th = (-th);
  return (th);
}


x86 assembly (clang, -O0):
<Theta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <acos@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xed2(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd 0x8(%rax),%xmm0
jbe    117f <Theta+0x6f>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Theta>:
push   %rbx
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
call   1030 <acos@plt>
mulsd  0xedb(%rip),%xmm0
divsd  0xedb(%rip),%xmm0
movsd  0x8(%rbx),%xmm1
movapd 0xed6(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
cmpltsd %xmm3,%xmm1
movapd %xmm1,%xmm3
andnpd %xmm0,%xmm3
andpd  %xmm2,%xmm1
orpd   %xmm3,%xmm1
movapd %xmm1,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @Theta(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
%4 = load double*, double** %2
%5 = getelementptr inbounds double, double* %4, i64 0
%6 = load double, double* %5
%7 = call double @acos(double %6)
store double %7, double* %3
%8 = load double, double* %3
%9 = fmul double %8, 1.800000e+02
%10 = fdiv double %9, 3.141590e+00
store double %10, double* %3
%11 = load double*, double** %2
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = fcmp olt double %13, 0.000000e+00
br i1 %14, label %15, label %18
15: ; preds = %1
%16 = load double, double* %3
%17 = fneg double %16
store double %17, double* %3
br label %18
18: ; preds = %15, %1
%19 = load double, double* %3
ret double %19
}

LLVM IR (-O2):
define double @Theta(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @acos(double %2)
%4 = fmul double %3, 1.800000e+02
%5 = fdiv double %4, 3.141590e+00
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = fcmp olt double %7, 0.000000e+00
%9 = fneg double %5
%10 = select i1 %8, double %9, double %5
ret double %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
char *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
char *fgets_or_exit(char *buffer, int size, FILE *stream) {
  char *message = fgets(buffer, size, stream);
  if (message == NULL) {
    printf("La connexion s'est interrompue !");
    exit(2);
  }
  return message;
}


x86 assembly (clang, -O0):
<fgets_or_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <fgets@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1178 <fgets_or_exit+0x48>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgets_or_exit>:
push   %rax
call   1040 <fgets@plt>
test   %rax,%rax
je     113d <fgets_or_exit+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"La connexion s'est interrompue !\00"
define i8* @fgets_or_exit(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i32*, i32** %6
%11 = call i8* @fgets(i8* %8, i32 %9, i32* %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 2)
unreachable
17: ; preds = %3
%18 = load i8*, i8** %7
ret i8* %18
}

LLVM IR (-O2):
@.str = [33 x i8] c"La connexion s'est interrompue !\00"
define i8* @fgets_or_exit(i8* %0, i32 %1, i32* nocapture %2) {
%4 = tail call i8* @fgets(i8* %0, i32 %1, i32* %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 2)
unreachable
9: ; preds = %3
ret i8* %4
}
int bar(unsigned char x) { return __builtin_parityll(x); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,%ecx
mov    %rcx,%rax
shr    %rax
movabs $0x5555555555555555,%rdx
55 55 55
and    %rdx,%rax
sub    %rax,%rcx
movabs $0x3333333333333333,%rdx
33 33 33
mov    %rcx,%rax
and    %rdx,%rax
shr    $0x2,%rcx
and    %rdx,%rcx
add    %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
add    %rcx,%rax
movabs $0xf0f0f0f0f0f0f0f,%rcx
0f 0f 0f
and    %rcx,%rax
movabs $0x101010101010101,%rcx
01 01 01
imul   %rcx,%rax
shr    $0x38,%rax
and    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
xor    %eax,%eax
test   %dil,%dil
setnp  %al
ret

LLVM IR (-O0):
define i32 @bar(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i64
%5 = call i64 @llvm.ctpop.i64(i64 %4)
%6 = and i64 %5, 1
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @bar(i8 zeroext %0) {
%2 = tail call i8 @llvm.ctpop.i8(i8 %0)
%3 = and i8 %2, 1
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Type definitions */
struct kdtree {
  int dummy;
};
struct kdres {
  int dummy;
};

/* Variables and functions */
struct kdres *kd_nearest2_w_filter(struct kdtree *, double, double,
                                   int /*<<< orphan*/ *);
struct kdres *kd_nearest2(struct kdtree *tree, double x, double y) {
  return kd_nearest2_w_filter(tree, x, y, NULL);
}


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

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

LLVM IR (-O0):
%struct.kdres = type { i32 }
%struct.kdtree = type { i32 }
define %struct.kdres* @kd_nearest2(%struct.kdtree* %0, double %1, double %2) {
%4 = alloca %struct.kdtree*
%5 = alloca double
%6 = alloca double
store %struct.kdtree* %0, %struct.kdtree** %4
store double %1, double* %5
store double %2, double* %6
%7 = load %struct.kdtree*, %struct.kdtree** %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call %struct.kdres* @kd_nearest2_w_filter(%struct.kdtree* %7, double %8, double %9, i32* null)
ret %struct.kdres* %10
}

LLVM IR (-O2):
%struct.kdres = type { i32 }
%struct.kdtree = type { i32 }
define %struct.kdres* @kd_nearest2(%struct.kdtree* %0, double %1, double %2) {
%4 = tail call %struct.kdres* @kd_nearest2_w_filter(%struct.kdtree* %0, double %1, double %2, i32* null)
ret %struct.kdres* %4
}
__attribute__((always_)) void idle_task_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @idle_task_exit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ snprintf(char *, int, char *);
int main(void) {
  char *tmp = malloc(128);
  snprintf(tmp, 128, "Hello mem\n");
  puts(tmp);
  free(tmp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x80,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x80,%esi
lea    0xe93(%rip),%rdx
call   1050 <snprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <puts@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x80,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rdx
mov    %rax,%rdi
mov    $0x80,%esi
call   1050 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Hello mem\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 128)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @snprintf(i8* %4, i32 128, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = call i32 @puts(i8* %6)
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Hello mem\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(128) i8* @malloc(i32 128)
%2 = tail call i32 @snprintf(i8* %1, i32 128, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) %1)
%4 = tail call i32 @free(i8* %1)
ret i32 0
}
int inevent_remove(const char *filename) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @inevent_remove(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ Error(char *);
void yyerror(char *s) { Error(s); }


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

x86 assembly (clang, -O2):
<yyerror>:
jmp    1030 <Error@plt>

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

LLVM IR (-O2):
define void @yyerror(i8* %0) {
%2 = tail call i32 @Error(i8* %0)
ret void
}
long long zzzz() { return 0x0000000000000000LL; }


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

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

LLVM IR (-O0):
define i64 @zzzz() {
ret i64 0
}

LLVM IR (-O2):
define i64 @zzzz() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ test_both_ways(int, char *);
void utf8_test() {
  test_both_ways(0x24, "\x24");
  test_both_ways(0xa2, "\xc2\xa2");
  test_both_ways(0x20AC, "\xe2\x82\xac");
  test_both_ways(0x10348, "\xf0\x90\x8d\x88");
}


x86 assembly (clang, -O0):
<utf8_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x24,%edi
lea    0xee0(%rip),%rsi
call   1030 <test_both_ways@plt>
mov    $0xa2,%edi
lea    0xed1(%rip),%rsi
call   1030 <test_both_ways@plt>
mov    $0x20ac,%edi
lea    0xec3(%rip),%rsi
call   1030 <test_both_ways@plt>
mov    $0x10348,%edi
lea    0xeb6(%rip),%rsi
call   1030 <test_both_ways@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_test>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x24,%edi
call   1030 <test_both_ways@plt>
lea    0xed9(%rip),%rsi
mov    $0xa2,%edi
call   1030 <test_both_ways@plt>
lea    0xecb(%rip),%rsi
mov    $0x20ac,%edi
call   1030 <test_both_ways@plt>
lea    0xebe(%rip),%rsi
mov    $0x10348,%edi
pop    %rax
jmp    1030 <test_both_ways@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"$\00"
@.str.1 = [3 x i8] c"\C2\A2\00"
@.str.2 = [4 x i8] c"\E2\82\AC\00"
@.str.3 = [5 x i8] c"\F0\90\8D\88\00"
define void @utf8_test() {
%1 = call i32 @test_both_ways(i32 36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @test_both_ways(i32 162, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @test_both_ways(i32 8364, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @test_both_ways(i32 66376, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"$\00"
@.str.1 = [3 x i8] c"\C2\A2\00"
@.str.2 = [4 x i8] c"\E2\82\AC\00"
@.str.3 = [5 x i8] c"\F0\90\8D\88\00"
define void @utf8_test() {
%1 = tail call i32 @test_both_ways(i32 36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @test_both_ways(i32 162, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @test_both_ways(i32 8364, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @test_both_ways(i32 66376, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, char *, int);
int write(int, unsigned char *, int);
int wkd_send_reset(int fd) {
  unsigned char buf[16];
  memcpy(buf,
         "\x69\x69\x69\x69"
         "\x06\x00\x00\x00\x00\x00\x80\x80\x00\x00\x00\x00",
         16);
  return write(fd, buf, 16);
}


x86 assembly (clang, -O0):
<wkd_send_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
lea    0xeca(%rip),%rsi
mov    $0x10,%edx
call   1040 <memcpy@plt>
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x10,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wkd_send_reset>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
lea    0xed0(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x10,%edx
call   1040 <memcpy@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x10,%edx
call   1030 <write@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"iiii\06\00\00\00\00\00\80\80\00\00\00\00\00"
define i32 @wkd_send_reset(i32 %0) {
%2 = alloca i32
%3 = alloca [16 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = call i32 @memcpy(i8* %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 16)
%6 = load i32, i32* %2
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%8 = call i32 @write(i32 %6, i8* %7, i32 16)
ret i32 %8
}

LLVM IR (-O2):
@.str = [17 x i8] c"iiii\06\00\00\00\00\00\80\80\00\00\00\00\00"
define i32 @wkd_send_reset(i32 %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @memcpy(i8* %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 16)
%5 = call i32 @write(i32 %0, i8* %3, i32 16)
ret i32 %5
}
void sig1(int a) {}


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

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

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

LLVM IR (-O2):
define void @sig1(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int day, x1, x2;
  day = 9;
  x2 = 1;
  while (day > 0) {
    x1 = (x2 + 1) * 2;
    x2 = x1;
    day--;
  }
  printf("total=%d\n", x1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x9,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1157 <main+0x47>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xe9f(%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
mov    $0x5fe,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"total=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1534)
ret i32 0
}
char *strchr(p, ch)
char *p, ch;
{ return (index(p, ch)); }


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

x86 assembly (clang, -O2):
<strchr>:
jmp    1030 <index@plt>

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i8 signext %1) {
%3 = sext i8 %1 to i32
%4 = tail call i8* @index(i8* %0, i32 %3)
ret i8* %4
}
void init_sub_rel_pixel_color_span_funcs_c(void) {}


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

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

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

LLVM IR (-O2):
define void @init_sub_rel_pixel_color_span_funcs_c() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ suspend();
void handle_sigtstp(int signum) { suspend(); }


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

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

LLVM IR (-O0):
define void @handle_sigtstp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @suspend()
ret void
}

LLVM IR (-O2):
define void @handle_sigtstp(i32 %0) {
%2 = tail call i32 (...) @suspend()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int usage(void) {
  puts("manpager: display man pages with color!\n"
       "\n"
       "Usage:\n"
       "\texport MANPAGER=manpager\n"
       "\tman man\n"
       "\n"
       "To control the colorization, set these env vars:\n"
       "\tLESS_TERMCAP_mb - start blinking\n"
       "\tLESS_TERMCAP_md - start bolding\n"
       "\tLESS_TERMCAP_me - stop bolding\n"
       "\tLESS_TERMCAP_us - start underlining\n"
       "\tLESS_TERMCAP_ue - stop underlining\n"
       "\tLESS_TERMCAP_so - start standout (reverse video)\n"
       "\tLESS_TERMCAP_se - stop standout (reverse video)\n"
       "\n"
       "You can do so by doing:\n"
       "\texport LESS_TERMCAP_md=\"$(printf '\\e[1;36m')\"\n"
       "\n"
       "Run 'less --help' or 'man less' for more info");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [523 x i8] c"manpager: display man pages with color!\0A\0AUsage:\0A\09export MANPAGER=manpager\0A\09man man\0A\0ATo control the colorization, set these env vars:\0A\09LESS_TERMCAP_mb - start blinking\0A\09LESS_TERMCAP_md - start bolding\0A\09LESS_TERMCAP_me - stop bolding\0A\09LESS_TERMCAP_us - start underlining\0A\09LESS_TERMCAP_ue - stop underlining\0A\09LESS_TERMCAP_so - start standout (reverse video)\0A\09LESS_TERMCAP_se - stop standout (reverse video)\0A\0AYou can do so by doing:\0A\09export LESS_TERMCAP_md=\22$(printf '\\e[1;36m')\22\0A\0ARun 'less --help' or 'man less' for more info\00"
define i32 @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([523 x i8], [523 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [523 x i8] c"manpager: display man pages with color!\0A\0AUsage:\0A\09export MANPAGER=manpager\0A\09man man\0A\0ATo control the colorization, set these env vars:\0A\09LESS_TERMCAP_mb - start blinking\0A\09LESS_TERMCAP_md - start bolding\0A\09LESS_TERMCAP_me - stop bolding\0A\09LESS_TERMCAP_us - start underlining\0A\09LESS_TERMCAP_ue - stop underlining\0A\09LESS_TERMCAP_so - start standout (reverse video)\0A\09LESS_TERMCAP_se - stop standout (reverse video)\0A\0AYou can do so by doing:\0A\09export LESS_TERMCAP_md=\22$(printf '\\e[1;36m')\22\0A\0ARun 'less --help' or 'man less' for more info\00"
define i32 @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([523 x i8], [523 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
double Sleef_atan2_u35(double x, double y) { return __builtin_atan2(x, y); }


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

x86 assembly (clang, -O2):
<Sleef_atan2_u35>:
jmp    1030 <atan2@plt>

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

LLVM IR (-O2):
define double @Sleef_atan2_u35(double %0, double %1) {
%3 = tail call double @atan2(double %0, double %1)
ret double %3
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
unsigned int _hash(wchar_t c) {
  unsigned low = c & 0xFFFF;
  unsigned high = (c >> 16) & 0xFFFF;
  return high ^ low;
}


x86 assembly (clang, -O0):
<_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hash>:
movzwl %di,%eax
shr    $0x10,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @_hash(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, 65535
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = ashr i32 %7, 16
%9 = and i32 %8, 65535
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = xor i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @_hash(i32 %0) {
%2 = and i32 %0, 65535
%3 = lshr i32 %0, 16
%4 = xor i32 %3, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int ioctl(int, int, int *);
int /*<<< orphan*/ printf(char *, int);
int ioctl_get_msg(int file_desc) {
  int ret_val;
  int seq;
  ret_val = ioctl(file_desc, 1, &seq);
  if (ret_val < 0) {
    printf("ioctl_get_msg failed:%d\n", ret_val);
    exit(-1);
  }
  printf("get_msg message:%d\n", seq);
  return ret_val;
}


x86 assembly (clang, -O0):
<ioctl_get_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
lea    -0xc(%rbp),%rdx
call   1040 <ioctl@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1172 <ioctl_get_msg+0x42>
mov    -0x8(%rbp),%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0xc(%rbp),%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ioctl_get_msg>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rdx
mov    $0x1,%esi
call   1040 <ioctl@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1162 <ioctl_get_msg+0x32>
mov    0xc(%rsp),%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret
lea    0xe97(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"ioctl_get_msg failed:%d\0A\00"
@.str.1 = [20 x i8] c"get_msg message:%d\0A\00"
define i32 @ioctl_get_msg(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @ioctl(i32 %5, i32 1, i32* %4)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 -1)
unreachable
13: ; preds = %1
%14 = load i32, i32* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [25 x i8] c"ioctl_get_msg failed:%d\0A\00"
@.str.1 = [20 x i8] c"get_msg message:%d\0A\00"
define i32 @ioctl_get_msg(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @ioctl(i32 %0, i32 1, i32* %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %4)
%8 = call i32 @exit(i32 -1)
unreachable
9: ; preds = %1
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int mode;
};
struct TYPE_4__ {
  TYPE_1__ xfocus;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xfocus_mode(void *_p, int _v) {
  ((XEvent *)_p)->xfocus.mode = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xfocus_mode>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xfocus_mode(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xfocus_mode(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int is_end_marker_for_round(char *line) { return strcmp(line, "\r\n") == 0; }


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

x86 assembly (clang, -O2):
<is_end_marker_for_round>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define i32 @is_end_marker_for_round(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define i32 @is_end_marker_for_round(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int main() {
  char a = 0;
  __builtin_prefetch(&a, 1, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
prefetchnta -0x5(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movb   $0x0,-0x1(%rsp)
prefetchnta -0x1(%rsp)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i8
store i8 0, i8* %1
ret i32 0
}
void cbyte_(MBYTE) int *MBYTE;
{
  *MBYTE = 1;
  return;
}


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

x86 assembly (clang, -O2):
<cbyte_>:
movl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @cbyte_(i32* nocapture writeonly %0) {
store i32 1, i32* %0
ret void
}
/* Variables and functions */
int matN_getIndex(int const, int const, int);
int mat4d_getIndex(const int row, const int col) {
  return matN_getIndex(row, col, 4);
}


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

x86 assembly (clang, -O2):
<mat4d_getIndex>:
mov    $0x4,%edx
jmp    1030 <matN_getIndex@plt>

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

LLVM IR (-O2):
define i32 @mat4d_getIndex(i32 %0, i32 %1) {
%3 = tail call i32 @matN_getIndex(i32 %0, i32 %1, i32 4)
ret i32 %3
}
/* Variables and functions */
int fib(int (*)(void *, int), int);
int fibWrapper(int (*fp)(void *, int), int i) { return fib(fp, i); }


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

x86 assembly (clang, -O2):
<fibWrapper>:
jmp    1030 <fib@plt>

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

LLVM IR (-O2):
define i32 @fibWrapper(i32 (i8*, i32)* %0, i32 %1) {
%3 = tail call i32 @fib(i32 (i8*, i32)* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ isPrime(int);
int /*<<< orphan*/ printf(char *, int);
void main(void) {
  int i, j;
  for (i = 2, j = 1; j <= 10001; ++i) {
    if (isPrime(i))
      ++j;
  }
  printf("%d\n", --i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x2711,-0x8(%rbp)
jg     1171 <main+0x51>
mov    -0x4(%rbp),%edi
call   1040 <isPrime@plt>
cmp    $0x0,%rax
je     115e <main+0x3e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1163 <main+0x43>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%esi
add    $0xffffffff,%esi
mov    %esi,-0x4(%rbp)
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebx
mov    $0x1,%ebp
nopl   (%rax)
add    $0x1,%ebx
mov    %ebx,%edi
call   1040 <isPrime@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebp
cmp    $0x2712,%ebp
jb     1130 <main+0x10>
lea    0xeb0(%rip),%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %8, %1 ]
%3 = phi i32 [ 2, %0 ], [ %6, %1 ]
%4 = tail call i64 @isPrime(i32 %3)
%5 = icmp ne i64 %4, 0
%6 = add nuw nsw i32 %3, 1
%7 = zext i1 %5 to i32
%8 = add nuw nsw i32 %2, %7
%9 = icmp ult i32 %8, 10002
br i1 %9, label %1, label %10
10: ; preds = %1
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ member_1;
  int /*<<< orphan*/ member_0;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
scalar_t__ select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                  int /*<<< orphan*/ *, struct timeval *);
int more_bytes(int sd) {
  struct timeval tv = {0, 0};
  fd_set readfds;
  FD_ZERO(&readfds);
  FD_SET(sd, &readfds);
  return (select(sd + 1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &tv) > 0);
}


x86 assembly (clang, -O0):
<more_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
lea    -0x14(%rbp),%rdi
call   1040 <FD_ZERO@plt>
mov    -0x4(%rbp),%edi
lea    -0x14(%rbp),%rsi
call   1060 <FD_SET@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
lea    -0x14(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x10(%rbp),%r8
mov    %rcx,%rdx
call   1050 <select@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<more_bytes>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
movq   $0x0,0x8(%rsp)
lea    0x14(%rsp),%r14
mov    %r14,%rdi
call   1030 <FD_ZERO@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <FD_SET@plt>
add    $0x1,%ebx
lea    0x8(%rsp),%r8
mov    %ebx,%edi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <select@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
mov    %ecx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @more_bytes(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timeval
%4 = alloca i32
store i32 %0, i32* %2
%5 = bitcast %struct.timeval* %3 to i8*
%6 = call i32 @FD_ZERO(i32* %4)
%7 = load i32, i32* %2
%8 = call i32 @FD_SET(i32 %7, i32* %4)
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
%11 = call i64 @select(i32 %10, i32* %4, i32* null, i32* null, %struct.timeval* %3)
%12 = icmp sgt i64 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @more_bytes(i32 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to %struct.timeval*
%4 = alloca i32
%5 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%6 = bitcast i32* %4 to i8*
%7 = call i32 @FD_ZERO(i32* %4)
%8 = call i32 @FD_SET(i32 %0, i32* %4)
%9 = add nsw i32 %0, 1
%10 = call i64 @select(i32 %9, i32* %4, i32* null, i32* null, %struct.timeval* %3)
%11 = icmp sgt i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
scalar_t__ lr(int /*<<< orphan*/);
int main(int argc, char **argv) { return (int)lr(0); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @lr(i32 0)
%4 = trunc i64 %3 to i32
ret i32 %4
}
__attribute__((no)) int transactionally_apply(void (*f)(void *), void *arg) {
  register int ok;
  __asm__ __volatile__("  xbegin .Lzzqqfail");
  f(arg);
  __asm__ __volatile__("  xend           \n\t"
                       "  movl $1,%0     \n\t"
                       "  jmp .Lzzqqout  \n\t"
                       ".Lzzqqfail:      \n\t"
                       "  movl $0,%0     \n\t"
                       ".Lzzqqout:       \n\t"
                       : "=r"(ok)
                       :
                       : "cc", "rax");
  return ok;
}


x86 assembly (clang, -O0):
<transactionally_apply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xbegin 112d <transactionally_apply+0x2d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
xend
mov    $0x1,%ecx
jmp    1132 <transactionally_apply+0x32>
mov    $0x0,%ecx
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transactionally_apply>:
push   %rax
mov    %rdi,%rax
xbegin 1119 <transactionally_apply+0x19>
mov    %rsi,%rdi
call   *%rax
xend
mov    $0x1,%ecx
jmp    111e <transactionally_apply+0x1e>
mov    $0x0,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @transactionally_apply(void (i8*)* %0, i8* %1) {
%3 = alloca void (i8*)*
%4 = alloca i8*
%5 = alloca i32
store void (i8*)* %0, void (i8*)** %3
store i8* %1, i8** %4
%6 = load void (i8*)*, void (i8*)** %3
%7 = load i8*, i8** %4
%8 = call i32 asm sideeffect " xend \0A\09 movl $$1,$0 \0A\09 jmp .Lzzqqout \0A\09.Lzzqqfail: \0A\09 movl $$0,$0 \0A\09.Lzzqqout: \0A\09", "=r,~{cc},~{rax},~{dirflag},~{fpsr},~{flags}"()
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @transactionally_apply(void (i8*)* nocapture %0, i8* %1) {
tail call void asm sideeffect " xbegin .Lzzqqfail", "~{dirflag},~{fpsr},~{flags}"()
tail call void %0(i8* %1)
%3 = tail call i32 asm sideeffect " xend \0A\09 movl $$1,$0 \0A\09 jmp .Lzzqqout \0A\09.Lzzqqfail: \0A\09 movl $$0,$0 \0A\09.Lzzqqout: \0A\09", "=r,~{cc},~{rax},~{dirflag},~{fpsr},~{flags}"()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/, int);
int main(void) { foo(0, 4); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @foo(i32 0, i32 4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0, i32 4)
ret i32 0
}
/* Variables and functions */
char *addColor(char *, char *);
char *bgBlue(char *str) { return addColor("44", str); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"44\00"
define i8* @bgBlue(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @addColor(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"44\00"
define i8* @bgBlue(i8* %0) {
%2 = tail call i8* @addColor(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_read_quaddobl_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(560, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_read_quaddobl_Laurent_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x230,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_read_quaddobl_Laurent_system>:
mov    $0x230,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @syscon_read_quaddobl_Laurent_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 560, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_read_quaddobl_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 560, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void PDMQueueR0Ptr(void) {}


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

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

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

LLVM IR (-O2):
define void @PDMQueueR0Ptr() {
ret void
}
/* Type definitions */
struct svc_req {
  int dummy;
};

/* Variables and functions */
int *printmessage_1_svc(char *, struct svc_req *);
int *_printmessage_1(char **argp, struct svc_req *rqstp) {
  return (printmessage_1_svc(*argp, rqstp));
}


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

x86 assembly (clang, -O2):
<_printmessage_1>:
mov    (%rdi),%rdi
jmp    1030 <printmessage_1_svc@plt>

LLVM IR (-O0):
%struct.svc_req = type { i32 }
define i32* @_printmessage_1(i8** %0, %struct.svc_req* %1) {
%3 = alloca i8**
%4 = alloca %struct.svc_req*
store i8** %0, i8*** %3
store %struct.svc_req* %1, %struct.svc_req** %4
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
%7 = load %struct.svc_req*, %struct.svc_req** %4
%8 = call i32* @printmessage_1_svc(i8* %6, %struct.svc_req* %7)
ret i32* %8
}

LLVM IR (-O2):
%struct.svc_req = type { i32 }
define i32* @_printmessage_1(i8** nocapture %0, %struct.svc_req* %1) {
%3 = load i8*, i8** %0
%4 = tail call i32* @printmessage_1_svc(i8* %3, %struct.svc_req* %1)
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ perf_env_bool(char *, int /*<<< orphan*/);
int perf_config_global(void) {
  return !perf_env_bool("PERF_CONFIG_NOGLOBAL", 0);
}


x86 assembly (clang, -O0):
<perf_config_global>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %esi,%esi
call   1030 <perf_env_bool@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<perf_config_global>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <perf_env_bool@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"PERF_CONFIG_NOGLOBAL\00"
define i32 @perf_config_global() {
%1 = call i32 @perf_env_bool(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = icmp ne i32 %1, 0
%3 = xor i1 %2, true
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
@.str = [21 x i8] c"PERF_CONFIG_NOGLOBAL\00"
define i32 @perf_config_global() {
%1 = tail call i32 @perf_env_bool(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
unsigned xrop3_172_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D ^ S;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


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

x86 assembly (clang, -O2):
<xrop3_172_1_1>:
mov    %edi,%eax
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_172_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ fenv_t;

/* Variables and functions */
int fesetenv(const fenv_t *envp) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @fesetenv(i32* nocapture readnone %0) {
ret i32 1
}