xunge/DecIR huggingface dataset:
void b(short *p) {
  p = (short *)__builtin_assume_aligned(p, 64);
  short *q = p + 256;
  for (; p < q; ++p, --q) {
    short t = *p;
    *p = *q;
    *q = t;
  }
}


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x200,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    116d <b+0x6d>
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x12(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
mov    -0x12(%rbp),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffffe,%rax
mov    %rax,-0x10(%rbp)
jmp    111e <b+0x1e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<b>:
lea    0x1fe(%rdi),%rax
nopw   0x0(%rax,%rax,1)
movzwl (%rdi),%ecx
movzwl 0x2(%rax),%edx
mov    %dx,(%rdi)
mov    %cx,0x2(%rax)
add    $0x2,%rdi
lea    -0x2(%rax),%rcx
cmp    %rax,%rdi
mov    %rcx,%rax
jb     1110 <b+0x10>
ret

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

LLVM IR (-O2):
define void @b(i16* %0) {
%2 = bitcast i16* %0 to i8*
%3 = getelementptr inbounds i16, i16* %0, i64 256
br label %4
4: ; preds = %1, %4
%5 = phi i16* [ %0, %1 ], [ %9, %4 ]
%6 = phi i16* [ %3, %1 ], [ %10, %4 ]
%7 = load i16, i16* %5
%8 = load i16, i16* %6
store i16 %8, i16* %5
store i16 %7, i16* %6
%9 = getelementptr inbounds i16, i16* %5, i64 1
%10 = getelementptr inbounds i16, i16* %6, i64 -1
%11 = icmp ult i16* %9, %10
br i1 %11, label %4, label %12
12: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
void funArea(void) {
  float a, r;
  printf("enter r ");
  scanf("%f", &r);
  a = 3.14 * r * r;
  printf("area = %f", a);
}


x86 assembly (clang, -O0):
<funArea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea9(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe90(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funArea>:
push   %rax
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeae(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"enter r \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [10 x i8] c"area = %f\00"
define void @funArea() {
%1 = alloca float
%2 = alloca float
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = fmul double 3.140000e+00, %6
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = fmul double %7, %9
%11 = fptrunc double %10 to float
store float %11, float* %1
%12 = load float, float* %1
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %13)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"enter r \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [10 x i8] c"area = %f\00"
define void @funArea() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = fmul double %6, 3.140000e+00
%8 = fmul double %7, %6
%9 = fptrunc double %8 to float
%10 = fpext float %9 to double
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %10)
ret void
}
/* Variables and functions */
int syscall(int, char *, char *, char);
int caesardec(char *src, char *dest, char key) {
  return syscall(315, src, dest, key);
}


x86 assembly (clang, -O0):
<caesardec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x13b,%edi
movsbl -0x11(%rbp),%ecx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<caesardec>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x13b,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @caesardec(i8* %0, i8* %1, i8 signext %2) {
%4 = tail call i32 @syscall(i32 315, i8* %0, i8* %1, i8 signext %2)
ret i32 %4
}
void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, int priority) {}


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

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

LLVM IR (-O0):
%struct.mem_cgroup = type opaque
define void @mem_cgroup_record_reclaim_priority(%struct.mem_cgroup* %0, i32 %1) {
%3 = alloca %struct.mem_cgroup*
%4 = alloca i32
store %struct.mem_cgroup* %0, %struct.mem_cgroup** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.mem_cgroup = type opaque
define void @mem_cgroup_record_reclaim_priority(%struct.mem_cgroup* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
double fabs(double);
double module_libc_fabs(double x) { return fabs(x); }


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

x86 assembly (clang, -O2):
<module_libc_fabs>:
andps  0xef9(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @module_libc_fabs(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
ret double %2
}
int test_imm_31uint16_reg(unsigned short val) {
  return ((val) & (-0x31 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_31uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffcf,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_31uint16_reg>:
test   $0xffcf,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_31uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -49
%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_31uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -49
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr, "Usage: mkdir"
                        " [<path> ...\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 = [27 x i8] c"Usage: mkdir [<path> ...\0A]\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Usage: mkdir [<path> ...\0A]\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_26int8_mem(signed char *val) {
  return ((*val) & (-0x26 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_26int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -38
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void Init_ext() {}


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

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

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

LLVM IR (-O2):
define void @Init_ext() {
ret void
}
void TimerOC2NPolarityConfigure(unsigned long ulBase,
                                unsigned long ulPolarity) {
  unsigned long ulTempccer = 0;

  ;

  ;
  ulTempccer = (*((volatile unsigned long *)(ulBase + 0x00000020)));
  ulTempccer &= ~0x00000080;
  ulTempccer |= (ulPolarity << 4);
  (*((volatile unsigned long *)(ulBase + 0x00000020))) = ulTempccer;
}


x86 assembly (clang, -O0):
<TimerOC2NPolarityConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0xffffffffffffff7f,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x4,%rax
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerOC2NPolarityConfigure>:
mov    $0xffffffffffffff7f,%rax
and    0x20(%rdi),%rax
shl    $0x4,%rsi
or     %rax,%rsi
mov    %rsi,0x20(%rdi)
ret

LLVM IR (-O0):
define void @TimerOC2NPolarityConfigure(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
store i64 0, i64* %5
%6 = load i64, i64* %3
%7 = add i64 %6, 32
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = and i64 %10, -129
store i64 %11, i64* %5
%12 = load i64, i64* %4
%13 = shl i64 %12, 4
%14 = load i64, i64* %5
%15 = or i64 %14, %13
store i64 %15, i64* %5
%16 = load i64, i64* %5
%17 = load i64, i64* %3
%18 = add i64 %17, 32
%19 = inttoptr i64 %18 to i64*
store volatile i64 %16, i64* %19
ret void
}

LLVM IR (-O2):
define void @TimerOC2NPolarityConfigure(i64 %0, i64 %1) {
%3 = add i64 %0, 32
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, -129
%7 = shl i64 %1, 4
%8 = or i64 %6, %7
store volatile i64 %8, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CompileString(int);
void DoSQuote(void) { CompileString(92); }


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

x86 assembly (clang, -O2):
<DoSQuote>:
mov    $0x5c,%edi
jmp    1030 <CompileString@plt>

LLVM IR (-O0):
define void @DoSQuote() {
%1 = call i32 @CompileString(i32 92)
ret void
}

LLVM IR (-O2):
define void @DoSQuote() {
%1 = tail call i32 @CompileString(i32 92)
ret void
}
/* Variables and functions */
int isspace(int c) {
  return (c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r' ||
          c == ' ');
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xb,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
cmpl   $0x20,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
lea    -0x9(%rdi),%eax
cmp    $0x5,%eax
setb   %al
cmp    $0x20,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = add i32 %0, -9
%3 = icmp ult i32 %2, 5
%4 = icmp eq i32 %0, 32
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
int get_raw_varint32_len(int value) {
  int index = 0;
  while (1) {
    if ((value & ~0x7F) == 0) {
      index++;
      return index;
    } else {
      index++;
      value >>= 7;
    }
  }
  return index;
}


x86 assembly (clang, -O0):
<get_raw_varint32_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff80,%eax
cmp    $0x0,%eax
jne    112b <get_raw_varint32_len+0x2b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x7,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <get_raw_varint32_len+0xe>

x86 assembly (clang, -O2):
<get_raw_varint32_len>:
mov    $0x1,%eax
cmp    $0x80,%edi
jb     1130 <get_raw_varint32_len+0x30>
mov    $0x1,%eax
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
sar    $0x7,%ecx
add    $0x1,%eax
cmp    $0x4000,%edi
mov    %ecx,%edi
jae    1120 <get_raw_varint32_len+0x20>
ret

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

LLVM IR (-O2):
define i32 @get_raw_varint32_len(i32 %0) {
%2 = icmp ult i32 %0, 128
br i1 %2, label %3, label %5
3: ; preds = %5, %1
%4 = phi i32 [ 1, %1 ], [ %9, %5 ]
ret i32 %4
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ 1, %1 ]
%7 = phi i32 [ %8, %5 ], [ %0, %1 ]
%8 = ashr i32 %7, 7
%9 = add i32 %6, 1
%10 = icmp ult i32 %7, 16384
br i1 %10, label %3, label %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int btor_is_power_of_2_util(int x) {
  assert(x > 0);
  return (x & (x - 1)) == 0;
}


x86 assembly (clang, -O0):
<btor_is_power_of_2_util>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btor_is_power_of_2_util>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
test   %ebx,%ebx
setg   %dil
call   1030 <assert@plt>
lea    -0x1(%rbx),%ecx
xor    %eax,%eax
test   %ecx,%ebx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @btor_is_power_of_2_util(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 1
%10 = and i32 %7, %9
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @btor_is_power_of_2_util(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @llvm.ctpop.i32(i32 %0)
%6 = icmp ult i32 %5, 2
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ prefix_cb();
void opcode_cb() { prefix_cb(); }


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

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

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

LLVM IR (-O2):
define void @opcode_cb() {
%1 = tail call i32 (...) @prefix_cb()
ret void
}
extern double muld(double a, float b) { return a * b; }


x86 assembly (clang, -O0):
<muld>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<muld>:
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @muld(double %0, float %1) {
%3 = alloca double
%4 = alloca float
store double %0, double* %3
store float %1, float* %4
%5 = load double, double* %3
%6 = load float, float* %4
%7 = fpext float %6 to double
%8 = fmul double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @muld(double %0, float %1) {
%3 = fpext float %1 to double
%4 = fmul double %3, %0
ret double %4
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_sapxsum(int, float, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_sapxsum(N, 5.0f, x, stride);
  printf("sum: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
movss  0xe8c(%rip),%xmm0
call   1040 <stdlib_strided_sapxsum@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
movss  0xebd(%rip),%xmm0
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_sapxsum@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_sapxsum(i32 %6, float 5.000000e+00, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_sapxsum(i32 4, float 5.000000e+00, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Variables and functions */
float atof(char *);
int /*<<< orphan*/ printf(char *, float, double);
double sqrt2(float);
int main(int argc, char *argv[]) {
  if (argc != 2)
    return 0;
  float a = atof(argv[1]);
  printf("sqrt(%f) = %f\n", a, sqrt2(a));
  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)
cmpl   $0x2,-0x8(%rbp)
je     115c <main+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    119d <main+0x6d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
call   1050 <sqrt2@plt>
movaps %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
lea    0xe6f(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jne    1163 <main+0x33>
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <atof@plt>
movss  %xmm0,0x4(%rsp)
call   1050 <sqrt2@plt>
movaps %xmm0,%xmm1
lea    0xeac(%rip),%rdi
movss  0x4(%rsp),%xmm0
call   1040 <printf@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"sqrt(%f) = %f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call float @atof(i8* %6)
%8 = tail call double @sqrt2(float %7)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), float %7, double %8)
br label %10
10: ; preds = %2, %4
ret i32 0
}
/* Type definitions */
typedef int fexcept_t;

/* Variables and functions */
int FE_ALL_EXCEPT;
int /*<<< orphan*/ _FPU_GETCW(int);
int fetestexcept(int excepts) {
  fexcept_t temp;
  _FPU_GETCW(temp);
  return temp & excepts & FE_ALL_EXCEPT;
}


x86 assembly (clang, -O0):
<fetestexcept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <_FPU_GETCW@plt>
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
mov    0x2eb0(%rip),%rcx
and    (%rcx),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@FE_ALL_EXCEPT = global i32 0
define i32 @fetestexcept(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %3
%5 = call i32 @_FPU_GETCW(i32 %4)
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = and i32 %6, %7
%9 = load i32, i32* @FE_ALL_EXCEPT
%10 = and i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
@FE_ALL_EXCEPT = global i32 0
define i32 @fetestexcept(i32 %0) {
%2 = tail call i32 @_FPU_GETCW(i32 undef)
ret i32 0
}
/* Variables and functions */
int *paging_findpte(int);
int paging_present(int virtaddr, char present) {
  int *pte = paging_findpte(virtaddr);
  if (present == 1)
    pte = (int)pte | 0x00000001;
  if (present == 0)
    pte = (int)pte | 0x00000000;
  return 1;
}


x86 assembly (clang, -O0):
<paging_present>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <paging_findpte@plt>
mov    %rax,-0x10(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x1,%eax
jne    1147 <paging_present+0x37>
mov    -0x10(%rbp),%rax
or     $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jne    1161 <paging_present+0x51>
mov    -0x10(%rbp),%rax
or     $0x0,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<paging_present>:
push   %rax
call   1030 <paging_findpte@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @paging_present(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32*
store i32 %0, i32* %3
store i8 %1, i8* %4
%6 = load i32, i32* %3
%7 = call i32* @paging_findpte(i32 %6)
store i32* %7, i32** %5
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i32*, i32** %5
%13 = ptrtoint i32* %12 to i32
%14 = or i32 %13, 1
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
store i32* %16, i32** %5
br label %17
17: ; preds = %11, %2
%18 = load i8, i8* %4
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %27
21: ; preds = %17
%22 = load i32*, i32** %5
%23 = ptrtoint i32* %22 to i32
%24 = or i32 %23, 0
%25 = sext i32 %24 to i64
%26 = inttoptr i64 %25 to i32*
store i32* %26, i32** %5
br label %27
27: ; preds = %21, %17
ret i32 1
}

LLVM IR (-O2):
define i32 @paging_present(i32 %0, i8 signext %1) {
%3 = tail call i32* @paging_findpte(i32 %0)
ret i32 1
}
/* Variables and functions */
double SIM_power_gatecap(double, int);
double SIM_array_mux_chgaddr_cap(void) {
  return (SIM_power_gatecap((60.0 * 0.0875), 1) +
          SIM_power_gatecap((80.0 * 0.0875), 1));
}


x86 assembly (clang, -O0):
<SIM_array_mux_chgaddr_cap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xee8(%rip),%xmm0
mov    $0x1,%edi
call   1030 <SIM_power_gatecap@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  0xec9(%rip),%xmm0
mov    $0x1,%edi
call   1030 <SIM_power_gatecap@plt>
movaps %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIM_array_mux_chgaddr_cap>:
push   %rax
movsd  0xee7(%rip),%xmm0
mov    $0x1,%edi
call   1030 <SIM_power_gatecap@plt>
movsd  %xmm0,(%rsp)
movsd  0xed8(%rip),%xmm0
mov    $0x1,%edi
call   1030 <SIM_power_gatecap@plt>
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @SIM_array_mux_chgaddr_cap() {
%1 = call double @SIM_power_gatecap(double 5.250000e+00, i32 1)
%2 = call double @SIM_power_gatecap(double 7.000000e+00, i32 1)
%3 = fadd double %1, %2
ret double %3
}

LLVM IR (-O2):
define double @SIM_array_mux_chgaddr_cap() {
%1 = tail call double @SIM_power_gatecap(double 5.250000e+00, i32 1)
%2 = tail call double @SIM_power_gatecap(double 7.000000e+00, i32 1)
%3 = fadd double %1, %2
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ pr_mask(char *);
void sig_int(int signo) { pr_mask("\n in sig_int: "); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"\0A in sig_int: \00"
define void @sig_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @pr_mask(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"\0A in sig_int: \00"
define void @sig_int(i32 %0) {
%2 = tail call i32 @pr_mask(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
double exp(double x) { return __builtin_exp(x); }


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

x86 assembly (clang, -O2):
<exp>:
ucomisd 0xef8(%rip),%xmm0
ja     1120 <exp+0x20>
movsd  0xef6(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1120 <exp+0x20>
ret
nopl   0x0(%rax)
jmp    1120 <exp+0x20>

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

LLVM IR (-O2):
define double @exp(double %0) {
%2 = fcmp olt double %0, -7.450000e+02
%3 = fcmp ogt double %0, 7.090000e+02
%4 = or i1 %3, %2
br i1 %4, label %5, label %6
5: ; preds = %1, %5
br label %5
6: ; preds = %1
ret double undef
}
long long _mpy2ll(int src1, int src2) {
  short ls1 = src1 & 0xffff;
  short hs1 = src1 >> 16;
  short ls2 = src2 & 0xffff;
  short hs2 = src2 >> 16;
  unsigned long long hi = hs1 * hs2;
  unsigned long long lo = (ls1 * ls2) & 0xFFFFFFFF;
  return (hi << 32) | lo;
}


x86 assembly (clang, -O0):
<_mpy2ll>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
mov    %ax,-0xa(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
mov    %ax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
mov    %ax,-0xe(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x10,%eax
mov    %ax,-0x10(%rbp)
movswl -0xc(%rbp),%eax
movswl -0x10(%rbp),%ecx
imul   %ecx,%eax
cltq
mov    %rax,-0x18(%rbp)
movswl -0xa(%rbp),%eax
movswl -0xe(%rbp),%ecx
imul   %ecx,%eax
and    $0xffffffff,%eax
mov    %eax,%eax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x20,%rax
or     -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mpy2ll>:
movswl %di,%ecx
sar    $0x10,%edi
movswl %si,%edx
mov    %esi,%eax
sar    $0x10,%eax
imul   %edi,%eax
imul   %ecx,%edx
shl    $0x20,%rax
or     %rdx,%rax
ret

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

LLVM IR (-O2):
define i64 @_mpy2ll(i32 %0, i32 %1) {
%3 = ashr i32 %0, 16
%4 = ashr i32 %1, 16
%5 = mul nsw i32 %4, %3
%6 = zext i32 %5 to i64
%7 = shl i32 %0, 16
%8 = ashr exact i32 %7, 16
%9 = shl i32 %1, 16
%10 = ashr exact i32 %9, 16
%11 = mul nsw i32 %10, %8
%12 = zext i32 %11 to i64
%13 = shl nuw i64 %6, 32
%14 = or i64 %13, %12
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ setMatrix();
void resize(int w, int h) {
  glViewport(0, 0, w, h);
  setMatrix();
}


x86 assembly (clang, -O0):
<resize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1040 <glViewport@plt>
mov    $0x0,%al
call   1030 <setMatrix@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resize>:
push   %rax
mov    %esi,%ecx
mov    %edi,%edx
xor    %edi,%edi
xor    %esi,%esi
call   1040 <glViewport@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <setMatrix@plt>

LLVM IR (-O0):
define void @resize(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 = call i32 @glViewport(i32 0, i32 0, i32 %5, i32 %6)
%8 = call i32 (...) @setMatrix()
ret void
}

LLVM IR (-O2):
define void @resize(i32 %0, i32 %1) {
%3 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
%4 = tail call i32 (...) @setMatrix()
ret void
}
int pinmux_enable_setting(const struct pinctrl_setting *setting) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.pinctrl_setting = type opaque
define i32 @pinmux_enable_setting(%struct.pinctrl_setting* nocapture readnone %0) {
ret i32 0
}
int fun812() { return 812; }


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

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

LLVM IR (-O0):
define i32 @fun812() {
ret i32 812
}

LLVM IR (-O2):
define i32 @fun812() {
ret i32 812
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printUsage(void) {
  printf("Usage :\n\n");
  printf("had --help  this text\n");
  printf("had -s      start (default)\n");
  printf("had -k      kill the daemon\n");
  printf(
      "had -r      reload config (does currently not reconnect db and mpd\n\n");
}


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

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0f(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Usage :\0A\0A\00"
@.str.1 = [23 x i8] c"had --help this text\0A\00"
@.str.2 = [29 x i8] c"had -s start (default)\0A\00"
@.str.3 = [29 x i8] c"had -k kill the daemon\0A\00"
@.str.4 = [69 x i8] c"had -r reload config (does currently not reconnect db and mpd\0A\0A\00"
define void @printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"Usage :\0A\00"
@str.5 = [22 x i8] c"had --help this text\00"
@str.6 = [28 x i8] c"had -s start (default)\00"
@str.7 = [28 x i8] c"had -k kill the daemon\00"
@str.8 = [68 x i8] c"had -r reload config (does currently not reconnect db and mpd\0A\00"
define void @printUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str.8, i64 0, i64 0))
ret void
}
void kernel_entry() {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @kernel_entry() {
br label %1
1: ; preds = %0, %1
br label %1
}
int hdmi_init_display(struct omap_dss_device *dssdev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.omap_dss_device = type opaque
define i32 @hdmi_init_display(%struct.omap_dss_device* nocapture readnone %0) {
ret i32 0
}
int outOfChina(double lat, double lon) {
  if (lon < 72.004 || lon > 137.8347)
    return 1;
  if (lat < 0.8293 || lat > 55.8271)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<outOfChina>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  0xeea(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
ja     1138 <outOfChina+0x38>
movsd  -0x18(%rbp),%xmm0
movsd  0xeda(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1144 <outOfChina+0x44>
movl   $0x1,-0x4(%rbp)
jmp    1181 <outOfChina+0x81>
movsd  0xec4(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
ja     116e <outOfChina+0x6e>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb4(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    117a <outOfChina+0x7a>
movl   $0x1,-0x4(%rbp)
jmp    1181 <outOfChina+0x81>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<outOfChina>:
movsd  0xef8(%rip),%xmm2
ucomisd %xmm1,%xmm2
seta   %al
ucomisd 0xef1(%rip),%xmm1
seta   %cl
or     %al,%cl
movsd  0xeec(%rip),%xmm1
ucomisd %xmm0,%xmm1
seta   %al
ucomisd 0xee5(%rip),%xmm0
seta   %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @outOfChina(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = fcmp olt double %6, 7.200400e+01
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load double, double* %5
%10 = fcmp ogt double %9, 0x40613AB5DCC63F14
br i1 %10, label %11, label %12
11: ; preds = %8, %2
store i32 1, i32* %3
br label %20
12: ; preds = %8
%13 = load double, double* %4
%14 = fcmp olt double %13, 8.293000e-01
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = load double, double* %4
%17 = fcmp ogt double %16, 5.582710e+01
br i1 %17, label %18, label %19
18: ; preds = %15, %12
store i32 1, i32* %3
br label %20
19: ; preds = %15
store i32 0, i32* %3
br label %20
20: ; preds = %19, %18, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @outOfChina(double %0, double %1) {
%3 = fcmp olt double %1, 7.200400e+01
%4 = fcmp ogt double %1, 0x40613AB5DCC63F14
%5 = or i1 %3, %4
%6 = fcmp olt double %0, 8.293000e-01
%7 = fcmp ogt double %0, 5.582710e+01
%8 = or i1 %6, %7
%9 = or i1 %8, %5
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
double __ieee754_jn(int, double);
double jn(int n, double x) { return __ieee754_jn(n, x); }


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

x86 assembly (clang, -O2):
<jn>:
jmp    1030 <__ieee754_jn@plt>

LLVM IR (-O0):
define double @jn(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load i32, i32* %3
%6 = load double, double* %4
%7 = call double @__ieee754_jn(i32 %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @jn(i32 %0, double %1) {
%3 = tail call double @__ieee754_jn(i32 %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int ps3_open(char *device) {
  int ps3_ir;
  ps3_ir = open(device, O_RDWR);
  if (ps3_ir < 0) {
    perror("Unable to open device");
  }
  return ps3_ir;
}


x86 assembly (clang, -O0):
<ps3_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1157 <ps3_open+0x37>
lea    0xeae(%rip),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps3_open>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1139 <ps3_open+0x19>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec0(%rip),%rdi
call   1040 <perror@plt>
jmp    1135 <ps3_open+0x15>

LLVM IR (-O0):
@O_RDWR = global i32 0
@.str = [22 x i8] c"Unable to open device\00"
define i32 @ps3_open(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDWR
%6 = call i32 @open(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@.str = [22 x i8] c"Unable to open device\00"
define i32 @ps3_open(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ func1(int);
int main(void) { func1(123); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7b,%edi
call   1030 <func1@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @func1(i32 123)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func1(i32 123)
ret i32 0
}
unsigned long strlen(char const *s) {
  unsigned long a;
  return a;
}


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

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

LLVM IR (-O0):
define i64 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i64, i64* %3
ret i64 %4
}

LLVM IR (-O2):
define i64 @strlen(i8* nocapture readnone %0) {
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ atexit(void (*)());
void PfmApiRegisterAtExit(void (*func)(void)) { atexit(func); }


x86 assembly (clang, -O0):
<PfmApiRegisterAtExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1130 <atexit>
add    $0x10,%rsp
pop    %rbp
ret
nopl   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<PfmApiRegisterAtExit>:
jmp    1120 <atexit>
cs nopw 0x0(%rax,%rax,1)
nop

LLVM IR (-O0):
define void @PfmApiRegisterAtExit(void ()* %0) {
%2 = alloca void ()*
store void ()* %0, void ()** %2
%3 = load void ()*, void ()** %2
%4 = bitcast void ()* %3 to void (...)*
%5 = call i32 @atexit(void (...)* %4)
ret void
}

LLVM IR (-O2):
define void @PfmApiRegisterAtExit(void ()* %0) {
%2 = bitcast void ()* %0 to void (...)*
%3 = tail call i32 @atexit(void (...)* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ greeting(char *, char *);
int /*<<< orphan*/ printf(char *, char *, char *);
main(int argc, char *argv[]) {
  greeting(argv[1], argv[2]);
  printf("Bye %s %s\n", argv[1], argv[2]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <greeting@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1040 <greeting@plt>
mov    0x8(%rbx),%rsi
mov    0x10(%rbx),%rdx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Bye %s %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 2
%10 = load i8*, i8** %9
%11 = call i32 @greeting(i8* %7, i8* %10)
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = load i8**, i8*** %4
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Bye %s %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i32 @greeting(i8* %4, i8* %6)
%8 = load i8*, i8** %3
%9 = load i8*, i8** %5
%10 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
ret i32 0
}