xunge/DecIR huggingface dataset:
int check_prime(int num) {
  int i;
  for (i = 2; i < num; i++) {
    if (num % i == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <check_prime+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <check_prime+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1150 <check_prime+0x50>
jmp    113b <check_prime+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <check_prime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_prime>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <check_prime+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <check_prime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <check_prime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @check_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
void setmode03() {
  void _setmode03();
  _setmode03();
}


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

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

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

LLVM IR (-O2):
define void @setmode03() {
tail call void (...) @_setmode03()
ret void
}
/* Variables and functions */
char *concatenate(char *, char *, int, char const *, char const *);
char *get_attempt_directory(const char *job_dir, const char *attempt_id) {
  return concatenate("%s/%s", "attempt_dir_path", 2, job_dir, attempt_id);
}


x86 assembly (clang, -O0):
<get_attempt_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xed1(%rip),%rdi
lea    0xed0(%rip),%rsi
mov    $0x2,%edx
call   1030 <concatenate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_attempt_directory>:
mov    %rsi,%r8
mov    %rdi,%rcx
lea    0xee3(%rip),%rdi
lea    0xee2(%rip),%rsi
mov    $0x2,%edx
jmp    1030 <concatenate@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s/%s\00"
@.str.1 = [17 x i8] c"attempt_dir_path\00"
define i8* @get_attempt_directory(i8* %0, i8* %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 = call i8* @concatenate(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 2, i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s/%s\00"
@.str.1 = [17 x i8] c"attempt_dir_path\00"
define i8* @get_attempt_directory(i8* %0, i8* %1) {
%3 = tail call i8* @concatenate(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 2, i8* %0, i8* %1)
ret i8* %3
}
long long zsuu() { return 0x0000ffff7fff7fffLL; }


x86 assembly (clang, -O0):
<zsuu>:
push   %rbp
mov    %rsp,%rbp
movabs $0xffff7fff7fff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zsuu>:
movabs $0xffff7fff7fff,%rax
ret

LLVM IR (-O0):
define i64 @zsuu() {
ret i64 281472829194239
}

LLVM IR (-O2):
define i64 @zsuu() {
ret i64 281472829194239
}
/* Type definitions */
struct strbuf {
  int dummy;
};

/* Variables and functions */
int strbuf_add_string(struct strbuf *, char *, int);
int strbuf_add_char(struct strbuf *buf, int c) {
  char ch = c;
  return strbuf_add_string(buf, &ch, 1);
}


x86 assembly (clang, -O0):
<strbuf_add_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xd(%rbp),%rsi
mov    $0x1,%edx
call   1030 <strbuf_add_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strbuf_add_char>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <strbuf_add_string@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.strbuf = type { i32 }
define i32 @strbuf_add_char(%struct.strbuf* %0, i32 %1) {
%3 = alloca %struct.strbuf*
%4 = alloca i32
%5 = alloca i8
store %struct.strbuf* %0, %struct.strbuf** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = trunc i32 %6 to i8
store i8 %7, i8* %5
%8 = load %struct.strbuf*, %struct.strbuf** %3
%9 = call i32 @strbuf_add_string(%struct.strbuf* %8, i8* %5, i32 1)
ret i32 %9
}

LLVM IR (-O2):
%struct.strbuf = type { i32 }
define i32 @strbuf_add_char(%struct.strbuf* %0, i32 %1) {
%3 = alloca i8
%4 = trunc i32 %1 to i8
store i8 %4, i8* %3
%5 = call i32 @strbuf_add_string(%struct.strbuf* %0, i8* %3, i32 1)
ret i32 %5
}
/* Variables and functions */
int from_gps(int);
int data_bus_test_r(void) { return (from_gps(0xf2)); }


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

x86 assembly (clang, -O2):
<data_bus_test_r>:
mov    $0xf2,%edi
jmp    1030 <from_gps@plt>

LLVM IR (-O0):
define i32 @data_bus_test_r() {
%1 = call i32 @from_gps(i32 242)
ret i32 %1
}

LLVM IR (-O2):
define i32 @data_bus_test_r() {
%1 = tail call i32 @from_gps(i32 242)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
__attribute__((__noreturn__)) void exitfunc4(void) {
  printf("Executing exitfunc"
         "4"
         ".\n");
  exit(0);
}


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

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

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

LLVM IR (-O2):
@str = [21 x i8] c"Executing exitfunc4.\00"
define void @exitfunc4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int same_screen;
};
struct TYPE_4__ {
  TYPE_1__ xmotion;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xmotion_same_screen(void *_p, int _v) {
  ((XEvent *)_p)->xmotion.same_screen = (int)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xmotion_same_screen>:
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_xmotion_same_screen>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xmotion_same_screen(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_xmotion_same_screen(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void av_get_channel_layout() {}


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

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

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

LLVM IR (-O2):
define void @av_get_channel_layout() {
ret void
}
void v4i(vec) long vec[4];
{
  float v[4];
  v[0] = vec[0];
  v[1] = vec[1];
  v[2] = vec[2];
  v[3] = vec[3];
  vcall(v, 4);
}


x86 assembly (clang, -O0):
<v4i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssq (%rax),%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssq 0x8(%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssq 0x10(%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssq 0x18(%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <vcall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v4i>:
sub    $0x18,%rsp
movdqu 0x10(%rdi),%xmm0
movq   %xmm0,%rax
cvtsi2ss %rax,%xmm1
movdqu (%rdi),%xmm2
pshufd $0xee,%xmm0,%xmm0
movq   %xmm0,%rax
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movq   %xmm2,%rax
cvtsi2ss %rax,%xmm3
pshufd $0xee,%xmm2,%xmm2
movq   %xmm2,%rax
xorps  %xmm2,%xmm2
cvtsi2ss %rax,%xmm2
unpcklps %xmm0,%xmm1
unpcklps %xmm2,%xmm3
movlhps %xmm1,%xmm3
movaps %xmm3,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <vcall@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @v4i(i64* %0) {
%2 = alloca i64*
%3 = alloca [4 x float]
store i64* %0, i64** %2
%4 = load i64*, i64** %2
%5 = getelementptr inbounds i64, i64* %4, i64 0
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to float
%8 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 0
store float %7, float* %8
%9 = load i64*, i64** %2
%10 = getelementptr inbounds i64, i64* %9, i64 1
%11 = load i64, i64* %10
%12 = sitofp i64 %11 to float
%13 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 1
store float %12, float* %13
%14 = load i64*, i64** %2
%15 = getelementptr inbounds i64, i64* %14, i64 2
%16 = load i64, i64* %15
%17 = sitofp i64 %16 to float
%18 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 2
store float %17, float* %18
%19 = load i64*, i64** %2
%20 = getelementptr inbounds i64, i64* %19, i64 3
%21 = load i64, i64* %20
%22 = sitofp i64 %21 to float
%23 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 3
store float %22, float* %23
%24 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 0
%25 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %24, i32 4)
ret void
}

LLVM IR (-O2):
define void @v4i(i64* nocapture %0) {
%2 = alloca <4 x float>
%3 = bitcast <4 x float>* %2 to i8*
%4 = getelementptr inbounds <4 x float>, <4 x float>* %2, i64 0, i64 0
%5 = bitcast i64* %0 to <4 x i64>*
%6 = load <4 x i64>, <4 x i64>* %5
%7 = sitofp <4 x i64> %6 to <4 x float>
store <4 x float> %7, <4 x float>* %2
%8 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %4, i32 4)
ret void
}
/* Type definitions */
struct timeval {
  int tv_usec;
  int /*<<< orphan*/ tv_sec;
};
struct timespec {
  int tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void gettime(struct timespec *ts) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  ts->tv_sec = tv.tv_sec;
  ts->tv_nsec = tv.tv_usec * 1000;
}


x86 assembly (clang, -O0):
<gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
imul   $0x3e8,-0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettime>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0xc(%rsp),%eax
mov    %eax,0x4(%rbx)
imul   $0x3e8,0x8(%rsp),%eax
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
%struct.timeval = type { i32, i32 }
define void @gettime(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
%3 = alloca %struct.timeval
store %struct.timespec* %0, %struct.timespec** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%6 = load i32, i32* %5
%7 = load %struct.timespec*, %struct.timespec** %2
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
store i32 %6, i32* %8
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%10 = load i32, i32* %9
%11 = mul nsw i32 %10, 1000
%12 = load %struct.timespec*, %struct.timespec** %2
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %12, i32 0, i32 0
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
%struct.timeval = type { i32, i32 }
define void @gettime(%struct.timespec* nocapture writeonly %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, 1000
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
store i32 %10, i32* %11
ret void
}
void caller_2_1_1_2_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_1_1_2_2_1_1() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
scalar_t__ bitcount(int);
uint32_t count_states(uint32_t *bitset) {
  uint32_t count = 0;
  for (uint32_t i = 0; i < (1 << 19); i++) {
    count += bitcount(bitset[i]);
  }
  return count;
}


x86 assembly (clang, -O0):
<count_states>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x80000,-0x10(%rbp)
jge    1162 <count_states+0x52>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <bitcount@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <count_states+0x1a>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_states>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
call   1030 <bitcount@plt>
add    %eax,%ebp
add    $0x1,%rbx
cmp    $0x80000,%rbx
jne    1120 <count_states+0x10>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @count_states(i32* nocapture %0) {
br label %3
2: ; preds = %3
ret i32 %10
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %11, %3 ]
%5 = phi i32 [ 0, %1 ], [ %10, %3 ]
%6 = getelementptr inbounds i32, i32* %0, i64 %4
%7 = load i32, i32* %6
%8 = tail call i64 @bitcount(i32 %7)
%9 = trunc i64 %8 to i32
%10 = add i32 %5, %9
%11 = add nuw nsw i64 %4, 1
%12 = icmp eq i64 %11, 524288
br i1 %12, label %2, label %3
}
void mylock_init(int *lock) {}


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

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

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

LLVM IR (-O2):
define void @mylock_init(i32* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char get_response(int /*<<< orphan*/ *);
int /*<<< orphan*/ send_line(int /*<<< orphan*/ *, char *);
char smtp_send(FILE *fp, char *s) {
  send_line(fp, s);
  return get_response(fp);
}


x86 assembly (clang, -O0):
<smtp_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <send_line@plt>
mov    -0x8(%rbp),%rdi
call   1030 <get_response@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smtp_send>:
push   %rbx
mov    %rdi,%rbx
call   1040 <send_line@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <get_response@plt>

LLVM IR (-O0):
define signext i8 @smtp_send(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @send_line(i32* %5, i8* %6)
%8 = load i32*, i32** %3
%9 = call signext i8 @get_response(i32* %8)
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @smtp_send(i32* %0, i8* %1) {
%3 = tail call i32 @send_line(i32* %0, i8* %1)
%4 = tail call signext i8 @get_response(i32* %0)
ret i8 %4
}
/* Variables and functions */
int nth_prime(int);
int /*<<< orphan*/ printf(char *, int);
int main() { printf("The 10,001st prime is %d.\n", nth_prime(10001)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2711,%edi
call   1040 <nth_prime@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [27 x i8] c"The 10,001st prime is %d.\0A\00"
define i32 @main() {
%1 = call i32 @nth_prime(i32 10001)
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"The 10,001st prime is %d.\0A\00"
define i32 @main() {
%1 = tail call i32 @nth_prime(i32 10001)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
float squareroot(float x) {
  union {
    int i;
    float x;
  } u;
  u.x = x;
  u.i = (1 << 29) + (u.i >> 1) - (1 << 22);
  u.x = u.x + x / u.x;
  u.x = 0.25f * u.x + x / u.x;
  return u.x;
}


x86 assembly (clang, -O0):
<squareroot>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
add    $0x20000000,%eax
sub    $0x400000,%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
divss  -0x8(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
divss  -0x8(%rbp),%xmm1
movss  0xeab(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<squareroot>:
movd   %xmm0,%eax
sar    %eax
add    $0x1fc00000,%eax
movd   %eax,%xmm1
movdqa %xmm0,%xmm2
divss  %xmm1,%xmm2
addss  %xmm1,%xmm2
divss  %xmm2,%xmm0
mulss  0xed9(%rip),%xmm2
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @squareroot(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.anon* %3 to float*
store float %4, float* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
%8 = ashr i32 %7, 1
%9 = add nsw i32 536870912, %8
%10 = sub nsw i32 %9, 4194304
%11 = bitcast %union.anon* %3 to i32*
store i32 %10, i32* %11
%12 = bitcast %union.anon* %3 to float*
%13 = load float, float* %12
%14 = load float, float* %2
%15 = bitcast %union.anon* %3 to float*
%16 = load float, float* %15
%17 = fdiv float %14, %16
%18 = fadd float %13, %17
%19 = bitcast %union.anon* %3 to float*
store float %18, float* %19
%20 = bitcast %union.anon* %3 to float*
%21 = load float, float* %20
%22 = load float, float* %2
%23 = bitcast %union.anon* %3 to float*
%24 = load float, float* %23
%25 = fdiv float %22, %24
%26 = call float @llvm.fmuladd.f32(float 2.500000e-01, float %21, float %25)
%27 = bitcast %union.anon* %3 to float*
store float %26, float* %27
%28 = bitcast %union.anon* %3 to float*
%29 = load float, float* %28
ret float %29
}

LLVM IR (-O2):
define float @squareroot(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = add nsw i32 %3, 532676608
%5 = bitcast i32 %4 to float
%6 = fdiv float %0, %5
%7 = fadd float %6, %5
%8 = fdiv float %0, %7
%9 = tail call float @llvm.fmuladd.f32(float %7, float 2.500000e-01, float %8)
ret float %9
}
void __attribute__((always_))
__initialize_bss(unsigned int *region_begin, unsigned int *region_end) {
  unsigned int *p = region_begin;
  while (p < region_end)
    *p++ = 0;
}


x86 assembly (clang, -O0):
<__initialize_bss>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    113c <__initialize_bss+0x3c>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
movl   $0x0,(%rax)
jmp    1114 <__initialize_bss+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__initialize_bss>:
cmp    %rsi,%rdi
jae    113e <__initialize_bss+0x2e>
push   %rax
lea    0x4(%rdi),%rax
cmp    %rax,%rsi
cmova  %rsi,%rax
mov    %rdi,%rcx
not    %rcx
lea    (%rax,%rcx,1),%rdx
add    $0x4,%rdx
and    $0xfffffffffffffffc,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @__initialize_bss(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** %3
store i32* %6, i32** %5
br label %7
7: ; preds = %11, %2
%8 = load i32*, i32** %5
%9 = load i32*, i32** %4
%10 = icmp ult i32* %8, %9
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32*, i32** %5
%13 = getelementptr inbounds i32, i32* %12, i32 1
store i32* %13, i32** %5
store i32 0, i32* %12
br label %7
14: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @__initialize_bss(i32* writeonly %0, i32* readnone %1) {
%3 = ptrtoint i32* %0 to i64
%4 = icmp ult i32* %0, %1
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = ptrtoint i32* %1 to i64
%7 = bitcast i32* %0 to i8*
%8 = add i64 %3, 4
%9 = call i64 @llvm.umax.i64(i64 %6, i64 %8)
%10 = xor i64 %3, -1
%11 = add i64 %9, %10
%12 = add i64 %11, 4
%13 = and i64 %12, -4
br label %14
14: ; preds = %5, %2
ret void
}
/* Variables and functions */
double sinh(double);
double module_libc_sinh(double x) { return sinh(x); }


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

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

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

LLVM IR (-O2):
define double @module_libc_sinh(double %0) {
%2 = tail call double @sinh(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ e(unsigned int);
void g(void) {
  unsigned int x = 0U;
  e(x);
}


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

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

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

LLVM IR (-O2):
define void @g() {
%1 = tail call i32 @e(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  printf("hello world\n");
  printf("argc %d", argc);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xeca(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str.1 = [8 x i8] c"argc %d\00"
@str = [12 x i8] c"hello world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret i32 0
}
/* Type definitions */
struct evbuffer {
  int dummy;
};

/* Variables and functions */
struct evbuffer *evbuffer_new(void) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.evbuffer = type { i32 }
define %struct.evbuffer* @evbuffer_new() {
ret %struct.evbuffer* null
}

LLVM IR (-O2):
%struct.evbuffer = type { i32 }
define noalias %struct.evbuffer* @evbuffer_new() {
ret %struct.evbuffer* null
}
/* Variables and functions */
int calc_universe(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int universe = calc_universe(0);
  printf("Hello! The universe from 0 is: %d\n", universe);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"Hello! The universe from 0 is: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @calc_universe(i32 0)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"Hello! The universe from 0 is: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @calc_universe(i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int sign(double x) { return (x > 0) - (x < 0); }


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
%5 = zext i1 %4 to i32
%6 = load double, double* %2
%7 = fcmp olt double %6, 0.000000e+00
%8 = zext i1 %7 to i32
%9 = sub nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @sign(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = zext i1 %2 to i32
%4 = fcmp olt double %0, 0.000000e+00
%5 = sext i1 %4 to i32
%6 = add nsw i32 %5, %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ GLenum;
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ glClipPlane(int /*<<< orphan*/, int /*<<< orphan*/ *);
void ClipPlane(GLenum plane, GLdouble equation[4]) {
  glClipPlane(plane, equation);
}


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

x86 assembly (clang, -O2):
<ClipPlane>:
jmp    1030 <glClipPlane@plt>

LLVM IR (-O0):
define void @ClipPlane(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 @glClipPlane(i32 %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @ClipPlane(i32 %0, i32* %1) {
%3 = tail call i32 @glClipPlane(i32 %0, i32* %1)
ret void
}
digits(s) char *s;
{
  while (*s) {
    if (!isdigit(*s))
      return (0);
    s++;
  }
  return (1);
}


x86 assembly (clang, -O0):
<digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <digits+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    114a <digits+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1162 <digits+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <digits+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digits>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1126 <digits+0x26>
add    $0x1,%rdi
nop
movsbl %cl,%ecx
add    $0xffffffd0,%ecx
cmp    $0xa,%ecx
jae    1127 <digits+0x27>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <digits+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @digits(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %7
4: ; preds = %7
%5 = load i8, i8* %13
%6 = icmp eq i8 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %13, %4 ], [ %0, %1 ]
%10 = sext i8 %8 to i32
%11 = add nsw i32 %10, -48
%12 = icmp ult i32 %11, 10
%13 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %12, label %4, label %14
14: ; preds = %7, %4, %1
%15 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %15
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
void timer_(double *ttime) {
  clock_t tim = clock();
  *ttime = (double)tim / CLOCKS_PER_SEC;
}


x86 assembly (clang, -O0):
<timer_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x10(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
mov    0x2eb4(%rip),%rax
divsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define void @timer_(double* %0) {
%2 = alloca double*
%3 = alloca i64
store double* %0, double** %2
%4 = call i64 (...) @clock()
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = sitofp i64 %5 to double
%7 = load double, double* @CLOCKS_PER_SEC
%8 = fdiv double %6, %7
%9 = load double*, double** %2
store double %8, double* %9
ret void
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define void @timer_(double* nocapture writeonly %0) {
%2 = tail call i64 (...) @clock()
%3 = sitofp i64 %2 to double
%4 = load double, double* @CLOCKS_PER_SEC
%5 = fdiv double %3, %4
store double %5, double* %0
ret void
}
void save_it(unsigned short x) { *((unsigned short *)0xFF0000) = x; }


x86 assembly (clang, -O0):
<save_it>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%cx
mov    $0xff0000,%eax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_it>:
mov    %di,0xff0000
ret

LLVM IR (-O0):
define void @save_it(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
store i16 %3, i16* inttoptr (i64 16711680 to i16*)
ret void
}

LLVM IR (-O2):
define void @save_it(i16 zeroext %0) {
store i16 %0, i16* inttoptr (i64 16711680 to i16*)
ret void
}
int mdp4_dsi_video_splash_done(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
void uninit_fflush(void) {
  FILE *fp;
  fflush(fp);
}


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

x86 assembly (clang, -O2):
<uninit_fflush>:
jmp    1030 <fflush@plt>

LLVM IR (-O0):
define void @uninit_fflush() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 @fflush(i32* %2)
ret void
}

LLVM IR (-O2):
define void @uninit_fflush() {
%1 = tail call i32 @fflush(i32* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char const *);
int eql(const char *s1, const char *s2) { return s1 && s2 && !strcmp(s1, s2); }


x86 assembly (clang, -O0):
<eql>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     1158 <eql+0x48>
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1158 <eql+0x48>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eql>:
xor    %eax,%eax
test   %rdi,%rdi
je     112f <eql+0x1f>
test   %rsi,%rsi
je     112f <eql+0x1f>
push   %rax
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @eql(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = call i32 @strcmp(i8* %11, i8* %12)
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
br label %16
16: ; preds = %10, %7, %2
%17 = phi i1 [ false, %7 ], [ false, %2 ], [ %15, %10 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @eql(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i32 @strcmp(i8* %0, i8* %1)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ 0, %2 ], [ %9, %6 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
short int fgetshi(FILE *f) { return (fgetc(f) + (fgetc(f) << 8)); }


x86 assembly (clang, -O0):
<fgetshi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
shl    $0x8,%ecx
add    %ecx,%eax
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetshi>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <fgetc@plt>
shl    $0x8,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i16 @fgetshi(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fgetc(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @fgetc(i32* %5)
%7 = shl i32 %6, 8
%8 = add nsw i32 %4, %7
%9 = trunc i32 %8 to i16
ret i16 %9
}

LLVM IR (-O2):
define signext i16 @fgetshi(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = tail call i32 @fgetc(i32* %0)
%4 = shl i32 %3, 8
%5 = add nsw i32 %4, %2
%6 = trunc i32 %5 to i16
ret i16 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo(void) { printf("This is foo ()!\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"This is foo ()!\0A\00"
define void @foo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"This is foo ()!\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
void outnbyte(byte) int byte;
{
  outbyte(byte);
  outnl();
}


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

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

LLVM IR (-O0):
define void @outnbyte(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @outbyte to i32 (i32, ...)*)(i32 %3)
%5 = call i32 (...) @outnl()
ret void
}

LLVM IR (-O2):
define void @outnbyte(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @outbyte to i32 (i32, ...)*)(i32 %0)
%3 = tail call i32 (...) @outnl()
ret void
}
void fd84(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    a:
      goto a;
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd84>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd84+0x7>

x86 assembly (clang, -O2):
<fd84>:
jmp    1100 <fd84>

LLVM IR (-O0):
define void @fd84(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; preds = %18
br label %18
19: ; No predecessors!
%20 = load i32, i32* %2
%21 = zext i32 %20 to i64
br label %22
22: ; preds = %22, %19
br label %22
23: ; preds = %23
br label %23
24: ; No predecessors!
%25 = load i32, i32* %2
%26 = zext i32 %25 to i64
br label %27
27: ; preds = %27, %24
br label %27
28: ; No predecessors!
%29 = load i32, i32* %2
%30 = zext i32 %29 to i64
br label %31
31: ; preds = %31, %28
br label %31
32: ; preds = %32
br label %32
33: ; No predecessors!
%34 = load i32, i32* %2
%35 = zext i32 %34 to i64
br label %36
36: ; preds = %36, %33
br label %36
37: ; preds = %37
br label %37
38: ; No predecessors!
%39 = load i32, i32* %2
%40 = zext i32 %39 to i64
br label %41
41: ; preds = %41, %38
br label %41
42: ; preds = %42
br label %42
43: ; No predecessors!
%44 = load i32, i32* %2
%45 = zext i32 %44 to i64
br label %46
46: ; preds = %46, %43
br label %46
47: ; preds = %47
br label %47
}

LLVM IR (-O2):
define void @fd84(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Type definitions */
struct defrule {
  int dummy;
};
struct constructHeader {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ DestroyDefrule(void *, struct defrule *);
void DestroyDefruleAction(void *theEnv, struct constructHeader *theConstruct,
                          void *buffer) {
  struct defrule *theDefrule = (struct defrule *)theConstruct;
  DestroyDefrule(theEnv, theDefrule);
}


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

x86 assembly (clang, -O2):
<DestroyDefruleAction>:
jmp    1030 <DestroyDefrule@plt>

LLVM IR (-O0):
%struct.constructHeader = type { i32 }
%struct.defrule = type { i32 }
define void @DestroyDefruleAction(i8* %0, %struct.constructHeader* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca %struct.constructHeader*
%6 = alloca i8*
%7 = alloca %struct.defrule*
store i8* %0, i8** %4
store %struct.constructHeader* %1, %struct.constructHeader** %5
store i8* %2, i8** %6
%8 = load %struct.constructHeader*, %struct.constructHeader** %5
%9 = bitcast %struct.constructHeader* %8 to %struct.defrule*
store %struct.defrule* %9, %struct.defrule** %7
%10 = load i8*, i8** %4
%11 = load %struct.defrule*, %struct.defrule** %7
%12 = call i32 @DestroyDefrule(i8* %10, %struct.defrule* %11)
ret void
}

LLVM IR (-O2):
%struct.constructHeader = type { i32 }
%struct.defrule = type { i32 }
define void @DestroyDefruleAction(i8* %0, %struct.constructHeader* %1, i8* nocapture readnone %2) {
%4 = bitcast %struct.constructHeader* %1 to %struct.defrule*
%5 = tail call i32 @DestroyDefrule(i8* %0, %struct.defrule* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TIM14_ISR();
int /*<<< orphan*/ TIM8_TRG_COM_ISR();
void TIM8_TRG_COM_TIM14_ISR(void) {
  TIM8_TRG_COM_ISR();
  TIM14_ISR();
}


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

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

LLVM IR (-O0):
define void @TIM8_TRG_COM_TIM14_ISR() {
%1 = call i32 (...) @TIM8_TRG_COM_ISR()
%2 = call i32 (...) @TIM14_ISR()
ret void
}

LLVM IR (-O2):
define void @TIM8_TRG_COM_TIM14_ISR() {
%1 = tail call i32 (...) @TIM8_TRG_COM_ISR()
%2 = tail call i32 (...) @TIM14_ISR()
ret void
}
void security_socket_post_accept(struct socket *sock, struct socket *newsock) {}


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

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

LLVM IR (-O0):
%struct.socket = type opaque
define void @security_socket_post_accept(%struct.socket* %0, %struct.socket* %1) {
%3 = alloca %struct.socket*
%4 = alloca %struct.socket*
store %struct.socket* %0, %struct.socket** %3
store %struct.socket* %1, %struct.socket** %4
ret void
}

LLVM IR (-O2):
%struct.socket = type opaque
define void @security_socket_post_accept(%struct.socket* nocapture %0, %struct.socket* nocapture %1) {
ret void
}
void pause() { __asm("pause" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @pause() {
tail call void asm sideeffect "pause", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
void av_opt_set_channel_layout() {}


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

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

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

LLVM IR (-O2):
define void @av_opt_set_channel_layout() {
ret void
}
double fahrenheit(double celsius) { return 9.0 * celsius / 5.0 + 32; }


x86 assembly (clang, -O0):
<fahrenheit>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeff(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xed6(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahrenheit>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @fahrenheit(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 9.000000e+00, %3
%5 = fdiv double %4, 5.000000e+00
%6 = fadd double %5, 3.200000e+01
ret double %6
}

LLVM IR (-O2):
define double @fahrenheit(double %0) {
%2 = fmul double %0, 9.000000e+00
%3 = fdiv double %2, 5.000000e+00
%4 = fadd double %3, 3.200000e+01
ret double %4
}