xunge/DecIR huggingface dataset:
void words(const char *sentence, void (*walker)(const char *, void *),
           void *memo) {}


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

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

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

LLVM IR (-O2):
define void @words(i8* nocapture %0, void (i8*, i8*)* nocapture %1, i8* nocapture %2) {
ret void
}
void abcdefghij6klmnopqrstuvwxzy() {}


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

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

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

LLVM IR (-O2):
define void @abcdefghij6klmnopqrstuvwxzy() {
ret void
}
void genadd_d() {}


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

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

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

LLVM IR (-O2):
define void @genadd_d() {
ret void
}
void muntrace() {}


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

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

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

LLVM IR (-O2):
define void @muntrace() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void b(void) { printf("b() called\n"); }


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"b() called\00"
define void @b() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
int compute_index(int n, double p) {
  int index = p * n / 100.0;
  if (index < 0)
    index = 0;
  else if (index >= n)
    index = n - 1;
  return index;
}


x86 assembly (clang, -O0):
<compute_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1143 <compute_index+0x43>
movl   $0x0,-0x14(%rbp)
jmp    115d <compute_index+0x5d>
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jl     1158 <compute_index+0x58>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115d <compute_index+0x5d>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_index>:
cvtsi2sd %edi,%xmm1
mulsd  %xmm0,%xmm1
divsd  0xef0(%rip),%xmm1
cvttsd2si %xmm1,%ecx
lea    -0x1(%rdi),%edx
cmp    %edi,%ecx
cmovl  %ecx,%edx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @compute_index(i32 %0, double %1) {
%3 = sitofp i32 %0 to double
%4 = fmul double %3, %1
%5 = fdiv double %4, 1.000000e+02
%6 = fptosi double %5 to i32
%7 = icmp slt i32 %6, 0
%8 = icmp slt i32 %6, %0
%9 = add nsw i32 %0, -1
%10 = select i1 %8, i32 %6, i32 %9
%11 = select i1 %7, i32 0, i32 %10
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ iconv_t;

/* Variables and functions */
size_t iconv(int /*<<< orphan*/, char const **, size_t *, char **, size_t *);
size_t portable_iconv(void *cd, const char **inbuf, size_t *inbytesleft,
                      char **outbuf, size_t *outbytesleft) {
  return iconv((iconv_t)cd, inbuf, inbytesleft, outbuf, outbytesleft);
}


x86 assembly (clang, -O0):
<portable_iconv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <iconv@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<portable_iconv>:
jmp    1030 <iconv@plt>

LLVM IR (-O0):
define i64 @portable_iconv(i8* %0, i8** %1, i64* %2, i8** %3, i64* %4) {
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i64*
%9 = alloca i8**
%10 = alloca i64*
store i8* %0, i8** %6
store i8** %1, i8*** %7
store i64* %2, i64** %8
store i8** %3, i8*** %9
store i64* %4, i64** %10
%11 = load i8*, i8** %6
%12 = ptrtoint i8* %11 to i32
%13 = load i8**, i8*** %7
%14 = load i64*, i64** %8
%15 = load i8**, i8*** %9
%16 = load i64*, i64** %10
%17 = call i64 @iconv(i32 %12, i8** %13, i64* %14, i8** %15, i64* %16)
ret i64 %17
}

LLVM IR (-O2):
define i64 @portable_iconv(i8* %0, i8** %1, i64* %2, i8** %3, i64* %4) {
%6 = ptrtoint i8* %0 to i64
%7 = trunc i64 %6 to i32
%8 = tail call i64 @iconv(i32 %7, i8** %1, i64* %2, i8** %3, i64* %4)
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XListExtensions() {
  printf("XListExtensions called\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"XListExtensions called\0A\00"
define i32 @XListExtensions() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"XListExtensions called\00"
define i32 @XListExtensions() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void foo451(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo451(i32 %0) {
ret void
}
int fun375() { return 375; }


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

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

LLVM IR (-O0):
define i32 @fun375() {
ret i32 375
}

LLVM IR (-O2):
define i32 @fun375() {
ret i32 375
}
void ocrshift1(char *p) {
  char cur;
  cur = 0;
  do {
    char next = *p;
    *p++ = cur;
    cur = next;
  } while (cur != 0);
  *p = 0;
}


x86 assembly (clang, -O0):
<ocrshift1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xa(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jne    110c <ocrshift1+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ocrshift1>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi),%ecx
mov    %al,(%rdi)
add    $0x1,%rdi
mov    %ecx,%eax
test   %cl,%cl
jne    1110 <ocrshift1+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @ocrshift1(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8 [ 0, %1 ], [ %5, %2 ]
%4 = phi i8* [ %0, %1 ], [ %6, %2 ]
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %3, i8* %4
%7 = icmp eq i8 %5, 0
br i1 %7, label %8, label %2
8: ; preds = %2
store i8 0, i8* %6
ret void
}
/* Type definitions */
struct llib_stat_t {
  int dummy;
};

/* Variables and functions */
scalar_t__ llib_sys_fstat(int, struct llib_stat_t *);
__attribute__((unused)) int fstat(int fd, struct llib_stat_t *st) {
  return llib_sys_fstat(fd, st) ? 0 : -1;
}


x86 assembly (clang, -O0):
<fstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <llib_sys_fstat@plt>
mov    %rax,%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstat>:
push   %rax
call   1030 <llib_sys_fstat@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.llib_stat_t = type { i32 }
define i32 @fstat(i32 %0, %struct.llib_stat_t* %1) {
%3 = alloca i32
%4 = alloca %struct.llib_stat_t*
store i32 %0, i32* %3
store %struct.llib_stat_t* %1, %struct.llib_stat_t** %4
%5 = load i32, i32* %3
%6 = load %struct.llib_stat_t*, %struct.llib_stat_t** %4
%7 = call i64 @llib_sys_fstat(i32 %5, %struct.llib_stat_t* %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 0, i32 -1
ret i32 %10
}

LLVM IR (-O2):
%struct.llib_stat_t = type { i32 }
define i32 @fstat(i32 %0, %struct.llib_stat_t* %1) {
%3 = tail call i64 @llib_sys_fstat(i32 %0, %struct.llib_stat_t* %1)
%4 = icmp eq i64 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_shuffle_pi16(int /*<<< orphan*/, int);
__m64 test21(__m64 a) { return _mm_shuffle_pi16(a, 3); }


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

x86 assembly (clang, -O2):
<test21>:
mov    $0x3,%esi
jmp    1030 <_mm_shuffle_pi16@plt>

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

LLVM IR (-O2):
define i32 @test21(i32 %0) {
%2 = tail call i32 @_mm_shuffle_pi16(i32 %0, i32 3)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ merge(int, int *, int /*<<< orphan*/, int,
                         int (*)(void const *, void const *));
void mergeSort(int *A, int n, int cmp(const void *, const void *)) {
  merge(n, A, 0, n - 1, cmp);
}


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

x86 assembly (clang, -O2):
<mergeSort>:
mov    %rdx,%r8
mov    %rdi,%rax
lea    -0x1(%rsi),%ecx
mov    %esi,%edi
mov    %rax,%rsi
xor    %edx,%edx
jmp    1030 <merge@plt>

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

LLVM IR (-O2):
define void @mergeSort(i32* %0, i32 %1, i32 (i8*, i8*)* %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @merge(i32 %1, i32* %0, i32 0, i32 %4, i32 (i8*, i8*)* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ swo_init(int, int, int);
int /*<<< orphan*/ swo_puts(int /*<<< orphan*/, char const *);
int main(void) {
  swo_init(21004050, 3000000, 0x1);
  const char *string = "You must construct additional pylons.";
  swo_puts(0, string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1407f12,%edi
mov    $0x2dc6c0,%esi
mov    $0x1,%edx
call   1040 <swo_init@plt>
lea    0xeb6(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
xor    %edi,%edi
call   1030 <swo_puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1407f12,%edi
mov    $0x2dc6c0,%esi
mov    $0x1,%edx
call   1040 <swo_init@plt>
lea    0xec4(%rip),%rsi
xor    %edi,%edi
call   1030 <swo_puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"You must construct additional pylons.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 @swo_init(i32 21004050, i32 3000000, i32 1)
store i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @swo_puts(i32 0, i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"You must construct additional pylons.\00"
define i32 @main() {
%1 = tail call i32 @swo_init(i32 21004050, i32 3000000, i32 1)
%2 = tail call i32 @swo_puts(i32 0, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void *test_anti_range_80(unsigned long n) {
  extern void *alloc_anti_range_80(unsigned long)
      __attribute__((alloc_size(1)));
  if (1 <= n && n <= 1)
    n = 1 - 1;
  return alloc_anti_range_80(n);
}


x86 assembly (clang, -O0):
<test_anti_range_80>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%eax
cmp    -0x8(%rbp),%rax
ja     113e <test_anti_range_80+0x2e>
cmpq   $0x1,-0x8(%rbp)
ja     113e <test_anti_range_80+0x2e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <alloc_anti_range_80@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_80>:
xor    %eax,%eax
cmp    $0x1,%rdi
cmove  %rax,%rdi
jmp    1030 <alloc_anti_range_80@plt>

LLVM IR (-O0):
define i8* @test_anti_range_80(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ule i64 1, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp ule i64 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %5
store i64 0, i64* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i64, i64* %2
%11 = call i8* @alloc_anti_range_80(i64 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_80(i64 %0) {
%2 = icmp eq i64 %0, 1
%3 = select i1 %2, i64 0, i64 %0
%4 = tail call i8* @alloc_anti_range_80(i64 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ out_ps(unsigned int, unsigned int, unsigned int);
int /*<<< orphan*/ pure2mixed(unsigned int, unsigned int *, unsigned int *);
int main() {
  unsigned int i, m, n;
  for (i = (40); i <= (248); i++) {
    pure2mixed(i, &m, &n);
    out_ps(i, m, n);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x28,-0x8(%rbp)
cmpl   $0xf8,-0x8(%rbp)
ja     116f <main+0x4f>
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <pure2mixed@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <out_ps@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    $0x28,%ebx
lea    0xc(%rsp),%r14
lea    0x8(%rsp),%r15
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <pure2mixed@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %ebx,%edi
call   1040 <out_ps@plt>
add    $0x1,%ebx
cmp    $0xf9,%ebx
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 40, i32* %2
br label %5
5: ; preds = %15, %0
%6 = load i32, i32* %2
%7 = icmp ule i32 %6, 248
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = load i32, i32* %2
%10 = call i32 @pure2mixed(i32 %9, i32* %3, i32* %4)
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 @out_ps(i32 %11, i32 %12, i32 %13)
br label %15
15: ; preds = %8
%16 = load i32, i32* %2
%17 = add i32 %16, 1
store i32 %17, i32* %2
br label %5
18: ; preds = %5
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %0, %5
%6 = phi i32 [ 40, %0 ], [ %11, %5 ]
%7 = call i32 @pure2mixed(i32 %6, i32* %1, i32* %2)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 @out_ps(i32 %6, i32 %8, i32 %9)
%11 = add nuw nsw i32 %6, 1
%12 = icmp eq i32 %11, 249
br i1 %12, label %13, label %5
13: ; preds = %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ term_putchar(char const);
void term_putsn(const char *str) {
  for (size_t i = 0; str[i] != '\0'; i++)
    term_putchar(str[i]);
}


x86 assembly (clang, -O0):
<term_putsn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115b <term_putsn+0x4b>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <term_putchar@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <term_putsn+0x14>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @term_putsn(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i8 [ %11, %5 ], [ %2, %1 ]
%7 = phi i64 [ %9, %5 ], [ 0, %1 ]
%8 = tail call i32 @term_putchar(i8 signext %6)
%9 = add i64 %7, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %4, label %5
}
double floor(double x) {
  int y;
  if (x < 0.0) {
    y = (int)x;
    if ((double)y != x) {
      y--;
    }
  } else {
    y = (int)x;
  }
  return ((double)y);
}


x86 assembly (clang, -O0):
<floor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1148 <floor+0x48>
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jne    113a <floor+0x3a>
jp     113a <floor+0x3a>
jmp    1143 <floor+0x43>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1150 <floor+0x50>
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
seta   %sil
cvttsd2si %xmm0,%ecx
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
ucomisd %xmm0,%xmm1
setp   %dl
setne  %al
or     %dl,%al
and    %sil,%al
movzbl %al,%eax
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
ret

LLVM IR (-O0):
define double @floor(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %17
6: ; preds = %1
%7 = load double, double* %2
%8 = fptosi double %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = sitofp i32 %9 to double
%11 = load double, double* %2
%12 = fcmp une double %10, %11
br i1 %12, label %13, label %16
13: ; preds = %6
%14 = load i32, i32* %3
%15 = add nsw i32 %14, -1
store i32 %15, i32* %3
br label %16
16: ; preds = %13, %6
br label %20
17: ; preds = %1
%18 = load double, double* %2
%19 = fptosi double %18 to i32
store i32 %19, i32* %3
br label %20
20: ; preds = %17, %16
%21 = load i32, i32* %3
%22 = sitofp i32 %21 to double
ret double %22
}

LLVM IR (-O2):
define double @floor(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fptosi double %0 to i32
%4 = sitofp i32 %3 to double
%5 = fcmp une double %4, %0
%6 = select i1 %2, i1 %5, i1 false
%7 = sext i1 %6 to i32
%8 = add nsw i32 %3, %7
%9 = sitofp i32 %8 to double
ret double %9
}
/* Variables and functions */
float sin(float);
float f(float x) { return sin(x); }


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

x86 assembly (clang, -O2):
<f>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define float @f(float %0) {
%2 = tail call float @sin(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void unexpected_intr(void) { panic("unexpected interrupt"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"unexpected interrupt\00"
define void @unexpected_intr() {
%1 = call i32 @panic(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"unexpected interrupt\00"
define void @unexpected_intr() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
int square(int num) { return num * num; }


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

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

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

LLVM IR (-O2):
define i32 @square(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) void store32(void *dst, uint32_t w) {
  uint8_t *p = (uint8_t *)dst;
  p[0] = (uint8_t)(w >> 0);
  p[1] = (uint8_t)(w >> 8);
  p[2] = (uint8_t)(w >> 16);
  p[3] = (uint8_t)(w >> 24);
}


x86 assembly (clang, -O0):
<store32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<store32>:
movslq %esi,%rax
mov    %rax,(%rdi)
mov    %eax,%ecx
sar    $0x8,%ecx
movslq %ecx,%rcx
mov    %rcx,0x8(%rdi)
mov    %eax,%ecx
sar    $0x10,%ecx
movslq %ecx,%rcx
mov    %rcx,0x10(%rdi)
sar    $0x18,%eax
cltq
mov    %rax,0x18(%rdi)
ret

LLVM IR (-O0):
define void @store32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i64*
store i64* %7, i64** %5
%8 = load i32, i32* %4
%9 = ashr i32 %8, 0
%10 = sext i32 %9 to i64
%11 = load i64*, i64** %5
%12 = getelementptr inbounds i64, i64* %11, i64 0
store i64 %10, i64* %12
%13 = load i32, i32* %4
%14 = ashr i32 %13, 8
%15 = sext i32 %14 to i64
%16 = load i64*, i64** %5
%17 = getelementptr inbounds i64, i64* %16, i64 1
store i64 %15, i64* %17
%18 = load i32, i32* %4
%19 = ashr i32 %18, 16
%20 = sext i32 %19 to i64
%21 = load i64*, i64** %5
%22 = getelementptr inbounds i64, i64* %21, i64 2
store i64 %20, i64* %22
%23 = load i32, i32* %4
%24 = ashr i32 %23, 24
%25 = sext i32 %24 to i64
%26 = load i64*, i64** %5
%27 = getelementptr inbounds i64, i64* %26, i64 3
store i64 %25, i64* %27
ret void
}

LLVM IR (-O2):
define void @store32(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i64*
%4 = sext i32 %1 to i64
store i64 %4, i64* %3
%5 = ashr i32 %1, 8
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 8
%8 = bitcast i8* %7 to i64*
store i64 %6, i64* %8
%9 = ashr i32 %1, 16
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 16
%12 = bitcast i8* %11 to i64*
store i64 %10, i64* %12
%13 = ashr i32 %1, 24
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %0, i64 24
%16 = bitcast i8* %15 to i64*
store i64 %14, i64* %16
ret void
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  printf("Diners: %s\n", argv[1]);
  printf("Juice: %s\n", getenv("JUICE"));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rsi
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rsi
lea    0xed4(%rip),%rdi
call   1040 <printf@plt>
lea    0xedf(%rip),%rdi
call   1030 <getenv@plt>
lea    0xec8(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Diners: %s\0A\00"
@.str.1 = [11 x i8] c"Juice: %s\0A\00"
@.str.2 = [6 x i8] c"JUICE\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i8* @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Diners: %s\0A\00"
@.str.1 = [11 x i8] c"Juice: %s\0A\00"
@.str.2 = [6 x i8] c"JUICE\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = tail call i8* @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}
/* Variables and functions */
bool nrf51_errata_56(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf51_errata_56() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf51_errata_56() {
ret i32 0
}
/* Variables and functions */
long double scalbnl(long double, int);
long double test7l(long double x, int exp) { return scalbnl(x, exp); }


x86 assembly (clang, -O0):
<test7l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %edi,-0x14(%rbp)
fldt   -0x10(%rbp)
mov    -0x14(%rbp),%edi
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <scalbnl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test7l>:
jmp    1030 <scalbnl@plt>

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

LLVM IR (-O2):
define x86_fp80 @test7l(x86_fp80 %0, i32 %1) {
%3 = tail call x86_fp80 @scalbnl(x86_fp80 %0, i32 %1)
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int x = 0;
  printf("Enter a number: ");
  scanf("%d", &x);
  printf("Here is the number you entered: %d\n", x);
  return 0;
}


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)
movl   $0x0,-0x14(%rbp)
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%esi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [36 x i8] c"Here is the number you entered: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%9 = load i32, i32* %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [36 x i8] c"Here is the number you entered: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
double SHRT_MAX;
extern double cmax_short() { return SHRT_MAX; }


x86 assembly (clang, -O0):
<cmax_short>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
movsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmax_short>:
mov    0x2ed9(%rip),%rax
movsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@SHRT_MAX = global double 0.000000e+00
define double @cmax_short() {
%1 = load double, double* @SHRT_MAX
ret double %1
}

LLVM IR (-O2):
@SHRT_MAX = global double 0.000000e+00
define double @cmax_short() {
%1 = load double, double* @SHRT_MAX
ret double %1
}
/* Variables and functions */
char *realloc(char *, scalar_t__);
scalar_t__ strlen(char *);
void shrinkWord(char **word) {
  *word = realloc(*word, strlen(*word) + 1);
  return;
}


x86 assembly (clang, -O0):
<shrinkWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
call   1040 <realloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shrinkWord>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rsi
mov    %rbx,%rdi
call   1040 <realloc@plt>
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @shrinkWord(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
%7 = call i64 @strlen(i8* %6)
%8 = add nsw i64 %7, 1
%9 = call i8* @realloc(i8* %4, i64 %8)
%10 = load i8**, i8*** %2
store i8* %9, i8** %10
ret void
}

LLVM IR (-O2):
define void @shrinkWord(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @realloc(i8* %2, i64 %4)
store i8* %5, i8** %0
ret void
}
/* Variables and functions */
float acos_f(float);
float asin_f(float x) { return (-acos_f(x) + 1.5707963267948966f); }


x86 assembly (clang, -O0):
<asin_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <acos_f@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xec4(%rip),%xmm1
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asin_f>:
push   %rax
call   1030 <acos_f@plt>
movss  0xee2(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @asin_f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @acos_f(float %3)
%5 = fneg float %4
%6 = fadd float %5, 0x3FF921FB60000000
ret float %6
}

LLVM IR (-O2):
define float @asin_f(float %0) {
%2 = tail call float @acos_f(float %0)
%3 = fsub float 0x3FF921FB60000000, %2
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *);
int /*<<< orphan*/ output_w32(int);
void emit_fmstat() {
  assem_debug("fmstat\n");
  output_w32(0xeef1fa10);
}


x86 assembly (clang, -O0):
<emit_fmstat>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xeef1fa10,%edi
call   1040 <output_w32@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fmstat>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xeef1fa10,%edi
pop    %rax
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"fmstat\0A\00"
define void @emit_fmstat() {
%1 = call i32 @assem_debug(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @output_w32(i32 -286131696)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"fmstat\0A\00"
define void @emit_fmstat() {
%1 = tail call i32 @assem_debug(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @output_w32(i32 -286131696)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int int64_t;

/* Variables and functions */
int INT64_MIN;
int64_t pn_decode_sign_rotated_value_int64(uint64_t value) {
  if ((value & 1) == 0) {
    return value >> 1;
  }
  if (value != 1) {
    return -(value >> 1);
  } else {
    return INT64_MIN;
  }
}


x86 assembly (clang, -O0):
<pn_decode_sign_rotated_value_int64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1124 <pn_decode_sign_rotated_value_int64+0x24>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114c <pn_decode_sign_rotated_value_int64+0x4c>
cmpl   $0x1,-0x8(%rbp)
je     1140 <pn_decode_sign_rotated_value_int64+0x40>
mov    -0x8(%rbp),%ecx
sar    $0x1,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    114c <pn_decode_sign_rotated_value_int64+0x4c>
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pn_decode_sign_rotated_value_int64>:
mov    %edi,%eax
test   $0x1,%al
jne    1109 <pn_decode_sign_rotated_value_int64+0x9>
sar    %eax
ret
cmp    $0x1,%eax
jne    1118 <pn_decode_sign_rotated_value_int64+0x18>
mov    0x2ed3(%rip),%rax
mov    (%rax),%eax
ret
sar    %eax
neg    %eax
ret

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

LLVM IR (-O2):
@INT64_MIN = global i32 0
define i32 @pn_decode_sign_rotated_value_int64(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = ashr i32 %0, 1
br label %13
6: ; preds = %1
%7 = icmp eq i32 %0, 1
br i1 %7, label %11, label %8
8: ; preds = %6
%9 = ashr i32 %0, 1
%10 = sub nsw i32 0, %9
br label %13
11: ; preds = %6
%12 = load i32, i32* @INT64_MIN
br label %13
13: ; preds = %11, %8, %4
%14 = phi i32 [ %5, %4 ], [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}
void handler(int signal) { return; }


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

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

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

LLVM IR (-O2):
define void @handler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setEndofPacket(char *);
void generateEndofPacket() { setEndofPacket("\0"); }


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

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

LLVM IR (-O0):
@.str = [2 x i8] zeroinitializer
define void @generateEndofPacket() {
%1 = call i32 @setEndofPacket(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] zeroinitializer
define void @generateEndofPacket() {
%1 = tail call i32 @setEndofPacket(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float pow(float, double);
float sRGB2linear(float v) {
  if (v <= 0.04045) {
    return v / 12.92;
  } else {
    return pow((v + 0.055) / 1.055, 2.4);
  }
}


x86 assembly (clang, -O0):
<sRGB2linear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     115b <sRGB2linear+0x4b>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed7(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1192 <sRGB2linear+0x82>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeac(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe98(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0xe80(%rip),%xmm1
call   1030 <pow@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sRGB2linear>:
cvtss2sd %xmm0,%xmm0
movsd  0xee4(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1143 <sRGB2linear+0x33>
addsd  0xee6(%rip),%xmm0
divsd  0xee6(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0xee2(%rip),%xmm1
jmp    1030 <pow@plt>
divsd  0xebd(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @sRGB2linear(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp ole double %5, 4.045000e-02
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = fdiv double %9, 1.292000e+01
%11 = fptrunc double %10 to float
store float %11, float* %2
br label %19
12: ; preds = %1
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = fadd double %14, 5.500000e-02
%16 = fdiv double %15, 1.055000e+00
%17 = fptrunc double %16 to float
%18 = call float @pow(float %17, double 2.400000e+00)
store float %18, float* %2
br label %19
19: ; preds = %12, %7
%20 = load float, float* %2
ret float %20
}

LLVM IR (-O2):
define float @sRGB2linear(float %0) {
%2 = fpext float %0 to double
%3 = fcmp ugt double %2, 4.045000e-02
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = fdiv double %2, 1.292000e+01
%6 = fptrunc double %5 to float
br label %12
7: ; preds = %1
%8 = fadd double %2, 5.500000e-02
%9 = fdiv double %8, 1.055000e+00
%10 = fptrunc double %9 to float
%11 = tail call float @pow(float %10, double 2.400000e+00)
br label %12
12: ; preds = %7, %4
%13 = phi float [ %6, %4 ], [ %11, %7 ]
ret float %13
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int strncmp(char const *, char const *, int /*<<< orphan*/);
int strcmp_len2(const char *str1, const char *str2) {
  return strncmp(str1, str2, strlen(str2));
}


x86 assembly (clang, -O0):
<strcmp_len2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp_len2>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
define i32 @strcmp_len2(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 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @strncmp(i8* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @strcmp_len2(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
double exp(double);
double bump(double x, double y, double a, double b) {
  return (exp(-(x - a) * (x - a) - (y - b) * (y - b)));
}


x86 assembly (clang, -O0):
<bump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x8(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm3
subsd  -0x20(%rbp),%xmm3
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <exp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bump>:
subsd  %xmm2,%xmm0
movapd 0xee4(%rip),%xmm2
xorpd  %xmm0,%xmm2
subsd  %xmm3,%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm2,%xmm0
subsd  %xmm1,%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @bump(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %7
%11 = fsub double %9, %10
%12 = fneg double %11
%13 = load double, double* %5
%14 = load double, double* %7
%15 = fsub double %13, %14
%16 = load double, double* %6
%17 = load double, double* %8
%18 = fsub double %16, %17
%19 = load double, double* %6
%20 = load double, double* %8
%21 = fsub double %19, %20
%22 = fmul double %18, %21
%23 = fneg double %22
%24 = call double @llvm.fmuladd.f64(double %12, double %15, double %23)
%25 = call double @exp(double %24)
ret double %25
}

LLVM IR (-O2):
define double @bump(double %0, double %1, double %2, double %3) {
%5 = fsub double %0, %2
%6 = fneg double %5
%7 = fsub double %1, %3
%8 = fneg double %7
%9 = fmul double %7, %8
%10 = tail call double @llvm.fmuladd.f64(double %6, double %5, double %9)
%11 = tail call double @exp(double %10)
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void register_ocaml_fn() { exit(1); }


x86 assembly (clang, -O0):
<register_ocaml_fn>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define void @register_ocaml_fn() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @register_ocaml_fn() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int CHAR_BIT;
unsigned rightrot(unsigned x, int n) {
  unsigned mask, rotbits;
  mask = ~(~0 << n);
  rotbits = x & mask;
  return ((x >> n) | (rotbits << (sizeof(x) * CHAR_BIT - n)));
}


x86 assembly (clang, -O0):
<rightrot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x10(%rbp),%edx
mov    0x2eab(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
movslq -0x8(%rbp),%rsi
sub    %rsi,%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightrot>:
mov    %esi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
and    %edi,%eax
shr    %cl,%edi
mov    0x2eca(%rip),%rdx
mov    (%rdx),%edx
shl    $0x2,%edx
sub    %esi,%edx
mov    %edx,%ecx
shl    %cl,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i32 @rightrot(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = shl i32 -1, %7
%9 = xor i32 %8, -1
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = and i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = lshr i32 %13, %14
%16 = load i32, i32* %6
%17 = load i32, i32* @CHAR_BIT
%18 = sext i32 %17 to i64
%19 = mul i64 4, %18
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = sub i64 %19, %21
%23 = trunc i64 %22 to i32
%24 = shl i32 %16, %23
%25 = or i32 %15, %24
ret i32 %25
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i32 @rightrot(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
%6 = lshr i32 %0, %1
%7 = load i32, i32* @CHAR_BIT
%8 = shl i32 %7, 2
%9 = sub i32 %8, %1
%10 = shl i32 %5, %9
%11 = or i32 %10, %6
ret i32 %11
}