xunge/DecIR huggingface dataset:
/* Variables and functions */
int getc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
bool check_crc(void) {
  int c;
  printf("Does this frame contain a final CRC ? [y/N] ");
  c = getc(stdin);
  if (c == 'y')
    return true;
  return false;
}


x86 assembly (clang, -O0):
<check_crc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1040 <getc@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x79,-0x8(%rbp)
jne    115b <check_crc+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1162 <check_crc+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_crc>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
call   1040 <getc@plt>
xor    %ecx,%ecx
cmp    $0x79,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"Does this frame contain a final CRC ? [y/N] \00"
@stdin = global i32 0
define i32 @check_crc() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @getc(i32 %4)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 121
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 1, i32* %1
br label %10
9: ; preds = %0
store i32 0, i32* %1
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [45 x i8] c"Does this frame contain a final CRC ? [y/N] \00"
@stdin = global i32 0
define i32 @check_crc() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdin
%3 = tail call i32 @getc(i32 %2)
%4 = icmp eq i32 %3, 121
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
char *jsonZcb(char *, int);
char *jsonZcbStatus(int status) { return (jsonZcb("status", status)); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"status\00"
define i8* @jsonZcbStatus(i32 %0) {
%2 = tail call i8* @jsonZcb(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %2
}
/* Variables and functions */
char *get_section_item(char *, char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int _main(int argc, char **argv) {
  printf("%s\n", get_section_item("test.conf", "x509", "country"));
  return 0;
}


x86 assembly (clang, -O0):
<_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xece(%rip),%rdi
lea    0xed1(%rip),%rsi
lea    0xecf(%rip),%rdx
call   1040 <get_section_item@plt>
mov    %rax,%rsi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_main>:
push   %rax
lea    0xedc(%rip),%rdi
lea    0xedf(%rip),%rsi
lea    0xedd(%rip),%rdx
call   1040 <get_section_item@plt>
lea    0xebe(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [10 x i8] c"test.conf\00"
@.str.2 = [5 x i8] c"x509\00"
@.str.3 = [8 x i8] c"country\00"
define i32 @_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i8* @get_section_item(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [10 x i8] c"test.conf\00"
@.str.2 = [5 x i8] c"x509\00"
@.str.3 = [8 x i8] c"country\00"
define i32 @_main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @get_section_item(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
int isUpperAlpha(char *c) {
  if ((*c >= 'A') && (*c <= 'Z'))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isUpperAlpha>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     1134 <isUpperAlpha+0x34>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     1134 <isUpperAlpha+0x34>
movl   $0x1,-0x4(%rbp)
jmp    113b <isUpperAlpha+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isUpperAlpha>:
mov    (%rdi),%cl
add    $0xbf,%cl
xor    %eax,%eax
cmp    $0x1a,%cl
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isUpperAlpha(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Login();
int main() {
  Login();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Login()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mall();
int main() {
  mall();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @mall()
ret i32 0
}
double sin_taylor3(const double x) {
  const double x2 = x * x;
  const double x3 = x * x2;
  const double x5 = x3 * x2;
  return x - x3 * (1.0 / 6) + x5 * (1.0 / 120);
}


x86 assembly (clang, -O0):
<sin_taylor3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xea9(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  0xe8c(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sin_taylor3>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm1
mulsd  0xee4(%rip),%xmm2
addsd  %xmm2,%xmm0
mulsd  0xee0(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sin_taylor3(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
%6 = load double, double* %2
%7 = load double, double* %2
%8 = fmul double %6, %7
store double %8, double* %3
%9 = load double, double* %2
%10 = load double, double* %3
%11 = fmul double %9, %10
store double %11, double* %4
%12 = load double, double* %4
%13 = load double, double* %3
%14 = fmul double %12, %13
store double %14, double* %5
%15 = load double, double* %2
%16 = load double, double* %4
%17 = fneg double %16
%18 = call double @llvm.fmuladd.f64(double %17, double 0x3FC5555555555555, double %15)
%19 = load double, double* %5
%20 = call double @llvm.fmuladd.f64(double %19, double 0x3F81111111111111, double %18)
ret double %20
}

LLVM IR (-O2):
define double @sin_taylor3(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
%4 = fmul double %2, %3
%5 = fneg double %3
%6 = tail call double @llvm.fmuladd.f64(double %5, double 0x3FC5555555555555, double %0)
%7 = tail call double @llvm.fmuladd.f64(double %4, double 0x3F81111111111111, double %6)
ret double %7
}
void NormalHandler(int sig) {}


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

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

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

LLVM IR (-O2):
define void @NormalHandler(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void os_closetypedfile(FILE *outfile) { fclose(outfile); }


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

x86 assembly (clang, -O2):
<os_closetypedfile>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @os_closetypedfile(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret void
}
__typeof__(strcat(1, 1)) test_strcat_145(void) { return strcat(1, 1); }


x86 assembly (clang, -O0):
<test_strcat_145>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
mov    %rsi,%rdi
call   1030 <strcat@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strcat_145>:
mov    $0x1,%edi
mov    $0x1,%esi
jmp    1030 <strcat@plt>

LLVM IR (-O0):
define i8* @test_strcat_145() {
%1 = call i8* @strcat(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*))
ret i8* %1
}

LLVM IR (-O2):
define i8* @test_strcat_145() {
%1 = tail call i8* @strcat(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*))
ret i8* inttoptr (i64 1 to i8*)
}
int getRegHi(int *context) { return *(context + 5); }


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

x86 assembly (clang, -O2):
<getRegHi>:
mov    0x14(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @getRegHi(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 5
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @getRegHi(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t clampY(uint32_t y) { return y >= 480 ? 480 - 1 : y; }


x86 assembly (clang, -O0):
<clampY>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1e0,-0x4(%rbp)
jl     1121 <clampY+0x21>
mov    $0x1df,%eax
mov    %eax,-0x8(%rbp)
jmp    1127 <clampY+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clampY>:
cmp    $0x1df,%edi
mov    $0x1df,%eax
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @clampY(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 480
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = load i32, i32* %2
br label %8
8: ; preds = %6, %5
%9 = phi i32 [ 479, %5 ], [ %7, %6 ]
ret i32 %9
}

LLVM IR (-O2):
define i32 @clampY(i32 %0) {
%2 = icmp slt i32 %0, 479
%3 = select i1 %2, i32 %0, i32 479
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
float max(float x, float y) {
  assert(x == x);
  assert(y == y);
  return (x >= y) ? x : y;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x4(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movss  -0x8(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1176 <max+0x66>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1180 <max+0x70>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
sub    $0x28,%rsp
movaps %xmm1,(%rsp)
movaps %xmm0,0x10(%rsp)
xor    %edi,%edi
ucomiss %xmm0,%xmm0
setnp  %dil
call   1030 <assert@plt>
xor    %edi,%edi
movaps (%rsp),%xmm0
ucomiss %xmm0,%xmm0
setnp  %dil
call   1030 <assert@plt>
movaps (%rsp),%xmm2
movaps %xmm2,%xmm0
movaps 0x10(%rsp),%xmm1
cmpless %xmm1,%xmm0
andps  %xmm0,%xmm1
andnps %xmm2,%xmm0
orps   %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define float @max(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %3
%7 = fcmp oeq float %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load float, float* %4
%11 = load float, float* %4
%12 = fcmp oeq float %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load float, float* %3
%16 = load float, float* %4
%17 = fcmp oge float %15, %16
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = load float, float* %3
br label %22
20: ; preds = %2
%21 = load float, float* %4
br label %22
22: ; preds = %20, %18
%23 = phi float [ %19, %18 ], [ %21, %20 ]
ret float %23
}

LLVM IR (-O2):
define float @max(float %0, float %1) {
%3 = fcmp ord float %0, 0.000000e+00
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = fcmp ord float %1, 0.000000e+00
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = fcmp oge float %0, %1
%10 = select i1 %9, float %0, float %1
ret float %10
}
short swaps16(short x) { return __builtin_bswap16(x); }


x86 assembly (clang, -O0):
<swaps16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
rol    $0x8,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<swaps16>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define signext i16 @swaps16(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i16 @llvm.bswap.i16(i16 %3)
ret i16 %4
}

LLVM IR (-O2):
define signext i16 @swaps16(i16 signext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Variables and functions */
double calcSine(double);
double sineCoefficient(int, int);
double getSine(int frequency, int sampleRate) {
  double coef = sineCoefficient(frequency, sampleRate);
  return calcSine(coef);
}


x86 assembly (clang, -O0):
<getSine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <sineCoefficient@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <calcSine@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSine>:
push   %rax
call   1040 <sineCoefficient@plt>
pop    %rax
jmp    1030 <calcSine@plt>

LLVM IR (-O0):
define double @getSine(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call double @sineCoefficient(i32 %6, i32 %7)
store double %8, double* %5
%9 = load double, double* %5
%10 = call double @calcSine(double %9)
ret double %10
}

LLVM IR (-O2):
define double @getSine(i32 %0, i32 %1) {
%3 = tail call double @sineCoefficient(i32 %0, i32 %1)
%4 = tail call double @calcSine(double %3)
ret double %4
}
void av_fifo_reset() {}


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

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

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

LLVM IR (-O2):
define void @av_fifo_reset() {
ret void
}
int process(int a, int b, int (*fun)(int a, int b)) {
  int result;
  result = (*fun)(a, b);
  return result;
}


x86 assembly (clang, -O0):
<process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   *%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process>:
jmp    *%rdx

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

LLVM IR (-O2):
define i32 @process(i32 %0, i32 %1, i32 (i32, i32)* nocapture %2) {
%4 = tail call i32 %2(i32 %0, i32 %1)
ret i32 %4
}
int dbl_cmp(x, y)
double *x, *y;
{
  double tmp;
  tmp = *x - *y;
  return (tmp > 0 ? 1 : tmp < 0 ? -1 : 0);
}


x86 assembly (clang, -O0):
<dbl_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1140 <dbl_cmp+0x40>
mov    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1159 <dbl_cmp+0x59>
movsd  -0x18(%rbp),%xmm1
xorps  %xmm0,%xmm0
xor    %eax,%eax
mov    $0xffffffff,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbl_cmp>:
movsd  (%rdi),%xmm0
subsd  (%rsi),%xmm0
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomisd %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @dbl_cmp(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = load double, double* %8
%10 = fsub double %7, %9
store double %10, double* %5
%11 = load double, double* %5
%12 = fcmp ogt double %11, 0.000000e+00
br i1 %12, label %13, label %14
13: ; preds = %2
br label %19
14: ; preds = %2
%15 = load double, double* %5
%16 = fcmp olt double %15, 0.000000e+00
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 -1, i32 0
br label %19
19: ; preds = %14, %13
%20 = phi i32 [ 1, %13 ], [ %18, %14 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @dbl_cmp(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fsub double %3, %4
%6 = fcmp ogt double %5, 0.000000e+00
%7 = fcmp olt double %5, 0.000000e+00
%8 = sext i1 %7 to i32
%9 = select i1 %6, i32 1, i32 %8
ret i32 %9
}
/* Variables and functions */
scalar_t__ is_lowercase(char);
scalar_t__ is_uppercase(char);
int is_alphabet(char c) { return is_uppercase(c) || is_lowercase(c); }


x86 assembly (clang, -O0):
<is_alphabet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <is_uppercase@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <is_alphabet+0x3c>
movsbl -0x1(%rbp),%edi
call   1040 <is_lowercase@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alphabet>:
push   %rbx
mov    %edi,%ebx
call   1030 <is_uppercase@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <is_alphabet+0x17>
pop    %rbx
ret
movsbl %bl,%edi
call   1040 <is_lowercase@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_alphabet(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @is_uppercase(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @is_lowercase(i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_alphabet(i8 signext %0) {
%2 = tail call i64 @is_uppercase(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @is_lowercase(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int close(int);
int readstat_close(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<readstat_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @readstat_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
char *util_nextword(char *str, unsigned int index, unsigned int total) {
  if (!index)
    return str;
  if (index >= total)
    return NULL;
  while (*str)
    str++;
  return str + 1;
}


x86 assembly (clang, -O0):
<util_nextword>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1125 <util_nextword+0x25>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116d <util_nextword+0x6d>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jb     113e <util_nextword+0x3e>
movq   $0x0,-0x8(%rbp)
jmp    116d <util_nextword+0x6d>
jmp    1143 <util_nextword+0x43>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1161 <util_nextword+0x61>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1143 <util_nextword+0x43>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_nextword>:
test   %esi,%esi
je     111d <util_nextword+0x1d>
cmp    %edx,%esi
jae    1121 <util_nextword+0x21>
nopl   0x0(%rax,%rax,1)
lea    0x1(%rdi),%rax
cmpb   $0x0,(%rdi)
mov    %rax,%rdi
jne    1110 <util_nextword+0x10>
ret
mov    %rdi,%rax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @util_nextword(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = icmp ult i32 %1, %2
br i1 %6, label %7, label %12
7: ; preds = %5, %7
%8 = phi i8* [ %11, %7 ], [ %0, %5 ]
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
%11 = getelementptr inbounds i8, i8* %8, i64 1
br i1 %10, label %12, label %7
12: ; preds = %7, %5, %3
%13 = phi i8* [ %0, %3 ], [ null, %5 ], [ %11, %7 ]
ret i8* %13
}
/* Type definitions */
struct v7 {
  int dummy;
};
struct bcode {
  int dummy;
};

/* Variables and functions */
char *bcode_deserialize_func(struct v7 *, struct bcode *, char const *);
void bcode_deserialize(struct v7 *v7, struct bcode *bcode, const char *data) {
  data = bcode_deserialize_func(v7, bcode, data);
}


x86 assembly (clang, -O0):
<bcode_deserialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <bcode_deserialize_func@plt>
mov    %rax,-0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcode_deserialize>:
jmp    1030 <bcode_deserialize_func@plt>

LLVM IR (-O0):
%struct.v7 = type { i32 }
%struct.bcode = type { i32 }
define void @bcode_deserialize(%struct.v7* %0, %struct.bcode* %1, i8* %2) {
%4 = alloca %struct.v7*
%5 = alloca %struct.bcode*
%6 = alloca i8*
store %struct.v7* %0, %struct.v7** %4
store %struct.bcode* %1, %struct.bcode** %5
store i8* %2, i8** %6
%7 = load %struct.v7*, %struct.v7** %4
%8 = load %struct.bcode*, %struct.bcode** %5
%9 = load i8*, i8** %6
%10 = call i8* @bcode_deserialize_func(%struct.v7* %7, %struct.bcode* %8, i8* %9)
store i8* %10, i8** %6
ret void
}

LLVM IR (-O2):
%struct.v7 = type { i32 }
%struct.bcode = type { i32 }
define void @bcode_deserialize(%struct.v7* %0, %struct.bcode* %1, i8* %2) {
%4 = tail call i8* @bcode_deserialize_func(%struct.v7* %0, %struct.bcode* %1, i8* %2)
ret void
}
char READ_CHAR(void) { ; }


x86 assembly (clang, -O0):
<READ_CHAR>:
push   %rbp
mov    %rsp,%rbp
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @READ_CHAR() {
%1 = alloca i8
%2 = load i8, i8* %1
ret i8 %2
}

LLVM IR (-O2):
define signext i8 @READ_CHAR() {
ret i8 undef
}
void window_game_top_toolbar_emptysub() {}


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

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

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

LLVM IR (-O2):
define void @window_game_top_toolbar_emptysub() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  if (a - b > 0) {
    printf("%d\n", a - b);
  } else {
    printf("%d\n", b - a);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
cmp    $0x0,%eax
jle    1169 <main+0x49>
mov    -0x8(%rbp),%esi
sub    -0xc(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    117b <main+0x5b>
mov    -0xc(%rbp),%esi
sub    -0x8(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
sub    (%rsp),%eax
mov    %eax,%esi
neg    %esi
cmovs  %eax,%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %0
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = sub nsw i32 %10, %11
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %19
14: ; preds = %0
%15 = load i32, i32* %3
%16 = load i32, i32* %2
%17 = sub nsw i32 %15, %16
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %14, %9
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %6, %7
%9 = call i32 @llvm.abs.i32(i32 %8, i1 false)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int tolower(unsigned char const);
int mg_lower(const char *s) { return tolower(*(const unsigned char *)s); }


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

x86 assembly (clang, -O2):
<mg_lower>:
movzbl (%rdi),%edi
jmp    1030 <tolower@plt>

LLVM IR (-O0):
define i32 @mg_lower(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = call i32 @tolower(i8 zeroext %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @mg_lower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @tolower(i8 zeroext %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ write_mbus_message(int, int);
int sleep() {
  write_mbus_message(0x1, 0x0);
  return 0;
}


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <write_mbus_message@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <write_mbus_message@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sleep() {
%1 = call i32 @write_mbus_message(i32 1, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @sleep() {
%1 = tail call i32 @write_mbus_message(i32 1, i32 0)
ret i32 0
}
/* Variables and functions */
int f(int, char);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int main() {
  int a = 1;
  char b = 'b';
  fprintf(stderr, "a = %d, b = %c, f() = %d\n", a, b, f(a, b));
  fprintf(stderr, "some output\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movb   $0x62,-0x9(%rbp)
mov    0x2e9f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
movsbl -0x9(%rbp),%esi
call   1030 <f@plt>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    %eax,%r8d
lea    0xe8e(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
lea    0xe91(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2eb5(%rip),%r14
mov    (%r14),%ebx
mov    $0x1,%edi
mov    $0x62,%esi
call   1030 <f@plt>
lea    0xebc(%rip),%rsi
mov    %ebx,%edi
mov    $0x1,%edx
mov    $0x62,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r14),%edi
lea    0xeb6(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"a = %d, b = %c, f() = %d\0A\00"
@.str.1 = [13 x i8] c"some output\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
store i32 1, i32* %2
store i8 98, i8* %3
%4 = load i32, i32* @stderr
%5 = load i32, i32* %2
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = load i32, i32* %2
%9 = load i8, i8* %3
%10 = call i32 @f(i32 %8, i8 signext %9)
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7, i32 %10)
%12 = load i32, i32* @stderr
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"a = %d, b = %c, f() = %d\0A\00"
@.str.1 = [13 x i8] c"some output\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @f(i32 1, i8 signext 98)
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 1, i32 98, i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double log(long double);
long double st_log2lf(long double x) {
  return log(x) * 1.442695040888963407359925;
}


x86 assembly (clang, -O0):
<st_log2lf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <log@plt>
movsd  0xecd(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
fldl   -0x18(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_log2lf>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <log@plt>
mulsd  0xed8(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
fldl   0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @st_log2lf(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call double @log(x86_fp80 %3)
%5 = fmul double %4, 0x3FF71547652B82FE
%6 = fpext double %5 to x86_fp80
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @st_log2lf(x86_fp80 %0) {
%2 = tail call double @log(x86_fp80 %0)
%3 = fmul double %2, 0x3FF71547652B82FE
%4 = fpext double %3 to x86_fp80
ret x86_fp80 %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void do_memcpy(void *s1, void *s2, size_t size) { memcpy(s1, s2, size); }


x86 assembly (clang, -O0):
<do_memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_memcpy>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @do_memcpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int go(char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc != 2) {
    fprintf(stderr, "usage: s390x_features <feature>\n");
    exit(3);
  }
  return go(argv[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     116f <main+0x3f>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xea0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x3,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <go@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1140 <main+0x10>
mov    0x8(%rsi),%rdi
pop    %rax
jmp    1030 <go@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x3,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"usage: s390x_features <feature>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 3)
unreachable
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @go(i8* %15)
ret i32 %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"usage: s390x_features <feature>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 3)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @go(i8* %10)
ret i32 %11
}
int main() {
  int a[5];
  int len = 0;
  _Bool c = nondet_bool();
  int i;
  while (c) {
    if (len == 4)
      len = 0;
    a[len] = 0;
    len++;
  }
  assert(len >= 0 && len < 5);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x24(%rbp)
mov    $0x0,%al
call   1040 <nondet_bool@plt>
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
mov    %al,-0x25(%rbp)
testb  $0x1,-0x25(%rbp)
je     117d <main+0x5d>
cmpl   $0x4,-0x24(%rbp)
jne    1163 <main+0x43>
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
movl   $0x0,-0x20(%rbp,%rax,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1148 <main+0x28>
xor    %eax,%eax
cmpl   $0x0,-0x24(%rbp)
mov    %al,-0x2d(%rbp)
jl     1196 <main+0x76>
cmpl   $0x5,-0x24(%rbp)
setl   %al
mov    %al,-0x2d(%rbp)
mov    -0x2d(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%6 = call i32 (...) @nondet_bool()
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i8
store i8 %8, i8* %4
br label %9
9: ; preds = %16, %0
%10 = load i8, i8* %4
%11 = trunc i8 %10 to i1
br i1 %11, label %12, label %22
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 4
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 0, i32* %3
br label %16
16: ; preds = %15, %12
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %18
store i32 0, i32* %19
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %9
22: ; preds = %9
%23 = load i32, i32* %3
%24 = icmp sge i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load i32, i32* %3
%27 = icmp slt i32 %26, 5
br label %28
28: ; preds = %25, %22
%29 = phi i1 [ false, %22 ], [ %27, %25 ]
%30 = zext i1 %29 to i32
%31 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %30)
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @nondet_bool()
%2 = icmp eq i32 %1, 0
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
ret i32 1
}
/* Variables and functions */
size_t number_of_reals(size_t n, size_t m) { return (2 * m * (n + 1) + n); }


x86 assembly (clang, -O0):
<number_of_reals>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    -0x8(%rbp),%rcx
add    $0x1,%rcx
imul   %rcx,%rax
add    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_of_reals>:
lea    0x1(%rdi),%rax
imul   %rsi,%rax
lea    (%rdi,%rax,2),%rax
ret

LLVM IR (-O0):
define i64 @number_of_reals(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = mul i64 2, %5
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = mul i64 %6, %8
%10 = load i64, i64* %3
%11 = add i64 %9, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @number_of_reals(i64 %0, i64 %1) {
%3 = shl i64 %1, 1
%4 = add i64 %0, 1
%5 = mul i64 %3, %4
%6 = add i64 %5, %0
ret i64 %6
}
/* Variables and functions */
scalar_t__ jpath_getindex(char const *);
char *jpath_setindex(char const *, scalar_t__);
char *jpath_decindex(char const *path, size_t count) {
  return jpath_setindex(path, jpath_getindex(path) - count);
}


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

x86 assembly (clang, -O2):
<jpath_decindex>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <jpath_getindex@plt>
sub    %r14,%rax
mov    %rbx,%rdi
mov    %rax,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <jpath_setindex@plt>

LLVM IR (-O0):
define i8* @jpath_decindex(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 i8*, i8** %3
%7 = call i64 @jpath_getindex(i8* %6)
%8 = load i64, i64* %4
%9 = sub i64 %7, %8
%10 = call i8* @jpath_setindex(i8* %5, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @jpath_decindex(i8* %0, i64 %1) {
%3 = tail call i64 @jpath_getindex(i8* %0)
%4 = sub i64 %3, %1
%5 = tail call i8* @jpath_setindex(i8* %0, i64 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ _errorloop();
void NMI_Handle() { _errorloop(); }


x86 assembly (clang, -O0):
<NMI_Handle>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <_errorloop@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @NMI_Handle() {
%1 = call i32 (...) @_errorloop()
ret void
}

LLVM IR (-O2):
define void @NMI_Handle() {
%1 = tail call i32 (...) @_errorloop()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init();
int /*<<< orphan*/ print_processes();
int /*<<< orphan*/ run_test();
int /*<<< orphan*/ scheduler();
int main() {
  init();
  run_test();
  print_processes();
  scheduler();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <init@plt>
mov    $0x0,%al
call   1040 <run_test@plt>
mov    $0x0,%al
call   1060 <print_processes@plt>
mov    $0x0,%al
call   1050 <scheduler@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <init@plt>
xor    %eax,%eax
call   1040 <run_test@plt>
xor    %eax,%eax
call   1060 <print_processes@plt>
xor    %eax,%eax
call   1050 <scheduler@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @init()
%2 = call i32 (...) @run_test()
%3 = call i32 (...) @print_processes()
%4 = call i32 (...) @scheduler()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 (...) @run_test()
%3 = tail call i32 (...) @print_processes()
%4 = tail call i32 (...) @scheduler()
ret i32 0
}
/* Variables and functions */
float bounce_ease_in(float);
float bounce_ease_out(float);
float bounce_ease_in_out(float p) {
  float f = 0.0f;
  if (p < 0.5f) {
    f = 0.5f * bounce_ease_in(p * 2.0f);
  } else {
    f = 0.5f * bounce_ease_out(p * 2.0f - 1.0f) + 0.5f;
  }
  return f;
}


x86 assembly (clang, -O0):
<bounce_ease_in_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xec3(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1172 <bounce_ease_in_out+0x52>
movss  0xeb9(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
call   1030 <bounce_ease_in@plt>
movaps %xmm0,%xmm1
movss  0xe9c(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    11a1 <bounce_ease_in_out+0x81>
movss  -0x4(%rbp),%xmm0
addss  %xmm0,%xmm0
movss  0xe81(%rip),%xmm1
addss  %xmm1,%xmm0
call   1040 <bounce_ease_out@plt>
movss  0xe6c(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bounce_ease_in_out>:
push   %rax
movss  0xed7(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1141 <bounce_ease_in_out+0x21>
addss  %xmm0,%xmm0
call   1030 <bounce_ease_in@plt>
mulss  0xec1(%rip),%xmm0
pop    %rax
ret
addss  %xmm0,%xmm0
addss  0xeb7(%rip),%xmm0
call   1040 <bounce_ease_out@plt>
movss  0xea6(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @bounce_ease_in_out(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
store float 0.000000e+00, float* %3
%4 = load float, float* %2
%5 = fcmp olt float %4, 5.000000e-01
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load float, float* %2
%8 = fmul float %7, 2.000000e+00
%9 = call float @bounce_ease_in(float %8)
%10 = fmul float 5.000000e-01, %9
store float %10, float* %3
br label %16
11: ; preds = %1
%12 = load float, float* %2
%13 = call float @llvm.fmuladd.f32(float %12, float 2.000000e+00, float -1.000000e+00)
%14 = call float @bounce_ease_out(float %13)
%15 = call float @llvm.fmuladd.f32(float 5.000000e-01, float %14, float 5.000000e-01)
store float %15, float* %3
br label %16
16: ; preds = %11, %6
%17 = load float, float* %3
ret float %17
}

LLVM IR (-O2):
define float @bounce_ease_in_out(float %0) {
%2 = fcmp olt float %0, 5.000000e-01
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fmul float %0, 2.000000e+00
%5 = tail call float @bounce_ease_in(float %4)
%6 = fmul float %5, 5.000000e-01
br label %11
7: ; preds = %1
%8 = tail call float @llvm.fmuladd.f32(float %0, float 2.000000e+00, float -1.000000e+00)
%9 = tail call float @bounce_ease_out(float %8)
%10 = tail call float @llvm.fmuladd.f32(float %9, float 5.000000e-01, float 5.000000e-01)
br label %11
11: ; preds = %7, %3
%12 = phi float [ %6, %3 ], [ %10, %7 ]
ret float %12
}