xunge/DecIR huggingface dataset:
/* Variables and functions */
int square(int);
int main(int argc, char const *argv[]) {
  int did_call = 0;
  if (square(argc + 1) != 0) {
    did_call = 1;
    return square(argc);
  }
  return square(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%edi
add    $0x1,%edi
call   1030 <square@plt>
cmp    $0x0,%eax
je     1158 <main+0x48>
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <square@plt>
mov    %eax,-0x4(%rbp)
jmp    1162 <main+0x52>
xor    %edi,%edi
call   1030 <square@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
lea    0x1(%rbx),%edi
call   1030 <square@plt>
test   %eax,%eax
cmove  %eax,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <square@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = add nsw i32 %0, 1
%4 = tail call i32 @square(i32 %3)
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 0, i32 %0
%7 = tail call i32 @square(i32 %6)
ret i32 %7
}
void DL_Shutdown() {}


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

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

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

LLVM IR (-O2):
define void @DL_Shutdown() {
ret void
}
void gdk_event_type_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_event_type_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WriteSerial(int /*<<< orphan*/);
void WriteSerialString(char *s) {
  while (*s != 0)
    WriteSerial(*s++);
}


x86 assembly (clang, -O0):
<WriteSerialString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <WriteSerialString+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <WriteSerial@plt>
jmp    111c <WriteSerialString+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteSerialString>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <WriteSerialString+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <WriteSerial@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <WriteSerialString+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @WriteSerialString(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
%13 = call i32 @WriteSerial(i32 %12)
br label %3
14: ; preds = %3
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int getFileLength(FILE *file) {
  int current_post = 0;
  int length = 0;
  current_post = ftell(file);
  fseek(file, 0, SEEK_END);
  length = ftell(file);
  fseek(file, current_post, SEEK_SET);
  return length;
}


x86 assembly (clang, -O0):
<getFileLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2e64(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFileLength>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <ftell@plt>
mov    %eax,%r14d
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %eax,%ebp
mov    0x2e85(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14d,%esi
call   1040 <fseek@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @getFileLength(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = load i32*, i32** %2
%6 = call i32 @ftell(i32* %5)
store i32 %6, i32* %3
%7 = load i32*, i32** %2
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseek(i32* %7, i32 0, i32 %8)
%10 = load i32*, i32** %2
%11 = call i32 @ftell(i32* %10)
store i32 %11, i32* %4
%12 = load i32*, i32** %2
%13 = load i32, i32* %3
%14 = load i32, i32* @SEEK_SET
%15 = call i32 @fseek(i32* %12, i32 %13, i32 %14)
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @getFileLength(i32* nocapture %0) {
%2 = tail call i32 @ftell(i32* %0)
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %0, i32 0, i32 %3)
%5 = tail call i32 @ftell(i32* %0)
%6 = load i32, i32* @SEEK_SET
%7 = tail call i32 @fseek(i32* %0, i32 %2, i32 %6)
ret i32 %5
}
int hypervisor_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hypervisor_init() {
ret i32 0
}
/* Variables and functions */
int sin(double);
double f(double x) { return x * x + 4 * sin(x) + 7; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
shl    $0x2,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xea4(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
shl    $0x2,%eax
cvtsi2sd %eax,%xmm1
movsd  (%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
addsd  0xec9(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = call i32 @sin(double %5)
%7 = mul nsw i32 4, %6
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double %3, double %4, double %8)
%10 = fadd double %9, 7.000000e+00
ret double %10
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = tail call i32 @sin(double %0)
%3 = shl nsw i32 %2, 2
%4 = sitofp i32 %3 to double
%5 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %4)
%6 = fadd double %5, 7.000000e+00
ret double %6
}
/* Type definitions */
struct buffer_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ brelse(struct buffer_head *);
void adfs_dir_free(struct buffer_head **bhp, int buffers) {
  int i;
  for (i = buffers - 1; i >= 0; i--)
    brelse(bhp[i]);
}


x86 assembly (clang, -O0):
<adfs_dir_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1151 <adfs_dir_free+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <brelse@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <adfs_dir_free+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adfs_dir_free>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <adfs_dir_free+0x36>
mov    %rdi,%r14
mov    %esi,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
mov    (%r14,%rax,8),%rdi
call   1030 <brelse@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1130 <adfs_dir_free+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.buffer_head = type { i32 }
define void @adfs_dir_free(%struct.buffer_head** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds %struct.buffer_head*, %struct.buffer_head** %0, i64 %9
%11 = load %struct.buffer_head*, %struct.buffer_head** %10
%12 = tail call i32 @brelse(%struct.buffer_head* %11)
%13 = icmp ugt i64 %7, 1
br i1 %13, label %6, label %14
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int main() {
  fprintf(stdout, "Hello World!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [14 x i8] c"Hello World!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [14 x i8] c"Hello World!\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
char caseup(char entry) {
  if (entry >= 'a' && entry <= 'z')
    entry -= 'a' - 'A';
  return entry;
}


x86 assembly (clang, -O0):
<caseup>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     112e <caseup+0x2e>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     112e <caseup+0x2e>
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<caseup>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define signext i8 @caseup(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
int test_imm_8Cuint32_reg(unsigned int val) {
  return ((val) & (0x8C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Cuint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x8c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Cuint32_reg>:
test   $0x8c,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Cuint32_reg(i32 %0) {
%2 = and i32 %0, 140
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int __builtin_mips_extr_w(long long, int);
long long __builtin_mips_mult(int, int);
int silk_SMULWW(int a, int b) {
  long long ac;
  int c;
  ac = __builtin_mips_mult(a, b);
  c = __builtin_mips_extr_w(ac, 16);
  return c;
}


x86 assembly (clang, -O0):
<silk_SMULWW>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <__builtin_mips_mult@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x10,%esi
call   1040 <__builtin_mips_extr_w@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<silk_SMULWW>:
push   %rax
call   1030 <__builtin_mips_mult@plt>
mov    %rax,%rdi
mov    $0x10,%esi
pop    %rax
jmp    1040 <__builtin_mips_extr_w@plt>

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

LLVM IR (-O2):
define i32 @silk_SMULWW(i32 %0, i32 %1) {
%3 = tail call i64 @__builtin_mips_mult(i32 %0, i32 %1)
%4 = tail call i32 @__builtin_mips_extr_w(i64 %3, i32 16)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ homun_read_embryodb();
int /*<<< orphan*/ homun_readdb();
int /*<<< orphan*/ read_homundb();
void homun_reload(void) {
  read_homundb();
  homun_readdb();
  homun_read_embryodb();
}


x86 assembly (clang, -O0):
<homun_reload>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <read_homundb@plt>
mov    $0x0,%al
call   1040 <homun_readdb@plt>
mov    $0x0,%al
call   1050 <homun_read_embryodb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<homun_reload>:
push   %rax
xor    %eax,%eax
call   1030 <read_homundb@plt>
xor    %eax,%eax
call   1040 <homun_readdb@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <homun_read_embryodb@plt>

LLVM IR (-O0):
define void @homun_reload() {
%1 = call i32 (...) @read_homundb()
%2 = call i32 (...) @homun_readdb()
%3 = call i32 (...) @homun_read_embryodb()
ret void
}

LLVM IR (-O2):
define void @homun_reload() {
%1 = tail call i32 (...) @read_homundb()
%2 = tail call i32 (...) @homun_readdb()
%3 = tail call i32 (...) @homun_read_embryodb()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_threads();
void main() { test_threads(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @test_threads()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Hello, world !\n"); }


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 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Hello, world !\0A\00"
define i32 @main() {
%1 = 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() {
%1 = 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 */
double sla_dt_(double *);
double slaDt(double epoch) {
  double EPOCH;
  double result;
  EPOCH = epoch;
  result = sla_dt_(&EPOCH);
  return result;
}


x86 assembly (clang, -O0):
<slaDt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <sla_dt_@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slaDt>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <sla_dt_@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define double @slaDt(double %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
store double %0, double* %2
%4 = call double @sla_dt_(double* %2)
ret double %4
}
void mystrcpy(s1, s2) char *s1, *s2;
{
  while (*s1++ = codeeval(&s2))
    ;
}


x86 assembly (clang, -O0):
<mystrcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <codeeval@plt>
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1149 <mystrcpy+0x39>
jmp    1120 <mystrcpy+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsi,(%rsp)
mov    %rsp,%r14
xchg   %ax,%ax
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <codeeval@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %al,%al
jne    1120 <mystrcpy+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @mystrcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %11, %2
%6 = call i32 (i8**, ...) bitcast (i32 (...)* @codeeval to i32 (i8**, ...)*)(i8** %4)
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %3
store i8 %7, i8* %8
%10 = icmp ne i8 %7, 0
br i1 %10, label %11, label %12
11: ; preds = %5
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @mystrcpy(i8* nocapture writeonly %0, i8* %1) {
%3 = alloca i8*
store i8* %1, i8** %3
br label %4
4: ; preds = %4, %2
%5 = phi i8* [ %0, %2 ], [ %8, %4 ]
%6 = call i32 (i8**, ...) bitcast (i32 (...)* @codeeval to i32 (i8**, ...)*)(i8** %3)
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %4
10: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr, "usage: db_dump [-p] [-f file] db_file\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"usage: db_dump [-p] [-f file] db_file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"usage: db_dump [-p] [-f file] db_file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void remove_end_of_line(char *line) {
  int i = 0;
  while (line[i] != '\n' && i < 512)
    i++;
  line[i] = 0;
}


x86 assembly (clang, -O0):
<remove_end_of_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0xd(%rbp)
je     1136 <remove_end_of_line+0x36>
cmpl   $0x200,-0xc(%rbp)
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1146 <remove_end_of_line+0x46>
jmp    1154 <remove_end_of_line+0x54>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <remove_end_of_line+0xf>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_end_of_line>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%rax),%rcx
cmpb   $0xa,(%rdi,%rax,1)
je     1125 <remove_end_of_line+0x25>
cmp    $0x200,%rax
mov    %rcx,%rax
jb     1110 <remove_end_of_line+0x10>
movb   $0x0,-0x1(%rdi,%rcx,1)
ret

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

LLVM IR (-O2):
define void @remove_end_of_line(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %9, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 10
%7 = icmp ult i64 %3, 512
%8 = select i1 %6, i1 %7, i1 false
%9 = add nuw nsw i64 %3, 1
br i1 %8, label %2, label %10
10: ; preds = %2
%11 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 0, i8* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void cmp_reg32_m32(int reg32, unsigned int *m32) {
  put8(0x3B);
  put8((reg32 << 3) | 5);
  put32((unsigned int)(m32));
}


x86 assembly (clang, -O0):
<cmp_reg32_m32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x3b,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0x5,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_reg32_m32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
mov    $0x3b,%edi
call   1030 <put8@plt>
lea    0x5(,%rbx,8),%edi
call   1030 <put8@plt>
mov    %r14d,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @cmp_reg32_m32(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = call i32 @put8(i32 59)
%6 = load i32, i32* %3
%7 = shl i32 %6, 3
%8 = or i32 %7, 5
%9 = call i32 @put8(i32 %8)
%10 = load i32*, i32** %4
%11 = ptrtoint i32* %10 to i32
%12 = call i32 @put32(i32 %11)
ret void
}

LLVM IR (-O2):
define void @cmp_reg32_m32(i32 %0, i32* %1) {
%3 = tail call i32 @put8(i32 59)
%4 = shl i32 %0, 3
%5 = or i32 %4, 5
%6 = tail call i32 @put8(i32 %5)
%7 = ptrtoint i32* %1 to i64
%8 = trunc i64 %7 to i32
%9 = tail call i32 @put32(i32 %8)
ret void
}
void fault_undefined(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @fault_undefined() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printString(char *, int);
int /*<<< orphan*/ printf(char *, int, int);
void invalidCharFound(char str[], int length, int invChar, int lineNumber) {
  printf("Line %d is invalid. Unexpected char received: '%c'.\n", lineNumber,
         invChar);
  printString(str, length);
}


x86 assembly (clang, -O0):
<invalidCharFound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <printString@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalidCharFound>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
mov    %ecx,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printString@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"Line %d is invalid. Unexpected char received: '%c'.\0A\00"
define void @invalidCharFound(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = load i32, i32* %7
%11 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = call i32 @printString(i8* %12, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"Line %d is invalid. Unexpected char received: '%c'.\0A\00"
define void @invalidCharFound(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %2)
%6 = tail call i32 @printString(i8* %0, i32 %1)
ret void
}
void gdk_keyval_is_lower() {}


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

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

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

LLVM IR (-O2):
define void @gdk_keyval_is_lower() {
ret void
}
/* Variables and functions */
double sinf(float);
float _redistribVal(float p) {
  float s = sinf(p * 3.14159f / 2.f);
  float t = 0.02 + (0.66 * s + 0.3 * sinf(s * 3.14159f / 2.f));
  return t;
}


x86 assembly (clang, -O0):
<_redistribVal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xef7(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xee6(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <sinf@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movss  0xec2(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  0xeb1(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <sinf@plt>
movsd  -0x18(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  0xe90(%rip),%xmm0
mulsd  %xmm2,%xmm0
movsd  0xe7c(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe64(%rip),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_redistribVal>:
push   %rax
mulss  0xee7(%rip),%xmm0
mulss  0xee3(%rip),%xmm0
call   1030 <sinf@plt>
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  %xmm1,(%rsp)
mulss  0xec5(%rip),%xmm0
mulss  0xec1(%rip),%xmm0
call   1030 <sinf@plt>
mulsd  0xeb8(%rip),%xmm0
movsd  (%rsp),%xmm1
mulsd  0xeb3(%rip),%xmm1
addsd  %xmm0,%xmm1
addsd  0xeaf(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @_redistribVal(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
%5 = load float, float* %2
%6 = fmul float %5, 0x400921FA00000000
%7 = fdiv float %6, 2.000000e+00
%8 = call double @sinf(float %7)
%9 = fptrunc double %8 to float
store float %9, float* %3
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = load float, float* %3
%13 = fmul float %12, 0x400921FA00000000
%14 = fdiv float %13, 2.000000e+00
%15 = call double @sinf(float %14)
%16 = fmul double 3.000000e-01, %15
%17 = call double @llvm.fmuladd.f64(double 6.600000e-01, double %11, double %16)
%18 = fadd double 2.000000e-02, %17
%19 = fptrunc double %18 to float
store float %19, float* %4
%20 = load float, float* %4
ret float %20
}

LLVM IR (-O2):
define float @_redistribVal(float %0) {
%2 = fmul float %0, 0x400921FA00000000
%3 = fmul float %2, 5.000000e-01
%4 = tail call double @sinf(float %3)
%5 = fptrunc double %4 to float
%6 = fpext float %5 to double
%7 = fmul float %5, 0x400921FA00000000
%8 = fmul float %7, 5.000000e-01
%9 = tail call double @sinf(float %8)
%10 = fmul double %9, 3.000000e-01
%11 = tail call double @llvm.fmuladd.f64(double %6, double 6.600000e-01, double %10)
%12 = fadd double %11, 2.000000e-02
%13 = fptrunc double %12 to float
ret float %13
}
/* Variables and functions */
int /*<<< orphan*/ irsens_get_location_fixed();
int /*<<< orphan*/ steering_set_direction(int /*<<< orphan*/);
void controller_steering_update_fixed() {
  steering_set_direction(irsens_get_location_fixed());
}


x86 assembly (clang, -O0):
<controller_steering_update_fixed>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <irsens_get_location_fixed@plt>
mov    %eax,%edi
call   1040 <steering_set_direction@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<controller_steering_update_fixed>:
push   %rax
xor    %eax,%eax
call   1030 <irsens_get_location_fixed@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <steering_set_direction@plt>

LLVM IR (-O0):
define void @controller_steering_update_fixed() {
%1 = call i32 (...) @irsens_get_location_fixed()
%2 = call i32 @steering_set_direction(i32 %1)
ret void
}

LLVM IR (-O2):
define void @controller_steering_update_fixed() {
%1 = tail call i32 (...) @irsens_get_location_fixed()
%2 = tail call i32 @steering_set_direction(i32 %1)
ret void
}
void XSharpDrawStringSet(void *dpy, unsigned long drawable, void *gc,
                         void *fontSet, int x, int y, const char *str,
                         int style) {}


x86 assembly (clang, -O0):
<XSharpDrawStringSet>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @XSharpDrawStringSet(i8* %0, i64 %1, i8* %2, i8* %3, i32 %4, i32 %5, i8* %6, i32 %7) {
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i32
store i8* %0, i8** %9
store i64 %1, i64* %10
store i8* %2, i8** %11
store i8* %3, i8** %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i8* %6, i8** %15
store i32 %7, i32* %16
ret void
}

LLVM IR (-O2):
define void @XSharpDrawStringSet(i8* nocapture %0, i64 %1, i8* nocapture %2, i8* nocapture %3, i32 %4, i32 %5, i8* nocapture %6, i32 %7) {
ret void
}
unsigned xrop3_141_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T ^ S;
  stk2 = D | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_141_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_141_1_0>:
or     %edi,%esi
not    %esi
shl    $0x8,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @xrop3_141_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %6
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %5
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = xor i32 %32, -1
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = load i32, i32* %6
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = and i32 %38, %39
%41 = or i32 %37, %40
ret i32 %41
}

LLVM IR (-O2):
define i32 @xrop3_141_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = or i8 %1, %0
%5 = zext i8 %4 to i32
%6 = xor i32 %5, -1
%7 = shl nsw i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
void assign_implicit_cast_bad() {
  bool *b = (bool *)malloc(sizeof(bool));
  uint16_t i = 0;
  if (b) {
    *b = false;
    *b = !i;
    if (*b) {
      int *p = 0;
      *p = 5;
    }
    free(b);
  }
}


x86 assembly (clang, -O0):
<assign_implicit_cast_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1190 <assign_implicit_cast_bad+0x70>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     1187 <assign_implicit_cast_bad+0x67>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assign_implicit_cast_bad>:
mov    $0x4,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @assign_implicit_cast_bad() {
%1 = alloca i32*
%2 = alloca i64
%3 = alloca i32*
%4 = call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %1
store i64 0, i64* %2
%6 = load i32*, i32** %1
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %23
8: ; preds = %0
%9 = load i32*, i32** %1
store i32 0, i32* %9
%10 = load i64, i64* %2
%11 = icmp ne i64 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
%14 = load i32*, i32** %1
store i32 %13, i32* %14
%15 = load i32*, i32** %1
%16 = load i32, i32* %15
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %8
store i32* null, i32** %3
%19 = load i32*, i32** %3
store i32 5, i32* %19
br label %20
20: ; preds = %18, %8
%21 = load i32*, i32** %1
%22 = call i32 @free(i32* %21)
br label %23
23: ; preds = %20, %0
ret void
}

LLVM IR (-O2):
define void @assign_implicit_cast_bad() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
tail call void @llvm.assume(i1 %2)
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ rcomment(int);
main() {
  int c, d;
  while ((c = getchar()) != EOF)
    rcomment(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     1155 <main+0x35>
mov    -0x8(%rbp),%edi
call   1040 <rcomment@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1152 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1040 <rcomment@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @rcomment(i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 0
}
__attribute__((always_)) void check_trace_callback_type_mm_pagevec_free(
    void (*cb)(void *__data, struct page *page, int cold)) {}


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

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

LLVM IR (-O0):
%struct.page = type opaque
define void @check_trace_callback_type_mm_pagevec_free(void (i8*, %struct.page*, i32)* %0) {
%2 = alloca void (i8*, %struct.page*, i32)*
store void (i8*, %struct.page*, i32)* %0, void (i8*, %struct.page*, i32)** %2
ret void
}

LLVM IR (-O2):
%struct.page = type opaque
define void @check_trace_callback_type_mm_pagevec_free(void (i8*, %struct.page*, i32)* nocapture %0) {
ret void
}
char *fun_0(char *p) {
  *--p = 1;
  *--p = 1;
  return p;
}


x86 assembly (clang, -O0):
<fun_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x1,-0x1(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x1,-0x1(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_0>:
movw   $0x101,-0x2(%rdi)
lea    -0x2(%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @fun_0(i8* writeonly %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -1
store i8 1, i8* %2
%3 = getelementptr inbounds i8, i8* %0, i64 -2
store i8 1, i8* %3
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ ntoh64(int /*<<< orphan*/ const *);
int ptls_decode64(uint64_t *value, const uint8_t **src, const uint8_t *end) {
  if (end - *src < 8)
    return 50;
  *value = ntoh64(*src);
  *src += 8;
  return 0;
}


x86 assembly (clang, -O0):
<ptls_decode64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
cmp    $0x8,%rax
jge    114c <ptls_decode64+0x3c>
movl   $0x32,-0x4(%rbp)
jmp    1175 <ptls_decode64+0x65>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <ntoh64@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
add    $0x20,%rcx
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptls_decode64>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rsi),%rdi
sub    %rdi,%rdx
mov    $0x32,%eax
cmp    $0x20,%rdx
jl     1139 <ptls_decode64+0x29>
mov    %rsi,%rbx
call   1030 <ntoh64@plt>
mov    %eax,(%r14)
addq   $0x20,(%rbx)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @ptls_decode64(i32* %0, i32** %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32**
%7 = alloca i32*
store i32* %0, i32** %5
store i32** %1, i32*** %6
store i32* %2, i32** %7
%8 = load i32*, i32** %7
%9 = load i32**, i32*** %6
%10 = load i32*, i32** %9
%11 = ptrtoint i32* %8 to i64
%12 = ptrtoint i32* %10 to i64
%13 = sub i64 %11, %12
%14 = sdiv exact i64 %13, 4
%15 = icmp slt i64 %14, 8
br i1 %15, label %16, label %17
16: ; preds = %3
store i32 50, i32* %4
br label %25
17: ; preds = %3
%18 = load i32**, i32*** %6
%19 = load i32*, i32** %18
%20 = call i32 @ntoh64(i32* %19)
%21 = load i32*, i32** %5
store i32 %20, i32* %21
%22 = load i32**, i32*** %6
%23 = load i32*, i32** %22
%24 = getelementptr inbounds i32, i32* %23, i64 8
store i32* %24, i32** %22
store i32 0, i32* %4
br label %25
25: ; preds = %17, %16
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @ptls_decode64(i32* nocapture writeonly %0, i32** nocapture %1, i32* %2) {
%4 = load i32*, i32** %1
%5 = ptrtoint i32* %2 to i64
%6 = ptrtoint i32* %4 to i64
%7 = sub i64 %5, %6
%8 = icmp slt i64 %7, 32
br i1 %8, label %13, label %9
9: ; preds = %3
%10 = tail call i32 @ntoh64(i32* %4)
store i32 %10, i32* %0
%11 = load i32*, i32** %1
%12 = getelementptr inbounds i32, i32* %11, i64 8
store i32* %12, i32** %1
br label %13
13: ; preds = %3, %9
%14 = phi i32 [ 0, %9 ], [ 50, %3 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ dcac_mask_ops(int, int);
void dcac_set_mask(unsigned short mask) { dcac_mask_ops(46, (int)mask); }


x86 assembly (clang, -O0):
<dcac_set_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%esi
mov    $0x2e,%edi
call   1030 <dcac_mask_ops@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcac_set_mask>:
mov    %edi,%esi
mov    $0x2e,%edi
jmp    1030 <dcac_mask_ops@plt>

LLVM IR (-O0):
define void @dcac_set_mask(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = call i32 @dcac_mask_ops(i32 46, i32 %4)
ret void
}

LLVM IR (-O2):
define void @dcac_set_mask(i16 zeroext %0) {
%2 = zext i16 %0 to i32
%3 = tail call i32 @dcac_mask_ops(i32 46, i32 %2)
ret void
}
int main() {
  int x;
  void *foo;
  void **bar;
  x = 0;
  foo = (void *)&x;
  bar = &foo;
  return **(int **)bar;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%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
%3 = alloca i8*
%4 = alloca i8**
store i32 0, i32* %1
store i32 0, i32* %2
%5 = bitcast i32* %2 to i8*
store i8* %5, i8** %3
store i8** %3, i8*** %4
%6 = load i8**, i8*** %4
%7 = bitcast i8** %6 to i32**
%8 = load i32*, i32** %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ calculateArea(int const, double *);
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char **argv) {
  const int recs = 0x100000;
  double area = 0.0;
  calculateArea(recs, &area);
  printf("The value of PI is approx. %.16f.\n", area);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x100000,-0x14(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x100000,%edi
lea    -0x20(%rbp),%rsi
call   1030 <calculateArea@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rsi
mov    $0x100000,%edi
call   1030 <calculateArea@plt>
movsd  (%rsp),%xmm0
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"The value of PI is approx. %.16f.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1048576, i32* %6
store double 0.000000e+00, double* %7
%8 = call i32 @calculateArea(i32 1048576, double* %7)
%9 = load double, double* %7
%10 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"The value of PI is approx. %.16f.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
store double 0.000000e+00, double* %3
%5 = call i32 @calculateArea(i32 1048576, double* %3)
%6 = load double, double* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), double %6)
ret i32 0
}