xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ llib_str_rchr(char *, int);
unsigned char *zrchr(void *s, int c) {
  return (unsigned char *)llib_str_rchr((char *)s, c);
}


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

x86 assembly (clang, -O2):
<zrchr>:
jmp    1030 <llib_str_rchr@plt>

LLVM IR (-O0):
define i8* @zrchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i64 @llib_str_rchr(i8* %5, i32 %6)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @zrchr(i8* %0, i32 %1) {
%3 = tail call i64 @llib_str_rchr(i8* %0, i32 %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ PrintErrorCode();
int /*<<< orphan*/ dxl_write_word(int, int, int);
void changePosL(int Id, int Pos) {
  if (Id == 254) {
    Id = (254);
  }
  Pos = (int)Pos / 0.87890625;
  dxl_write_word(Id, 30, Pos);
  PrintErrorCode();
}


x86 assembly (clang, -O0):
<changePosL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xfe,-0x4(%rbp)
jne    1142 <changePosL+0x22>
movl   $0xfe,-0x4(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xeb1(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x1e,%esi
call   1040 <dxl_write_word@plt>
mov    $0x0,%al
call   1030 <PrintErrorCode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<changePosL>:
push   %rax
cvtsi2sd %esi,%xmm0
divsd  0xed3(%rip),%xmm0
cvttsd2si %xmm0,%edx
mov    $0x1e,%esi
call   1040 <dxl_write_word@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <PrintErrorCode@plt>

LLVM IR (-O0):
define void @changePosL(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 = icmp eq i32 %5, 254
br i1 %6, label %7, label %8
7: ; preds = %2
store i32 254, i32* %3
br label %8
8: ; preds = %7, %2
%9 = load i32, i32* %4
%10 = sitofp i32 %9 to double
%11 = fdiv double %10, 0x3FEC200000000000
%12 = fptosi double %11 to i32
store i32 %12, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @dxl_write_word(i32 %13, i32 30, i32 %14)
%16 = call i32 (...) @PrintErrorCode()
ret void
}

LLVM IR (-O2):
define void @changePosL(i32 %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = fdiv double %3, 0x3FEC200000000000
%5 = fptosi double %4 to i32
%6 = tail call i32 @dxl_write_word(i32 %0, i32 30, i32 %5)
%7 = tail call i32 (...) @PrintErrorCode()
ret void
}
void _k_heap_disp(void) {}


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

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

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

LLVM IR (-O2):
define void @_k_heap_disp() {
ret void
}
int mapColor(int code) {
  int step = 16777216 / 86;
  int color = code * step;
  return color;
}


x86 assembly (clang, -O0):
<mapColor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x2fa0b,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapColor>:
imul   $0x2fa0b,%edi,%eax
ret

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

LLVM IR (-O2):
define i32 @mapColor(i32 %0) {
%2 = mul nsw i32 %0, 195083
ret i32 %2
}
int f(int x) {
  int i = 10;
  unsigned *ptr;
  while (i / x + 1)
    x--;
  for (*ptr = 3; i / *ptr > 4; ptr++)
    ;
  return x + 1;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
add    $0x1,%eax
cmp    $0x0,%eax
je     112f <f+0x2f>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <f+0xe>
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
xor    %edx,%edx
divl   (%rcx)
cmp    $0x4,%eax
jbe    1163 <f+0x63>
jmp    1152 <f+0x52>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    1139 <f+0x39>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %2
store i32 10, i32* %3
br label %5
5: ; preds = %11, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = sdiv i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %5
%12 = load i32, i32* %2
%13 = add nsw i32 %12, -1
store i32 %13, i32* %2
br label %5
14: ; preds = %5
%15 = load i32*, i32** %4
store i32 3, i32* %15
br label %16
16: ; preds = %23, %14
%17 = load i32, i32* %3
%18 = load i32*, i32** %4
%19 = load i32, i32* %18
%20 = udiv i32 %17, %19
%21 = icmp ugt i32 %20, 4
br i1 %21, label %22, label %26
22: ; preds = %16
br label %23
23: ; preds = %22
%24 = load i32*, i32** %4
%25 = getelementptr inbounds i32, i32* %24, i32 1
store i32* %25, i32** %4
br label %16
26: ; preds = %16
%27 = load i32, i32* %2
%28 = add nsw i32 %27, 1
ret i32 %28
}

LLVM IR (-O2):
int test_imm_9Cint64_lowword_reg(long long val) {
  return ((val) & (0x9C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Cint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 156
%5 = icmp ne i64 %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_9Cint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 156
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef unsigned long long uint64_t;
struct timespec {
  unsigned long long tv_sec;
  unsigned long long tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t timestamp(void) {
  struct timespec ts;
  uint64_t val;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  val = ts.tv_sec * 1000000000ULL + ts.tv_nsec;
  val /= 1000000ULL;
  return val;
}


x86 assembly (clang, -O0):
<timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,-0x10(%rbp),%rax
3b
add    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timestamp>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x8(%rsp),%rax
9a 3b
add    0x10(%rsp),%rax
movabs $0x431bde82d7b634db,%rcx
de 1b 43
mul    %rcx
mov    %rdx,%rax
shr    $0x12,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @timestamp() {
%1 = alloca %struct.timespec
%2 = alloca i64
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%6 = load i64, i64* %5
%7 = mul i64 %6, 1000000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%9 = load i64, i64* %8
%10 = add i64 %7, %9
store i64 %10, i64* %2
%11 = load i64, i64* %2
%12 = udiv i64 %11, 1000000
store i64 %12, i64* %2
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @timestamp() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = mul i64 %6, 1000000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add i64 %7, %9
%11 = udiv i64 %10, 1000000
ret i64 %11
}
/* Variables and functions */
int construct_vap(char *, unsigned int, int /*<<< orphan*/, int /*<<< orphan*/);
int construct_main_ap(char *name, unsigned int radio) {
  return construct_vap(name, radio, 0, 0);
}


x86 assembly (clang, -O0):
<construct_main_ap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <construct_vap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<construct_main_ap>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <construct_vap@plt>

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

LLVM IR (-O2):
define i32 @construct_main_ap(i8* %0, i32 %1) {
%3 = tail call i32 @construct_vap(i8* %0, i32 %1, i32 0, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("Sizeof(int = %d\n", sizeof(int));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"Sizeof(int = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
char *nio_getsn(char *, int);
char *nio_gets(char *str) { return nio_getsn(str, 50); }


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

x86 assembly (clang, -O2):
<nio_gets>:
mov    $0x32,%esi
jmp    1030 <nio_getsn@plt>

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

LLVM IR (-O2):
define i8* @nio_gets(i8* %0) {
%2 = tail call i8* @nio_getsn(i8* %0, i32 50)
ret i8* %2
}
int main() {
  int i;
  return i + i;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
void RTLinuxFindDevicePath(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLinuxFindDevicePath() {
ret void
}
double diamondprice(double m, double n) {
  double price;
  for (; m <= n; m++)
    price += m * m;
  return price;
}


x86 assembly (clang, -O0):
<diamondprice>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1155 <diamondprice+0x55>
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeba(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    110e <diamondprice+0xe>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<diamondprice>:
ucomisd %xmm0,%xmm1
jb     1126 <diamondprice+0x26>
movsd  0xef2(%rip),%xmm3
xchg   %ax,%ax
movapd %xmm0,%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm4,%xmm2
addsd  %xmm3,%xmm0
ucomisd %xmm0,%xmm1
jae    1110 <diamondprice+0x10>
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @diamondprice(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
br label %6
6: ; preds = %15, %2
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fcmp ole double %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load double, double* %3
%12 = load double, double* %3
%13 = load double, double* %5
%14 = call double @llvm.fmuladd.f64(double %11, double %12, double %13)
store double %14, double* %5
br label %15
15: ; preds = %10
%16 = load double, double* %3
%17 = fadd double %16, 1.000000e+00
store double %17, double* %3
br label %6
18: ; preds = %6
%19 = load double, double* %5
ret double %19
}

LLVM IR (-O2):
define double @diamondprice(double %0, double %1) {
%3 = fcmp ugt double %0, %1
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi double [ %7, %4 ], [ undef, %2 ]
%6 = phi double [ %8, %4 ], [ %0, %2 ]
%7 = tail call double @llvm.fmuladd.f64(double %6, double %6, double %5)
%8 = fadd double %6, 1.000000e+00
%9 = fcmp ugt double %8, %1
br i1 %9, label %10, label %4
10: ; preds = %4, %2
%11 = phi double [ undef, %2 ], [ %7, %4 ]
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char *);
void log_syslog_verbose(char *msg) { syslog(LOG_INFO, "%s", msg); }


x86 assembly (clang, -O0):
<log_syslog_verbose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <syslog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_syslog_verbose>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <syslog@plt>

LLVM IR (-O0):
@LOG_INFO = global i32 0
@.str = [3 x i8] c"%s\00"
define void @log_syslog_verbose(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_INFO
%4 = load i8*, i8** %2
%5 = call i32 @syslog(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
@.str = [3 x i8] c"%s\00"
define void @log_syslog_verbose(i8* %0) {
%2 = load i32, i32* @LOG_INFO
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int test_imm_64int32_reg(int val) { return ((val) & (0x64 << 0)) ? -20 : -40; }


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

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

LLVM IR (-O0):
define i32 @test_imm_64int32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 100
%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_64int32_reg(i32 %0) {
%2 = and i32 %0, 100
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void StartLine(long id) { printf("\033GL%ld", id); }


x86 assembly (clang, -O0):
<StartLine>:
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):
<StartLine>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"\1BGL%ld\00"
define void @StartLine(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
int emac2_etherstatsdropevents_set(unsigned int dev_id,
                                   union emac2_etherstatsdropevents_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.emac2_etherstatsdropevents_u = type opaque
define i32 @emac2_etherstatsdropevents_set(i32 %0, %union.emac2_etherstatsdropevents_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac2_etherstatsdropevents_u*
store i32 %0, i32* %3
store %union.emac2_etherstatsdropevents_u* %1, %union.emac2_etherstatsdropevents_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac2_etherstatsdropevents_u = type opaque
define i32 @emac2_etherstatsdropevents_set(i32 %0, %union.emac2_etherstatsdropevents_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *new = malloc(size);
  if (!new) {
    fprintf(stderr,
            "ERROR: out of memory when requesting "
            "%zu bytes\n",
            size);
    abort();
  }
  return new;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1174 <xmalloc+0x44>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe98(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1050 <malloc@plt>
test   %rax,%rax
je     1140 <xmalloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"ERROR: out of memory when requesting %zu bytes\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i64, i64* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"ERROR: out of memory when requesting %zu bytes\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret i8* %2
}
void fz_nullendgroup(void *user) {}


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

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

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

LLVM IR (-O2):
define void @fz_nullendgroup(i8* nocapture %0) {
ret void
}
pause() { ; }


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

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

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

LLVM IR (-O2):
define i32 @pause() {
ret i32 undef
}
void swap(struct ListNode **a, struct ListNode **b) {
  struct ListNode *tmp = *a;
  *a = *b;
  *b = tmp;
}


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

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    %rcx,(%rdi)
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
%struct.ListNode = type opaque
define void @swap(%struct.ListNode** %0, %struct.ListNode** %1) {
%3 = alloca %struct.ListNode**
%4 = alloca %struct.ListNode**
%5 = alloca %struct.ListNode*
store %struct.ListNode** %0, %struct.ListNode*** %3
store %struct.ListNode** %1, %struct.ListNode*** %4
%6 = load %struct.ListNode**, %struct.ListNode*** %3
%7 = load %struct.ListNode*, %struct.ListNode** %6
store %struct.ListNode* %7, %struct.ListNode** %5
%8 = load %struct.ListNode**, %struct.ListNode*** %4
%9 = load %struct.ListNode*, %struct.ListNode** %8
%10 = load %struct.ListNode**, %struct.ListNode*** %3
store %struct.ListNode* %9, %struct.ListNode** %10
%11 = load %struct.ListNode*, %struct.ListNode** %5
%12 = load %struct.ListNode**, %struct.ListNode*** %4
store %struct.ListNode* %11, %struct.ListNode** %12
ret void
}

LLVM IR (-O2):
%struct.ListNode = type opaque
define void @swap(%struct.ListNode** nocapture %0, %struct.ListNode** nocapture %1) {
%3 = load %struct.ListNode*, %struct.ListNode** %0
%4 = load %struct.ListNode*, %struct.ListNode** %1
store %struct.ListNode* %4, %struct.ListNode** %0
store %struct.ListNode* %3, %struct.ListNode** %1
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int bind(int, struct sockaddr const *, int /*<<< orphan*/);
int w_bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen) {
  int ret = bind(sockfd, addr, addrlen);
  return ret;
}


x86 assembly (clang, -O0):
<w_bind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <bind@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_bind>:
jmp    1030 <bind@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @w_bind(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load %struct.sockaddr*, %struct.sockaddr** %5
%10 = load i32, i32* %6
%11 = call i32 @bind(i32 %8, %struct.sockaddr* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @w_bind(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = tail call i32 @bind(i32 %0, %struct.sockaddr* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(scalar_t__);
int /*<<< orphan*/ read_keymap(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
scalar_t__ strlen(char *);
void read_configuration(char *dirname) {
  char *keymap = malloc(strlen(dirname) + 20);
  sprintf(keymap, "%s/keymap", dirname);
  read_keymap(keymap);
  free(keymap);
}


x86 assembly (clang, -O0):
<read_configuration>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x14,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe7c(%rip),%rsi
call   1070 <sprintf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <read_keymap@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_configuration>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x14(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xe91(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1070 <sprintf@plt>
mov    %rbx,%rdi
call   1060 <read_keymap@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s/keymap\00"
define void @read_configuration(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 20
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %3
%12 = call i32 @read_keymap(i8* %11)
%13 = load i8*, i8** %3
%14 = call i32 @free(i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s/keymap\00"
define void @read_configuration(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 20
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 @read_keymap(i8* %4)
%7 = tail call i32 @free(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _wanConfList(int);
int /*<<< orphan*/ printf(char *);
void showWanInterface() {
  printf("\nWAN Interface:\n");
  _wanConfList(1);
}


x86 assembly (clang, -O0):
<showWanInterface>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <_wanConfList@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<showWanInterface>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <_wanConfList@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"\0AWAN Interface:\0A\00"
define void @showWanInterface() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @_wanConfList(i32 1)
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"\0AWAN Interface:\00"
define void @showWanInterface() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @_wanConfList(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *translateDate(char *);
int /*<<< orphan*/ write(char *, char *, char *);
void function_real_date_ini(char *ini) {
  char *new = translateDate(ini);
  write("msproject.xml", "\t<ManualStart>%s</ManualStart>\n", new);
  free(new);
}


x86 assembly (clang, -O0):
<function_real_date_ini>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <translateDate@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
lea    0xeac(%rip),%rdi
lea    0xeb3(%rip),%rsi
call   1040 <write@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_real_date_ini>:
push   %rbx
call   1050 <translateDate@plt>
mov    %rax,%rbx
lea    0xec0(%rip),%rdi
lea    0xec7(%rip),%rsi
mov    %rax,%rdx
call   1040 <write@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [32 x i8] c"\09<ManualStart>%s</ManualStart>\0A\00"
define void @function_real_date_ini(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @translateDate(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [32 x i8] c"\09<ManualStart>%s</ManualStart>\0A\00"
define void @function_real_date_ini(i8* %0) {
%2 = tail call i8* @translateDate(i8* %0)
%3 = tail call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
float __rnint(float);
float r_nint(float *x) { return (__rnint(*x)); }


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

x86 assembly (clang, -O2):
<r_nint>:
movss  (%rdi),%xmm0
jmp    1030 <__rnint@plt>

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

LLVM IR (-O2):
define float @r_nint(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call float @__rnint(float %2)
ret float %3
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=19 REPO_URL=r3p2-01rel0 REVISION=r3p2-01rel0 "
         "CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Вск Фев 10 00:03:30 MSK "
         "2013 BUILD=release TARGET_PLATFORM=mali400-pmu MALI_PLATFORM= KDIR= "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= "
         "USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 "
         "MALI_UPPER_HALF_SCHEDULING=1";
}


x86 assembly (clang, -O0):
<__malidrv_build_info>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__malidrv_build_info>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [352 x i8] c"malidrv: API_VERSION=19 REPO_URL=r3p2-01rel0 REVISION=r3p2-01rel0 CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=\D0\92\D1\81\D0\BA \D0\A4\D0\B5\D0\B2 10 00:03:30 MSK 2013 BUILD=release TARGET_PLATFORM=mali400-pmu MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([352 x i8], [352 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [352 x i8] c"malidrv: API_VERSION=19 REPO_URL=r3p2-01rel0 REVISION=r3p2-01rel0 CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=\D0\92\D1\81\D0\BA \D0\A4\D0\B5\D0\B2 10 00:03:30 MSK 2013 BUILD=release TARGET_PLATFORM=mali400-pmu MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([352 x i8], [352 x i8]* @.str, i64 0, i64 0)
}
int fn2(int a, int b) {
  int tem1 = b | a;
  int tem2 = a ^ b;
  return tem1 - tem2;
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fn2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = or i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = xor i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fn2(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
/* Variables and functions */
scalar_t__ doubleFactorial(double);
double pow(int, double);
double sqrt(double);
double gammaFunction(double k) {
  k = k * 2;
  return (double)doubleFactorial(k - 2) * sqrt(3.1415926535897932) /
         pow(2, (k - 1) / 2);
}


x86 assembly (clang, -O0):
<gammaFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xebb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xea4(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <doubleFactorial@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe99(%rip),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe6e(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe5a(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gammaFunction>:
sub    $0x18,%rsp
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xec6(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1030 <doubleFactorial@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  0xeb5(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  0xea9(%rip),%xmm0
mulsd  0xea9(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @gammaFunction(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 2.000000e+00
store double %4, double* %2
%5 = load double, double* %2
%6 = fsub double %5, 2.000000e+00
%7 = call i64 @doubleFactorial(double %6)
%8 = sitofp i64 %7 to double
%9 = call double @sqrt(double 0x400921FB54442D18)
%10 = fmul double %8, %9
%11 = load double, double* %2
%12 = fsub double %11, 1.000000e+00
%13 = fdiv double %12, 2.000000e+00
%14 = call double @pow(i32 2, double %13)
%15 = fdiv double %10, %14
ret double %15
}

LLVM IR (-O2):
define double @gammaFunction(double %0) {
%2 = fmul double %0, 2.000000e+00
%3 = fadd double %2, -2.000000e+00
%4 = tail call i64 @doubleFactorial(double %3)
%5 = sitofp i64 %4 to double
%6 = fmul double %5, 0x3FFC5BF891B4EF6A
%7 = fadd double %2, -1.000000e+00
%8 = fmul double %7, 5.000000e-01
%9 = tail call double @pow(i32 2, double %8)
%10 = fdiv double %6, %9
ret double %10
}
void ff_hevc_put_hevc_qpel_h16_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_h16_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int *open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read(int *, int /*<<< orphan*/ *, int /*<<< orphan*/);
void touch_null_kp() {
  printf("[+]Start touch kernel null point\n");
  int *f = open("/proc/test", O_RDONLY);
  read(f, NULL, 0);
}


x86 assembly (clang, -O0):
<touch_null_kp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
lea    0xece(%rip),%rdi
call   1050 <open@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<touch_null_kp>:
push   %rax
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
lea    0xeb3(%rip),%rdi
call   1050 <open@plt>
mov    %rax,%rdi
xor    %esi,%esi
xor    %edx,%edx
pop    %rax
jmp    1040 <read@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"[+]Start touch kernel null point\0A\00"
@.str.1 = [11 x i8] c"/proc/test\00"
@O_RDONLY = global i32 0
define void @touch_null_kp() {
%1 = alloca i32*
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @O_RDONLY
%4 = call i32* @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %3)
store i32* %4, i32** %1
%5 = load i32*, i32** %1
%6 = call i32 @read(i32* %5, i32* null, i32 0)
ret void
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"/proc/test\00"
@O_RDONLY = global i32 0
@str = [33 x i8] c"[+]Start touch kernel null point\00"
define void @touch_null_kp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32* @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 @read(i32* %3, i32* null, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parse_sched_entry(char *);
int /*<<< orphan*/ strcpy(char *, char const *);
void add_cmdline_entry(const char *arg) {
  char line[512];
  strcpy(line, arg);
  parse_sched_entry(line);
}


x86 assembly (clang, -O0):
<add_cmdline_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x210(%rbp),%rdi
call   1040 <parse_sched_entry@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_cmdline_entry>:
push   %rbx
sub    $0x200,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <parse_sched_entry@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @add_cmdline_entry(i8* %0) {
%2 = alloca i8*
%3 = alloca [512 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strcpy(i8* %4, i8* %5)
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%8 = call i32 @parse_sched_entry(i8* %7)
ret void
}

LLVM IR (-O2):
define void @add_cmdline_entry(i8* %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
%5 = call i32 @parse_sched_entry(i8* %3)
ret void
}
void cli_val_ieee754_attr_deinit(struct cli_val_ieee754_attr *a) {}


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

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

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

LLVM IR (-O2):
%struct.cli_val_ieee754_attr = type opaque
define void @cli_val_ieee754_attr_deinit(%struct.cli_val_ieee754_attr* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_shuffle_ps(int /*<<< orphan*/, int /*<<< orphan*/, int);
__m128 __attribute__((no, unused)) test(__m128 s1, __m128 s2) {
  return _mm_shuffle_ps(s1, s2, 0xab);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0xab,%edx
call   1030 <_mm_shuffle_ps@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    $0xab,%edx
jmp    1030 <_mm_shuffle_ps@plt>

LLVM IR (-O0):
define i32 @test(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 @_mm_shuffle_ps(i32 %5, i32 %6, i32 171)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_shuffle_ps(i32 %0, i32 %1, i32 171)
ret i32 %3
}
/* Variables and functions */
int strncmp(char const *, char *const, int);
int cmp_addr(const void *keyp, const void *ap) {
  const char *key = keyp;
  char *const *a = ap;
  return strncmp(key, *a, 8);
}


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

x86 assembly (clang, -O2):
<cmp_addr>:
mov    (%rsi),%rsi
mov    $0x8,%edx
jmp    1030 <strncmp@plt>

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

LLVM IR (-O2):
define i32 @cmp_addr(i8* %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i8**
%4 = load i8*, i8** %3
%5 = tail call i32 @strncmp(i8* %0, i8* %4, i32 8)
ret i32 %5
}
/* Variables and functions */
int GET32(int);
void uart_flush(void) {
  while (1) {
    if ((GET32((0x20000000 + 0x00215054)) & 0x100) == 0)
      break;
  }
}


x86 assembly (clang, -O0):
<uart_flush>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <uart_flush+0x9>
mov    $0x20215054,%edi
call   1030 <GET32@plt>
and    $0x100,%eax
cmp    $0x0,%eax
jne    1136 <uart_flush+0x26>
jmp    113b <uart_flush+0x2b>
jmp    1119 <uart_flush+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_flush>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x20215054,%edi
call   1030 <GET32@plt>
test   $0x100,%eax
jne    1120 <uart_flush+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @uart_flush() {
br label %1
1: ; preds = %0, %6
%2 = call i32 @GET32(i32 539054164)
%3 = and i32 %2, 256
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %7
6: ; preds = %1
br label %1
7: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @uart_flush() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @GET32(i32 539054164)
%3 = and i32 %2, 256
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
unsigned long blong(unsigned char *p) {
  unsigned long n;
  n = p[0];
  n = (n << 8) + p[1];
  n = (n << 8) + p[2];
  n = (n << 8) + p[3];
  return n;
}


x86 assembly (clang, -O0):
<blong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blong>:
mov    (%rdi),%eax
shl    $0x20,%rax
bswap  %rax
ret

LLVM IR (-O0):
define i64 @blong(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = shl i64 %8, 8
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i64
%14 = add i64 %9, %13
store i64 %14, i64* %3
%15 = load i64, i64* %3
%16 = shl i64 %15, 8
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 2
%19 = load i8, i8* %18
%20 = zext i8 %19 to i64
%21 = add i64 %16, %20
store i64 %21, i64* %3
%22 = load i64, i64* %3
%23 = shl i64 %22, 8
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 3
%26 = load i8, i8* %25
%27 = zext i8 %26 to i64
%28 = add i64 %23, %27
store i64 %28, i64* %3
%29 = load i64, i64* %3
ret i64 %29
}

LLVM IR (-O2):
define i64 @blong(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = shl nuw nsw i64 %3, 16
%8 = shl nuw nsw i64 %6, 8
%9 = or i64 %8, %7
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = or i64 %9, %12
%14 = shl nuw nsw i64 %13, 8
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i64
%18 = or i64 %14, %17
ret i64 %18
}
void __outbc_p(unsigned char value, unsigned short port) {
  __asm__ __volatile__("out"
                       "b"
                       " %"
                       "b"
                       "0,%"
                       ""
                       "1"
                       :
                       : "a"(value), "id"(port));
  __asm__ __volatile__("outb %al,$0x80");
}


x86 assembly (clang, -O0):
<__outbc_p>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%al
mov    -0x4(%rbp),%dx
out    %al,(%dx)
out    %al,$0x80
pop    %rbp
ret

x86 assembly (clang, -O2):
<__outbc_p>:
mov    %esi,%edx
mov    %edi,%eax
out    %al,(%dx)
out    %al,$0x80
ret

LLVM IR (-O0):
define void @__outbc_p(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @__outbc_p(i8 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outb ${0:b},$1", "{ax},i{dx},~{dirflag},~{fpsr},~{flags}"(i8 %0, i16 %1)
tail call void asm sideeffect "outb %al,$$0x80", "~{dirflag},~{fpsr},~{flags}"()
ret void
}