xunge/DecIR huggingface dataset:
IR0AX1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((*p0) <= (((double *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0AX1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm1
movslq -0x20(%rbp),%rcx
mov    $0xa98ac7,%eax
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jb     1148 <IR0AX1+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <IR0AX1+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0AX1>:
movslq %esi,%rax
movsd  0xa98ac7(,%rax,8),%xmm0
xor    %eax,%eax
ucomisd (%rdx),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @IR0AX1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double*, double** %12
%15 = load double, double* %14
%16 = load i32, i32* %11
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* inttoptr (i64 11111111 to double*), i64 %17
%19 = load double, double* %18
%20 = fcmp ole double %15, %19
br i1 %20, label %21, label %22
21: ; preds = %6
store i32 1, i32* %7
br label %23
22: ; preds = %6
store i32 0, i32* %7
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
define i32 @IR0AX1(double %0, double %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture readnone %5) {
%7 = load double, double* %4
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds double, double* inttoptr (i64 11111111 to double*), i64 %8
%10 = load double, double* %9
%11 = fcmp ole double %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
void SysCtlIntClear(unsigned long ulInts) {
  (*((volatile unsigned long *)(0x400FE058))) = ulInts;
}


x86 assembly (clang, -O0):
<SysCtlIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400fe058,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlIntClear>:
mov    %rdi,0x400fe058
40
ret

LLVM IR (-O0):
define void @SysCtlIntClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1074782296 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlIntClear(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1074782296 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
void osd_clone_task_stop(void) {
  printk("-- osd_clone depends on GE2D module!\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"-- osd_clone depends on GE2D module!\0A\00"
define void @osd_clone_task_stop() {
%1 = call i32 @printk(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"-- osd_clone depends on GE2D module!\0A\00"
define void @osd_clone_task_stop() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_indents(int indent) {
  for (int i = 0; i < indent; i++) {
    printf("  ");
  }
}


x86 assembly (clang, -O0):
<print_indents>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <print_indents+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <print_indents+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_indents>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <print_indents+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <print_indents+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c" \00"
define void @print_indents(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
define void @print_indents(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
void dummy_text(int x __attribute__((unused)), int y __attribute__((unused)),
                const char *s __attribute__((unused)),
                int n __attribute__((unused)), int fg __attribute__((unused)),
                int bg __attribute__((unused)),
                struct bogl_font *font __attribute__((unused))) {}


x86 assembly (clang, -O0):
<dummy_text>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.bogl_font = type opaque
define void @dummy_text(i32 %0, i32 %1, i8* %2, i32 %3, i32 %4, i32 %5, %struct.bogl_font* %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca %struct.bogl_font*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i8* %2, i8** %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store %struct.bogl_font* %6, %struct.bogl_font** %14
ret void
}

LLVM IR (-O2):
%struct.bogl_font = type opaque
define void @dummy_text(i32 %0, i32 %1, i8* nocapture %2, i32 %3, i32 %4, i32 %5, %struct.bogl_font* nocapture %6) {
ret void
}
int k_hasafs(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @k_hasafs() {
ret i32 0
}
/* Variables and functions */
scalar_t__ randrange(double, double);
int randrange_int(int start, int end) {
  return (int)randrange((double)start, (double)end);
}


x86 assembly (clang, -O0):
<randrange_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
call   1030 <randrange@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randrange_int>:
cvtsi2sd %edi,%xmm0
cvtsi2sd %esi,%xmm1
jmp    1030 <randrange@plt>

LLVM IR (-O0):
define i32 @randrange_int(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 = sitofp i32 %5 to double
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = call i64 @randrange(double %6, double %8)
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @randrange_int(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = sitofp i32 %1 to double
%5 = tail call i64 @randrange(double %3, double %4)
%6 = trunc i64 %5 to i32
ret i32 %6
}
int isxdigit(int c) {
  return ((c >= 0x30 && c <= 0x39) || (c >= 0x41 && c <= 0x46) ||
          (c >= 0x61 && c <= 0x66))
             ? 1
             : 0;
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x30,-0x4(%rbp)
jl     1120 <isxdigit+0x20>
mov    $0x1,%al
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isxdigit+0x58>
cmpl   $0x41,-0x4(%rbp)
jl     1139 <isxdigit+0x39>
mov    $0x1,%al
cmpl   $0x46,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isxdigit+0x58>
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <isxdigit+0x52>
cmpl   $0x66,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x6,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 70
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 97
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 102
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i64
%25 = select i1 %23, i32 1, i32 0
ret i32 %25
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ simplify_fraction(int *, int *);
int rounded_int_division(int n, int d) {
  simplify_fraction(&n, &d);
  return (n / d + (2 * (n % d) > d));
}


x86 assembly (clang, -O0):
<rounded_int_division>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <simplify_fraction@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%edx
cmp    -0x8(%rbp),%edx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rounded_int_division>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <simplify_fraction@plt>
mov    0x4(%rsp),%eax
mov    (%rsp),%ecx
cltd
idiv   %ecx
add    %edx,%edx
xor    %esi,%esi
cmp    %ecx,%edx
setg   %sil
add    %esi,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rounded_int_division(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @simplify_fraction(i32* %3, i32* %4)
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sdiv i32 %6, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = srem i32 %9, %10
%12 = mul nsw i32 2, %11
%13 = load i32, i32* %4
%14 = icmp sgt i32 %12, %13
%15 = zext i1 %14 to i32
%16 = add nsw i32 %8, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @rounded_int_division(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @simplify_fraction(i32* %3, i32* %4)
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sdiv i32 %6, %7
%9 = srem i32 %6, %7
%10 = shl nsw i32 %9, 1
%11 = icmp sgt i32 %10, %7
%12 = zext i1 %11 to i32
%13 = add nsw i32 %8, %12
ret i32 %13
}
int fun1174() { return 1174; }


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

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

LLVM IR (-O0):
define i32 @fun1174() {
ret i32 1174
}

LLVM IR (-O2):
define i32 @fun1174() {
ret i32 1174
}
int test_imm_5Eint8_reg(signed char val) {
  return ((val) & (0x5E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Eint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x5e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_5Eint8_reg(i8 signext %0) {
%2 = and i8 %0, 94
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *get_utc_date(int /*<<< orphan*/);
int /*<<< orphan*/ timestamp_to_utc_time(char const *);
char *timestamp_get_utc_date(const char *ts) {
  time_t time;
  if ((time = timestamp_to_utc_time(ts)) < 0) {
    return NULL;
  }
  return get_utc_date(time);
}


x86 assembly (clang, -O0):
<timestamp_get_utc_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <timestamp_to_utc_time@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    114e <timestamp_get_utc_date+0x2e>
movq   $0x0,-0x8(%rbp)
jmp    115a <timestamp_get_utc_date+0x3a>
mov    -0x14(%rbp),%edi
call   1040 <get_utc_date@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timestamp_get_utc_date>:
push   %rax
call   1030 <timestamp_to_utc_time@plt>
test   %eax,%eax
js     1132 <timestamp_get_utc_date+0x12>
mov    %eax,%edi
pop    %rax
jmp    1040 <get_utc_date@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @timestamp_get_utc_date(i8* %0) {
%2 = tail call i32 @timestamp_to_utc_time(i8* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i8* @get_utc_date(i32 %2)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ null, %1 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ loop();
int /*<<< orphan*/ setup();
int main() {
  setup();
  while (1) {
    loop();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <setup@plt>
mov    $0x0,%al
call   1030 <loop@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <setup@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <loop@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @setup()
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @loop()
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setup()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @loop()
br label %2
}
void g_queue_push_head() {}


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

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

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

LLVM IR (-O2):
define void @g_queue_push_head() {
ret void
}
void c(int w) { int z = w; }


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

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

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

LLVM IR (-O2):
define void @c(i32 %0) {
ret void
}
void qqsocket_init() {}


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

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

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

LLVM IR (-O2):
define void @qqsocket_init() {
ret void
}
XRemoveFromSaveSet() {}


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

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

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

LLVM IR (-O2):
define i32 @XRemoveFromSaveSet() {
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int main() {
  double d, f = 3.1415;
  uint32_t a = 7, b = 3, c, r;
  c = a / b;
  r = a % b;
  d = f * 2.0;
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movsd  0xef5(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x7,-0x1c(%rbp)
movl   $0x3,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cltd
idivl  -0x20(%rbp)
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
cltd
idivl  -0x20(%rbp)
mov    %edx,-0x28(%rbp)
movsd  0xebe(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store double 3.141500e+00, double* %3
store i32 7, i32* %4
store i32 3, i32* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = sdiv i32 %8, %9
store i32 %10, i32* %6
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = srem i32 %11, %12
store i32 %13, i32* %7
%14 = load double, double* %3
%15 = fmul double %14, 2.000000e+00
store double %15, double* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
bool nrf52_errata_44(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_44() {
ret i32 0
}
int areaOfRectangle(int length, int width) { return (length * width); }


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

x86 assembly (clang, -O2):
<areaOfRectangle>:
mov    %edi,%eax
imul   %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @areaOfRectangle(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int test_if5(void) {
  if (1)
    return 'e';
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @test_if5() {
ret i32 101
}

LLVM IR (-O2):
define i32 @test_if5() {
ret i32 101
}
void test(int *a, int *b, int *__restrict__ v) {
  *a = *v;
  *b = *v;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    (%rdx),%eax
mov    %eax,(%rdi)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @test(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* noalias nocapture %2) {
%4 = load i32, i32* %2
store i32 %4, i32* %0
store i32 %4, i32* %1
ret void
}
int poweroff(void) {
  asm("movl $0x80000b80, %eax\n"
      "movw $0xcf8, %dx\n"
      "outl  %eax, %dx\n"
      "movw $0xcfc, %dx\n"
      "inb  %dx, %al\n"
      "orb  $1, %al\n"
      "outb  %al, %dx\n"
      "\n"
      "movl $0x80000b40, %eax\n"
      "movw $0xcf8, %dx\n"
      "outl  %eax, %dx\n"
      "movl $0x7001, %eax\n"
      "movw $0xcfc, %dx\n"
      "outl  %eax, %dx\n"
      "movw $0x2000, %ax\n"
      "movw $0x7004, %dx\n"
      "outw  %ax, %dx\n");
  return 0;
}


x86 assembly (clang, -O0):
<poweroff>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80000b80,%eax
mov    $0xcf8,%dx
out    %eax,(%dx)
mov    $0xcfc,%dx
in     (%dx),%al
or     $0x1,%al
out    %al,(%dx)
mov    $0x80000b40,%eax
mov    $0xcf8,%dx
out    %eax,(%dx)
mov    $0x7001,%eax
mov    $0xcfc,%dx
out    %eax,(%dx)
mov    $0x2000,%ax
mov    $0x7004,%dx
out    %ax,(%dx)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<poweroff>:
mov    $0x80000b80,%eax
mov    $0xcf8,%dx
out    %eax,(%dx)
mov    $0xcfc,%dx
in     (%dx),%al
or     $0x1,%al
out    %al,(%dx)
mov    $0x80000b40,%eax
mov    $0xcf8,%dx
out    %eax,(%dx)
mov    $0x7001,%eax
mov    $0xcfc,%dx
out    %eax,(%dx)
mov    $0x2000,%ax
mov    $0x7004,%dx
out    %ax,(%dx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @poweroff() {
tail call void asm sideeffect "movl $$0x80000b80, %eax\0Amovw $$0xcf8, %dx\0Aoutl %eax, %dx\0Amovw $$0xcfc, %dx\0Ainb %dx, %al\0Aorb $$1, %al\0Aoutb %al, %dx\0A\0Amovl $$0x80000b40, %eax\0Amovw $$0xcf8, %dx\0Aoutl %eax, %dx\0Amovl $$0x7001, %eax\0Amovw $$0xcfc, %dx\0Aoutl %eax, %dx\0Amovw $$0x2000, %ax\0Amovw $$0x7004, %dx\0Aoutw %ax, %dx\0A", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
int test_imm_95uint32_reg(unsigned int val) {
  return ((val) & (0x95 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_95uint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 149
%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_95uint32_reg(i32 %0) {
%2 = and i32 %0, 149
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int /*<<< orphan*/ SSL_shutdown;
int zopenssl_timed_do(int /*<<< orphan*/ *, int /*<<< orphan*/,
                      int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int /*<<< orphan*/, long);
int zopenssl_shutdown(SSL *ssl, long timeout) {
  return zopenssl_timed_do(ssl, SSL_shutdown, 0, 0, 0, 0, timeout);
}


x86 assembly (clang, -O0):
<zopenssl_shutdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
mov    %rax,(%rsp)
call   1030 <zopenssl_timed_do@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zopenssl_shutdown>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%eax
mov    %rsi,(%rsp)
mov    %eax,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <zopenssl_timed_do@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SSL_shutdown = global i32 0
define i32 @zopenssl_shutdown(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* @SSL_shutdown
%7 = load i64, i64* %4
%8 = call i32 @zopenssl_timed_do(i32* %5, i32 %6, i32 0, i32 0, i32 0, i32 0, i64 %7)
ret i32 %8
}

LLVM IR (-O2):
@SSL_shutdown = global i32 0
define i32 @zopenssl_shutdown(i32* %0, i64 %1) {
%3 = load i32, i32* @SSL_shutdown
%4 = tail call i32 @zopenssl_timed_do(i32* %0, i32 %3, i32 0, i32 0, i32 0, i32 0, i64 %1)
ret i32 %4
}
/* Variables and functions */
int expression();
int /*<<< orphan*/ getNext();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  getNext();
  printf("%d\n", expression());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <getNext@plt>
xor    %eax,%eax
call   1040 <expression@plt>
lea    0xeba(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getNext()
%2 = tail call i32 (...) @expression()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ color_scheme_fenable(char const *, char const *,
                                        int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void color_scheme_enable(const char *name, const char *dflt) {
  color_scheme_fenable(name, dflt, stdout);
}


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

x86 assembly (clang, -O2):
<color_scheme_enable>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
jmp    1030 <color_scheme_fenable@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @color_scheme_enable(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 = load i8*, i8** %4
%7 = load i32, i32* @stdout
%8 = call i32 @color_scheme_fenable(i8* %5, i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @color_scheme_enable(i8* %0, i8* %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @color_scheme_fenable(i8* %0, i8* %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  float floatingcomma = 69.6969;
  printf("4islo = %2.4f\n", floatingcomma);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"4islo = %2.4f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 0x40516C9A00000000, float* %2
%3 = load float, float* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), float %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"4islo = %2.4f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), float 0x40516C9A00000000)
ret i32 0
}
/* Type definitions */
struct array_s {
  int dummy;
};

/* Variables and functions */
int array___reserve_with_ratio(struct array_s *, unsigned long, float, int);
int array_reserve_with_ratio_and_clean(struct array_s *a, unsigned long count,
                                       float ratio) {
  return array___reserve_with_ratio(a, count, ratio, 1);
}


x86 assembly (clang, -O0):
<array_reserve_with_ratio_and_clean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movss  -0x14(%rbp),%xmm0
mov    $0x1,%edx
call   1030 <array___reserve_with_ratio@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_reserve_with_ratio_and_clean>:
mov    $0x1,%edx
jmp    1030 <array___reserve_with_ratio@plt>

LLVM IR (-O0):
%struct.array_s = type { i32 }
define i32 @array_reserve_with_ratio_and_clean(%struct.array_s* %0, i64 %1, float %2) {
%4 = alloca %struct.array_s*
%5 = alloca i64
%6 = alloca float
store %struct.array_s* %0, %struct.array_s** %4
store i64 %1, i64* %5
store float %2, float* %6
%7 = load %struct.array_s*, %struct.array_s** %4
%8 = load i64, i64* %5
%9 = load float, float* %6
%10 = call i32 @array___reserve_with_ratio(%struct.array_s* %7, i64 %8, float %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.array_s = type { i32 }
define i32 @array_reserve_with_ratio_and_clean(%struct.array_s* %0, i64 %1, float %2) {
%4 = tail call i32 @array___reserve_with_ratio(%struct.array_s* %0, i64 %1, float %2, i32 1)
ret i32 %4
}
int op_gt(int a, int b) { return a > b; }


x86 assembly (clang, -O0):
<op_gt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_gt>:
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @op_gt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @op_gt(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRF2_set(void) { return U_WMRCORENONE_set("U_WMRF2"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRF2\00"
define i8* @U_WMRF2_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRF2\00"
define i8* @U_WMRF2_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
int test_imm_A9int32_mem(int *val) {
  return ((*val) & (0xA9 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A9int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 169
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *program_name) {
  printf("Usage: %s [-d] [filename ..]\n  -d print component per line (default "
         "is segment\n",
         program_name);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [80 x i8] c"Usage: %s [-d] [filename ..]\0A -d print component per line (default is segment\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [80 x i8] c"Usage: %s [-d] [filename ..]\0A -d print component per line (default is segment\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void thread_signal_handler(int sig) {
  do {
    if (0)
      printf("%s: "
             "Signal %d received\n",
             __FUNCTION__, sig);
  } while (0);
}


x86 assembly (clang, -O0):
<thread_signal_handler>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    110c <thread_signal_handler+0xc>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @thread_signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @thread_signal_handler(i32 %0) {
ret void
}
long double ReturnLongDoubleFromDouble(double d) { return d; }


x86 assembly (clang, -O0):
<ReturnLongDoubleFromDouble>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
fldl   -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReturnLongDoubleFromDouble>:
movsd  %xmm0,-0x8(%rsp)
fldl   -0x8(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @ReturnLongDoubleFromDouble(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fpext double %3 to x86_fp80
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @ReturnLongDoubleFromDouble(double %0) {
%2 = fpext double %0 to x86_fp80
ret x86_fp80 %2
}
int timestwo(const int x) { return x * 2; }


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

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

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

LLVM IR (-O2):
define i32 @timestwo(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ print_list();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("\n---- Running test0 ---\n");
  int i = 2;
  int j = 3;
  int k = i + j;
  print_list();
  exit(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)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
movl   $0x2,-0x14(%rbp)
movl   $0x3,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <print_list@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <print_list@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"\0A---- Running test0 ---\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 2, i32* %6
store i32 3, i32* %7
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = add nsw i32 %10, %11
store i32 %12, i32* %8
%13 = call i32 (...) @print_list()
%14 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [24 x i8] c"\0A---- Running test0 ---\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @print_list()
%5 = tail call i32 @exit(i32 0)
unreachable
}
void RandomFunc(unsigned char input[1], unsigned char output[1]) {
  unsigned char state[1];
  unsigned char local1;
  {
    state[0UL] = (input[0UL] + 914778474UL) - (unsigned char)183;
    local1 = 0UL;
    while (local1 < (unsigned char)0) {
      state[0UL] += state[0UL];
      local1++;
    }
    output[0UL] = state[0UL] - 554263832UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
add    $0x3686696a,%rax
sub    $0xb7,%rax
mov    %al,-0x11(%rbp)
movb   $0x0,-0x12(%rbp)
movzbl -0x12(%rbp),%eax
cmp    $0x0,%eax
jge    114d <RandomFunc+0x4d>
movzbl -0x11(%rbp),%ecx
movzbl -0x11(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x11(%rbp)
mov    -0x12(%rbp),%al
add    $0x1,%al
mov    %al,-0x12(%rbp)
jmp    1126 <RandomFunc+0x26>
movzbl -0x11(%rbp),%eax
sub    $0x21096518,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%al
add    $0x9b,%al
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1 x i8]
%6 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i64
%11 = add i64 %10, 914778474
%12 = sub i64 %11, 183
%13 = trunc i64 %12 to i8
%14 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %13, i8* %14
store i8 0, i8* %6
br label %15
15: ; preds = %19, %2
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %30
19: ; preds = %15
%20 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = add nsw i32 %25, %22
%27 = trunc i32 %26 to i8
store i8 %27, i8* %23
%28 = load i8, i8* %6
%29 = add i8 %28, 1
store i8 %29, i8* %6
br label %15
30: ; preds = %15
%31 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%32 = load i8, i8* %31
%33 = zext i8 %32 to i64
%34 = sub i64 %33, 554263832
%35 = trunc i64 %34 to i8
%36 = load i8*, i8** %4
%37 = getelementptr inbounds i8, i8* %36, i64 0
store i8 %35, i8* %37
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, -101
store i8 %4, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("usage : ipconfig interface \n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"usage : ipconfig interface \0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [28 x i8] c"usage : ipconfig interface \00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
int fn(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @fn() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @fn() {
ret i32 -1
}
extern int gui_ksys_get_screen_mouse_coordinates(void) {
  int value;
  __asm__ __volatile__("int $0x40" : "=a"(value) : "a"(37), "b"(0));
  return (value);
}


x86 assembly (clang, -O0):
<gui_ksys_get_screen_mouse_coordinates>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x25,%eax
xor    %ebx,%ebx
int    $0x40
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_ksys_get_screen_mouse_coordinates>:
push   %rbx
mov    $0x25,%eax
xor    %ebx,%ebx
int    $0x40
pop    %rbx
ret

LLVM IR (-O0):
define i32 @gui_ksys_get_screen_mouse_coordinates() {
%1 = alloca i32
%2 = call i32 asm sideeffect "int $$0x40", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 37, i32 0)
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gui_ksys_get_screen_mouse_coordinates() {
%1 = tail call i32 asm sideeffect "int $$0x40", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 37, i32 0)
ret i32 %1
}
/* Type definitions */
struct view_log {
  int dummy;
};
struct view {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct view_log *);
void view_log_free(struct view *v) { free((struct view_log *)v); }


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

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

LLVM IR (-O0):
%struct.view = type { i32 }
%struct.view_log = type { i32 }
define void @view_log_free(%struct.view* %0) {
%2 = alloca %struct.view*
store %struct.view* %0, %struct.view** %2
%3 = load %struct.view*, %struct.view** %2
%4 = bitcast %struct.view* %3 to %struct.view_log*
%5 = call i32 @free(%struct.view_log* %4)
ret void
}

LLVM IR (-O2):
%struct.view = type { i32 }
%struct.view_log = type { i32 }
define void @view_log_free(%struct.view* nocapture %0) {
%2 = bitcast %struct.view* %0 to %struct.view_log*
%3 = tail call i32 @free(%struct.view_log* %2)
ret void
}
void main() {
  _Bool c = nondet_bool();
  if (c) {
    f(1);
  } else {
    f(2);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <nondet_bool@plt>
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
mov    %al,-0x1(%rbp)
testb  $0x1,-0x1(%rbp)
je     1155 <main+0x35>
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <f@plt>
jmp    1161 <main+0x41>
mov    $0x2,%edi
mov    $0x0,%al
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @nondet_bool()
%2 = icmp eq i32 %1, 0
%3 = select i1 %2, i32 2, i32 1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @f to i32 (i32, ...)*)(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
__attribute__((always_)) void tu_move_down(int delta_y) {
  printf("\x1b[%dB", delta_y);
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dB\00"
define void @tu_move_down(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t dfilt_single_pole_u16(uint16_t input, uint16_t prev_output,
                               uint16_t alpha) {
  uint16_t output;
  uint32_t beta = ((1 << 15) - alpha);
  uint16_t y1 = (beta * (uint32_t)prev_output) >> 15;
  uint16_t u1 = ((uint32_t)alpha * (uint32_t)input) >> 15;
  output = y1 + u1;
  return output;
}


x86 assembly (clang, -O0):
<dfilt_single_pole_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x8000,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x8(%rbp),%eax
sar    $0xf,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x4(%rbp),%eax
sar    $0xf,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dfilt_single_pole_u16>:
mov    $0x8000,%eax
sub    %edx,%eax
imul   %esi,%eax
sar    $0xf,%eax
imul   %edx,%edi
sar    $0xf,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @dfilt_single_pole_u16(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%11 = load i32, i32* %6
%12 = sub nsw i32 32768, %11
store i32 %12, i32* %8
%13 = load i32, i32* %8
%14 = load i32, i32* %5
%15 = mul nsw i32 %13, %14
%16 = ashr i32 %15, 15
store i32 %16, i32* %9
%17 = load i32, i32* %6
%18 = load i32, i32* %4
%19 = mul nsw i32 %17, %18
%20 = ashr i32 %19, 15
store i32 %20, i32* %10
%21 = load i32, i32* %9
%22 = load i32, i32* %10
%23 = add nsw i32 %21, %22
store i32 %23, i32* %7
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
define i32 @dfilt_single_pole_u16(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 32768, %2
%5 = mul nsw i32 %4, %1
%6 = ashr i32 %5, 15
%7 = mul nsw i32 %2, %0
%8 = ashr i32 %7, 15
%9 = add nsw i32 %6, %8
ret i32 %9
}