xunge/DecIR huggingface dataset:
void Fig5() {}


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

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

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

LLVM IR (-O2):
define void @Fig5() {
ret void
}
/* Variables and functions */
bool nrf52_errata_230(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_230() {
ret i32 0
}
void gtk_accel_group_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_accel_group_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char ch;
  int rez;
  printf("Enter char: ");
  scanf("%c", &ch);
  rez = (ch >= 'a') && (ch <= 'z');
  printf("%d\n", rez);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0xd(%rbp)
jl     116c <main+0x4c>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x7(%rsp),%al
add    $0x9f,%al
xor    %esi,%esi
cmp    $0x1a,%al
setb   %sil
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Enter char: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = icmp sge i32 %7, 97
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = icmp sle i32 %11, 122
br label %13
13: ; preds = %9, %0
%14 = phi i1 [ false, %0 ], [ %12, %9 ]
%15 = zext i1 %14 to i32
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Enter char: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = add i8 %4, -97
%6 = icmp ult i8 %5, 26
%7 = zext i1 %6 to i32
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}
int verify_benchmark(int r) {
  int exp = 122;
  if (r != exp)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<verify_benchmark>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x7a,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1126 <verify_benchmark+0x26>
movl   $0x0,-0x4(%rbp)
jmp    112d <verify_benchmark+0x2d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @verify_benchmark(i32 %0) {
%2 = icmp eq i32 %0, 122
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t __attribute__((no, noclone)) vec_while_int64_t(int64_t *restrict a) {
  for (int i = 0; i < 8; ++i)
    a[i] += 1;
}


x86 assembly (clang, -O0):
<vec_while_int64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1138 <vec_while_int64_t+0x38>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <vec_while_int64_t+0xf>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec_while_int64_t>:
pcmpeqd %xmm0,%xmm0
movdqu (%rdi),%xmm1
movdqu 0x10(%rdi),%xmm2
psubd  %xmm0,%xmm1
movdqu %xmm1,(%rdi)
psubd  %xmm0,%xmm2
movdqu %xmm2,0x10(%rdi)
ret

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

LLVM IR (-O2):
define i32 @vec_while_int64_t(i32* noalias nocapture %0) {
%2 = bitcast i32* %0 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = add nsw <4 x i32> %3, <i32 1, i32 1, i32 1, i32 1>
%5 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %4, <4 x i32>* %5
%6 = getelementptr inbounds i32, i32* %0, i64 4
%7 = bitcast i32* %6 to <4 x i32>*
%8 = load <4 x i32>, <4 x i32>* %7
%9 = add nsw <4 x i32> %8, <i32 1, i32 1, i32 1, i32 1>
%10 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> %9, <4 x i32>* %10
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ R_iso_seq(char **, double *, double *, int *);
int test_R_iso_seq(char *seq) {
  const int nres = 5;
  double resmass[nres];
  double resprob[nres];
  int failed = 0;
  R_iso_seq(&seq, resmass, resprob, &failed);
  return failed;
}


x86 assembly (clang, -O0):
<test_R_iso_seq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    %rsp,%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rsi
lea    -0x80(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1030 <R_iso_seq@plt>
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rsp
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_R_iso_seq>:
sub    $0x68,%rsp
mov    %rdi,0x8(%rsp)
movl   $0x0,0x4(%rsp)
lea    0x8(%rsp),%rdi
lea    0x40(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x4(%rsp),%rcx
call   1030 <R_iso_seq@plt>
mov    0x4(%rsp),%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
define i32 @test_R_iso_seq(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %2
store i32 5, i32* %3
%6 = call i8* @llvm.stacksave()
store i8* %6, i8** %4
%7 = alloca double, i64 5
%8 = alloca double, i64 5
store i32 0, i32* %5
%9 = call i32 @R_iso_seq(i8** %2, double* %7, double* %8, i32* %5)
%10 = load i32, i32* %5
%11 = load i8*, i8** %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @test_R_iso_seq(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = alloca [5 x double]
%5 = alloca [5 x double]
%6 = getelementptr inbounds [5 x double], [5 x double]* %5, i64 0, i64 0
%7 = getelementptr inbounds [5 x double], [5 x double]* %4, i64 0, i64 0
%8 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%9 = call i32 @R_iso_seq(i8** %2, double* %7, double* %6, i32* %3)
%10 = load i32, i32* %3
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ asm_setvideomode(char);
void setvideomode(char mode) { asm_setvideomode(mode); }


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

x86 assembly (clang, -O2):
<setvideomode>:
jmp    1030 <asm_setvideomode@plt>

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

LLVM IR (-O2):
define void @setvideomode(i8 signext %0) {
%2 = tail call i32 @asm_setvideomode(i8 signext %0)
ret void
}
int pointsystem_trivial(int players, int alive) { return 1; }


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

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

LLVM IR (-O0):
define i32 @pointsystem_trivial(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret i32 1
}

LLVM IR (-O2):
define i32 @pointsystem_trivial(i32 %0, i32 %1) {
ret i32 1
}
unsigned long FindBitRate(int devhandle) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @FindBitRate(i32 %0) {
ret i64 0
}
/* Variables and functions */
double acos(int);
double angle_degree_to_radian(double value) { return value * acos(-1) / 180; }


x86 assembly (clang, -O0):
<angle_degree_to_radian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0xffffffff,%edi
call   1030 <acos@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xebb(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<angle_degree_to_radian>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0xffffffff,%edi
call   1030 <acos@plt>
mulsd  (%rsp),%xmm0
divsd  0xed3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @angle_degree_to_radian(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @acos(i32 -1)
%5 = fmul double %3, %4
%6 = fdiv double %5, 1.800000e+02
ret double %6
}

LLVM IR (-O2):
define double @angle_degree_to_radian(double %0) {
%2 = tail call double @acos(i32 -1)
%3 = fmul double %2, %0
%4 = fdiv double %3, 1.800000e+02
ret double %4
}
/* Variables and functions */
int a1(int);
int a2(int, int);
int a3(int, int, int);
int a0(void) { return a1(1) + a2(2, 3) + a3(4, 5, 6); }


x86 assembly (clang, -O0):
<a0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <a1@plt>
mov    %eax,-0x8(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
call   1050 <a2@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    $0x4,%edi
mov    $0x5,%esi
mov    $0x6,%edx
call   1040 <a3@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a0>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%edi
call   1030 <a1@plt>
mov    %eax,%ebx
mov    $0x2,%edi
mov    $0x3,%esi
call   1050 <a2@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0x4,%edi
mov    $0x5,%esi
mov    $0x6,%edx
call   1040 <a3@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @a0() {
%1 = call i32 @a1(i32 1)
%2 = call i32 @a2(i32 2, i32 3)
%3 = add nsw i32 %1, %2
%4 = call i32 @a3(i32 4, i32 5, i32 6)
%5 = add nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @a0() {
%1 = tail call i32 @a1(i32 1)
%2 = tail call i32 @a2(i32 2, i32 3)
%3 = add nsw i32 %2, %1
%4 = tail call i32 @a3(i32 4, i32 5, i32 6)
%5 = add nsw i32 %3, %4
ret i32 %5
}
int test_imm_18int64_highword_reg(long long val) {
  return ((val >> 32) & (0x18 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_18int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x18,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_18int64_highword_reg>:
movabs $0x1800000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_18int64_highword_reg(i64 %0) {
%2 = and i64 %0, 103079215104
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_CDint8_mem(signed char *val) {
  return ((*val) & (0xCD << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_CDint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -51
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_sw_volume_to_dB() {
  printf("NOT IMPLEMENTED:"
         "pa_sw_volume_to_dB"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"NOT IMPLEMENTED:pa_sw_volume_to_dB\0A\00"
define i32 @pa_sw_volume_to_dB() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [35 x i8] c"NOT IMPLEMENTED:pa_sw_volume_to_dB\00"
define i32 @pa_sw_volume_to_dB() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
double fabs(double);
double abs_wrapper(double *arg_list) { return (fabs(arg_list[0])); }


x86 assembly (clang, -O0):
<abs_wrapper>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movaps 0xee9(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_wrapper>:
movsd  (%rdi),%xmm0
andps  0xef5(%rip),%xmm0
ret

LLVM IR (-O0):
define double @abs_wrapper(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = call double @llvm.fabs.f64(double %5)
ret double %6
}

LLVM IR (-O2):
define double @abs_wrapper(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @llvm.fabs.f64(double %2)
ret double %3
}
/* Variables and functions */
int f56(int *);
int f57(int *p) { return f56(p); }


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

x86 assembly (clang, -O2):
<f57>:
jmp    1030 <f56@plt>

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

LLVM IR (-O2):
define i32 @f57(i32* %0) {
%2 = tail call i32 @f56(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hello world! How are you doing?"); }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"Hello world! How are you doing?\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"Hello world! How are you doing?\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
__attribute__((weak)) void EFC1_IrqHandler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<EFC1_IrqHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <EFC1_IrqHandler+0x9>
jmp    1109 <EFC1_IrqHandler+0x9>

x86 assembly (clang, -O2):
<EFC1_IrqHandler>:
jmp    1100 <EFC1_IrqHandler>

LLVM IR (-O0):
define weak void @EFC1_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @EFC1_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_sys_info_usage(void) {
  printf("\nUsage : sys_info\n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [18 x i8] c"\0AUsage : sys_info\00"
define void @print_sys_info_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_gint_sts(int);
void handle_earlysuspend_interrupt(void) { set_gint_sts((1 << 10)); }


x86 assembly (clang, -O0):
<handle_earlysuspend_interrupt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400,%edi
call   1030 <set_gint_sts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_earlysuspend_interrupt>:
mov    $0x400,%edi
jmp    1030 <set_gint_sts@plt>

LLVM IR (-O0):
define void @handle_earlysuspend_interrupt() {
%1 = call i32 @set_gint_sts(i32 1024)
ret void
}

LLVM IR (-O2):
define void @handle_earlysuspend_interrupt() {
%1 = tail call i32 @set_gint_sts(i32 1024)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void goUpLine() {
  printf("\033[A\033[2K");
  rewind(stdout);
}


x86 assembly (clang, -O0):
<goUpLine>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <rewind@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<goUpLine>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <rewind@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[A\1B[2K\00"
@stdout = global i32 0
define void @goUpLine() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @rewind(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[A\1B[2K\00"
@stdout = global i32 0
define void @goUpLine() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @rewind(i32 %2)
ret void
}
int mycomp(const void *p1, const void *p2) {
  const double *a1 = (const double *)p1;
  const double *a2 = (const double *)p2;
  if (*a1 < *a2) {
    return -1;
  } else if (*a1 == *a2) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<mycomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1142 <mycomp+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <mycomp+0x71>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jne    116a <mycomp+0x6a>
jp     116a <mycomp+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    1171 <mycomp+0x71>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mycomp>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
movapd %xmm0,%xmm2
cmpneqsd %xmm1,%xmm2
movq   %xmm2,%rcx
and    $0x1,%ecx
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @mycomp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = fcmp une double %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
int main(void) {
  const int t = 0;
  struct s {
    int x;
    int g[t];
  };
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ my_abort();
void sigsegv(int segv) {
  (void)segv;
  my_abort();
}


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

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

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

LLVM IR (-O2):
define void @sigsegv(i32 %0) {
%2 = tail call i32 (...) @my_abort()
ret void
}
/* Variables and functions */
int lrint(double);
int double_to_d22(double x) { return lrint(x * 0x400000); }


x86 assembly (clang, -O0):
<double_to_d22>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <lrint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_to_d22>:
mulsd  0xee8(%rip),%xmm0
jmp    1030 <lrint@plt>

LLVM IR (-O0):
define i32 @double_to_d22(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x4150000000000000
%5 = call i32 @lrint(double %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @double_to_d22(double %0) {
%2 = fmul double %0, 0x4150000000000000
%3 = tail call i32 @lrint(double %2)
ret i32 %3
}
/* Variables and functions */
int main();
int _start() { return main(); }


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

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

LLVM IR (-O0):
define i32 @_start() {
%1 = call i32 (...) @main()
ret i32 %1
}

LLVM IR (-O2):
define i32 @_start() {
%1 = tail call i32 (...) @main()
ret i32 %1
}
/* Variables and functions */
scalar_t__ sancus_get_ffs(char const *, long double *);
int sancus_get_frff(long double, long double, long double, double *);
bool sancus_get_frffs(const char *s, long double a, long double b,
                      double *out) {
  long double v;
  bool ret = false;
  if (sancus_get_ffs(s, &v))
    ret = sancus_get_frff(v, a, b, out);
  return ret;
}


x86 assembly (clang, -O0):
<sancus_get_frffs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
mov    %rsi,-0x38(%rbp)
movl   $0x0,-0x54(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1030 <sancus_get_ffs@plt>
cmp    $0x0,%rax
je     117d <sancus_get_frffs+0x5d>
fldt   -0x50(%rbp)
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
mov    -0x38(%rbp),%rdi
mov    %rsp,%rax
fstpt  0x20(%rax)
fstpt  0x10(%rax)
fstpt  (%rax)
call   1040 <sancus_get_frff@plt>
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_get_frffs>:
push   %rbx
sub    $0x60,%rsp
mov    %rsi,%rbx
fldt   0x80(%rsp)
fstpt  0x38(%rsp)
fldt   0x70(%rsp)
fstpt  0x44(%rsp)
lea    0x50(%rsp),%rsi
call   1030 <sancus_get_ffs@plt>
test   %rax,%rax
je     116b <sancus_get_frffs+0x4b>
fldt   0x50(%rsp)
fldt   0x38(%rsp)
fstpt  0x20(%rsp)
fldt   0x44(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
mov    %rbx,%rdi
call   1040 <sancus_get_frff@plt>
jmp    116d <sancus_get_frffs+0x4d>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @sancus_get_frffs(i8* %0, x86_fp80 %1, x86_fp80 %2, double* %3) {
%5 = alloca x86_fp80
%6 = bitcast x86_fp80* %5 to i8*
%7 = call i64 @sancus_get_ffs(i8* %0, x86_fp80* %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = load x86_fp80, x86_fp80* %5
%11 = call i32 @sancus_get_frff(x86_fp80 %10, x86_fp80 %1, x86_fp80 %2, double* %3)
br label %12
12: ; preds = %9, %4
%13 = phi i32 [ %11, %9 ], [ 0, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ Visualizar(unsigned char);
unsigned char fnxxx(unsigned char);
unsigned char getchar();
int /*<<< orphan*/ printf(char *);
main() {
  unsigned char c;
  printf("Introducir un carácter: ");
  c = getchar();
  Visualizar(c);
  printf("\nCarácter resultante:\n");
  c = fnxxx(c);
  Visualizar(c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1060 <Visualizar@plt>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
movzbl -0x1(%rbp),%edi
call   1040 <fnxxx@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1060 <Visualizar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
movzbl %al,%ebx
mov    %ebx,%edi
call   1070 <Visualizar@plt>
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1050 <fnxxx@plt>
movzbl %al,%edi
call   1070 <Visualizar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Introducir un car\C3\A1cter: \00"
@.str.1 = [24 x i8] c"\0ACar\C3\A1cter resultante:\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call zeroext i8 (...) @getchar()
store i8 %3, i8* %1
%4 = load i8, i8* %1
%5 = call i32 @Visualizar(i8 zeroext %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%7 = load i8, i8* %1
%8 = call zeroext i8 @fnxxx(i8 zeroext %7)
store i8 %8, i8* %1
%9 = load i8, i8* %1
%10 = call i32 @Visualizar(i8 zeroext %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Introducir un car\C3\A1cter: \00"
@str = [23 x i8] c"\0ACar\C3\A1cter resultante:\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call zeroext i8 (...) @getchar()
%3 = tail call i32 @Visualizar(i8 zeroext %2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%5 = tail call zeroext i8 @fnxxx(i8 zeroext %2)
%6 = tail call i32 @Visualizar(i8 zeroext %5)
ret i32 0
}
/* Variables and functions */
scalar_t__ isShortWord(char *);
int isStoppWord(char *term) {
  if (isShortWord(term)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isStoppWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <isShortWord@plt>
cmp    $0x0,%rax
je     113b <isStoppWord+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <isStoppWord+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isStoppWord>:
push   %rax
call   1030 <isShortWord@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @isStoppWord(i8* %0) {
%2 = tail call i64 @isShortWord(i8* %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t twhash_32(uint32_t val, unsigned int bits) {
  uint32_t hash = val * 0x9e370001UL;
  return hash >> (32 - bits);
}


x86 assembly (clang, -O0):
<twhash_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movabs $0x9e370001,%rcx
imul   %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<twhash_32>:
mov    %esi,%ecx
imul   $0x9e370001,%edi,%eax
neg    %cl
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @twhash_32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 2654404609
%9 = trunc i64 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = sub i32 32, %11
%13 = ashr i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @twhash_32(i32 %0, i32 %1) {
%3 = mul i32 %0, -1640562687
%4 = sub i32 32, %1
%5 = ashr i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void handle_exit() {
  fprintf(stderr, "\nOut of memory\n");
  exit(10);
}


x86 assembly (clang, -O0):
<handle_exit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xa,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handle_exit>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xa,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"\0AOut of memory\0A\00"
define void @handle_exit() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 10)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"\0AOut of memory\0A\00"
define void @handle_exit() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 10)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void spy_error(char *m) {
  printf("Syntax: foo-spy [path-to-glftpd-conf]\n");
  printf("Error: %s\n", m);
  exit(1);
}


x86 assembly (clang, -O0):
<spy_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<spy_error>:
push   %rbx
mov    %rdi,%rbx
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Syntax: foo-spy [path-to-glftpd-conf]\0A\00"
@.str.1 = [11 x i8] c"Error: %s\0A\00"
define void @spy_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"Error: %s\0A\00"
@str = [38 x i8] c"Syntax: foo-spy [path-to-glftpd-conf]\00"
define void @spy_error(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ sleep(int);
int main(void) {
  int count = 0;
  int a;
  while ((++count) <= 20) {
    printf("pid=%d sleep(%d)\n", getpid(), count);
    sleep(2);
  }
  a += 1;
  a += 1;
  a += 1;
  a += 1;
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x14,%eax
jg     117f <main+0x4f>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
mov    -0x8(%rbp),%edx
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
jmp    1146 <main+0x16>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xec0(%rip),%r14
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    %ebx,%edx
call   1040 <printf@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
add    $0x1,%ebx
cmp    $0x15,%ebx
jne    1140 <main+0x10>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"pid=%d sleep(%d)\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %6, %1 ]
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %2)
%5 = tail call i32 @sleep(i32 2)
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 21
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ msgErro(char *);
void erroExpInvalida() { msgErro("Expressao invalida!"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Expressao invalida!\00"
define void @erroExpInvalida() {
%1 = call i32 @msgErro(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Expressao invalida!\00"
define void @erroExpInvalida() {
%1 = tail call i32 @msgErro(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *, char *);
void unknown_value(char *filename, char *directive, char *tag, char *val) {
  char *title = "Unknown Value";
  (void)printf("<HR><H2>%s</H2>\nThe requested server-side-includes filename, "
               "%s,\ntried to use the directive %s %s with an unknown value, "
               "%s.\n<HR>\n",
               title, filename, directive, tag, val);
}


x86 assembly (clang, -O0):
<unknown_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xed1(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unknown_value>:
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xeeb(%rip),%rdi
lea    0xed6(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Unknown Value\00"
@.str.1 = [131 x i8] c"<HR><H2>%s</H2>\0AThe requested server-side-includes filename, %s,\0Atried to use the directive %s %s with an unknown value, %s.\0A<HR>\0A\00"
define void @unknown_value(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %9
%10 = load i8*, i8** %9
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = call i32 @printf(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str.1, i64 0, i64 0), i8* %10, i8* %11, i8* %12, i8* %13, i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Unknown Value\00"
@.str.1 = [131 x i8] c"<HR><H2>%s</H2>\0AThe requested server-side-includes filename, %s,\0Atried to use the directive %s %s with an unknown value, %s.\0A<HR>\0A\00"
define void @unknown_value(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_console() { printf("basicmail>"); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"basicmail>\00"
define void @print_console() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
long IS_ERR_OR_NULL(const void *ptr) {
  return !ptr ||
         __builtin_expect(!!(((unsigned long)ptr) >= (unsigned long)-4095), 0);
}


x86 assembly (clang, -O0):
<IS_ERR_OR_NULL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     113a <IS_ERR_OR_NULL+0x3a>
mov    -0x8(%rbp),%rax
cmp    $0xfffffffffffff001,%rax
setae  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cltq
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<IS_ERR_OR_NULL>:
test   %rdi,%rdi
sete   %al
cmp    $0xfffffffffffff001,%rdi
setae  %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i64 @IS_ERR_OR_NULL(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = ptrtoint i8* %6 to i64
%8 = icmp uge i64 %7, -4095
%9 = xor i1 %8, true
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
%12 = sext i32 %11 to i64
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %5, %1
%15 = phi i1 [ true, %1 ], [ %13, %5 ]
%16 = zext i1 %15 to i32
%17 = sext i32 %16 to i64
ret i64 %17
}

LLVM IR (-O2):
define i64 @IS_ERR_OR_NULL(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = icmp ugt i8* %0, inttoptr (i64 -4096 to i8*)
%4 = or i1 %2, %3
%5 = zext i1 %4 to i64
ret i64 %5
}
void replace(s) char *s;
{
  if (count_con_seq() > 0)
    setto(s);
}


x86 assembly (clang, -O0):
<replace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <count_con_seq@plt>
cmp    $0x0,%eax
jle    1147 <replace+0x27>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <setto@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <count_con_seq@plt>
test   %eax,%eax
jle    113a <replace+0x1a>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <setto@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @replace(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @count_con_seq()
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @setto to i32 (i8*, ...)*)(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @replace(i8* %0) {
%2 = tail call i32 (...) @count_con_seq()
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @setto to i32 (i8*, ...)*)(i8* %0)
br label %6
6: ; preds = %4, %1
ret void
}
void s5p_memset(void *p, char c, unsigned long size) {
  int i;
  char *cp = p;
  for (i = 0; i < size; i++, cp++)
    *cp = c;
}


x86 assembly (clang, -O0):
<s5p_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1152 <s5p_memset+0x52>
mov    -0x9(%rbp),%cl
mov    -0x28(%rbp),%rax
mov    %cl,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1121 <s5p_memset+0x21>
pop    %rbp
ret

x86 assembly (clang, -O2):
<s5p_memset>:
test   %rdx,%rdx
je     1123 <s5p_memset+0x13>
push   %rax
movzbl %sil,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @s5p_memset(i8* nocapture writeonly %0, i8 signext %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %6, label %5
5: ; preds = %3
br label %6
6: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int main() {
  printf("After a long time");
  system("/home/mazumdar/DRTSIM/drt-code/tregression.sh");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xede(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"After a long time\00"
@.str.1 = [46 x i8] c"/home/mazumdar/DRTSIM/drt-code/tregression.sh\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"After a long time\00"
@.str.1 = [46 x i8] c"/home/mazumdar/DRTSIM/drt-code/tregression.sh\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}