xunge/DecIR huggingface dataset:
/* Variables and functions */
int memcmp(char const *, char const *, int);
int msgu_binary_cmp(const char *a, const char *b, size_t a_len, size_t b_len) {
  int min = (a_len < b_len) ? a_len : b_len;
  int cmp = memcmp(a, b, min);
  if (cmp) {
    return cmp;
  } else {
    return a_len - b_len;
  }
}


x86 assembly (clang, -O0):
<msgu_binary_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1143 <msgu_binary_cmp+0x33>
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    114b <msgu_binary_cmp+0x3b>
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x2c(%rbp),%edx
call   1030 <memcmp@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x30(%rbp)
je     117a <msgu_binary_cmp+0x6a>
mov    -0x30(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <msgu_binary_cmp+0x75>
mov    -0x20(%rbp),%rax
sub    -0x28(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msgu_binary_cmp>:
push   %rbx
mov    %rdx,%rbx
sub    %rcx,%rbx
cmovae %ecx,%edx
call   1030 <memcmp@plt>
test   %eax,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @msgu_binary_cmp(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i32
%11 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i64 %3, i64* %9
%12 = load i64, i64* %8
%13 = load i64, i64* %9
%14 = icmp ult i64 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %4
%16 = load i64, i64* %8
br label %19
17: ; preds = %4
%18 = load i64, i64* %9
br label %19
19: ; preds = %17, %15
%20 = phi i64 [ %16, %15 ], [ %18, %17 ]
%21 = trunc i64 %20 to i32
store i32 %21, i32* %10
%22 = load i8*, i8** %6
%23 = load i8*, i8** %7
%24 = load i32, i32* %10
%25 = call i32 @memcmp(i8* %22, i8* %23, i32 %24)
store i32 %25, i32* %11
%26 = load i32, i32* %11
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %19
%29 = load i32, i32* %11
store i32 %29, i32* %5
br label %35
30: ; preds = %19
%31 = load i64, i64* %8
%32 = load i64, i64* %9
%33 = sub i64 %31, %32
%34 = trunc i64 %33 to i32
store i32 %34, i32* %5
br label %35
35: ; preds = %30, %28
%36 = load i32, i32* %5
ret i32 %36
}

LLVM IR (-O2):
define i32 @msgu_binary_cmp(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = icmp ult i64 %2, %3
%6 = select i1 %5, i64 %2, i64 %3
%7 = trunc i64 %6 to i32
%8 = tail call i32 @memcmp(i8* %0, i8* %1, i32 %7)
%9 = icmp eq i32 %8, 0
%10 = sub i64 %2, %3
%11 = trunc i64 %10 to i32
%12 = select i1 %9, i32 %11, i32 %8
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;

/* Variables and functions */
int zero_test(const u_int8_t *p, size_t sz) {
  while (sz-- > 0)
    if (*p++ != 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<zero_test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
jbe    114e <zero_test+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
cmpl   $0x0,(%rax)
je     1149 <zero_test+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1155 <zero_test+0x55>
jmp    110c <zero_test+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_test>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    %rax,%rsi
je     1122 <zero_test+0x22>
cmpl   $0x0,(%rdi,%rax,4)
lea    0x1(%rax),%rax
je     1110 <zero_test+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @zero_test(i32* nocapture %0, i64 %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i32* [ %0, %2 ], [ %9, %7 ]
%5 = phi i64 [ %1, %2 ], [ %8, %7 ]
%6 = icmp eq i64 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = add i64 %5, -1
%9 = getelementptr inbounds i32, i32* %4, i64 1
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 0
br i1 %11, label %3, label %12
12: ; preds = %3, %7
%13 = phi i32 [ 0, %7 ], [ 1, %3 ]
ret i32 %13
}
void main() {
  int a;
  a = -2147483648;
  a = -2147483649;
  a = -2147483648LL;
  a = -2147483649LL;
  long long int b;
  b = -2147483648;
  b = -2147483649;
  b = -2147483648LL;
  b = -2147483649LL;
  char c;
  c = -2147483648;
  c = -2147483649;
  c = -2147483648LL;
  c = -2147483649LL;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x80000000,-0x4(%rbp)
movl   $0x7fffffff,-0x4(%rbp)
movl   $0x80000000,-0x4(%rbp)
movl   $0x7fffffff,-0x4(%rbp)
movq   $0xffffffff80000000,-0x10(%rbp)
80
movabs $0xffffffff7fffffff,%rax
ff ff ff
mov    %rax,-0x10(%rbp)
movq   $0xffffffff80000000,-0x10(%rbp)
80
movabs $0xffffffff7fffffff,%rax
ff ff ff
mov    %rax,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
movb   $0xff,-0x11(%rbp)
movb   $0x0,-0x11(%rbp)
movb   $0xff,-0x11(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i8
store i32 -2147483648, i32* %1
store i32 2147483647, i32* %1
store i32 -2147483648, i32* %1
store i32 2147483647, i32* %1
store i64 -2147483648, i64* %2
store i64 -2147483649, i64* %2
store i64 -2147483648, i64* %2
store i64 -2147483649, i64* %2
store i8 0, i8* %3
store i8 -1, i8* %3
store i8 0, i8* %3
store i8 -1, i8* %3
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, unsigned long long);
void printunsigned(char *name, unsigned long long x) {
  printf("%20s: %llu\n", name, x);
}


x86 assembly (clang, -O0):
<printunsigned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printunsigned>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%20s: %llu\0A\00"
define void @printunsigned(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5, i64 %6)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%20s: %llu\0A\00"
define void @printunsigned(i8* %0, i64 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1)
ret void
}
/* Variables and functions */
double pow(double, double);
double S_nu(double nu, double temperature) {
  double h_plank = 6.6260693e-27;
  double k_a = 1.38e-16;
  return (2.0 * 1.380658e-16 * pow(nu, 2.0) * temperature) *
         pow(2.99792458e10, -2.0);
}


x86 assembly (clang, -O0):
<S_nu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xefe(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xeb7(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe91(%rip),%xmm0
movsd  0xe91(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<S_nu>:
mulsd  %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @S_nu(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 0x3A8067C5367C9154, double* %5
store double 1.380000e-16, double* %6
%7 = load double, double* %3
%8 = call double @pow(double %7, double 2.000000e+00)
%9 = fmul double 0x3CB3E5BA9CD9FBD6, %8
%10 = load double, double* %4
%11 = fmul double %9, %10
%12 = call double @pow(double 0x421BEB9BF3A00000, double -2.000000e+00)
%13 = fmul double %11, %12
ret double %13
}

LLVM IR (-O2):
define double @S_nu(double %0, double %1) {
%3 = fmul double %0, %0
%4 = fmul double %3, 0x3CB3E5BA9CD9FBD6
%5 = fmul double %4, %1
%6 = fmul double %5, 0x3B9504720DD99F36
ret double %6
}
/* Variables and functions */
int partition(int *, int, int);
void quick_sort(int *array, int low, int high) {
  if (low >= high) {
    return;
  }
  int pivot = partition(array, low, high);
  quick_sort(array, low, pivot - 1);
  quick_sort(array, pivot + 1, high);
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1143 <quick_sort+0x23>
jmp    1179 <quick_sort+0x59>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp sge i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
br label %25
12: ; preds = %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @partition(i32* %13, i32 %14, i32 %15)
store i32 %16, i32* %7
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 1
%21 = load i32*, i32** %4
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %6
br label %25
25: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int fun_stub_base_2_stub(int, int);
int /*<<< orphan*/ printf(char *, int, ...);
int fun_stub_base_2_call(int a, int b) {
  printf("fun_stub_base_2_call:a = %d, b = %d\n", a, b);
  int x = fun_stub_base_2_stub(a, b);
  printf("fun_stub_base_2_stub return %d\n", x);
  return x;
}


x86 assembly (clang, -O0):
<fun_stub_base_2_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <fun_stub_base_2_stub@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_stub_base_2_call>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <fun_stub_base_2_stub@plt>
mov    %eax,%ebx
lea    0xeda(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"fun_stub_base_2_call:a = %d, b = %d\0A\00"
@.str.1 = [32 x i8] c"fun_stub_base_2_stub return %d\0A\00"
define i32 @fun_stub_base_2_call(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @fun_stub_base_2_stub(i32 %9, i32 %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
@.str = [37 x i8] c"fun_stub_base_2_call:a = %d, b = %d\0A\00"
@.str.1 = [32 x i8] c"fun_stub_base_2_stub return %d\0A\00"
define i32 @fun_stub_base_2_call(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = tail call i32 @fun_stub_base_2_stub(i32 %0, i32 %1)
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_BIT_STRING;

/* Variables and functions */
int ASN1_STRING_set(int /*<<< orphan*/ *, unsigned char *, int);
int ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, int len) {
  return ASN1_STRING_set(x, d, len);
}


x86 assembly (clang, -O0):
<ASN1_BIT_STRING_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ASN1_STRING_set@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_BIT_STRING_set>:
jmp    1030 <ASN1_STRING_set@plt>

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

LLVM IR (-O2):
define i32 @ASN1_BIT_STRING_set(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @ASN1_STRING_set(i32* %0, i8* %1, i32 %2)
ret i32 %4
}
int main() {
  int i, j;
  i = 24;
  if (i) {
    float f[50][50];
    float b[10][500];
  } else {
    i = 1 + 2 + 3 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 +
        4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 +
        2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 +
        4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 +
        2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 +
        4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 +
        2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 +
        4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 +
        2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 +
        4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 +
        2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4 + 1 + 2 + 3 + 4;
  }
  while (i < 17000) {
    int a;
    i = i + 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x74d0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x18,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1128 <main+0x28>
jmp    112f <main+0x2f>
movl   $0x1e6,-0x8(%rbp)
jmp    1134 <main+0x34>
cmpl   $0x4268,-0x8(%rbp)
jge    114f <main+0x4f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x34>
mov    -0x4(%rbp),%eax
add    $0x74d0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [50 x [50 x float]]
%5 = alloca [10 x [500 x float]]
%6 = alloca i32
store i32 0, i32* %1
store i32 24, i32* %2
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %0
br label %11
10: ; preds = %0
store i32 486, i32* %2
br label %11
11: ; preds = %10, %9
br label %12
12: ; preds = %15, %11
%13 = load i32, i32* %2
%14 = icmp slt i32 %13, 17000
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %12
18: ; preds = %12
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void myDelay(unsigned long delay) {
  while (delay)
    delay--;
}


x86 assembly (clang, -O0):
<myDelay>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1124 <myDelay+0x24>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <myDelay+0x8>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @myDelay(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void blkfree(char **av) {
  int i;
  for (i = 0; av[i]; i++)
    free(av[i]);
}


x86 assembly (clang, -O0):
<blkfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1155 <blkfree+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <blkfree+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blkfree>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1131 <blkfree+0x21>
add    $0x8,%rbx
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1120 <blkfree+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @blkfree(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @free(i8* %6)
%8 = add nuw nsw i64 %5, 1
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ generate_alpha(int /*<<< orphan*/ *);
int /*<<< orphan*/ generate_letter(int /*<<< orphan*/ *);
void generate_name(int len, FILE *fp) {
  generate_alpha(fp);
  for (int i = 1; i < len; i++)
    generate_letter(fp);
}


x86 assembly (clang, -O0):
<generate_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <generate_alpha@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1162 <generate_name+0x42>
mov    -0x10(%rbp),%rdi
call   1040 <generate_letter@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113f <generate_name+0x1f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_name>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <generate_alpha@plt>
cmp    $0x2,%ebp
jl     114d <generate_name+0x2d>
add    $0xffffffff,%ebp
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <generate_letter@plt>
add    $0xffffffff,%ebp
jne    1140 <generate_name+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @generate_name(i32 %0, i32* %1) {
%3 = tail call i32 @generate_alpha(i32* %1)
%4 = icmp sgt i32 %0, 1
br i1 %4, label %6, label %5
5: ; preds = %6, %2
ret void
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ 1, %2 ]
%8 = tail call i32 @generate_letter(i32* %1)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %5, label %6
}
void kgsl_cffdump_user_event(struct kgsl_device *device,
                             unsigned int cff_opcode, unsigned int op1,
                             unsigned int op2, unsigned int op3,
                             unsigned int op4, unsigned int op5) {
  return;
}


x86 assembly (clang, -O0):
<kgsl_cffdump_user_event>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.kgsl_device = type opaque
define void @kgsl_cffdump_user_event(%struct.kgsl_device* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca %struct.kgsl_device*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store %struct.kgsl_device* %0, %struct.kgsl_device** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
ret void
}

LLVM IR (-O2):
%struct.kgsl_device = type opaque
define void @kgsl_cffdump_user_event(%struct.kgsl_device* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
ret void
}
double foo() {
  double a[3];
  a[0] = 1.0;
  a[1] = 2.0;
  a[2] = 3.0;
  return a[0] + a[1] + a[2];
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  0xf04(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeda(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @foo() {
%1 = alloca [3 x double]
%2 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
store double 1.000000e+00, double* %2
%3 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 1
store double 2.000000e+00, double* %3
%4 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 2
store double 3.000000e+00, double* %4
%5 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%6 = load double, double* %5
%7 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 1
%8 = load double, double* %7
%9 = fadd double %6, %8
%10 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 2
%11 = load double, double* %10
%12 = fadd double %9, %11
ret double %12
}

LLVM IR (-O2):
define double @foo() {
ret double 6.000000e+00
}
/* Variables and functions */
int wrap(int i, int max) { return ((i % max) + max) % max; }


x86 assembly (clang, -O0):
<wrap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
add    -0x8(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap>:
mov    %edi,%eax
cltd
idiv   %esi
lea    (%rdx,%rsi,1),%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @wrap(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = srem i32 %5, %6
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %4
%11 = srem i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @wrap(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = add nsw i32 %3, %1
%5 = srem i32 %4, %1
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int find(int *, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int a[] = {7, 8, 1, 2, 3, 4, 5, 6};
  int b[] = {3, 4, 5, 6, 7, 8, 1, 2};
  int len = sizeof(a) / sizeof(a[0]);
  int res = find(b, 0, len - 1, 5);
  printf("Index is %d", res);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xec5(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xec2(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xebf(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xebc(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0x8,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
mov    $0x5,%ecx
call   1040 <find@plt>
mov    %eax,-0x48(%rbp)
mov    -0x48(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x7,%edx
mov    $0x5,%ecx
call   1040 <find@plt>
lea    0xeca(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [8 x i32] [i32 7, i32 8, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6]
@__const.main.b = [8 x i32] [i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 1, i32 2]
@.str = [12 x i8] c"Index is %d\00"
define void @main() {
%1 = alloca [8 x i32]
%2 = alloca [8 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = bitcast [8 x i32]* %1 to i8*
%6 = bitcast [8 x i32]* %2 to i8*
store i32 8, i32* %3
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = call i32 @find(i32* %7, i32 0, i32 %9, i32 5)
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@__const.main.b = [8 x i32] [i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 1, i32 2]
@.str = [12 x i8] c"Index is %d\00"
define void @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @find(i32* %3, i32 0, i32 7, i32 5)
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *xmalloc(scalar_t__);
char *newstr(const char *str) {
  char *p = xmalloc(strlen(str) + 1);
  (void)strcpy(p, str);
  return p;
}


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

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

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

LLVM IR (-O2):
define i8* @newstr(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @xmalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int doswitch(int);
int rand();
int main(int argc, char **argv) {
  int r = rand();
  return doswitch(r) + doswitch(argc);
}


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)
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <doswitch@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <doswitch@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <rand@plt>
mov    %eax,%edi
call   1030 <doswitch@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <doswitch@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
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
%7 = call i32 (...) @rand()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @doswitch(i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @doswitch(i32 %10)
%12 = add nsw i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = tail call i32 @doswitch(i32 %3)
%5 = tail call i32 @doswitch(i32 %0)
%6 = add nsw i32 %5, %4
ret i32 %6
}
__attribute__((format(printf, 1, 2))) int no_printk(const char *fmt, ...) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @no_printk(i8* nocapture readnone %0, ...) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int wctomb(char *s, wchar_t wchar __attribute__((unused))) {
  return (s == NULL) ? 0 : -1;
}


x86 assembly (clang, -O0):
<wctomb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wctomb>:
neg    %rdi
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @wctomb(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 = icmp eq i8* %5, null
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 0, i32 -1
ret i32 %8
}

LLVM IR (-O2):
define i32 @wctomb(i8* readnone %0, i32 %1) {
%3 = icmp ne i8* %0, null
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;
typedef int int64_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ lseek64(int, int, int, int *, int);
int64_t lseek(int fd, int64_t offset, int whence) {
  uint64_t real_result;
  int32_t result;
  result =
      lseek64(fd, (offset >> 32), offset & 0xffffffff, &real_result, whence);
  if (result < 0) {
    return result;
  }
  return real_result;
}


x86 assembly (clang, -O0):
<lseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x20,%ecx
sar    %cl,%esi
mov    -0xc(%rbp),%edx
and    $0xffffffff,%edx
mov    -0x10(%rbp),%r8d
lea    -0x14(%rbp),%rcx
call   1030 <lseek64@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jge    115c <lseek+0x4c>
mov    -0x20(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    1162 <lseek+0x52>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lseek>:
push   %rax
mov    %edx,%r8d
mov    %esi,%edx
lea    0x4(%rsp),%rcx
call   1030 <lseek64@plt>
test   %rax,%rax
js     1129 <lseek+0x19>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = ashr i32 %11, 32
%13 = load i32, i32* %6
%14 = and i32 %13, -1
%15 = load i32, i32* %7
%16 = call i64 @lseek64(i32 %10, i32 %12, i32 %14, i32* %8, i32 %15)
store i64 %16, i64* %9
%17 = load i64, i64* %9
%18 = icmp slt i64 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %3
%20 = load i64, i64* %9
%21 = trunc i64 %20 to i32
store i32 %21, i32* %4
br label %24
22: ; preds = %3
%23 = load i32, i32* %8
store i32 %23, i32* %4
br label %24
24: ; preds = %22, %19
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i64 @lseek64(i32 %0, i32 poison, i32 %1, i32* %4, i32 %2)
%7 = icmp slt i64 %6, 0
%8 = trunc i64 %6 to i32
%9 = load i32, i32* %4
%10 = select i1 %7, i32 %8, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ addstr(char *);
void nmstermio_print_string(char *s) { addstr(s); }


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

x86 assembly (clang, -O2):
<nmstermio_print_string>:
jmp    1030 <addstr@plt>

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

LLVM IR (-O2):
define void @nmstermio_print_string(i8* %0) {
%2 = tail call i32 @addstr(i8* %0)
ret void
}
void RTSemMutexCreateEx(void) {}


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

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

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

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

/* Variables and functions */
int person_by_key_cmp(const uint64_t keyA, const uint64_t keyB) {
  return keyB - keyA;
}


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

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

LLVM IR (-O0):
define i32 @person_by_key_cmp(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @person_by_key_cmp(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
struct _rtext {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rtext_senditup(struct _rtext *, int /*<<< orphan*/, int *,
                                  int *, int *);
int rtext_height(struct _rtext *x) {
  int w = 0, h = 0, indx;
  rtext_senditup(x, 0, &w, &h, &indx);
  return (h);
}


x86 assembly (clang, -O0):
<rtext_height>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <rtext_senditup@plt>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtext_height>:
sub    $0x18,%rsp
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x14(%rsp),%r8
xor    %esi,%esi
call   1030 <rtext_senditup@plt>
mov    0xc(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct._rtext = type { i32 }
define i32 @rtext_height(%struct._rtext* %0) {
%2 = alloca %struct._rtext*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store %struct._rtext* %0, %struct._rtext** %2
store i32 0, i32* %3
store i32 0, i32* %4
%6 = load %struct._rtext*, %struct._rtext** %2
%7 = call i32 @rtext_senditup(%struct._rtext* %6, i32 0, i32* %3, i32* %4, i32* %5)
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
%struct._rtext = type { i32 }
define i32 @rtext_height(%struct._rtext* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%7 = bitcast i32* %4 to i8*
%8 = call i32 @rtext_senditup(%struct._rtext* %0, i32 0, i32* %2, i32* %3, i32* %4)
%9 = load i32, i32* %3
ret i32 %9
}
/* Variables and functions */
double powf(double, double);
double pow(double arg1, double arg2) { return powf(arg1, arg2); }


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

x86 assembly (clang, -O2):
<pow>:
jmp    1030 <powf@plt>

LLVM IR (-O0):
define double @pow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @powf(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @pow(double %0, double %1) {
%3 = tail call double @powf(double %0, double %1)
ret double %3
}
void ff_hevc_put_hevc_bi_w_epel_hv24_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_hv24_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(char, int);
void commandRegister2(char var) { outb(var, 0x0260 + 0x01); }


x86 assembly (clang, -O0):
<commandRegister2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x261,%esi
movsbl -0x1(%rbp),%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<commandRegister2>:
mov    $0x261,%esi
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @commandRegister2(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @outb(i8 signext %3, i32 609)
ret void
}

LLVM IR (-O2):
define void @commandRegister2(i8 signext %0) {
%2 = tail call i32 @outb(i8 signext %0, i32 609)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int my_function(int a) { printf("my function: %d!\n", a); }


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

x86 assembly (clang, -O2):
<my_function>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"my function: %d!\0A\00"
define i32 @my_function(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@.str = [18 x i8] c"my function: %d!\0A\00"
define i32 @my_function(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 undef
}
/* Type definitions */
struct MemoryPage {
  int dummy;
};

/* Variables and functions */
void *MAAllocMemoryBlockEx(struct MemoryPage *, long, int /*<<< orphan*/);
void *MAAllocMemoryBlock(struct MemoryPage *p_mempage, long block_size) {
  return MAAllocMemoryBlockEx(p_mempage, block_size, 0);
}


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

x86 assembly (clang, -O2):
<MAAllocMemoryBlock>:
xor    %edx,%edx
jmp    1030 <MAAllocMemoryBlockEx@plt>

LLVM IR (-O0):
%struct.MemoryPage = type { i32 }
define i8* @MAAllocMemoryBlock(%struct.MemoryPage* %0, i64 %1) {
%3 = alloca %struct.MemoryPage*
%4 = alloca i64
store %struct.MemoryPage* %0, %struct.MemoryPage** %3
store i64 %1, i64* %4
%5 = load %struct.MemoryPage*, %struct.MemoryPage** %3
%6 = load i64, i64* %4
%7 = call i8* @MAAllocMemoryBlockEx(%struct.MemoryPage* %5, i64 %6, i32 0)
ret i8* %7
}

LLVM IR (-O2):
%struct.MemoryPage = type { i32 }
define i8* @MAAllocMemoryBlock(%struct.MemoryPage* %0, i64 %1) {
%3 = tail call i8* @MAAllocMemoryBlockEx(%struct.MemoryPage* %0, i64 %1, i32 0)
ret i8* %3
}
/* Type definitions */
typedef int uint32_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t rgb32ToRgb16(const uint32_t rgb32) {
  return (rgb32 >> 8 & 0xF800) | (rgb32 >> 5 & 0x07E0) | (rgb32 >> 3 & 0x001F);
}


x86 assembly (clang, -O0):
<rgb32ToRgb16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xf800,%eax
mov    -0x4(%rbp),%ecx
sar    $0x5,%ecx
and    $0x7e0,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x3,%ecx
and    $0x1f,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb32ToRgb16>:
mov    %edi,%ecx
shr    $0x8,%ecx
and    $0xf800,%ecx
mov    %edi,%eax
shr    $0x5,%eax
and    $0x7e0,%eax
or     %ecx,%eax
shr    $0x3,%edi
and    $0x1f,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rgb32ToRgb16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = and i32 %4, 63488
%6 = load i32, i32* %2
%7 = ashr i32 %6, 5
%8 = and i32 %7, 2016
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = ashr i32 %10, 3
%12 = and i32 %11, 31
%13 = or i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @rgb32ToRgb16(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 63488
%4 = lshr i32 %0, 5
%5 = and i32 %4, 2016
%6 = or i32 %3, %5
%7 = lshr i32 %0, 3
%8 = and i32 %7, 31
%9 = or i32 %6, %8
ret i32 %9
}
int keyeq(const char *s1, const char *s2) {
  for (; *s1 == *s2; s1++, s2++)
    if (*s1 == 0)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<keyeq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1160 <keyeq+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <keyeq+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1167 <keyeq+0x67>
jmp    1143 <keyeq+0x43>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <keyeq+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyeq>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    (%rsi),%cl
jne    1124 <keyeq+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %cl,%cl
je     1125 <keyeq+0x25>
movzbl (%rdi,%rdx,1),%ecx
lea    0x1(%rdx),%r8
cmp    (%rsi,%rdx,1),%cl
mov    %r8,%rdx
je     1110 <keyeq+0x10>
ret
mov    $0x1,%eax
ret

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

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