xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ds2482_busReset();
int /*<<< orphan*/ ds2482_busWriteByte(int);
void ds1820_resetAndConvertTForAll() {
  ds2482_busReset();
  ds2482_busWriteByte(0xCC);
  ds2482_busWriteByte(0x44);
}


x86 assembly (clang, -O0):
<ds1820_resetAndConvertTForAll>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ds2482_busReset@plt>
mov    $0xcc,%edi
call   1040 <ds2482_busWriteByte@plt>
mov    $0x44,%edi
call   1040 <ds2482_busWriteByte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds1820_resetAndConvertTForAll>:
push   %rax
xor    %eax,%eax
call   1030 <ds2482_busReset@plt>
mov    $0xcc,%edi
call   1040 <ds2482_busWriteByte@plt>
mov    $0x44,%edi
pop    %rax
jmp    1040 <ds2482_busWriteByte@plt>

LLVM IR (-O0):
define void @ds1820_resetAndConvertTForAll() {
%1 = call i32 (...) @ds2482_busReset()
%2 = call i32 @ds2482_busWriteByte(i32 204)
%3 = call i32 @ds2482_busWriteByte(i32 68)
ret void
}

LLVM IR (-O2):
define void @ds1820_resetAndConvertTForAll() {
%1 = tail call i32 (...) @ds2482_busReset()
%2 = tail call i32 @ds2482_busWriteByte(i32 204)
%3 = tail call i32 @ds2482_busWriteByte(i32 68)
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ malloc_stats();
int main() {
  char *s;
  s = malloc(20);
  malloc_stats();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 20)
store i8* %3, i8** %2
%4 = call i32 (...) @malloc_stats()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @malloc_stats()
ret i32 0
}
/* Variables and functions */
float brrand();
float linlo() {
  float randnum, randnum2;
  randnum = brrand();
  randnum2 = brrand();
  if (randnum2 < randnum)
    randnum = randnum2;
  return (randnum);
}


x86 assembly (clang, -O0):
<linlo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <brrand@plt>
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <brrand@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    114d <linlo+0x3d>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linlo>:
push   %rax
xor    %eax,%eax
call   1030 <brrand@plt>
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <brrand@plt>
minss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @linlo() {
%1 = alloca float
%2 = alloca float
%3 = call float (...) @brrand()
store float %3, float* %1
%4 = call float (...) @brrand()
store float %4, float* %2
%5 = load float, float* %2
%6 = load float, float* %1
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = load float, float* %2
store float %9, float* %1
br label %10
10: ; preds = %8, %0
%11 = load float, float* %1
ret float %11
}

LLVM IR (-O2):
define float @linlo() {
%1 = tail call float (...) @brrand()
%2 = tail call float (...) @brrand()
%3 = fcmp olt float %2, %1
%4 = select i1 %3, float %2, float %1
ret float %4
}
/* Type definitions */
struct timeval {
  unsigned int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ select(int /*<<< orphan*/, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          struct timeval *);
void my_usleep(unsigned int us) {
  struct timeval tv;
  tv.tv_sec = 0;
  tv.tv_usec = us;
  select(0, NULL, NULL, NULL, &tv);
}


x86 assembly (clang, -O0):
<my_usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x18(%rbp),%r8
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <select@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_usleep>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
mov    %edi,0x8(%rsp)
lea    0x8(%rsp),%r8
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define void @my_usleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timeval
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
store i64 0, i64* %4
%5 = load i32, i32* %2
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %3)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define void @my_usleep(i32 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store i64 0, i64* %4
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i32 %0, i32* %5
%6 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %2)
ret void
}
unsigned long rho_ruby_callmethod_arg(unsigned long classValue,
                                      const char *name, unsigned long arg) {
  return 0;
}


x86 assembly (clang, -O0):
<rho_ruby_callmethod_arg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @rho_ruby_callmethod_arg(i64 %0, i8* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i64 %0, i64* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i64 0
}

LLVM IR (-O2):
define i64 @rho_ruby_callmethod_arg(i64 %0, i8* nocapture readnone %1, i64 %2) {
ret i64 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef size_t uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, size_t);
int __byte_decode_array(const void *_buf, uint32_t offset, uint32_t maxlen,
                        uint8_t *p, uint32_t elements) {
  if (maxlen < elements)
    return -1;
  uint8_t *buf = (uint8_t *)_buf;
  memcpy(p, &buf[offset], elements);
  return elements;
}


x86 assembly (clang, -O0):
<__byte_decode_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x30(%rbp),%rax
jae    1146 <__byte_decode_array+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <__byte_decode_array+0x61>
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x30(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x30(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__byte_decode_array>:
mov    $0xffffffff,%eax
cmp    %r8,%rdx
jb     1130 <__byte_decode_array+0x20>
push   %rbx
mov    %r8,%rbx
lea    (%rdi,%rsi,4),%rsi
mov    %rcx,%rdi
mov    %r8,%rdx
call   1030 <memcpy@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @__byte_decode_array(i8* %0, i64 %1, i64 %2, i32* %3, i64 %4) {
%6 = icmp ult i64 %2, %4
br i1 %6, label %12, label %7
7: ; preds = %5
%8 = bitcast i8* %0 to i32*
%9 = getelementptr inbounds i32, i32* %8, i64 %1
%10 = tail call i32 @memcpy(i32* %3, i32* %9, i64 %4)
%11 = trunc i64 %4 to i32
br label %12
12: ; preds = %5, %7
%13 = phi i32 [ %11, %7 ], [ -1, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ qsort_helper(void *, int /*<<< orphan*/, int, int,
                                int (*)(void *, void *));
void myqsort(void *base, int n, int elem_size, int (*cmpfn)(void *, void *)) {
  qsort_helper(base, 0, n - 1, elem_size, cmpfn);
}


x86 assembly (clang, -O0):
<myqsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
xor    %esi,%esi
call   1030 <qsort_helper@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myqsort>:
mov    %rcx,%r8
mov    %edx,%ecx
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <qsort_helper@plt>

LLVM IR (-O0):
define void @myqsort(i8* %0, i32 %1, i32 %2, i32 (i8*, i8*)* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32 (i8*, i8*)*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 (i8*, i8*)* %3, i32 (i8*, i8*)** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = sub nsw i32 %10, 1
%12 = load i32, i32* %7
%13 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %8
%14 = call i32 @qsort_helper(i8* %9, i32 0, i32 %11, i32 %12, i32 (i8*, i8*)* %13)
ret void
}

LLVM IR (-O2):
define void @myqsort(i8* %0, i32 %1, i32 %2, i32 (i8*, i8*)* %3) {
%5 = add nsw i32 %1, -1
%6 = tail call i32 @qsort_helper(i8* %0, i32 0, i32 %5, i32 %2, i32 (i8*, i8*)* %3)
ret void
}
/* Type definitions */
struct b_whirl {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ whirlProc2(struct b_whirl *, float const *, float *, float *,
                              int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                              size_t);
void whirlProc(struct b_whirl *w, const float *inbuffer, float *outbL,
               float *outbR, size_t bufferLengthSamples) {
  whirlProc2(w, inbuffer, outbL, outbR, NULL, NULL, NULL, NULL,
             bufferLengthSamples);
}


x86 assembly (clang, -O0):
<whirlProc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rax
xor    %r8d,%r8d
mov    %r8d,%r9d
mov    %r9,%r8
movq   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <whirlProc2@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<whirlProc>:
sub    $0x18,%rsp
mov    %r8,0x10(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <whirlProc2@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.b_whirl = type { i32 }
define void @whirlProc(%struct.b_whirl* %0, float* %1, float* %2, float* %3, i64 %4) {
%6 = alloca %struct.b_whirl*
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca i64
store %struct.b_whirl* %0, %struct.b_whirl** %6
store float* %1, float** %7
store float* %2, float** %8
store float* %3, float** %9
store i64 %4, i64* %10
%11 = load %struct.b_whirl*, %struct.b_whirl** %6
%12 = load float*, float** %7
%13 = load float*, float** %8
%14 = load float*, float** %9
%15 = load i64, i64* %10
%16 = call i32 @whirlProc2(%struct.b_whirl* %11, float* %12, float* %13, float* %14, i32* null, i32* null, i32* null, i32* null, i64 %15)
ret void
}

LLVM IR (-O2):
%struct.b_whirl = type { i32 }
define void @whirlProc(%struct.b_whirl* %0, float* %1, float* %2, float* %3, i64 %4) {
%6 = tail call i32 @whirlProc2(%struct.b_whirl* %0, float* %1, float* %2, float* %3, i32* null, i32* null, i32* null, i32* null, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stamp_test();
int main(int argc, char **argv) { stamp_test(); }


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @stamp_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @stamp_test()
ret i32 0
}
/* Variables and functions */
int i2c_write_byte(int, int);
int display_enable() { return i2c_write_byte(0x80, 0x0C); }


x86 assembly (clang, -O0):
<display_enable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80,%edi
mov    $0xc,%esi
call   1030 <i2c_write_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_enable>:
mov    $0x80,%edi
mov    $0xc,%esi
jmp    1030 <i2c_write_byte@plt>

LLVM IR (-O0):
define i32 @display_enable() {
%1 = call i32 @i2c_write_byte(i32 128, i32 12)
ret i32 %1
}

LLVM IR (-O2):
define i32 @display_enable() {
%1 = tail call i32 @i2c_write_byte(i32 128, i32 12)
ret i32 %1
}
int strcmp(const char *s1, const char *s2) {
  while (*s1 == *s2++)
    if (*s1++ == '\0')
      return (0);
  return (*s1 - *--s2);
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1159 <strcmp+0x59>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1154 <strcmp+0x54>
movl   $0x0,-0x4(%rbp)
jmp    1178 <strcmp+0x78>
jmp    110c <strcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x18(%rbp)
movsbl -0x1(%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi,%rcx,1),%eax
movsbl (%rsi,%rcx,1),%edx
cmp    %dl,%al
jne    1127 <strcmp+0x27>
add    $0x1,%rcx
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
ret
sub    %edx,%eax
ret

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

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

/* Variables and functions */
__attribute__((always_)) int16_t clamp_int16_t(int16_t a, int16_t b,
                                               int16_t c) {
  return a < b ? b : a > c ? c : a;
}


x86 assembly (clang, -O0):
<clamp_int16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    112b <clamp_int16_t+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1156 <clamp_int16_t+0x56>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1146 <clamp_int16_t+0x46>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    114e <clamp_int16_t+0x4e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_int16_t>:
mov    %rdx,%rax
cmp    %rdx,%rdi
cmovle %rdi,%rax
cmp    %rsi,%rdi
cmovl  %rsi,%rax
ret

LLVM IR (-O0):
define i64 @clamp_int16_t(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = icmp slt i64 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i64, i64* %5
br label %22
12: ; preds = %3
%13 = load i64, i64* %4
%14 = load i64, i64* %6
%15 = icmp sgt i64 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i64, i64* %6
br label %20
18: ; preds = %12
%19 = load i64, i64* %4
br label %20
20: ; preds = %18, %16
%21 = phi i64 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i64 [ %11, %10 ], [ %21, %20 ]
ret i64 %23
}

LLVM IR (-O2):
define i64 @clamp_int16_t(i64 %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %0, %1
%5 = icmp sgt i64 %0, %2
%6 = select i1 %5, i64 %2, i64 %0
%7 = select i1 %4, i64 %1, i64 %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void derp(char *s) {
  perror(s);
  exit(1);
}


x86 assembly (clang, -O0):
<derp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<derp>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @derp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @derp(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
double norm(double x, double a, double b) {
  return (x - 0.5 * (a + b)) * (2 / (b - a));
}


x86 assembly (clang, -O0):
<norm>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xede(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
movsd  0xebc(%rip),%xmm1
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<norm>:
movapd %xmm1,%xmm3
addsd  %xmm2,%xmm3
mulsd  0xef0(%rip),%xmm3
addsd  %xmm3,%xmm0
subsd  %xmm1,%xmm2
movsd  0xee8(%rip),%xmm1
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @norm(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fadd double %8, %9
%11 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %10, double %7)
%12 = load double, double* %6
%13 = load double, double* %5
%14 = fsub double %12, %13
%15 = fdiv double 2.000000e+00, %14
%16 = fmul double %11, %15
ret double %16
}

LLVM IR (-O2):
define double @norm(double %0, double %1, double %2) {
%4 = fadd double %1, %2
%5 = tail call double @llvm.fmuladd.f64(double %4, double -5.000000e-01, double %0)
%6 = fsub double %2, %1
%7 = fdiv double 2.000000e+00, %6
%8 = fmul double %5, %7
ret double %8
}
/* Variables and functions */
int bfin_gpio_direction_output(unsigned int, int);
int gpio_direction_output(unsigned gpio, int value) {
  return bfin_gpio_direction_output(gpio, value);
}


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

x86 assembly (clang, -O2):
<gpio_direction_output>:
jmp    1030 <bfin_gpio_direction_output@plt>

LLVM IR (-O0):
define i32 @gpio_direction_output(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 @bfin_gpio_direction_output(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @gpio_direction_output(i32 %0, i32 %1) {
%3 = tail call i32 @bfin_gpio_direction_output(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
struct activity {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ stub_print_ktables_stats(struct activity *, int, int,
                                            unsigned long long,
                                            int /*<<< orphan*/);
void print_ktables_stats(struct activity *a, int prev, int curr,
                         unsigned long long itv) {
  stub_print_ktables_stats(a, prev, curr, itv, 0);
}


x86 assembly (clang, -O0):
<print_ktables_stats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <stub_print_ktables_stats@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ktables_stats>:
xor    %r8d,%r8d
jmp    1030 <stub_print_ktables_stats@plt>

LLVM IR (-O0):
%struct.activity = type { i32 }
define void @print_ktables_stats(%struct.activity* %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca %struct.activity*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
store %struct.activity* %0, %struct.activity** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%9 = load %struct.activity*, %struct.activity** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i64, i64* %8
%13 = call i32 @stub_print_ktables_stats(%struct.activity* %9, i32 %10, i32 %11, i64 %12, i32 0)
ret void
}

LLVM IR (-O2):
%struct.activity = type { i32 }
define void @print_ktables_stats(%struct.activity* %0, i32 %1, i32 %2, i64 %3) {
%5 = tail call i32 @stub_print_ktables_stats(%struct.activity* %0, i32 %1, i32 %2, i64 %3, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ load_regs_zero();
int /*<<< orphan*/ switch_test_thread();
void zero_thread_func() {
  for (;;) {
    load_regs_zero();
    switch_test_thread();
  }
}


x86 assembly (clang, -O0):
<zero_thread_func>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <zero_thread_func+0x9>
mov    $0x0,%al
call   1040 <load_regs_zero@plt>
mov    $0x0,%al
call   1030 <switch_test_thread@plt>
jmp    1129 <zero_thread_func+0x9>

x86 assembly (clang, -O2):
<zero_thread_func>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <load_regs_zero@plt>
xor    %eax,%eax
call   1030 <switch_test_thread@plt>
jmp    1130 <zero_thread_func+0x10>

LLVM IR (-O0):
define void @zero_thread_func() {
br label %1
1: ; preds = %1, %0
%2 = call i32 (...) @load_regs_zero()
%3 = call i32 (...) @switch_test_thread()
br label %1
}

LLVM IR (-O2):
define void @zero_thread_func() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @load_regs_zero()
%3 = tail call i32 (...) @switch_test_thread()
br label %1
}
int glue(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @glue(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ clearscr();
int /*<<< orphan*/ init_cpu();
int /*<<< orphan*/ init_roms();
int /*<<< orphan*/ init_vpp();
void do_reset(void) {
  init_cpu();
  init_roms();
  init_vpp();
  clearscr();
}


x86 assembly (clang, -O0):
<do_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <init_cpu@plt>
mov    $0x0,%al
call   1030 <init_roms@plt>
mov    $0x0,%al
call   1040 <init_vpp@plt>
mov    $0x0,%al
call   1050 <clearscr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_reset>:
push   %rax
xor    %eax,%eax
call   1060 <init_cpu@plt>
xor    %eax,%eax
call   1030 <init_roms@plt>
xor    %eax,%eax
call   1040 <init_vpp@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <clearscr@plt>

LLVM IR (-O0):
define void @do_reset() {
%1 = call i32 (...) @init_cpu()
%2 = call i32 (...) @init_roms()
%3 = call i32 (...) @init_vpp()
%4 = call i32 (...) @clearscr()
ret void
}

LLVM IR (-O2):
define void @do_reset() {
%1 = tail call i32 (...) @init_cpu()
%2 = tail call i32 (...) @init_roms()
%3 = tail call i32 (...) @init_vpp()
%4 = tail call i32 (...) @clearscr()
ret void
}
int main() {
  int sum = 0;
  do {
    sum += 1;
  } while (0);
  return sum;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %0
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
br label %6
6: ; preds = %3
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
struct passwd {
  char *pw_dir;
  int /*<<< orphan*/ pw_name;
};

/* Variables and functions */
int EINVAL;
int ENOENT;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
struct passwd *getpwuid(int /*<<< orphan*/);
int /*<<< orphan*/ getuid();
scalar_t__ setenv(char *, char *, int);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(int /*<<< orphan*/, char *);
int xwalk_tizen_set_home_for_user_app(void) {
  return 0;
  uid_t uid = getuid();
  struct passwd *passwd = getpwuid(uid);
  if (!passwd)
    return -ENOENT;
  if (strcmp(passwd->pw_name, "app")) {
    fprintf(stderr,
            "User is not 'app', launching an application will not work\n");
    return -EINVAL;
  }
  if (setenv("HOME", passwd->pw_dir, true) != 0) {
    fprintf(stderr, "Couldn't set 'HOME' env variable to '%s'\n",
            passwd->pw_dir);
    return -EINVAL;
  }
  return 0;
}


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

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

LLVM IR (-O0):
%struct.passwd = type { i8*, i32 }
@EINVAL = global i32 0
@ENOENT = global i32 0
@stderr = global i32 0
define i32 @xwalk_tizen_set_home_for_user_app() {
%1 = alloca i32
%2 = alloca %struct.passwd*
ret i32 0
}

LLVM IR (-O2):
@EINVAL = global i32 0
@ENOENT = global i32 0
@stderr = global i32 0
define i32 @xwalk_tizen_set_home_for_user_app() {
ret i32 0
}
/* Variables and functions */
int digitCount(int);
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
char *intToStr(int Integer) {
  char *str = malloc(digitCount(Integer) * sizeof(char) + 1);
  sprintf(str, "%d", Integer);
  return str;
}


x86 assembly (clang, -O0):
<intToStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <digitCount@plt>
cltq
shl    $0x0,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xe9a(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intToStr>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1030 <digitCount@plt>
lea    0x1(%rax),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xeb4(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i8* @intToStr(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @digitCount(i32 %4)
%6 = sext i32 %5 to i64
%7 = mul i64 %6, 1
%8 = add i64 %7, 1
%9 = trunc i64 %8 to i32
%10 = call i8* @malloc(i32 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = load i32, i32* %2
%13 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define noalias i8* @intToStr(i32 %0) {
%2 = tail call i32 @digitCount(i32 %0)
%3 = add i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %4
}
unsigned short int f53(unsigned short int x, unsigned int y) {
  return (x << (8 * 2 - y)) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f53>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
mov    $0x10,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f53>:
mov    $0x10,%cl
sub    %sil,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f53(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = sub i32 16, %7
%9 = shl i32 %6, %8
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = load i32, i32* %4
%13 = ashr i32 %11, %12
%14 = xor i32 %9, %13
%15 = trunc i32 %14 to i16
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @f53(i16 zeroext %0, i32 %1) {
%3 = zext i16 %0 to i32
%4 = sub i32 16, %1
%5 = shl i32 %3, %4
%6 = lshr i32 %3, %1
%7 = xor i32 %5, %6
%8 = trunc i32 %7 to i16
ret i16 %8
}
unsigned int ipow(unsigned int base, unsigned int exp) {
  unsigned int result = 1;
  while (exp) {
    if (exp & 1)
      result *= base;
    exp >>= 1;
    base *= base;
  }
  return result;
}


x86 assembly (clang, -O0):
<ipow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114c <ipow+0x4c>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1134 <ipow+0x34>
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1111 <ipow+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipow>:
test   %esi,%esi
je     113a <ipow+0x3a>
mov    $0x1,%r8d
mov    $0x1,%eax
mov    %esi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   $0x1,%sil
mov    %edi,%ecx
cmove  %r8d,%ecx
imul   %ecx,%eax
shr    %edx
imul   %edi,%edi
cmp    $0x1,%esi
mov    %edx,%esi
ja     1120 <ipow+0x20>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ipow(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
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32, i32* %4
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i32, i32* %3
%15 = load i32, i32* %5
%16 = mul i32 %15, %14
store i32 %16, i32* %5
br label %17
17: ; preds = %13, %9
%18 = load i32, i32* %4
%19 = lshr i32 %18, 1
store i32 %19, i32* %4
%20 = load i32, i32* %3
%21 = load i32, i32* %3
%22 = mul i32 %21, %20
store i32 %22, i32* %3
br label %6
23: ; preds = %6
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @ipow(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 1, %2 ]
%6 = phi i32 [ %12, %4 ], [ %1, %2 ]
%7 = phi i32 [ %13, %4 ], [ %0, %2 ]
%8 = and i32 %6, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 1, i32 %7
%11 = mul i32 %10, %5
%12 = lshr i32 %6, 1
%13 = mul i32 %7, %7
%14 = icmp ult i32 %6, 2
br i1 %14, label %15, label %4
15: ; preds = %4, %2
%16 = phi i32 [ 1, %2 ], [ %11, %4 ]
ret i32 %16
}
/* Variables and functions */
double log(int);
double rah_0(double zom_0, double u_0) {
  return (log(200 / zom_0) * log(2 / (0.01 * zom_0)) / (u_0 * 0.41 * 0.41));
}


x86 assembly (clang, -O0):
<rah_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeee(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xecb(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xeb6(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe8d(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xe80(%rip),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rah_0>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,(%rsp)
movsd  0xed9(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <log@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm1
mulsd  0xec1(%rip),%xmm1
movsd  0xec1(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0xeae(%rip),%xmm1
movsd  0x10(%rsp),%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @rah_0(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 = fdiv double 2.000000e+02, %5
%7 = fptosi double %6 to i32
%8 = call double @log(i32 %7)
%9 = load double, double* %3
%10 = fmul double 1.000000e-02, %9
%11 = fdiv double 2.000000e+00, %10
%12 = fptosi double %11 to i32
%13 = call double @log(i32 %12)
%14 = fmul double %8, %13
%15 = load double, double* %4
%16 = fmul double %15, 4.100000e-01
%17 = fmul double %16, 4.100000e-01
%18 = fdiv double %14, %17
ret double %18
}

LLVM IR (-O2):
define double @rah_0(double %0, double %1) {
%3 = fdiv double 2.000000e+02, %0
%4 = fptosi double %3 to i32
%5 = tail call double @log(i32 %4)
%6 = fmul double %0, 1.000000e-02
%7 = fdiv double 2.000000e+00, %6
%8 = fptosi double %7 to i32
%9 = tail call double @log(i32 %8)
%10 = fmul double %5, %9
%11 = fmul double %1, 4.100000e-01
%12 = fmul double %11, 4.100000e-01
%13 = fdiv double %10, %12
ret double %13
}
void pci_release_bus_of_node(struct pci_bus *bus) {}


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

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

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

LLVM IR (-O2):
%struct.pci_bus = type opaque
define void @pci_release_bus_of_node(%struct.pci_bus* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ _color_set_8(int, int);
void vt_color_fg_set_8(uint8_t color) {
  if (color > 215) {
    return;
  }
  _color_set_8(38, color);
}


x86 assembly (clang, -O0):
<vt_color_fg_set_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xd7,-0x4(%rbp)
jle    112d <vt_color_fg_set_8+0x1d>
jmp    113a <vt_color_fg_set_8+0x2a>
mov    -0x4(%rbp),%esi
mov    $0x26,%edi
call   1030 <_color_set_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vt_color_fg_set_8>:
cmp    $0xd7,%edi
jle    1119 <vt_color_fg_set_8+0x9>
ret
mov    %edi,%esi
mov    $0x26,%edi
jmp    1030 <_color_set_8@plt>

LLVM IR (-O0):
define void @vt_color_fg_set_8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 215
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @_color_set_8(i32 38, i32 %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @vt_color_fg_set_8(i32 %0) {
%2 = icmp sgt i32 %0, 215
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @_color_set_8(i32 38, i32 %0)
br label %5
5: ; preds = %1, %3
ret void
}
int main(void) { return 2; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
/* Variables and functions */
int mysyscall();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  i = mysyscall();
  printf("return = %d\n", i);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"return = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @mysyscall()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_char(char);
void print_string(char *str) {
  int i;
  i = 0;
  while (*(str + i) != '\0') {
    print_char(str[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<print_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <print_string+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <print_char@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_string+0x13>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @print_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @print_char(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void printerr(char *x) {
  fprintf(stderr,
          "usage: %s [-b] [-s] [-i] [-q] [-m] [-h] [-sh] number1 [number2 ... "
          "] (maximum 32 numbers)\n",
          x);
  exit(1);
}


x86 assembly (clang, -O0):
<printerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<printerr>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [91 x i8] c"usage: %s [-b] [-s] [-i] [-q] [-m] [-h] [-sh] number1 [number2 ... ] (maximum 32 numbers)\0A\00"
define void @printerr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [91 x i8] c"usage: %s [-b] [-s] [-i] [-q] [-m] [-h] [-sh] number1 [number2 ... ] (maximum 32 numbers)\0A\00"
define void @printerr(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int PPCMMU(int, void *, void *, int /*<<< orphan*/);
int MmuTurnOn(void *fun, void *arg) { return PPCMMU(0x107, fun, arg, 0); }


x86 assembly (clang, -O0):
<MmuTurnOn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x107,%edi
xor    %ecx,%ecx
call   1030 <PPCMMU@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MmuTurnOn>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x107,%edi
xor    %ecx,%ecx
jmp    1030 <PPCMMU@plt>

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

LLVM IR (-O2):
define i32 @MmuTurnOn(i8* %0, i8* %1) {
%3 = tail call i32 @PPCMMU(i32 263, i8* %0, i8* %1, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ mask;
typedef int /*<<< orphan*/ cpu_set_t;

/* Variables and functions */
int /*<<< orphan*/ CPU_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ CPU_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int, int /*<<< orphan*/, char *, int);
scalar_t__ sched_setaffinity(int /*<<< orphan*/, int, int /*<<< orphan*/ *);
void setcpu(int cpu) {
  cpu_set_t mask;
  CPU_ZERO(&mask);
  CPU_SET(cpu, &mask);
  if (sched_setaffinity(0, sizeof(mask), &mask))
    error(1, errno, "sched.%d", cpu);
}


x86 assembly (clang, -O0):
<setcpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <CPU_ZERO@plt>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1060 <CPU_SET@plt>
xor    %edi,%edi
mov    $0x4,%esi
lea    -0x8(%rbp),%rdx
call   1030 <sched_setaffinity@plt>
cmp    $0x0,%rax
je     1197 <setcpu+0x57>
mov    0x2e5f(%rip),%rax
mov    (%rax),%esi
mov    -0x4(%rbp),%ecx
mov    $0x1,%edi
lea    0xe6e(%rip),%rdx
call   1050 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setcpu>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <CPU_ZERO@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1060 <CPU_SET@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    %rbx,%rdx
call   1030 <sched_setaffinity@plt>
test   %rax,%rax
je     118c <setcpu+0x4c>
mov    0x2e69(%rip),%rax
mov    (%rax),%esi
lea    0xe80(%rip),%rdx
mov    $0x1,%edi
mov    %ebp,%ecx
call   1050 <error@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
@.str = [9 x i8] c"sched.%d\00"
define void @setcpu(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @CPU_ZERO(i32* %3)
%5 = load i32, i32* %2
%6 = call i32 @CPU_SET(i32 %5, i32* %3)
%7 = call i64 @sched_setaffinity(i32 0, i32 4, i32* %3)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* @errno
%11 = load i32, i32* %2
%12 = call i32 @error(i32 1, i32 %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [9 x i8] c"sched.%d\00"
define void @setcpu(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @CPU_ZERO(i32* %2)
%5 = call i32 @CPU_SET(i32 %0, i32* %2)
%6 = call i64 @sched_setaffinity(i32 0, i32 4, i32* %2)
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i32, i32* @errno
%10 = call i32 @error(i32 1, i32 %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %11
11: ; preds = %8, %1
ret void
}
void evict_cb(void *arg) { (void)arg; }


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

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

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

LLVM IR (-O2):
define void @evict_cb(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
char *__getcwd(char *buf, size_t size) {
  __set_errno(ENOSYS);
  return NULL;
}


x86 assembly (clang, -O0):
<__getcwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__getcwd>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i8* @__getcwd(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i8* null
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define noalias i8* @__getcwd(i8* nocapture readnone %0, i64 %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i8* null
}