xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void print_usage_menu() {
  printf("Usage: b64 -option <input-file> <output-file>\n");
  printf("  -e     Encode input file to output file\n");
  printf("  -d     Decode input file to output file\n");
  printf("  -h     Display this help menu\n");
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage_menu>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
call   1030 <printf@plt>
lea    0xf17(%rip),%rdi
call   1030 <printf@plt>
lea    0xf36(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage_menu>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
lea    0xf18(%rip),%rdi
call   1030 <puts@plt>
lea    0xf36(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"Usage: b64 -option <input-file> <output-file>\0A\00"
@.str.1 = [43 x i8] c" -e Encode input file to output file\0A\00"
@.str.2 = [43 x i8] c" -d Decode input file to output file\0A\00"
@.str.3 = [33 x i8] c" -h Display this help menu\0A\00"
define void @print_usage_menu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [46 x i8] c"Usage: b64 -option <input-file> <output-file>\00"
@str.4 = [42 x i8] c" -e Encode input file to output file\00"
@str.5 = [42 x i8] c" -d Decode input file to output file\00"
@str.6 = [32 x i8] c" -h Display this help menu\00"
define void @print_usage_menu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
__attribute__((warn_unused_result)) uint16_t modbusRBE(const uint8_t *p) {
  uint8_t lo = *(p + 1);
  uint8_t hi = *p;
  return (uint16_t)lo | ((uint16_t)hi << 8);
}


x86 assembly (clang, -O0):
<modbusRBE>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modbusRBE>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @modbusRBE(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
%4 = alloca i64
store i64* %0, i64** %2
%5 = load i64*, i64** %2
%6 = getelementptr inbounds i64, i64* %5, i64 1
%7 = load i64, i64* %6
store i64 %7, i64* %3
%8 = load i64*, i64** %2
%9 = load i64, i64* %8
store i64 %9, i64* %4
%10 = load i64, i64* %3
%11 = trunc i64 %10 to i32
%12 = load i64, i64* %4
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 8
%15 = or i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @modbusRBE(i64* nocapture %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 1
%3 = load i64, i64* %2
%4 = load i64, i64* %0
%5 = trunc i64 %3 to i32
%6 = trunc i64 %4 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %5
ret i32 %8
}
int g(int d) {
  while (d < 10) {
    if (d < 0) {
      continue;
    }
    d = d - 1;
  }
  return 3;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    112e <g+0x2e>
cmpl   $0x0,-0x4(%rbp)
jge    1120 <g+0x20>
jmp    1107 <g+0x7>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <g+0x7>
mov    $0x3,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
ret i32 3
}
SIGNAL(sig, func) int *sig, *func;
{ return ((long)signal(*sig, *func)); }


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

x86 assembly (clang, -O2):
<SIGNAL>:
mov    (%rdi),%edi
mov    (%rsi),%esi
xor    %eax,%eax
jmp    1030 <signal@plt>

LLVM IR (-O0):
define i32 @SIGNAL(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = call i32 (i32, i32, ...) bitcast (i32 (...)* @signal to i32 (i32, i32, ...)*)(i32 %6, i32 %8)
%10 = sext i32 %9 to i64
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @SIGNAL(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @signal to i32 (i32, i32, ...)*)(i32 %3, i32 %4)
ret i32 %5
}
int houseToChar(int house) {
  switch (house) {
  case 0:
    return 'A';
    break;
  case 1:
    return 'D';
    break;
  case 2:
    return 'H';
    break;
  case 3:
    return 'J';
    break;
  case 4:
    return 'L';
    break;
  case 5:
    return 'M';
    break;
  }
}


x86 assembly (clang, -O0):
<houseToChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x5,%rax
ja     116f <houseToChar+0x6f>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x41,-0x4(%rbp)
jmp    116f <houseToChar+0x6f>
movl   $0x44,-0x4(%rbp)
jmp    116f <houseToChar+0x6f>
movl   $0x48,-0x4(%rbp)
jmp    116f <houseToChar+0x6f>
movl   $0x4a,-0x4(%rbp)
jmp    116f <houseToChar+0x6f>
movl   $0x4c,-0x4(%rbp)
jmp    116f <houseToChar+0x6f>
movl   $0x4d,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<houseToChar>:
add    $0xffffffff,%edi
mov    $0x41,%eax
cmp    $0x4,%edi
ja     111a <houseToChar+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @houseToChar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %11 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 4, label %9
i32 5, label %10
]
5: ; preds = %1
store i32 65, i32* %2
br label %11
6: ; preds = %1
store i32 68, i32* %2
br label %11
7: ; preds = %1
store i32 72, i32* %2
br label %11
8: ; preds = %1
store i32 74, i32* %2
br label %11
9: ; preds = %1
store i32 76, i32* %2
br label %11
10: ; preds = %1
store i32 77, i32* %2
br label %11
11: ; preds = %5, %6, %7, %8, %9, %10, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@switch.table.houseToChar = [5 x i32] [i32 68, i32 72, i32 74, i32 76, i32 77]
define i32 @houseToChar(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 5
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [5 x i32], [5 x i32]* @switch.table.houseToChar, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 65, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int strcmp(char *const, char *const);
int namesort(const void *p1, const void *p2) {
  return strcmp(*(char *const *)p1, *(char *const *)p2);
}


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

x86 assembly (clang, -O2):
<namesort>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @namesort(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @namesort(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
int test_imm_81int8_mem(signed char *val) {
  return ((*val) & (-0x81 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_81int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff7f,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_81int8_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, -129
%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_81int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -129
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
double inner_3d(double *p0, double *p1) {
  double out;
  out = *(p0++) * *(p1++);
  out += *(p0++) * *(p1++);
  out += *(p0) * *(p1);
  return out;
}


x86 assembly (clang, -O0):
<inner_3d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
movsd  (%rax),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<inner_3d>:
movsd  (%rdi),%xmm0
mulsd  (%rsi),%xmm0
movsd  0x8(%rdi),%xmm1
mulsd  0x8(%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @inner_3d(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 = getelementptr inbounds double, double* %6, i32 1
store double* %7, double** %3
%8 = load double, double* %6
%9 = load double*, double** %4
%10 = getelementptr inbounds double, double* %9, i32 1
store double* %10, double** %4
%11 = load double, double* %9
%12 = fmul double %8, %11
store double %12, double* %5
%13 = load double*, double** %3
%14 = getelementptr inbounds double, double* %13, i32 1
store double* %14, double** %3
%15 = load double, double* %13
%16 = load double*, double** %4
%17 = getelementptr inbounds double, double* %16, i32 1
store double* %17, double** %4
%18 = load double, double* %16
%19 = load double, double* %5
%20 = call double @llvm.fmuladd.f64(double %15, double %18, double %19)
store double %20, double* %5
%21 = load double*, double** %3
%22 = load double, double* %21
%23 = load double*, double** %4
%24 = load double, double* %23
%25 = load double, double* %5
%26 = call double @llvm.fmuladd.f64(double %22, double %24, double %25)
store double %26, double* %5
%27 = load double, double* %5
ret double %27
}

LLVM IR (-O2):
define double @inner_3d(double* nocapture %0, double* nocapture %1) {
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %0
%5 = getelementptr inbounds double, double* %1, i64 1
%6 = load double, double* %1
%7 = fmul double %4, %6
%8 = getelementptr inbounds double, double* %0, i64 2
%9 = load double, double* %3
%10 = getelementptr inbounds double, double* %1, i64 2
%11 = load double, double* %5
%12 = tail call double @llvm.fmuladd.f64(double %9, double %11, double %7)
%13 = load double, double* %8
%14 = load double, double* %10
%15 = tail call double @llvm.fmuladd.f64(double %13, double %14, double %12)
ret double %15
}
void gtk_editable_cut_clipboard() {}


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

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

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

LLVM IR (-O2):
define void @gtk_editable_cut_clipboard() {
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
scalar_t__ time(void *);
time_t gettime_98842(void) {
  time_t result;
  result = 0;
  result = time(((void *)0));
  goto BeforeRet;
BeforeRet:;
  return result;
}


x86 assembly (clang, -O0):
<gettime_98842>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettime_98842>:
xor    %edi,%edi
jmp    1030 <time@plt>

LLVM IR (-O0):
define i64 @gettime_98842() {
%1 = alloca i64
store i64 0, i64* %1
%2 = call i64 @time(i8* null)
store i64 %2, i64* %1
br label %3
3: ; preds = %0
%4 = load i64, i64* %1
ret i64 %4
}

LLVM IR (-O2):
define i64 @gettime_98842() {
%1 = tail call i64 @time(i8* null)
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello");
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char const *argv[]) {
  printf("Hello World ! \n");
  return 0;
}


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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"Hello World ! \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 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"Hello World ! \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int SIM_power_draincap(int, int, int);
double SIM_power_gatecap(int, int /*<<< orphan*/);
double c_PASS(void) {
  return (2 * (SIM_power_draincap((3 * ((0.8 * 0.0875) * 0.5)), 0, 1) +
               SIM_power_draincap((3 * ((0.8 * 0.0875) * 0.5)), 1, 1)) +
          SIM_power_gatecap(
              (3 * ((0.8 * 0.0875) * 0.5)) + (3 * ((0.8 * 0.0875) * 0.5)), 0));
}


x86 assembly (clang, -O0):
<c_PASS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %esi,%esi
mov    $0x1,%edx
mov    %esi,%edi
call   1030 <SIM_power_draincap@plt>
mov    %eax,-0xc(%rbp)
xor    %edi,%edi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <SIM_power_draincap@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1040 <SIM_power_gatecap@plt>
movaps %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_PASS>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <SIM_power_draincap@plt>
mov    %eax,%ebx
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <SIM_power_draincap@plt>
add    %ebx,%eax
add    %eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %edi,%edi
xor    %esi,%esi
call   1040 <SIM_power_gatecap@plt>
addsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @c_PASS() {
%1 = call i32 @SIM_power_draincap(i32 0, i32 0, i32 1)
%2 = call i32 @SIM_power_draincap(i32 0, i32 1, i32 1)
%3 = add nsw i32 %1, %2
%4 = mul nsw i32 2, %3
%5 = sitofp i32 %4 to double
%6 = call double @SIM_power_gatecap(i32 0, i32 0)
%7 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @c_PASS() {
%1 = tail call i32 @SIM_power_draincap(i32 0, i32 0, i32 1)
%2 = tail call i32 @SIM_power_draincap(i32 0, i32 1, i32 1)
%3 = add nsw i32 %2, %1
%4 = shl nsw i32 %3, 1
%5 = sitofp i32 %4 to double
%6 = tail call double @SIM_power_gatecap(i32 0, i32 0)
%7 = fadd double %6, %5
ret double %7
}
void set_sequence(int sequence) {
  (*(volatile unsigned long *)(0xE0028000 + 0x1C)) |= sequence;
}


x86 assembly (clang, -O0):
<set_sequence>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
mov    $0xe002801c,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0xe002801c,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_sequence>:
movslq %edi,%rax
mov    $0xe002801c,%ecx
or     %rax,(%rcx)
ret

LLVM IR (-O0):
define void @set_sequence(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = load volatile i64, i64* inttoptr (i64 3758260252 to i64*)
%6 = or i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 3758260252 to i64*)
ret void
}

LLVM IR (-O2):
define void @set_sequence(i32 %0) {
%2 = sext i32 %0 to i64
%3 = load volatile i64, i64* inttoptr (i64 3758260252 to i64*)
%4 = or i64 %3, %2
store volatile i64 %4, i64* inttoptr (i64 3758260252 to i64*)
ret void
}
OP(dd, b8) {
  illegal_1();
  op_b8();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_b8@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_b8@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_b8()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_b8()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ uli2a(long, int, int /*<<< orphan*/, char *);
void li2a(long num, char *bf) {
  if (num < 0) {
    num = -num;
    *bf++ = '-';
  }
  uli2a(num, 10, 0, bf);
}


x86 assembly (clang, -O0):
<li2a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1147 <li2a+0x37>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x2d,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0xa,%esi
xor    %edx,%edx
call   1030 <uli2a@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<li2a>:
mov    %rsi,%rcx
test   %rdi,%rdi
jns    1122 <li2a+0x12>
neg    %rdi
movb   $0x2d,(%rcx)
add    $0x1,%rcx
mov    $0xa,%esi
xor    %edx,%edx
jmp    1030 <uli2a@plt>

LLVM IR (-O0):
define void @li2a(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i64, i64* %3
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i64, i64* %3
%9 = sub nsw i64 0, %8
store i64 %9, i64* %3
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %4
store i8 45, i8* %10
br label %12
12: ; preds = %7, %2
%13 = load i64, i64* %3
%14 = load i8*, i8** %4
%15 = call i32 @uli2a(i64 %13, i32 10, i32 0, i8* %14)
ret void
}

LLVM IR (-O2):
define void @li2a(i64 %0, i8* %1) {
%3 = icmp slt i64 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = sub nsw i64 0, %0
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 45, i8* %1
br label %7
7: ; preds = %4, %2
%8 = phi i64 [ %5, %4 ], [ %0, %2 ]
%9 = phi i8* [ %6, %4 ], [ %1, %2 ]
%10 = tail call i32 @uli2a(i64 %8, i32 10, i32 0, i8* %9)
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_emit_properties_changed(void *bus, const char *path,
                               const char *interface, const char *name, ...) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_emit_properties_changed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%eax
neg    %eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_emit_properties_changed>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_emit_properties_changed(i8* %0, i8* %1, i8* %2, i8* %3, ...) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* @EINVAL
%10 = sub nsw i32 0, %9
ret i32 %10
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_emit_properties_changed(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, ...) {
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}
/* Variables and functions */
double sqrt(int);
double area_triangle(double edge) { return edge * edge * sqrt(3) / 4; }


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

x86 assembly (clang, -O2):
<area_triangle>:
push   %rax
mulsd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
mov    $0x3,%edi
call   1030 <sqrt@plt>
mulsd  (%rsp),%xmm0
mulsd  0xecf(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @area_triangle(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = call double @sqrt(i32 3)
%7 = fmul double %5, %6
%8 = fdiv double %7, 4.000000e+00
ret double %8
}

LLVM IR (-O2):
define double @area_triangle(double %0) {
%2 = fmul double %0, %0
%3 = tail call double @sqrt(i32 3)
%4 = fmul double %2, %3
%5 = fmul double %4, 2.500000e-01
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, char *);
void detalle(int numlinea, char *componlexico, char *id) {
  printf("Linea: %d - componente lexico: %s - lexema: %s \n", numlinea,
         componlexico, id);
}


x86 assembly (clang, -O0):
<detalle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<detalle>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"Linea: %d - componente lexico: %s - lexema: %s \0A\00"
define void @detalle(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"Linea: %d - componente lexico: %s - lexema: %s \0A\00"
define void @detalle(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1, i8* %2)
ret void
}
int main(void) {
  char *A;
  A = "text";
  A = "text"
      "text";
  A = "text"
      "text"
      "text"
      "text";
  A = "text"
      "text"
      "text"
      "text"
      "text"
      "text"
      "text"
      "text";
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    0xf0a(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xefb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xee8(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xecd(%rip),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"text\00"
@.str.1 = [9 x i8] c"texttext\00"
@.str.2 = [17 x i8] c"texttexttexttext\00"
@.str.3 = [33 x i8] c"texttexttexttexttexttexttexttext\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void default_free(void *data) { return; }


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

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

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

LLVM IR (-O2):
define void @default_free(i8* nocapture %0) {
ret void
}
doga() {}


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

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

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

LLVM IR (-O2):
define i32 @doga() {
ret i32 undef
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *calloc_verify(size_t nmemb, size_t size) {
  void *p;
  p = calloc(nmemb, size);
  if (!p) {
    fprintf(stderr, "blockrage: malloc failed!\n");
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<calloc_verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117b <calloc_verify+0x4b>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc_verify>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     113d <calloc_verify+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"blockrage: malloc failed!\0A\00"
define noalias i8* @calloc_verify(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i8* %3
}
double f4_cb_send_pre_int_float(double (*cb)(int, float)) {
  float r = 55.0;
  return cb(8, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_int_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  0xef4(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm0
mov    $0x8,%edi
call   *%rax
movsd  0xecf(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_int_float>:
push   %rax
mov    %rdi,%rax
movss  0xef4(%rip),%xmm0
mov    $0x8,%edi
call   *%rax
addsd  0xeed(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_int_float(double (i32, float)* %0) {
%2 = alloca double (i32, float)*
%3 = alloca float
store double (i32, float)* %0, double (i32, float)** %2
store float 5.500000e+01, float* %3
%4 = load double (i32, float)*, double (i32, float)** %2
%5 = load float, float* %3
%6 = call double %4(i32 8, float %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_int_float(double (i32, float)* nocapture %0) {
%2 = tail call double %0(i32 8, float 5.500000e+01)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ name;

/* Variables and functions */
int gethostname(char *, int);
int main(void) {
  char name[128];
  return gethostname(name, sizeof(name));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
mov    $0x80,%esi
call   1030 <gethostname@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x88,%rsp
mov    %rsp,%rdi
mov    $0x80,%esi
call   1030 <gethostname@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @gethostname(i8* %3, i32 128)
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i32 @gethostname(i8* %2, i32 128)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int gen_ABRT() { kill(getpid(), SIGABRT); }


x86 assembly (clang, -O0):
<gen_ABRT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_ABRT>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1040 <kill@plt>

LLVM IR (-O0):
@SIGABRT = global i32 0
define i32 @gen_ABRT() {
%1 = alloca i32
%2 = call i32 (...) @getpid()
%3 = load i32, i32* @SIGABRT
%4 = call i32 @kill(i32 %2, i32 %3)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@SIGABRT = global i32 0
define i32 @gen_ABRT() {
%1 = tail call i32 (...) @getpid()
%2 = load i32, i32* @SIGABRT
%3 = tail call i32 @kill(i32 %1, i32 %2)
ret i32 undef
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char *, struct stat *);
int getFileSize(char *filename) {
  struct stat fileStat;
  stat(filename, &fileStat);
  return fileStat.st_size;
}


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

x86 assembly (clang, -O2):
<getFileSize>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @getFileSize(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @getFileSize(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Error(char *);
void Usage() {
  Error("USAGE: screwup  [-o <funcs> <func_desc>] (-d <define1> (<define2> "
        "..)) -f <file1> [<file2> ..]");
}


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

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

LLVM IR (-O0):
@.str = [95 x i8] c"USAGE: screwup [-o <funcs> <func_desc>] (-d <define1> (<define2> ..)) -f <file1> [<file2> ..]\00"
define void @Usage() {
%1 = call i32 @Error(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [95 x i8] c"USAGE: screwup [-o <funcs> <func_desc>] (-d <define1> (<define2> ..)) -f <file1> [<file2> ..]\00"
define void @Usage() {
%1 = tail call i32 @Error(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int __u8;

/* Variables and functions */
#define IPPROTO_AH 134
#define IPPROTO_DCCP 133
#define IPPROTO_ESP 132
#define IPPROTO_SCTP 131
#define IPPROTO_TCP 130
#define IPPROTO_UDP 129
#define IPPROTO_UDPLITE 128
int flow_ports_offset(__u8 ip_proto) {
  switch (ip_proto) {
  case IPPROTO_TCP:
  case IPPROTO_UDP:
  case IPPROTO_DCCP:
  case IPPROTO_ESP:
  case IPPROTO_SCTP:
  case IPPROTO_UDPLITE:
  default:
    return 0;
  case IPPROTO_AH:
    return 4;
  }
}


x86 assembly (clang, -O0):
<flow_ports_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffff80,%eax
sub    $0x6,%eax
jb     1131 <flow_ports_offset+0x31>
jmp    111e <flow_ports_offset+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x86,%eax
je     1142 <flow_ports_offset+0x42>
jmp    1136 <flow_ports_offset+0x36>
jmp    1136 <flow_ports_offset+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1149 <flow_ports_offset+0x49>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @flow_ports_offset(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 130, label %5
i32 129, label %5
i32 133, label %5
i32 132, label %5
i32 131, label %5
i32 128, label %5
i32 134, label %7
]
5: ; preds = %1, %1, %1, %1, %1, %1
br label %6
6: ; preds = %1, %5
store i32 0, i32* %2
br label %8
7: ; preds = %1
store i32 4, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @flow_ports_offset(i32 %0) {
%2 = icmp eq i32 %0, 134
%3 = select i1 %2, i32 4, i32 0
ret i32 %3
}
void gtk_entry_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_entry_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void TIM8_BRK_TIM12_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @TIM8_BRK_TIM12_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @TIM8_BRK_TIM12_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
char *basename(name) const char *name;
{
  const char *base = name;
  while (*name) {
    if (*name++ == '/') {
      base = name;
    }
  }
  return (char *)base;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <basename+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1140 <basename+0x40>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <basename+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1122 <basename+0x22>
lea    0x1(%rax),%rdx
nopl   (%rax)
cmp    $0x2f,%cl
cmove  %rdx,%rax
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <basename+0x10>
ret

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

LLVM IR (-O2):
define i8* @basename(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = icmp eq i8 %5, 47
%10 = select i1 %9, i8* %8, i8* %6
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i8* [ %0, %1 ], [ %10, %4 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_MATERIAL;
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
void InitGL() {
  glEnable(GL_COLOR_MATERIAL);
  glEnable(GL_DEPTH_TEST);
}


x86 assembly (clang, -O0):
<InitGL>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitGL>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <glEnable@plt>

LLVM IR (-O0):
@GL_COLOR_MATERIAL = global i32 0
@GL_DEPTH_TEST = global i32 0
define void @InitGL() {
%1 = load i32, i32* @GL_COLOR_MATERIAL
%2 = call i32 @glEnable(i32 %1)
%3 = load i32, i32* @GL_DEPTH_TEST
%4 = call i32 @glEnable(i32 %3)
ret void
}

LLVM IR (-O2):
@GL_COLOR_MATERIAL = global i32 0
@GL_DEPTH_TEST = global i32 0
define void @InitGL() {
%1 = load i32, i32* @GL_COLOR_MATERIAL
%2 = tail call i32 @glEnable(i32 %1)
%3 = load i32, i32* @GL_DEPTH_TEST
%4 = tail call i32 @glEnable(i32 %3)
ret void
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ assert(int);
int cvAlign(int size, int align) {
  assert((align & (align - 1)) == 0 && size < INT_MAX);
  return (size + align - 1) & -align;
}


x86 assembly (clang, -O0):
<cvAlign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
and    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    1149 <cvAlign+0x39>
mov    -0x4(%rbp),%eax
mov    0x2ea7(%rip),%rcx
cmp    (%rcx),%eax
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvAlign>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%r14d
lea    -0x1(%rbx),%eax
test   %eax,%esi
sete   %al
mov    0x2ec0(%rip),%rcx
cmp    %edi,(%rcx)
setg   %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
lea    (%r14,%rbx,1),%eax
add    $0xffffffff,%eax
neg    %ebx
and    %eax,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@INT_MAX = global i32 0
define i32 @cvAlign(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = and i32 %5, %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* %3
%12 = load i32, i32* @INT_MAX
%13 = icmp slt i32 %11, %12
br label %14
14: ; preds = %10, %2
%15 = phi i1 [ false, %2 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = add nsw i32 %18, %19
%21 = sub nsw i32 %20, 1
%22 = load i32, i32* %4
%23 = sub nsw i32 0, %22
%24 = and i32 %21, %23
ret i32 %24
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @cvAlign(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.ctpop.i32(i32 %1)
%4 = icmp ult i32 %3, 2
%5 = load i32, i32* @INT_MAX
%6 = icmp sgt i32 %5, %0
%7 = select i1 %4, i1 %6, i1 false
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = add i32 %0, -1
%11 = add i32 %10, %1
%12 = sub nsw i32 0, %1
%13 = and i32 %11, %12
ret i32 %13
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void get_now_time(int64_t *msec) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  *msec = tv.tv_sec * 1000 + tv.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<get_now_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x10(%rbp),%ecx
mov    -0xc(%rbp),%eax
mov    $0x3e8,%esi
cltd
idiv   %esi
add    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_now_time>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x8(%rsp),%eax
movslq 0xc(%rsp),%rcx
imul   $0x10624dd3,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
add    %eax,%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @get_now_time(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.timeval
store i32* %0, i32** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = add nsw i32 %7, %10
%12 = load i32*, i32** %2
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @get_now_time(i32* nocapture writeonly %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = add nsw i32 %10, %7
store i32 %11, i32* %0
ret void
}
int do_177() { return 177; }


x86 assembly (clang, -O0):
<do_177>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_177() {
ret i32 177
}

LLVM IR (-O2):
define i32 @do_177() {
ret i32 177
}
/* Variables and functions */
int getchar();
int alt_getchar(void) { return getchar(); }


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

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

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

LLVM IR (-O2):
define i32 @alt_getchar() {
%1 = tail call i32 (...) @getchar()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int main() {
  int i;
  for (i = 0; i < 5; i++) {
    foo();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1145 <main+0x35>
mov    $0x0,%al
call   1030 <foo@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 5
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 (...) @foo()
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @foo()
%3 = tail call i32 (...) @foo()
%4 = tail call i32 (...) @foo()
%5 = tail call i32 (...) @foo()
ret i32 0
}
int fun670() { return 670; }


x86 assembly (clang, -O0):
<fun670>:
push   %rbp
mov    %rsp,%rbp
mov    $0x29e,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun670() {
ret i32 670
}

LLVM IR (-O2):
define i32 @fun670() {
ret i32 670
}