xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
void test_vorr_s8x8(int8_t *__restrict__ dest, int8_t *a, int8_t *b) {
  int i;
  for (i = 0; i < 8; i++) {
    dest[i] = a[i] | b[i];
  }
}


x86 assembly (clang, -O0):
<test_vorr_s8x8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jge    1150 <test_vorr_s8x8+0x50>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
or     (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <test_vorr_s8x8+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vorr_s8x8>:
movups (%rsi),%xmm0
movups (%rdx),%xmm1
orps   %xmm0,%xmm1
movups %xmm1,(%rdi)
movups 0x10(%rsi),%xmm0
movups 0x10(%rdx),%xmm1
orps   %xmm0,%xmm1
movups %xmm1,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @test_vorr_s8x8(i32* noalias nocapture writeonly %0, i32* nocapture %1, i32* nocapture %2) {
%4 = bitcast i32* %1 to <4 x i32>*
%5 = load <4 x i32>, <4 x i32>* %4
%6 = bitcast i32* %2 to <4 x i32>*
%7 = load <4 x i32>, <4 x i32>* %6
%8 = or <4 x i32> %7, %5
%9 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %8, <4 x i32>* %9
%10 = getelementptr inbounds i32, i32* %1, i64 4
%11 = getelementptr inbounds i32, i32* %2, i64 4
%12 = getelementptr inbounds i32, i32* %0, i64 4
%13 = bitcast i32* %10 to <4 x i32>*
%14 = load <4 x i32>, <4 x i32>* %13
%15 = bitcast i32* %11 to <4 x i32>*
%16 = load <4 x i32>, <4 x i32>* %15
%17 = or <4 x i32> %16, %14
%18 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> %17, <4 x i32>* %18
ret void
}
/* Variables and functions */
double __nv_drcp_rn(double);
double __drcp_rn(double __a) { return __nv_drcp_rn(__a); }


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

x86 assembly (clang, -O2):
<__drcp_rn>:
jmp    1030 <__nv_drcp_rn@plt>

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

LLVM IR (-O2):
define double @__drcp_rn(double %0) {
%2 = tail call double @__nv_drcp_rn(double %0)
ret double %2
}
int func(int i) { return i * 2; }


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

x86 assembly (clang, -O2):
<func>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @func(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ O_WRONLY;
int open(char *, int /*<<< orphan*/);
int opengpio(int pin) {
  return open("/sys/class/gpio/gpio204/value", O_WRONLY);
}


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

x86 assembly (clang, -O2):
<opengpio>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <open@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"/sys/class/gpio/gpio204/value\00"
@O_WRONLY = global i32 0
define i32 @opengpio(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @O_WRONLY
%4 = call i32 @open(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [30 x i8] c"/sys/class/gpio/gpio204/value\00"
@O_WRONLY = global i32 0
define i32 @opengpio(i32 %0) {
%2 = load i32, i32* @O_WRONLY
%3 = tail call i32 @open(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int random8();
uint8_t random8_max(uint8_t lim) {
  uint8_t r = random8();
  r = (r * lim) >> 8;
  return r;
}


x86 assembly (clang, -O0):
<random8_max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random8@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random8_max>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <random8@plt>
imul   %ebx,%eax
sar    $0x8,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @random8_max(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @random8()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = mul nsw i32 %5, %6
%8 = ashr i32 %7, 8
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @random8_max(i32 %0) {
%2 = tail call i32 (...) @random8()
%3 = mul nsw i32 %2, %0
%4 = ashr i32 %3, 8
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void pipeutils_signal(int write_fd) { write(write_fd, "", 1); }


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

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

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @pipeutils_signal(i32 %0) {
%2 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ret;

/* Variables and functions */
uintptr_t __attribute__((always_)) _dl_setup_stack_chk_guard(void) {
  uintptr_t ret = 0;
  unsigned char *p = (unsigned char *)&ret;
  p[sizeof(ret) - 1] = 255;
  p[sizeof(ret) - 2] = '\n';
  p[0] = 0;
  return ret;
}


x86 assembly (clang, -O0):
<_dl_setup_stack_chk_guard>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0xff,0x7(%rax)
mov    -0x10(%rbp),%rax
movb   $0xa,0x6(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @_dl_setup_stack_chk_guard() {
%1 = alloca i64
%2 = alloca i8*
store i64 0, i64* %1
%3 = bitcast i64* %1 to i8*
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 7
store i8 -1, i8* %5
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 6
store i8 10, i8* %7
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 0, i8* %9
%10 = load i64, i64* %1
ret i64 %10
}

LLVM IR (-O2):
define i64 @_dl_setup_stack_chk_guard() {
ret i64 -69242844270821376
}
int ltoi(l)
char l[];
{ return (l[3] + (l[2] << 8)); }


x86 assembly (clang, -O0):
<ltoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x3(%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltoi>:
movsbl 0x3(%rdi),%ecx
movsbl 0x2(%rdi),%eax
shl    $0x8,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ltoi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = add nsw i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ltoi(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = shl nsw i32 %7, 8
%9 = add nsw i32 %8, %4
ret i32 %9
}
/* Variables and functions */
int strcmp(char const *, char const *);
int strcoll(const char *scan1, const char *scan2) {
  return strcmp(scan1, scan2);
}


x86 assembly (clang, -O0):
<strcoll>:
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   1030 <strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcoll>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @strcoll(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ bladeenc_read_stat(double *);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ usleep(double);
int main(int argc, char **argv) {
  double current = 0;
  while (1) {
    if (bladeenc_read_stat(&current) == 0)
      printf("[P %f]\n", current);
    usleep(0.5 * 1000000);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
call   1040 <bladeenc_read_stat@plt>
cmp    $0x0,%rax
jne    1172 <main+0x42>
movsd  -0x18(%rbp),%xmm0
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe86(%rip),%xmm0
call   1050 <usleep@plt>
jmp    114e <main+0x1e>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rbx
lea    0xec2(%rip),%r14
jmp    115d <main+0x2d>
nopl   0x0(%rax,%rax,1)
movsd  0xea8(%rip),%xmm0
call   1050 <usleep@plt>
mov    %rbx,%rdi
call   1040 <bladeenc_read_stat@plt>
test   %rax,%rax
jne    1150 <main+0x20>
movsd  (%rsp),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
jmp    1150 <main+0x20>

LLVM IR (-O0):
@.str = [8 x i8] c"[P %f]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 0.000000e+00, double* %6
br label %7
7: ; preds = %2, %13
%8 = call i64 @bladeenc_read_stat(double* %6)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load double, double* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %11)
br label %13
13: ; preds = %10, %7
%14 = call i32 @usleep(double 5.000000e+05)
br label %7
}

LLVM IR (-O2):
@.str = [8 x i8] c"[P %f]\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
store double 0.000000e+00, double* %3
br label %5
5: ; preds = %11, %2
%6 = call i64 @bladeenc_read_stat(double* %3)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load double, double* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %9)
br label %11
11: ; preds = %8, %5
%12 = call i32 @usleep(double 5.000000e+05)
br label %5
}
int mDB_fields(fn, dst) { return mDBi_msg('I', fn, 0, 0, 0, 0, 0, dst); }


x86 assembly (clang, -O0):
<mDB_fields>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%eax
mov    $0x49,%edi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1030 <mDBi_msg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mDB_fields>:
push   %rax
mov    %esi,%r10d
mov    %edi,%esi
mov    $0x49,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
push   %r10
push   $0x0
call   1030 <mDBi_msg@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mDB_fields(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 (i32, i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @mDBi_msg to i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 73, i32 %5, i32 0, i32 0, i32 0, i32 0, i32 0, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @mDB_fields(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @mDBi_msg to i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 73, i32 %0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main(void) {
  system("ls -al /etc/passwd");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"ls -al /etc/passwd\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"ls -al /etc/passwd\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int sum_upto(int /*<<< orphan*/);
int useitp(const int *val) {
  static int usedval;
  usedval = *val;
  return *val + sum_upto(0);
}


x86 assembly (clang, -O0):
<useitp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,0x2f04(%rip)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
xor    %edi,%edi
call   1030 <sum_upto@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<useitp>:
push   %rbx
mov    (%rdi),%ebx
xor    %edi,%edi
call   1030 <sum_upto@plt>
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @useitp(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @sum_upto(i32 0)
%4 = add nsw i32 %3, %2
ret i32 %4
}
/* Variables and functions */
long xdl_bogosqrt(long n) {
  long i;
  for (i = 1; n > 0; n >>= 2)
    i <<= 1;
  return i;
}


x86 assembly (clang, -O0):
<xdl_bogosqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1138 <xdl_bogosqrt+0x38>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <xdl_bogosqrt+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdl_bogosqrt>:
mov    $0x1,%eax
test   %rdi,%rdi
jle    1120 <xdl_bogosqrt+0x20>
mov    %rdi,%rcx
nopl   (%rax)
add    %rax,%rax
shr    $0x2,%rcx
cmp    $0x3,%rdi
mov    %rcx,%rdi
ja     1110 <xdl_bogosqrt+0x10>
ret

LLVM IR (-O0):
define i64 @xdl_bogosqrt(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 1, i64* %3
br label %4
4: ; preds = %10, %1
%5 = load i64, i64* %2
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i64, i64* %3
%9 = shl i64 %8, 1
store i64 %9, i64* %3
br label %10
10: ; preds = %7
%11 = load i64, i64* %2
%12 = ashr i64 %11, 2
store i64 %12, i64* %2
br label %4
13: ; preds = %4
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
define i64 @xdl_bogosqrt(i64 %0) {
%2 = icmp sgt i64 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 1, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = shl i64 %4, 1
%7 = lshr i64 %5, 2
%8 = icmp ult i64 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 1, %1 ], [ %6, %3 ]
ret i64 %10
}
char *psnd_get_version_string() {
  static char *version_string =
      "ProsPectND version 2.2 (Wed Feb 7 15:28:02 CET 2007)";
  return version_string;
}


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

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

LLVM IR (-O0):
@psnd_get_version_string.version_string = internal global i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i32 0, i32 0)
@.str = [53 x i8] c"ProsPectND version 2.2 (Wed Feb 7 15:28:02 CET 2007)\00"
define i8* @psnd_get_version_string() {
%1 = load i8*, i8** @psnd_get_version_string.version_string
ret i8* %1
}

LLVM IR (-O2):
@.str = [53 x i8] c"ProsPectND version 2.2 (Wed Feb 7 15:28:02 CET 2007)\00"
define i8* @psnd_get_version_string() {
ret i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef unsigned char int8_t;

/* Variables and functions */
unsigned char *serialize_int8_t(unsigned char *buffer, int8_t value) {
  buffer[0] = value;
  return buffer + 1;
}


x86 assembly (clang, -O0):
<serialize_int8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialize_int8_t>:
mov    %sil,(%rdi)
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @serialize_int8_t(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 %5, i8* %7
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 1
ret i8* %9
}

LLVM IR (-O2):
define i8* @serialize_int8_t(i8* writeonly %0, i8 zeroext %1) {
store i8 %1, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ adc12_ConfigPort(int);
int /*<<< orphan*/ adc12_Enable();
int /*<<< orphan*/ adc12_Init();
void Sensor_ADC_Init(void) {
  adc12_Init();
  adc12_ConfigPort((12));
  adc12_Enable();
}


x86 assembly (clang, -O0):
<Sensor_ADC_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <adc12_Init@plt>
mov    $0xc,%edi
call   1050 <adc12_ConfigPort@plt>
mov    $0x0,%al
call   1030 <adc12_Enable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sensor_ADC_Init>:
push   %rax
xor    %eax,%eax
call   1040 <adc12_Init@plt>
mov    $0xc,%edi
call   1050 <adc12_ConfigPort@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <adc12_Enable@plt>

LLVM IR (-O0):
define void @Sensor_ADC_Init() {
%1 = call i32 (...) @adc12_Init()
%2 = call i32 @adc12_ConfigPort(i32 12)
%3 = call i32 (...) @adc12_Enable()
ret void
}

LLVM IR (-O2):
define void @Sensor_ADC_Init() {
%1 = tail call i32 (...) @adc12_Init()
%2 = tail call i32 @adc12_ConfigPort(i32 12)
%3 = tail call i32 (...) @adc12_Enable()
ret void
}
/* Variables and functions */
scalar_t__ dlg_ok_buttoncode(int);
int dlg_next_ok_buttonindex(int current, int extra) {
  int result = current + 1;
  if (current >= 0 && dlg_ok_buttoncode(result) < 0)
    result = extra;
  return result;
}


x86 assembly (clang, -O0):
<dlg_next_ok_buttonindex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1149 <dlg_next_ok_buttonindex+0x39>
mov    -0xc(%rbp),%edi
call   1030 <dlg_ok_buttoncode@plt>
cmp    $0x0,%rax
jge    1149 <dlg_next_ok_buttonindex+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlg_next_ok_buttonindex>:
push   %rbp
push   %rbx
push   %rax
lea    0x1(%rdi),%ebx
test   %edi,%edi
js     1129 <dlg_next_ok_buttonindex+0x19>
mov    %esi,%ebp
mov    %ebx,%edi
call   1030 <dlg_ok_buttoncode@plt>
test   %rax,%rax
cmovs  %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dlg_next_ok_buttonindex(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
%7 = add nsw i32 %6, 1
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32, i32* %5
%12 = call i64 @dlg_ok_buttoncode(i32 %11)
%13 = icmp slt i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load i32, i32* %4
store i32 %15, i32* %5
br label %16
16: ; preds = %14, %10, %2
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
define i32 @dlg_next_ok_buttonindex(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 1
%4 = icmp sgt i32 %0, -1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i64 @dlg_ok_buttoncode(i32 %3)
%7 = icmp slt i64 %6, 0
%8 = select i1 %7, i32 %1, i32 %3
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ %3, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ hello_cab202();
int main() {
  hello_cab202();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @hello_cab202()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ hdd_image_init();
void hdc_init(void) {
  ;
  hdd_image_init();
}


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

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

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

LLVM IR (-O2):
define void @hdc_init() {
%1 = tail call i32 (...) @hdd_image_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(int);
void jl_near_rj(unsigned long saut) {
  put8(0x0F);
  put8(0x8C);
  put32(saut);
}


x86 assembly (clang, -O0):
<jl_near_rj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0x8c,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rdi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jl_near_rj>:
push   %rbx
mov    %rdi,%rbx
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0x8c,%edi
call   1030 <put8@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @jl_near_rj(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @put8(i32 15)
%4 = call i32 @put8(i32 140)
%5 = load i64, i64* %2
%6 = call i32 @put32(i64 %5)
ret void
}

LLVM IR (-O2):
define void @jl_near_rj(i64 %0) {
%2 = tail call i32 @put8(i32 15)
%3 = tail call i32 @put8(i32 140)
%4 = tail call i32 @put32(i64 %0)
ret void
}
void _vRestoreLine(void) {}


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

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

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

LLVM IR (-O2):
define void @_vRestoreLine() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  const int ANSWER = 3;
  int guess;
  scanf("%d", &guess);
  if (guess == ANSWER)
    printf("true");
  else
    printf("false");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
lea    0xec3(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x3,-0xc(%rbp)
jne    1161 <main+0x41>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
jmp    116d <main+0x4d>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x3,0x4(%rsp)
lea    0xec5(%rip),%rax
lea    0xec3(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 3
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 3
%6 = select i1 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%7 = call i32 @printf(i8* dereferenceable(1) %6)
ret i32 0
}
int invert(int x, int p, int n) {
  int y;
  y = (~(~0 << n)) << (p + 1 - n);
  return y ^ x;
}


x86 assembly (clang, -O0):
<invert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert>:
mov    %edx,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
sub    %edx,%esi
lea    0x1(%rsi),%ecx
shl    %cl,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = shl i32 -1, %8
%10 = xor i32 %9, -1
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 1
%13 = load i32, i32* %6
%14 = sub nsw i32 %12, %13
%15 = shl i32 %10, %14
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = load i32, i32* %4
%18 = xor i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 -1, %2
%5 = xor i32 %4, -1
%6 = add nsw i32 %1, 1
%7 = sub i32 %6, %2
%8 = shl i32 %5, %7
%9 = xor i32 %8, %0
ret i32 %9
}
int test_imm_23uint8_reg(unsigned char val) {
  return ((val) & (0x23 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_23uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x23,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_23uint8_reg>:
test   $0x23,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_23uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 35
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ test_thread_name_set_and_get_impl();
void *test_thread_name_set_and_get(void *v __attribute__((unused))) {
  return (void *)(uintptr_t)test_thread_name_set_and_get_impl();
}


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

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

LLVM IR (-O0):
define i8* @test_thread_name_set_and_get(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 (...) @test_thread_name_set_and_get_impl()
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}

LLVM IR (-O2):
define i8* @test_thread_name_set_and_get(i8* nocapture readnone %0) {
%2 = tail call i64 (...) @test_thread_name_set_and_get_impl()
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
size_t foo_strlen(const char *src) {
  size_t size = 0;
  for (; *src; ++src)
    ++size;
  return size;
}


x86 assembly (clang, -O0):
<foo_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113a <foo_strlen+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <foo_strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_strlen>:
cmpb   $0x0,(%rdi)
je     111f <foo_strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <foo_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @foo_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add i64 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %7, %4 ]
ret i64 %12
}
/* Variables and functions */
double atan2f(double, double);
double atan2(double arg1, double arg2) { return atan2f(arg1, arg2); }


x86 assembly (clang, -O0):
<atan2>:
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 <atan2f@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @atan2(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 @atan2f(double %5, double %6)
ret double %7
}

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

/* Variables and functions */
int /*<<< orphan*/ __dorand48(struct _reent *, unsigned short *);
long _jrand48_r(struct _reent *r, unsigned short xseed[3]) {
  __dorand48(r, xseed);
  return ((long)xseed[2] << 16) + (long)xseed[1];
}


x86 assembly (clang, -O0):
<_jrand48_r>:
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   1030 <__dorand48@plt>
mov    -0x10(%rbp),%rax
movzwl 0x4(%rax),%eax
shl    $0x10,%rax
mov    -0x10(%rbp),%rcx
movzwl 0x2(%rcx),%ecx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_jrand48_r>:
push   %rbx
mov    %rsi,%rbx
call   1030 <__dorand48@plt>
mov    0x2(%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct._reent = type { i32 }
define i64 @_jrand48_r(%struct._reent* %0, i16* %1) {
%3 = alloca %struct._reent*
%4 = alloca i16*
store %struct._reent* %0, %struct._reent** %3
store i16* %1, i16** %4
%5 = load %struct._reent*, %struct._reent** %3
%6 = load i16*, i16** %4
%7 = call i32 @__dorand48(%struct._reent* %5, i16* %6)
%8 = load i16*, i16** %4
%9 = getelementptr inbounds i16, i16* %8, i64 2
%10 = load i16, i16* %9
%11 = zext i16 %10 to i64
%12 = shl i64 %11, 16
%13 = load i16*, i16** %4
%14 = getelementptr inbounds i16, i16* %13, i64 1
%15 = load i16, i16* %14
%16 = zext i16 %15 to i64
%17 = add nsw i64 %12, %16
ret i64 %17
}

LLVM IR (-O2):
%struct._reent = type { i32 }
define i64 @_jrand48_r(%struct._reent* %0, i16* %1) {
%3 = tail call i32 @__dorand48(%struct._reent* %0, i16* %1)
%4 = getelementptr inbounds i16, i16* %1, i64 2
%5 = load i16, i16* %4
%6 = zext i16 %5 to i64
%7 = shl nuw nsw i64 %6, 16
%8 = getelementptr inbounds i16, i16* %1, i64 1
%9 = load i16, i16* %8
%10 = zext i16 %9 to i64
%11 = or i64 %7, %10
ret i64 %11
}
void print(char *string) {
  asm volatile("mov   $0x09, %%ah\n"
               "int   $0x21\n"
               :
               : "d"(string)
               : "ah");
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x9,%ah
int    $0x21
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
mov    %rdi,%rdx
mov    $0x9,%ah
int    $0x21
ret

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

LLVM IR (-O2):
define void @print(i8* %0) {
tail call void asm sideeffect "mov $$0x09, %ah\0Aint $$0x21\0A", "{dx},~{ah},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
char *strchr(const char *s, int c) {
  do {
    if (*s == c) {
      return (char *)s;
    }
  } while (*s++);
  return (0);
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1128 <strchr+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114d <strchr+0x4d>
jmp    112d <strchr+0x2d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
jne    110b <strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl (%rax),%ecx
cmp    %esi,%ecx
je     1121 <strchr+0x21>
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %9, %8 ]
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, %1
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = icmp eq i8 %5, 0
br i1 %10, label %11, label %3
11: ; preds = %8, %3
%12 = phi i8* [ %4, %3 ], [ null, %8 ]
ret i8* %12
}
void zlog_backtrace_sigsafe(int priority, void *program_counter) {}


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

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

LLVM IR (-O0):
define void @zlog_backtrace_sigsafe(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @zlog_backtrace_sigsafe(i32 %0, i8* nocapture %1) {
ret void
}
int fitsBits(int x, int n) {
  int a = ~0;
  x = x >> (n + a);
  return !x | !(x ^ a);
}


x86 assembly (clang, -O0):
<fitsBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    -0x4(%rbp),%ecx
xor    -0xc(%rbp),%ecx
cmp    $0x0,%ecx
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fitsBits>:
lea    -0x1(%rsi),%ecx
sar    %cl,%edi
add    $0x1,%edi
xor    %eax,%eax
cmp    $0x2,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @fitsBits(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 -1, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = ashr i32 %6, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
%15 = load i32, i32* %3
%16 = load i32, i32* %5
%17 = xor i32 %15, %16
%18 = icmp ne i32 %17, 0
%19 = xor i1 %18, true
%20 = zext i1 %19 to i32
%21 = or i32 %14, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @fitsBits(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = ashr i32 %0, %3
%5 = add i32 %4, 1
%6 = icmp ult i32 %5, 2
%7 = zext i1 %6 to i32
ret i32 %7
}
int dec10_size(unsigned int size) {
  size++;
  if (size == 3)
    size++;
  return size;
}


x86 assembly (clang, -O0):
<dec10_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    1123 <dec10_size+0x23>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec10_size>:
lea    0x1(%rdi),%ecx
cmp    $0x3,%ecx
mov    $0x4,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @dec10_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 3
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = add i32 %8, 1
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @dec10_size(i32 %0) {
%2 = add i32 %0, 1
%3 = icmp eq i32 %2, 3
%4 = select i1 %3, i32 4, i32 %2
ret i32 %4
}
void r_csi20_callback_receiveend(void) {}


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

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

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

LLVM IR (-O2):
define void @r_csi20_callback_receiveend() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_idxset_get_by_data() {
  printf("NOT IMPLEMENTED:"
         "pa_idxset_get_by_data"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"NOT IMPLEMENTED:pa_idxset_get_by_data\0A\00"
define i32 @pa_idxset_get_by_data() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_idxset_get_by_data\00"
define i32 @pa_idxset_get_by_data() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void g() {}


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

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

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

LLVM IR (-O2):
define void @g() {
ret void
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) {
  if (islower(c))
    c = c - 0x20;
  return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     1136 <toupper+0x26>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @islower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 32
store i32 %8, i32* %2
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
float ct_fast_cos(float);
float ct_fast_sin(const float x) {
  return ct_fast_cos((0.5f * 3.1415926535897932384626433832795029f) - x);
}


x86 assembly (clang, -O0):
<ct_fast_sin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
subss  -0x4(%rbp),%xmm0
call   1030 <ct_fast_cos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ct_fast_sin>:
movss  0xee8(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
jmp    1030 <ct_fast_cos@plt>

LLVM IR (-O0):
define float @ct_fast_sin(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float 0x3FF921FB60000000, %3
%5 = call float @ct_fast_cos(float %4)
ret float %5
}

LLVM IR (-O2):
define float @ct_fast_sin(float %0) {
%2 = fsub float 0x3FF921FB60000000, %0
%3 = tail call float @ct_fast_cos(float %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char *malloc(int);
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ shcmd(char *, char *);
int main(void) {
  char *buf = malloc(sizeof(char) * 1024);
  memset(buf, '\0', 1024);
  shcmd("ls", buf);
  printf("%s\n", buf);
  assert(buf[0] != '\0');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x400,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rsi
lea    0xe78(%rip),%rdi
call   1070 <shcmd@plt>
mov    -0x10(%rbp),%rsi
lea    0xe6b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x400,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
lea    0xe8c(%rip),%rdi
mov    %rbx,%rsi
call   1070 <shcmd@plt>
lea    0xe80(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
cmpb   $0x0,(%rbx)
setne  %dil
call   1050 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"ls\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 1024)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memset(i8* %4, i8 signext 0, i32 1024)
%6 = load i8*, i8** %2
%7 = call i32 @shcmd(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"ls\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
%2 = tail call i32 @memset(i8* %1, i8 signext 0, i32 1024)
%3 = tail call i32 @shcmd(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%5 = load i8, i8* %1
%6 = icmp ne i8 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ m162_commonSet8(int, int);
void m164_initSet8(uint16_t ori_addr) {
  uint16_t proc_addr = (ori_addr & 0x7000) | ((ori_addr >> 1) & 0x0100) |
                       ((ori_addr << 1) & 0x0200);
  m162_commonSet8(ori_addr, proc_addr);
}


x86 assembly (clang, -O0):
<m164_initSet8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7000,%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
and    $0x100,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
and    $0x200,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <m162_commonSet8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m164_initSet8>:
mov    %edi,%eax
mov    %edi,%ecx
mov    %edi,%edx
and    $0x7000,%edx
shr    %eax
and    $0x100,%eax
or     %edx,%eax
and    $0x100,%ecx
lea    (%rax,%rcx,2),%esi
jmp    1030 <m162_commonSet8@plt>

LLVM IR (-O0):
define void @m164_initSet8(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 28672
%6 = load i32, i32* %2
%7 = ashr i32 %6, 1
%8 = and i32 %7, 256
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = shl i32 %10, 1
%12 = and i32 %11, 512
%13 = or i32 %9, %12
store i32 %13, i32* %3
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = call i32 @m162_commonSet8(i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
define void @m164_initSet8(i32 %0) {
%2 = and i32 %0, 28672
%3 = lshr i32 %0, 1
%4 = and i32 %3, 256
%5 = or i32 %4, %2
%6 = shl i32 %0, 1
%7 = and i32 %6, 512
%8 = or i32 %5, %7
%9 = tail call i32 @m162_commonSet8(i32 %0, i32 %8)
ret void
}