xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ __le32_to_cpus(unsigned int *);
void le32_to_cpu_array(unsigned int *buf, unsigned int words) {
  while (words--) {
    __le32_to_cpus(buf);
    buf++;
  }
}


x86 assembly (clang, -O0):
<le32_to_cpu_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     114d <le32_to_cpu_array+0x3d>
mov    -0x8(%rbp),%rdi
call   1030 <__le32_to_cpus@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    111f <le32_to_cpu_array+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<le32_to_cpu_array>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
je     1131 <le32_to_cpu_array+0x21>
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <__le32_to_cpus@plt>
add    $0x4,%rbx
add    $0xffffffff,%ebp
jne    1120 <le32_to_cpu_array+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @le32_to_cpu_array(i32* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32* [ %9, %4 ], [ %0, %2 ]
%7 = add i32 %5, -1
%8 = tail call i32 @__le32_to_cpus(i32* %6)
%9 = getelementptr inbounds i32, i32* %6, i64 1
%10 = icmp eq i32 %7, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef scalar_t__ uint;

/* Variables and functions */
uint _h2_uintmax(uint x, uint y) { return (x < y ? y : x); }


x86 assembly (clang, -O0):
<_h2_uintmax>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <_h2_uintmax+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <_h2_uintmax+0x2f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @_h2_uintmax(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ SYS_open;
int syscall(int /*<<< orphan*/, char const *, int, int);
int real_open(const char *fn, int flags, int mode) {
  return (syscall(SYS_open, (fn), (flags), (mode)));
}


x86 assembly (clang, -O0):
<real_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<real_open>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_open = global i32 0
define i32 @real_open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @SYS_open
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @syscall(i32 %7, i8* %8, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@SYS_open = global i32 0
define i32 @real_open(i8* %0, i32 %1, i32 %2) {
%4 = load i32, i32* @SYS_open
%5 = tail call i32 @syscall(i32 %4, i8* %0, i32 %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
char *get_char_pointer(char *s, char ch) {
  while (*s && *s != ch)
    ++s;
  if (!*s)
    return NULL;
  return s;
}


x86 assembly (clang, -O0):
<get_char_pointer>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x12(%rbp)
je     1136 <get_char_pointer+0x36>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    1146 <get_char_pointer+0x46>
jmp    1157 <get_char_pointer+0x57>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <get_char_pointer+0xe>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1171 <get_char_pointer+0x71>
movq   $0x0,-0x8(%rbp)
jmp    1179 <get_char_pointer+0x79>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_char_pointer>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1121 <get_char_pointer+0x21>
cmp    %sil,%cl
jne    1110 <get_char_pointer+0x10>
xor    %edx,%edx
test   %cl,%cl
cmove  %rdx,%rax
ret

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

LLVM IR (-O2):
define i8* @get_char_pointer(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = icmp eq i8 %5, %1
%8 = or i1 %6, %7
%9 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %8, label %10, label %3
10: ; preds = %3
%11 = select i1 %6, i8* null, i8* %4
ret i8* %11
}
int cast_to_int(double x) {
  int i = x;
  return i;
}


x86 assembly (clang, -O0):
<cast_to_int>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cast_to_int>:
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @cast_to_int(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @cast_to_int(double %0) {
%2 = fptosi double %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookcomplex16array_(void *x, unsigned int *n) {
  lookNarray((char *)x, (*n * 16));
}


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

x86 assembly (clang, -O2):
<lookcomplex16array_>:
mov    (%rsi),%esi
shl    $0x4,%esi
jmp    1030 <lookNarray@plt>

LLVM IR (-O0):
define void @lookcomplex16array_(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = mul i32 %7, 16
%9 = call i32 @lookNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @lookcomplex16array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 4
%5 = tail call i32 @lookNarray(i8* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dataType();
int /*<<< orphan*/ memoryAddress();
int main() {
  dataType();
  memoryAddress();
  return 1;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <dataType@plt>
xor    %eax,%eax
call   1040 <memoryAddress@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @dataType()
%2 = tail call i32 (...) @memoryAddress()
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ SBC_(int);
int /*<<< orphan*/ c64_memAbsoluteAddr();
void SBC_abs(void) {
  c64_memAbsoluteAddr();
  SBC_(1);
}


x86 assembly (clang, -O0):
<SBC_abs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <c64_memAbsoluteAddr@plt>
mov    $0x1,%edi
call   1030 <SBC_@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SBC_abs>:
push   %rax
xor    %eax,%eax
call   1040 <c64_memAbsoluteAddr@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <SBC_@plt>

LLVM IR (-O0):
define void @SBC_abs() {
%1 = call i32 (...) @c64_memAbsoluteAddr()
%2 = call i32 @SBC_(i32 1)
ret void
}

LLVM IR (-O2):
define void @SBC_abs() {
%1 = tail call i32 (...) @c64_memAbsoluteAddr()
%2 = tail call i32 @SBC_(i32 1)
ret void
}
int bitcount(unsigned int k) {
  int b = 0;
  while (k) {
    b++;
    k &= (k - 1);
  }
  return b;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <bitcount+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110e <bitcount+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
xor    %eax,%eax
test   %edi,%edi
je     111c <bitcount+0x1c>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <bitcount+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitcount(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = add i32 %5, -1
%8 = and i32 %7, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
double log(double);
double logbx(double x, double b) { return log(x) / log(b); }


x86 assembly (clang, -O0):
<logbx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logbx>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
call   1030 <log@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <log@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @logbx(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 = call double @log(double %5)
%7 = load double, double* %4
%8 = call double @log(double %7)
%9 = fdiv double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @logbx(double %0, double %1) {
%3 = tail call double @log(double %0)
%4 = tail call double @log(double %1)
%5 = fdiv double %3, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ FIRCalcHannWindow(int, double *);
int /*<<< orphan*/ FIRCalcWindow(int, double, double *, double *);
int /*<<< orphan*/ free(double *);
double *malloc(int);
void FIRCalcHann(int length, double cutoff, double *coeffs) {
  double *window;
  window = malloc(length * sizeof(double));
  FIRCalcHannWindow(length, window);
  FIRCalcWindow(length, cutoff, coeffs, window);
  free(window);
}


x86 assembly (clang, -O0):
<FIRCalcHann>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1040 <FIRCalcHannWindow@plt>
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1050 <FIRCalcWindow@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FIRCalcHann>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
movsd  %xmm0,0x8(%rsp)
mov    %edi,%r15d
lea    0x0(,%r15,8),%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %r15d,%edi
mov    %rax,%rsi
call   1040 <FIRCalcHannWindow@plt>
mov    %r15d,%edi
movsd  0x8(%rsp),%xmm0
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <FIRCalcWindow@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @FIRCalcHann(i32 %0, double %1, double* %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double*
%7 = alloca double*
store i32 %0, i32* %4
store double %1, double* %5
store double* %2, double** %6
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 8
%11 = trunc i64 %10 to i32
%12 = call double* @malloc(i32 %11)
store double* %12, double** %7
%13 = load i32, i32* %4
%14 = load double*, double** %7
%15 = call i32 @FIRCalcHannWindow(i32 %13, double* %14)
%16 = load i32, i32* %4
%17 = load double, double* %5
%18 = load double*, double** %6
%19 = load double*, double** %7
%20 = call i32 @FIRCalcWindow(i32 %16, double %17, double* %18, double* %19)
%21 = load double*, double** %7
%22 = call i32 @free(double* %21)
ret void
}

LLVM IR (-O2):
define void @FIRCalcHann(i32 %0, double %1, double* %2) {
%4 = shl i32 %0, 3
%5 = tail call double* @malloc(i32 %4)
%6 = tail call i32 @FIRCalcHannWindow(i32 %0, double* %5)
%7 = tail call i32 @FIRCalcWindow(i32 %0, double %1, double* %2, double* %5)
%8 = tail call i32 @free(double* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_short_prod_to_all(short *target, short *source, int nreduce,
                                    int PE_start, int logPE_stride, int PE_size,
                                    short *pWrk, long *pSync) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_short_prod_to_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_short_prod_to_all(i16* %0, i16* %1, i32 %2, i32 %3, i32 %4, i32 %5, i16* %6, i64* %7) {
%9 = alloca i16*
%10 = alloca i16*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i16*
%16 = alloca i64*
store i16* %0, i16** %9
store i16* %1, i16** %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i16* %6, i16** %15
store i64* %7, i64** %16
%17 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_short_prod_to_all(i16* nocapture readnone %0, i16* nocapture readnone %1, i32 %2, i32 %3, i32 %4, i32 %5, i16* nocapture readnone %6, i64* nocapture readnone %7) {
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() {
  int intTen = 10;
  if (intTen == (intTen - 1)) {
    printf("Never prints");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    113c <main+0x2c>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
void MIDI_send_tune_request(void) {}


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

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

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

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

/* Variables and functions */
int32_t NumberOfSetBits(int32_t i) {
  i = i - ((i >> 1) & 0x55555555);
  i = (i & 0x33333333) + ((i >> 2) & 0x33333333);
  return (((i + (i >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24;
}


x86 assembly (clang, -O0):
<NumberOfSetBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
and    $0x55555555,%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
sar    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NumberOfSetBits>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @NumberOfSetBits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 1
%6 = and i32 %5, 1431655765
%7 = sub nsw i32 %3, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = and i32 %8, 858993459
%10 = load i32, i32* %2
%11 = ashr i32 %10, 2
%12 = and i32 %11, 858993459
%13 = add nsw i32 %9, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 4
%17 = add nsw i32 %14, %16
%18 = and i32 %17, 252645135
%19 = mul nsw i32 %18, 16843009
%20 = ashr i32 %19, 24
ret i32 %20
}

LLVM IR (-O2):
define i32 @NumberOfSetBits(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = sub nsw i32 %0, %3
%5 = and i32 %4, 858993459
%6 = lshr i32 %4, 2
%7 = and i32 %6, 858993459
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 252645135
%12 = mul nsw i32 %11, 16843009
%13 = lshr i32 %12, 24
ret i32 %13
}
int test_imm_74uint16_mem(unsigned short *val) {
  return ((*val) & (0x74 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_74uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x74,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_74uint16_mem>:
testb  $0x74,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_74uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 116
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct multiple_ir_module_section {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct multiple_ir_module_section *);
int multiple_ir_module_section_destroy(
    struct multiple_ir_module_section *section) {
  free(section);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.multiple_ir_module_section = type { i32 }
define i32 @multiple_ir_module_section_destroy(%struct.multiple_ir_module_section* %0) {
%2 = alloca %struct.multiple_ir_module_section*
store %struct.multiple_ir_module_section* %0, %struct.multiple_ir_module_section** %2
%3 = load %struct.multiple_ir_module_section*, %struct.multiple_ir_module_section** %2
%4 = call i32 @free(%struct.multiple_ir_module_section* %3)
ret i32 0
}

LLVM IR (-O2):
%struct.multiple_ir_module_section = type { i32 }
define i32 @multiple_ir_module_section_destroy(%struct.multiple_ir_module_section* nocapture %0) {
%2 = tail call i32 @free(%struct.multiple_ir_module_section* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ms_free_node(void *node) {
  if (node)
    free(node);
}


x86 assembly (clang, -O0):
<ms_free_node>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <ms_free_node+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms_free_node>:
test   %rdi,%rdi
je     111a <ms_free_node+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @ms_free_node(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @ms_free_node(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t num;
  while (str[num]) {
    num++;
  }
  return num;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     112b <strlen+0x2b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <strlen+0x8>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1100 <strlen>
ret

LLVM IR (-O0):
define i64 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
br label %4
4: ; preds = %10, %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 = icmp ne i8 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = load i64, i64* %3
%12 = add i64 %11, 1
store i64 %12, i64* %3
br label %4
13: ; preds = %4
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ undef, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
extern int isfoldersep(int x) { return x == '/'; }


x86 assembly (clang, -O0):
<isfoldersep>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x2f,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isfoldersep>:
xor    %eax,%eax
cmp    $0x2f,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isfoldersep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 47
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @isfoldersep(i32 %0) {
%2 = icmp eq i32 %0, 47
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void end_task_section() { write("csv-task.csv", "break\n", NULL); }


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

x86 assembly (clang, -O2):
<end_task_section>:
lea    0xee9(%rip),%rdi
lea    0xeef(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"csv-task.csv\00"
@.str.1 = [7 x i8] c"break\0A\00"
define void @end_task_section() {
%1 = call i32 @write(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"csv-task.csv\00"
@.str.1 = [7 x i8] c"break\0A\00"
define void @end_task_section() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
int xislower(int c) { return (c >= (int)'a' && c <= (int)'z'); }


x86 assembly (clang, -O0):
<xislower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <xislower+0x20>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xislower>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xislower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xislower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int bar(int);
int main() {
  if (sizeof(long long) > sizeof(int) && bar(-1) != -1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xffffffff,%edi
call   1040 <bar@plt>
cmp    $0xffffffff,%eax
je     1149 <main+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffffff,%edi
call   1040 <bar@plt>
cmp    $0xffffffff,%eax
jne    1134 <main+0x14>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @bar(i32 -1)
%3 = icmp ne i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bar(i32 -1)
%2 = icmp eq i32 %1, -1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Type definitions */
struct ndm_strmap_t {
  int dummy;
};

/* Variables and functions */
int ndm_strmap_nset(struct ndm_strmap_t *, char const *const,
                    int /*<<< orphan*/, char const *const, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *const);
bool ndm_strmap_set(struct ndm_strmap_t *map, const char *const key,
                    const char *const value) {
  return ndm_strmap_nset(map, key, strlen(key), value, strlen(value));
}


x86 assembly (clang, -O0):
<ndm_strmap_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    %eax,%r8d
call   1040 <ndm_strmap_nset@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndm_strmap_set>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %r14,%rcx
mov    %eax,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <ndm_strmap_nset@plt>

LLVM IR (-O0):
%struct.ndm_strmap_t = type { i32 }
define i32 @ndm_strmap_set(%struct.ndm_strmap_t* %0, i8* %1, i8* %2) {
%4 = alloca %struct.ndm_strmap_t*
%5 = alloca i8*
%6 = alloca i8*
store %struct.ndm_strmap_t* %0, %struct.ndm_strmap_t** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.ndm_strmap_t*, %struct.ndm_strmap_t** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %5
%10 = call i32 @strlen(i8* %9)
%11 = load i8*, i8** %6
%12 = load i8*, i8** %6
%13 = call i32 @strlen(i8* %12)
%14 = call i32 @ndm_strmap_nset(%struct.ndm_strmap_t* %7, i8* %8, i32 %10, i8* %11, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.ndm_strmap_t = type { i32 }
define i32 @ndm_strmap_set(%struct.ndm_strmap_t* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i32 @strlen(i8* %2)
%6 = tail call i32 @ndm_strmap_nset(%struct.ndm_strmap_t* %0, i8* %1, i32 %4, i8* %2, i32 %5)
ret i32 %6
}
/* Variables and functions */
double atan2(double, double);
double cos(double);
double sin(double);
double carmen_normalize_theta(double theta) {
  double s = sin(theta);
  double c = cos(theta);
  return atan2(s, c);
}


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

x86 assembly (clang, -O2):
<carmen_normalize_theta>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
jmp    1030 <atan2@plt>

LLVM IR (-O0):
define double @carmen_normalize_theta(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = call double @sin(double %5)
store double %6, double* %3
%7 = load double, double* %2
%8 = call double @cos(double %7)
store double %8, double* %4
%9 = load double, double* %3
%10 = load double, double* %4
%11 = call double @atan2(double %9, double %10)
ret double %11
}

LLVM IR (-O2):
define double @carmen_normalize_theta(double %0) {
%2 = tail call double @sin(double %0)
%3 = tail call double @cos(double %0)
%4 = tail call double @atan2(double %2, double %3)
ret double %4
}
/* Variables and functions */
int fptr_capi20ext_get_flags(unsigned int, unsigned int *);
scalar_t__ loadlib();
int capi20ext_get_flags(unsigned ApplID, unsigned *flagsptr) {
  if (loadlib() < 0)
    return -1;
  return fptr_capi20ext_get_flags(ApplID, flagsptr);
}


x86 assembly (clang, -O0):
<capi20ext_get_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <loadlib@plt>
cmp    $0x0,%rax
jge    114c <capi20ext_get_flags+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <capi20ext_get_flags+0x3b>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <fptr_capi20ext_get_flags@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capi20ext_get_flags>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <loadlib@plt>
test   %rax,%rax
js     1144 <capi20ext_get_flags+0x24>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fptr_capi20ext_get_flags@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @capi20ext_get_flags(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
%6 = call i64 (...) @loadlib()
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 -1, i32* %3
br label %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32*, i32** %5
%12 = call i32 @fptr_capi20ext_get_flags(i32 %10, i32* %11)
store i32 %12, i32* %3
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @capi20ext_get_flags(i32 %0, i32* %1) {
%3 = tail call i64 (...) @loadlib()
%4 = icmp slt i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @fptr_capi20ext_get_flags(i32 %0, i32* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ writestr(int, char *);
void usage(void) { writestr(2, "usage: wc [-clw] [FILE ...]\n"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xee0(%rip),%rsi
call   1030 <writestr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
lea    0xee9(%rip),%rsi
mov    $0x2,%edi
jmp    1030 <writestr@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"usage: wc [-clw] [FILE ...]\0A\00"
define void @usage() {
%1 = call i32 @writestr(i32 2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"usage: wc [-clw] [FILE ...]\0A\00"
define void @usage() {
%1 = tail call i32 @writestr(i32 2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct HMMSegment {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ FreeHMMSegment(struct HMMSegment *);
void free_hmm(struct HMMSegment *handle) { FreeHMMSegment(handle); }


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

x86 assembly (clang, -O2):
<free_hmm>:
jmp    1030 <FreeHMMSegment@plt>

LLVM IR (-O0):
%struct.HMMSegment = type { i32 }
define void @free_hmm(%struct.HMMSegment* %0) {
%2 = alloca %struct.HMMSegment*
store %struct.HMMSegment* %0, %struct.HMMSegment** %2
%3 = load %struct.HMMSegment*, %struct.HMMSegment** %2
%4 = call i32 @FreeHMMSegment(%struct.HMMSegment* %3)
ret void
}

LLVM IR (-O2):
%struct.HMMSegment = type { i32 }
define void @free_hmm(%struct.HMMSegment* %0) {
%2 = tail call i32 @FreeHMMSegment(%struct.HMMSegment* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool multimap_isPowerOfTwo32(uint32_t value) {
  return (value & (value - 1)) == 0;
}


x86 assembly (clang, -O0):
<multimap_isPowerOfTwo32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<multimap_isPowerOfTwo32>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @multimap_isPowerOfTwo32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = and i32 %3, %5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @multimap_isPowerOfTwo32(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ glMaterialfv(unsigned int, unsigned int, float *);
void Materialfv(unsigned int f, unsigned int p, float v[4]) {
  glMaterialfv(f, p, v);
}


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

x86 assembly (clang, -O2):
<Materialfv>:
jmp    1030 <glMaterialfv@plt>

LLVM IR (-O0):
define void @Materialfv(i32 %0, i32 %1, float* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca float*
store i32 %0, i32* %4
store i32 %1, i32* %5
store float* %2, float** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load float*, float** %6
%10 = call i32 @glMaterialfv(i32 %7, i32 %8, float* %9)
ret void
}

LLVM IR (-O2):
define void @Materialfv(i32 %0, i32 %1, float* %2) {
%4 = tail call i32 @glMaterialfv(i32 %0, i32 %1, float* %2)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int is_little(void) {
  uint16_t w = 0x0001;
  return *((unsigned char *)&w);
}


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

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

LLVM IR (-O0):
define i32 @is_little() {
%1 = alloca i32
store i32 1, i32* %1
%2 = bitcast i32* %1 to i8*
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @is_little() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ Widget;

/* Variables and functions */
void fancy_widgets(Widget parent) {}


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

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

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

LLVM IR (-O2):
define void @fancy_widgets(i32 %0) {
ret void
}
int main(int argc, char **argv) {
  char *data = "\x12\x34\x56\x78";
  int *idata = (int *)data;
  return !(*idata == 0x12345678);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xee7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpl   $0x12345678,(%rax)
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"\124Vx\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %7
%10 = load i32*, i32** %7
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 305419896
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 1
}
int test_imm_67uint8_mem(unsigned char *val) {
  return ((*val) & (-0x67 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_67uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffff99,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_67uint8_mem>:
testb  $0x99,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_67uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -103
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ input;

/* Variables and functions */
int /*<<< orphan*/ test_rebase(int, int /*<<< orphan*/ *, int, int,
                               int /*<<< orphan*/ *, int /*<<< orphan*/);
void test_single_zero(void) {
  int8_t input[] = {0};
  int8_t expected[] = {0};
  test_rebase(2, input, (sizeof(input) / sizeof(input[0])), 10, expected, 0);
}


x86 assembly (clang, -O0):
<test_single_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%r8
mov    $0x2,%edi
mov    $0x1,%edx
mov    $0xa,%ecx
xor    %r9d,%r9d
call   1040 <test_rebase@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_single_zero>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%r8
mov    $0x2,%edi
mov    $0x1,%edx
mov    $0xa,%ecx
xor    %r9d,%r9d
call   1030 <test_rebase@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test_single_zero() {
%1 = alloca [1 x i32]
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %1 to i8*
%4 = bitcast [1 x i32]* %2 to i8*
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%7 = call i32 @test_rebase(i32 2, i32* %5, i32 1, i32 10, i32* %6, i32 0)
ret void
}

LLVM IR (-O2):
define void @test_single_zero() {
%1 = alloca [1 x i32]
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %1 to i8*
%4 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
store i32 0, i32* %4
%5 = bitcast [1 x i32]* %2 to i8*
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 0, i32* %6
%7 = call i32 @test_rebase(i32 2, i32* %4, i32 1, i32 10, i32* %6, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
unsigned int hash(char *key) {
  unsigned int n = 0;
  assert(key != NULL);
  while (*key)
    n += *(key++);
  return n & ((1 << 2) - 1);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115f <hash+0x4f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <hash+0x25>
mov    -0xc(%rbp),%eax
and    $0x3,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%cl
test   %cl,%cl
je     1145 <hash+0x35>
add    $0x1,%rbx
xor    %eax,%eax
xchg   %ax,%ax
movzbl %cl,%ecx
add    %ecx,%eax
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1130 <hash+0x20>
and    $0x3,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @hash(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %18, label %7
7: ; preds = %1, %7
%8 = phi i8 [ %14, %7 ], [ %5, %1 ]
%9 = phi i32 [ %13, %7 ], [ 0, %1 ]
%10 = phi i8* [ %11, %7 ], [ %0, %1 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = zext i8 %8 to i32
%13 = add i32 %9, %12
%14 = load i8, i8* %11
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %7
16: ; preds = %7
%17 = and i32 %13, 3
br label %18
18: ; preds = %16, %1
%19 = phi i32 [ 0, %1 ], [ %17, %16 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ f();
main() {
  return 1 + ({
           f();
           1;
         });
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @f()
store i32 1, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 1, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
ret i32 2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
long __stdio_ftell(int /*<<< orphan*/ *);
long ftell(FILE *stream) { return __stdio_ftell(stream); }


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

x86 assembly (clang, -O2):
<ftell>:
jmp    1030 <__stdio_ftell@plt>

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

LLVM IR (-O2):
define i64 @ftell(i32* %0) {
%2 = tail call i64 @__stdio_ftell(i32* %0)
ret i64 %2
}