xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t strlen(char *);
char *strscpy(char *, char const *, size_t);
__attribute__((always_)) char *strscat(char *dest, const char *src,
                                       size_t size) {
  register size_t l = strlen(dest);
  return strscpy(dest + l, src, size > l ? size - l : 0);
}


x86 assembly (clang, -O0):
<strscat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jbe    1174 <strscat+0x54>
mov    -0x18(%rbp),%rax
sub    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    117f <strscat+0x5f>
xor    %eax,%eax
mov    %rax,-0x38(%rbp)
jmp    117f <strscat+0x5f>
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rdx
call   1040 <strscpy@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strscat>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
add    %rax,%rbx
xor    %edx,%edx
sub    %rax,%r15
cmovae %r15,%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <strscpy@plt>

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

LLVM IR (-O2):
define i8* @strscat(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i64 @llvm.usub.sat.i64(i64 %2, i64 %4)
%7 = tail call i8* @strscpy(i8* %5, i8* %1, i64 %6)
ret i8* %7
}
void assert(int cond) {
  if (cond)
    return;
ERROR:
  goto ERROR;
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1113 <assert+0x13>
pop    %rbp
ret
jmp    1118 <assert+0x18>
jmp    1118 <assert+0x18>

x86 assembly (clang, -O2):
<assert>:
test   %edi,%edi
je     1110 <assert+0x10>
ret
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1110 <assert+0x10>

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

LLVM IR (-O2):
define void @assert(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %1
ret void
4: ; preds = %1, %4
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int strnlen(char *, int);
void strnlen_constant4() { clang_analyzer_eval(strnlen("123456", 3) == 3); }


x86 assembly (clang, -O0):
<strnlen_constant4>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x3,%esi
call   1030 <strnlen@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen_constant4>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x3,%esi
call   1030 <strnlen@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"123456\00"
define void @strnlen_constant4() {
%1 = call i32 @strnlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = icmp eq i32 %1, 3
%3 = zext i1 %2 to i32
%4 = call i32 @clang_analyzer_eval(i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"123456\00"
define void @strnlen_constant4() {
%1 = tail call i32 @strnlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = icmp eq i32 %1, 3
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
/* Variables and functions */
char *malloc(int);
char *strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ umount(char *);
int bind_umount(char *path, char *dir) {
  char *tmp_path;
  tmp_path = malloc(512 * sizeof(char));
  strcpy(tmp_path, path);
  strcpy(tmp_path, strcat(tmp_path, dir));
  if (umount(tmp_path) != 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<bind_umount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    $0x200,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x28(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
call   1040 <umount@plt>
cmp    $0x0,%rax
je     11ab <bind_umount+0x6b>
movl   $0x1,-0x4(%rbp)
jmp    11b2 <bind_umount+0x72>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bind_umount>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x200,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <umount@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @bind_umount(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = call i8* @malloc(i32 512)
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = load i8*, i8** %4
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %6
%12 = load i8*, i8** %6
%13 = load i8*, i8** %5
%14 = call i8* @strcat(i8* %12, i8* %13)
%15 = call i32 @strcpy(i8* %11, i8* %14)
%16 = load i8*, i8** %6
%17 = call i64 @umount(i8* %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %2
store i32 1, i32* %3
br label %21
20: ; preds = %2
store i32 0, i32* %3
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @bind_umount(i8* %0, i8* nocapture %1) {
%3 = tail call dereferenceable_or_null(512) i8* @malloc(i32 512)
%4 = tail call i32 @strcpy(i8* %3, i8* %0)
%5 = tail call i8* @strcat(i8* dereferenceable(1) %3, i8* dereferenceable(1) %1)
%6 = tail call i32 @strcpy(i8* %3, i8* %3)
%7 = tail call i64 @umount(i8* %3)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
int f(unsigned int b, unsigned int c) {
  unsigned int a = (unsigned short)b * (c >> 16);
  if (!a)
    return 10;
  return a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
movzwl %ax,%eax
mov    -0xc(%rbp),%ecx
shr    $0x10,%ecx
imul   %ecx,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1132 <f+0x32>
movl   $0xa,-0x4(%rbp)
jmp    1138 <f+0x38>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movzwl %di,%ecx
shr    $0x10,%esi
imul   %esi,%ecx
test   %ecx,%ecx
mov    $0xa,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = trunc i32 %7 to i16
%9 = zext i16 %8 to i32
%10 = load i32, i32* %5
%11 = lshr i32 %10, 16
%12 = mul i32 %9, %11
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %2
store i32 10, i32* %3
br label %18
16: ; preds = %2
%17 = load i32, i32* %6
store i32 %17, i32* %3
br label %18
18: ; preds = %16, %15
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = and i32 %0, 65535
%4 = lshr i32 %1, 16
%5 = mul nuw i32 %4, %3
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 10, i32 %5
ret i32 %7
}
double fmax(double a, double b) {
  if (a > b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<fmax>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    112d <fmax+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <fmax+0x37>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmax>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fmax(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp ogt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @fmax(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
void rop3_126_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk1 = S ^ T;
  stk2 = *D ^ S;
  stk1 = stk1 | stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_126_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_126_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = load i8, i8* %6
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %7
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %5
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %8
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %8
%25 = zext i8 %24 to i32
%26 = or i32 %23, %25
%27 = trunc i32 %26 to i8
store i8 %27, i8* %7
%28 = load i8, i8* %7
%29 = zext i8 %28 to i32
%30 = load i8, i8* %5
%31 = zext i8 %30 to i32
%32 = xor i32 %31, -1
%33 = and i32 %29, %32
%34 = load i8, i8* %6
%35 = zext i8 %34 to i32
%36 = xor i32 %35, -1
%37 = and i32 %33, %36
%38 = load i8*, i8** %4
%39 = load i8, i8* %38
%40 = zext i8 %39 to i32
%41 = load i8, i8* %5
%42 = zext i8 %41 to i32
%43 = and i32 %40, %42
%44 = or i32 %37, %43
%45 = load i8*, i8** %4
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = load i8, i8* %6
%49 = zext i8 %48 to i32
%50 = and i32 %47, %49
%51 = or i32 %44, %50
%52 = trunc i32 %51 to i8
%53 = load i8*, i8** %4
store i8 %52, i8* %53
ret void
}

LLVM IR (-O2):
define void @rop3_126_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hoc_pushx(int);
int /*<<< orphan*/ hoc_ret();
axis() {
  hoc_ret();
  hoc_pushx(0.);
}


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

x86 assembly (clang, -O2):
<axis>:
push   %rax
xor    %eax,%eax
call   1030 <hoc_ret@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <hoc_pushx@plt>

LLVM IR (-O0):
define i32 @axis() {
%1 = alloca i32
%2 = call i32 (...) @hoc_ret()
%3 = call i32 @hoc_pushx(i32 0)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @axis() {
%1 = tail call i32 (...) @hoc_ret()
%2 = tail call i32 @hoc_pushx(i32 0)
ret i32 undef
}
_Complex float foo_float(_Complex float x) { return x; }


x86 assembly (clang, -O0):
<foo_float>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define <2 x float> @foo_float(<2 x float> %0) {
%2 = alloca { float, float }
%3 = alloca { float, float }
%4 = bitcast { float, float }* %3 to <2 x float>*
store <2 x float> %0, <2 x float>* %4
%5 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%6 = load float, float* %5
%7 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
%8 = load float, float* %7
%9 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%10 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
store float %6, float* %9
store float %8, float* %10
%11 = bitcast { float, float }* %2 to <2 x float>*
%12 = load <2 x float>, <2 x float>* %11
ret <2 x float> %12
}

LLVM IR (-O2):
define <2 x float> @foo_float(<2 x float> returned %0) {
ret <2 x float> %0
}
/* Variables and functions */
int PMPI_Dims_create(int, int, int *);
int MPI_Dims_create(int nnodes, int ndims, int *dims) {
  ;
  return PMPI_Dims_create(nnodes, ndims, dims);
}


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

x86 assembly (clang, -O2):
<MPI_Dims_create>:
jmp    1030 <PMPI_Dims_create@plt>

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

LLVM IR (-O2):
define i32 @MPI_Dims_create(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32 @PMPI_Dims_create(i32 %0, i32 %1, i32* %2)
ret i32 %4
}
void RTEnvGet(void) {}


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

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

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

LLVM IR (-O2):
define void @RTEnvGet() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
void print_version(const char *progname) {
  (void)fprintf(stderr, "%s %s\n", progname, "version 0.05");
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
lea    0xed0(%rip),%rcx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
lea    0xedd(%rip),%rcx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [13 x i8] c"version 0.05\00"
define void @print_version(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [13 x i8] c"version 0.05\00"
define void @print_version(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int islower(int);
void test_islower(int x) {
  clang_analyzer_eval(islower('x'));
  clang_analyzer_eval(islower('X'));
  if (islower(x))
    clang_analyzer_eval(x < 'a');
}


x86 assembly (clang, -O0):
<test_islower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x78,%edi
call   1030 <islower@plt>
mov    %eax,%edi
call   1040 <clang_analyzer_eval@plt>
mov    $0x58,%edi
call   1030 <islower@plt>
mov    %eax,%edi
call   1040 <clang_analyzer_eval@plt>
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%eax
je     116f <test_islower+0x4f>
cmpl   $0x61,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_islower>:
push   %rbx
mov    %edi,%ebx
mov    $0x78,%edi
call   1030 <islower@plt>
mov    %eax,%edi
call   1040 <clang_analyzer_eval@plt>
mov    $0x58,%edi
call   1030 <islower@plt>
mov    %eax,%edi
call   1040 <clang_analyzer_eval@plt>
mov    %ebx,%edi
call   1030 <islower@plt>
test   %eax,%eax
je     115f <test_islower+0x3f>
xor    %edi,%edi
cmp    $0x61,%ebx
setl   %dil
pop    %rbx
jmp    1040 <clang_analyzer_eval@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @test_islower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @islower(i32 120)
%4 = call i32 @clang_analyzer_eval(i32 %3)
%5 = call i32 @islower(i32 88)
%6 = call i32 @clang_analyzer_eval(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @islower(i32 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 97
%13 = zext i1 %12 to i32
%14 = call i32 @clang_analyzer_eval(i32 %13)
br label %15
15: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
define void @test_islower(i32 %0) {
%2 = tail call i32 @islower(i32 120)
%3 = tail call i32 @clang_analyzer_eval(i32 %2)
%4 = tail call i32 @islower(i32 88)
%5 = tail call i32 @clang_analyzer_eval(i32 %4)
%6 = tail call i32 @islower(i32 %0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = icmp slt i32 %0, 97
%10 = zext i1 %9 to i32
%11 = tail call i32 @clang_analyzer_eval(i32 %10)
br label %12
12: ; preds = %8, %1
ret void
}
void genbltzal_out() {}


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

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

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

LLVM IR (-O2):
define void @genbltzal_out() {
ret void
}
void *thread_fun(void *arg) {
  (void)arg;
  return (void *)0;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @thread_fun(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void assert(_Bool cond) {
  if (!cond)
    abort();
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x1(%rbp)
testb  $0x1,-0x1(%rbp)
jne    1131 <assert+0x21>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert>:
test   %edi,%edi
je     1115 <assert+0x5>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @assert(i1 zeroext %0) {
%2 = alloca i8
%3 = zext i1 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = trunc i8 %4 to i1
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @assert(i1 zeroext %0) {
br i1 %0, label %4, label %2
2: ; preds = %1
%3 = tail call i32 (...) @abort()
unreachable
4: ; preds = %1
ret void
}
/* Variables and functions */
char *flu_n_unescape(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *flu_unescape(const char *s) { return flu_n_unescape(s, strlen(s)); }


x86 assembly (clang, -O0):
<flu_unescape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <flu_n_unescape@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flu_unescape>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <flu_n_unescape@plt>

LLVM IR (-O0):
define i8* @flu_unescape(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i8* @flu_n_unescape(i8* %3, i32 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @flu_unescape(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @flu_n_unescape(i8* %0, i32 %2)
ret i8* %3
}
int f(int a, int b) { return (a + b); }


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

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

LLVM IR (-O0):
define i32 @f(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
do_tau_fill(argc, argv) int argc;
char **argv;
{}


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

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

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

LLVM IR (-O2):
define i32 @do_tau_fill(i32 %0, i8** nocapture readnone %1) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
void print_msg(FILE *fp, char *msg, va_list args) {
  fprintf(fp, "[test-driver] ");
  vfprintf(fp, msg, args);
  fprintf(fp, "\n");
}


x86 assembly (clang, -O0):
<print_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <vfprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_msg>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0xebc(%rip),%rdi
mov    $0xe,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   1050 <fwrite@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <vfprintf@plt>
mov    $0xa,%edi
mov    %rbp,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"[test-driver] \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_msg(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 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = load i32*, i32** %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @vfprintf(i32* %9, i8* %10, i32 %11)
%13 = load i32*, i32** %4
%14 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"[test-driver] \00"
define void @print_msg(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 14, i64 1, i32* %0)
%5 = tail call i32 @vfprintf(i32* %0, i8* %1, i32 %2)
%6 = tail call i32 @fputc(i32 10, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_spi_register(int, int);
void spi_reset() { write_spi_register(0x40, 0x0000000a); }


x86 assembly (clang, -O0):
<spi_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40,%edi
mov    $0xa,%esi
call   1030 <write_spi_register@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_reset>:
mov    $0x40,%edi
mov    $0xa,%esi
jmp    1030 <write_spi_register@plt>

LLVM IR (-O0):
define void @spi_reset() {
%1 = call i32 @write_spi_register(i32 64, i32 10)
ret void
}

LLVM IR (-O2):
define void @spi_reset() {
%1 = tail call i32 @write_spi_register(i32 64, i32 10)
ret void
}
float sgnf(float val) { return (0. < val) - (val < 0.); }


x86 assembly (clang, -O0):
<sgnf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgnf>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
ret

LLVM IR (-O0):
define float @sgnf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fcmp olt double 0.000000e+00, %4
%6 = zext i1 %5 to i32
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fcmp olt double %8, 0.000000e+00
%10 = zext i1 %9 to i32
%11 = sub nsw i32 %6, %10
%12 = sitofp i32 %11 to float
ret float %12
}

LLVM IR (-O2):
define float @sgnf(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = zext i1 %2 to i32
%4 = fcmp olt float %0, 0.000000e+00
%5 = sext i1 %4 to i32
%6 = add nsw i32 %5, %3
%7 = sitofp i32 %6 to float
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ write(int, char *, int);
void sighandler(int sig) {
  write(1, "timeout\n", 8);
  _exit(1);
}


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
lea    0xec9(%rip),%rsi
mov    $0x8,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<sighandler>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
mov    $0x8,%edx
call   1040 <write@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"timeout\0A\00"
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
%4 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [9 x i8] c"timeout\0A\00"
define void @sighandler(i32 %0) {
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
%3 = tail call i32 @_exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ cramtest();
int /*<<< orphan*/ ramfill();
int /*<<< orphan*/ report_end();
int /*<<< orphan*/ report_start();
int main() {
  report_start();
  ramfill();
  cramtest();
  report_end();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <report_start@plt>
xor    %eax,%eax
call   1050 <ramfill@plt>
xor    %eax,%eax
call   1040 <cramtest@plt>
xor    %eax,%eax
call   1030 <report_end@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @report_start()
%3 = call i32 (...) @ramfill()
%4 = call i32 (...) @cramtest()
%5 = call i32 (...) @report_end()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @report_start()
%2 = tail call i32 (...) @ramfill()
%3 = tail call i32 (...) @cramtest()
%4 = tail call i32 (...) @report_end()
ret i32 0
}
unsigned int bit_reverse_32(unsigned int val) {
  val = ((val >> 1) & 0x55555555) | ((val << 1) & 0xAAAAAAAA);
  val = ((val >> 2) & 0x33333333) | ((val << 2) & 0xCCCCCCCC);
  val = ((val >> 4) & 0x0F0F0F0F) | ((val << 4) & 0xF0F0F0F0);
  val = ((val >> 8) & 0x00FF00FF) | ((val << 8) & 0xFF00FF00);
  val = ((val >> 16) & 0x0000FFFF) | ((val << 16) & 0xFFFF0000);
  return val;
}


x86 assembly (clang, -O0):
<bit_reverse_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
and    $0x55555555,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
and    $0xaaaaaaaa,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
shl    $0x2,%ecx
and    $0xcccccccc,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
and    $0xf0f0f0f,%eax
mov    -0x4(%rbp),%ecx
shl    $0x4,%ecx
and    $0xf0f0f0f0,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xff00ff,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff00ff00,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0xffff,%eax
mov    -0x4(%rbp),%ecx
shl    $0x10,%ecx
and    $0xffff0000,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_reverse_32>:
bswap  %edi
mov    %edi,%eax
and    $0xf0f0f0f,%eax
shl    $0x4,%eax
shr    $0x4,%edi
and    $0xf0f0f0f,%edi
or     %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
lea    (%rdi,%rax,4),%eax
mov    %eax,%ecx
and    $0x55555555,%ecx
shr    %eax
and    $0x55555555,%eax
lea    (%rax,%rcx,2),%eax
ret

LLVM IR (-O0):
define i32 @bit_reverse_32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 1
%5 = and i32 %4, 1431655765
%6 = load i32, i32* %2
%7 = shl i32 %6, 1
%8 = and i32 %7, -1431655766
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = lshr i32 %10, 2
%12 = and i32 %11, 858993459
%13 = load i32, i32* %2
%14 = shl i32 %13, 2
%15 = and i32 %14, -858993460
%16 = or i32 %12, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = lshr i32 %17, 4
%19 = and i32 %18, 252645135
%20 = load i32, i32* %2
%21 = shl i32 %20, 4
%22 = and i32 %21, -252645136
%23 = or i32 %19, %22
store i32 %23, i32* %2
%24 = load i32, i32* %2
%25 = lshr i32 %24, 8
%26 = and i32 %25, 16711935
%27 = load i32, i32* %2
%28 = shl i32 %27, 8
%29 = and i32 %28, -16711936
%30 = or i32 %26, %29
store i32 %30, i32* %2
%31 = load i32, i32* %2
%32 = lshr i32 %31, 16
%33 = and i32 %32, 65535
%34 = load i32, i32* %2
%35 = shl i32 %34, 16
%36 = and i32 %35, -65536
%37 = or i32 %33, %36
store i32 %37, i32* %2
%38 = load i32, i32* %2
ret i32 %38
}

LLVM IR (-O2):
define i32 @bit_reverse_32(i32 %0) {
%2 = tail call i32 @llvm.bitreverse.i32(i32 %0)
ret i32 %2
}
/* Type definitions */
struct StrBuffer {
  int dummy;
};

/* Variables and functions */
struct StrBuffer *newBuffer();
extern struct StrBuffer *new_string(char *text) {
  struct StrBuffer *result = newBuffer();
  return result;
}


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

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

LLVM IR (-O0):
%struct.StrBuffer = type { i32 }
define %struct.StrBuffer* @new_string(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.StrBuffer*
store i8* %0, i8** %2
%4 = call %struct.StrBuffer* (...) @newBuffer()
store %struct.StrBuffer* %4, %struct.StrBuffer** %3
%5 = load %struct.StrBuffer*, %struct.StrBuffer** %3
ret %struct.StrBuffer* %5
}

LLVM IR (-O2):
%struct.StrBuffer = type { i32 }
define %struct.StrBuffer* @new_string(i8* nocapture readnone %0) {
%2 = tail call %struct.StrBuffer* (...) @newBuffer()
ret %struct.StrBuffer* %2
}
/* Type definitions */
struct group {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct group *);
void free_g(struct group *g) { free(g); }


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

x86 assembly (clang, -O2):
<free_g>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.group = type { i32 }
define void @free_g(%struct.group* nocapture %0) {
%2 = tail call i32 @free(%struct.group* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
uint16_t minu16(uint16_t a, uint16_t b) { return ((a) < (b) ? (a) : (b)); }


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

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

LLVM IR (-O0):
define i64 @minu16(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* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @minu16(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fred(void) { printf("yo\n"); }


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"yo\00"
define void @fred() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isSorted(int *, int);
int /*<<< orphan*/ shuffle(int *, int);
void bogoSort(int a[], int size) {
  while (!isSorted(a, size)) {
    shuffle(a, size);
  }
}


x86 assembly (clang, -O0):
<bogoSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <isSorted@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1150 <bogoSort+0x30>
jmp    1161 <bogoSort+0x41>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <shuffle@plt>
jmp    112f <bogoSort+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bogoSort>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
call   1040 <isSorted@plt>
test   %eax,%eax
jne    114a <bogoSort+0x2a>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <shuffle@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
jmp    1130 <bogoSort+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @bogoSort(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 = %11, %2
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = call i32 @isSorted(i32* %6, i32 %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br i1 %10, label %11, label %15
11: ; preds = %5
%12 = load i32*, i32** %3
%13 = load i32, i32* %4
%14 = call i32 @shuffle(i32* %12, i32 %13)
br label %5
15: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @bogoSort(i32* %0, i32 %1) {
%3 = tail call i32 @isSorted(i32* %0, i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2, %5
%6 = tail call i32 @shuffle(i32* %0, i32 %1)
%7 = tail call i32 @isSorted(i32* %0, i32 %1)
%8 = icmp eq i32 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5, %2
ret void
}
const char *trim(const char *string) {
  while (((*string == 0x20) || (*string == 0x9) || (*string == 0xD) ||
          (*string == 0xA)))
    string++;
  return string;
}


x86 assembly (clang, -O0):
<trim>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     1157 <trim+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x9(%rbp)
je     1157 <trim+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x9(%rbp)
je     1157 <trim+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1167 <trim+0x67>
jmp    1178 <trim+0x78>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <trim+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim>:
mov    %rdi,%rax
movabs $0x100002600,%rcx
nopl   (%rax)
movzbl (%rax),%edx
cmp    $0x20,%rdx
ja     1125 <trim+0x25>
bt     %rdx,%rcx
jae    1125 <trim+0x25>
add    $0x1,%rax
jmp    1110 <trim+0x10>
ret

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

LLVM IR (-O2):
define i8* @trim(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
i8 13, label %5
i8 10, label %5
]
5: ; preds = %2, %2, %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ myFunc();
int main() {
  myFunc();
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @myFunc()
ret i32 0
}
void debugme(void) {}


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

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

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

LLVM IR (-O2):
define void @debugme() {
ret void
}
int gca_search_float(const void *aa, void *bb) {
  const float a = *(const float *)aa;
  const float b = *(float *)bb;
  return (((a) > (b)) - ((b) > (a)));
}


x86 assembly (clang, -O0):
<gca_search_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
ucomiss -0x18(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
movss  -0x18(%rbp),%xmm0
ucomiss -0x14(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gca_search_float>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gca_search_float(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca float
%6 = alloca float
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to float*
%9 = load float, float* %8
store float %9, float* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to float*
%12 = load float, float* %11
store float %12, float* %6
%13 = load float, float* %5
%14 = load float, float* %6
%15 = fcmp ogt float %13, %14
%16 = zext i1 %15 to i32
%17 = load float, float* %6
%18 = load float, float* %5
%19 = fcmp ogt float %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @gca_search_float(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp ogt float %4, %6
%8 = zext i1 %7 to i32
%9 = fcmp ogt float %6, %4
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
int create_flat_sort_predicate(const void *_1, const void *_2) {
  if (*(int *)(_1) > *(int *)(_2)) {
    return 1;
  } else if (*(int *)(_1) < *(int *)(_2)) {
    return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<create_flat_sort_predicate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    112a <create_flat_sort_predicate+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    114f <create_flat_sort_predicate+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    1148 <create_flat_sort_predicate+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <create_flat_sort_predicate+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_flat_sort_predicate>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @create_flat_sort_predicate(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ terminal_get_line_from_history(int);
void terminal_action_history_begin(int c, void (*process_line)(char *line)) {
  terminal_get_line_from_history(-1);
}


x86 assembly (clang, -O0):
<terminal_action_history_begin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%edi
call   1030 <terminal_get_line_from_history@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminal_action_history_begin>:
mov    $0xffffffff,%edi
jmp    1030 <terminal_get_line_from_history@plt>

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

LLVM IR (-O2):
define void @terminal_action_history_begin(i32 %0, void (i8*)* nocapture readnone %1) {
%3 = tail call i32 @terminal_get_line_from_history(i32 -1)
ret void
}
/* Variables and functions */
int do_send(int, char *);
int irc_list(int fd) { return do_send(fd, "LIST"); }


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

x86 assembly (clang, -O2):
<irc_list>:
lea    0xee9(%rip),%rsi
jmp    1030 <do_send@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"LIST\00"
define i32 @irc_list(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @do_send(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [5 x i8] c"LIST\00"
define i32 @irc_list(i32 %0) {
%2 = tail call i32 @do_send(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}