xunge/DecIR huggingface dataset:
REMQUE(long *e, long *a) {
  int retval = 0;
  if (e == e[1])
    retval |= 1;
  remque(e, 0);
  if (e[0] == e[1])
    retval |= 2;
  *a = e;
  return retval;
}


x86 assembly (clang, -O0):
<REMQUE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
cmp    %rcx,%rax
jne    1145 <REMQUE+0x35>
mov    -0x14(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <remque@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
cmp    0x8(%rcx),%rax
jne    1170 <REMQUE+0x60>
mov    -0x14(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<REMQUE>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %r15d,%r15d
cmp    %rdi,0x8(%rdi)
sete   %r15b
xor    %esi,%esi
xor    %eax,%eax
call   1030 <remque@plt>
mov    (%rbx),%rax
cmp    0x8(%rbx),%rax
lea    0x2(%r15),%eax
cmovne %r15d,%eax
mov    %rbx,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @REMQUE(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca i32
store i64* %0, i64** %3
store i64* %1, i64** %4
store i32 0, i32* %5
%6 = load i64*, i64** %3
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 1
%9 = load i64, i64* %8
%10 = inttoptr i64 %9 to i64*
%11 = icmp eq i64* %6, %10
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* %5
%14 = or i32 %13, 1
store i32 %14, i32* %5
br label %15
15: ; preds = %12, %2
%16 = load i64*, i64** %3
%17 = call i32 (i64*, i32, ...) bitcast (i32 (...)* @remque to i32 (i64*, i32, ...)*)(i64* %16, i32 0)
%18 = load i64*, i64** %3
%19 = getelementptr inbounds i64, i64* %18, i64 0
%20 = load i64, i64* %19
%21 = load i64*, i64** %3
%22 = getelementptr inbounds i64, i64* %21, i64 1
%23 = load i64, i64* %22
%24 = icmp eq i64 %20, %23
br i1 %24, label %25, label %28
25: ; preds = %15
%26 = load i32, i32* %5
%27 = or i32 %26, 2
store i32 %27, i32* %5
br label %28
28: ; preds = %25, %15
%29 = load i64*, i64** %3
%30 = ptrtoint i64* %29 to i64
%31 = load i64*, i64** %4
store i64 %30, i64* %31
%32 = load i32, i32* %5
ret i32 %32
}

LLVM IR (-O2):
define i32 @REMQUE(i64* %0, i64* nocapture writeonly %1) {
%3 = getelementptr inbounds i64, i64* %0, i64 1
%4 = load i64, i64* %3
%5 = inttoptr i64 %4 to i64*
%6 = icmp eq i64* %5, %0
%7 = zext i1 %6 to i32
%8 = tail call i32 (i64*, i32, ...) bitcast (i32 (...)* @remque to i32 (i64*, i32, ...)*)(i64* %0, i32 0)
%9 = load i64, i64* %0
%10 = load i64, i64* %3
%11 = icmp eq i64 %9, %10
%12 = or i32 %7, 2
%13 = select i1 %11, i32 %12, i32 %7
%14 = ptrtoint i64* %0 to i64
store i64 %14, i64* %1
ret i32 %13
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memset(struct tm *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strptime(char const *, char *, struct tm *);
void time_parse_iso8601(struct tm *tm, const char *s) {
  memset(tm, 0, sizeof(struct tm));
  strptime(s, "%FT%T%z", tm);
}


x86 assembly (clang, -O0):
<time_parse_iso8601>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeb1(%rip),%rsi
call   1040 <strptime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_parse_iso8601>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    0xec3(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strptime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [8 x i8] c"%FT%T%z\00"
define void @time_parse_iso8601(%struct.tm* %0, i8* %1) {
%3 = alloca %struct.tm*
%4 = alloca i8*
store %struct.tm* %0, %struct.tm** %3
store i8* %1, i8** %4
%5 = load %struct.tm*, %struct.tm** %3
%6 = call i32 @memset(%struct.tm* %5, i32 0, i32 4)
%7 = load i8*, i8** %4
%8 = load %struct.tm*, %struct.tm** %3
%9 = call i32 @strptime(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %struct.tm* %8)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [8 x i8] c"%FT%T%z\00"
define void @time_parse_iso8601(%struct.tm* %0, i8* %1) {
%3 = tail call i32 @memset(%struct.tm* %0, i32 0, i32 4)
%4 = tail call i32 @strptime(i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %struct.tm* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main() {
  int i;
  foo(100);
  for (i = 2; i > -10; i--)
    foo(i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%edi
call   1030 <foo@plt>
movl   $0x2,-0x8(%rbp)
cmpl   $0xfffffff6,-0x8(%rbp)
jle    1150 <main+0x40>
mov    -0x8(%rbp),%edi
call   1030 <foo@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <main+0x20>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
call   1030 <foo@plt>
mov    $0x2,%edi
call   1030 <foo@plt>
mov    $0x1,%edi
call   1030 <foo@plt>
xor    %edi,%edi
call   1030 <foo@plt>
mov    $0xffffffff,%edi
call   1030 <foo@plt>
mov    $0xfffffffe,%edi
call   1030 <foo@plt>
mov    $0xfffffffd,%edi
call   1030 <foo@plt>
mov    $0xfffffffc,%edi
call   1030 <foo@plt>
mov    $0xfffffffb,%edi
call   1030 <foo@plt>
mov    $0xfffffffa,%edi
call   1030 <foo@plt>
mov    $0xfffffff9,%edi
call   1030 <foo@plt>
mov    $0xfffffff8,%edi
call   1030 <foo@plt>
mov    $0xfffffff7,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 100)
%2 = tail call i32 @foo(i32 2)
%3 = tail call i32 @foo(i32 1)
%4 = tail call i32 @foo(i32 0)
%5 = tail call i32 @foo(i32 -1)
%6 = tail call i32 @foo(i32 -2)
%7 = tail call i32 @foo(i32 -3)
%8 = tail call i32 @foo(i32 -4)
%9 = tail call i32 @foo(i32 -5)
%10 = tail call i32 @foo(i32 -6)
%11 = tail call i32 @foo(i32 -7)
%12 = tail call i32 @foo(i32 -8)
%13 = tail call i32 @foo(i32 -9)
ret i32 0
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ random();
float frand(float from, float to) {
  return (float)(((double)random() / RAND_MAX) * (to - from) + from);
}


x86 assembly (clang, -O0):
<frand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb3(%rip),%rax
divsd  (%rax),%xmm0
movss  -0x8(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frand>:
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <random@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    0x2eb6(%rip),%rax
divsd  (%rax),%xmm0
movss  (%rsp),%xmm2
movss  0x4(%rsp),%xmm1
subss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define float @frand(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = call i64 (...) @random()
%6 = sitofp i64 %5 to double
%7 = load double, double* @RAND_MAX
%8 = fdiv double %6, %7
%9 = load float, float* %4
%10 = load float, float* %3
%11 = fsub float %9, %10
%12 = fpext float %11 to double
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = call double @llvm.fmuladd.f64(double %8, double %12, double %14)
%16 = fptrunc double %15 to float
ret float %16
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define float @frand(float %0, float %1) {
%3 = tail call i64 (...) @random()
%4 = sitofp i64 %3 to double
%5 = load double, double* @RAND_MAX
%6 = fdiv double %4, %5
%7 = fsub float %1, %0
%8 = fpext float %7 to double
%9 = fpext float %0 to double
%10 = tail call double @llvm.fmuladd.f64(double %6, double %8, double %9)
%11 = fptrunc double %10 to float
ret float %11
}
int isspace(int c) {
  return !!((c == ' ') || (c == '\f') || (c == '\n') || (c == '\r') ||
            (c == '\t') || (c == '\v'));
}


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

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%edi
ja     111d <isspace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100003600,%rdx
bt     %rcx,%rdx
jae    111d <isspace+0x1d>
ret
xor    %eax,%eax
cmp    $0xb,%edi
sete   %al
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, 32
br i1 %4, label %20, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 12
br i1 %7, label %20, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 10
br i1 %10, label %20, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 13
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 9
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 11
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 = xor i1 %21, true
%23 = xor i1 %22, true
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 13, label %5
i32 12, label %5
i32 10, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 11
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
unsigned int endian_swap_u32(unsigned int x) {
  x = (x >> 24) | ((x << 8) & 0x00FF0000) | ((x >> 8) & 0x0000FF00) | (x << 24);
  return x;
}


x86 assembly (clang, -O0):
<endian_swap_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<endian_swap_u32>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @endian_swap_u32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 24
%5 = load i32, i32* %2
%6 = shl i32 %5, 8
%7 = and i32 %6, 16711680
%8 = or i32 %4, %7
%9 = load i32, i32* %2
%10 = lshr i32 %9, 8
%11 = and i32 %10, 65280
%12 = or i32 %8, %11
%13 = load i32, i32* %2
%14 = shl i32 %13, 24
%15 = or i32 %12, %14
store i32 %15, i32* %2
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @endian_swap_u32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void resume_wifi(void) {
  system("/etc/init.d/network start");
  system("/etc/init.d/led restart");
}


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

x86 assembly (clang, -O2):
<resume_wifi>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
lea    0xef6(%rip),%rdi
pop    %rax
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"/etc/init.d/network start\00"
@.str.1 = [24 x i8] c"/etc/init.d/led restart\00"
define void @resume_wifi() {
%1 = call i32 @system(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"/etc/init.d/network start\00"
@.str.1 = [24 x i8] c"/etc/init.d/led restart\00"
define void @resume_wifi() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void likwid_markerInit(void) {
  fprintf(stderr, "WARNING: dummy likwid_markerInit() called\n");
}


x86 assembly (clang, -O0):
<likwid_markerInit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<likwid_markerInit>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"WARNING: dummy likwid_markerInit() called\0A\00"
define void @likwid_markerInit() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"WARNING: dummy likwid_markerInit() called\0A\00"
define void @likwid_markerInit() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_2Euint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x2E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Euint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 46
%6 = icmp ne i64 %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_2Euint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 46
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void gtk_widget_event() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_event() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_getcwd() {
  printf("NOT IMPLEMENTED:"
         "pa_getcwd"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"NOT IMPLEMENTED:pa_getcwd\0A\00"
define i32 @pa_getcwd() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [26 x i8] c"NOT IMPLEMENTED:pa_getcwd\00"
define i32 @pa_getcwd() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void RTTimeNanoTS(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTimeNanoTS() {
ret void
}
/* Variables and functions */
int syscall(int, int /*<<< orphan*/, int);
int high_freq(void) { return syscall(295, 0, 2); }


x86 assembly (clang, -O0):
<high_freq>:
push   %rbp
mov    %rsp,%rbp
mov    $0x127,%edi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<high_freq>:
mov    $0x127,%edi
xor    %esi,%esi
mov    $0x2,%edx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @high_freq() {
%1 = call i32 @syscall(i32 295, i32 0, i32 2)
ret i32 %1
}

LLVM IR (-O2):
define i32 @high_freq() {
%1 = tail call i32 @syscall(i32 295, i32 0, i32 2)
ret i32 %1
}
/* Variables and functions */
int irq_desc_has_action(int /*<<< orphan*/);
int /*<<< orphan*/ irq_to_desc(unsigned int);
int irq_has_action(unsigned int irq) {
  return irq_desc_has_action(irq_to_desc(irq));
}


x86 assembly (clang, -O0):
<irq_has_action>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <irq_to_desc@plt>
mov    %eax,%edi
call   1040 <irq_desc_has_action@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_has_action>:
push   %rax
call   1030 <irq_to_desc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <irq_desc_has_action@plt>

LLVM IR (-O0):
define i32 @irq_has_action(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @irq_to_desc(i32 %3)
%5 = call i32 @irq_desc_has_action(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @irq_has_action(i32 %0) {
%2 = tail call i32 @irq_to_desc(i32 %0)
%3 = tail call i32 @irq_desc_has_action(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ bit_hl(int);
void opcb_66() { bit_hl(4); }


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

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

LLVM IR (-O0):
define void @opcb_66() {
%1 = call i32 @bit_hl(i32 4)
ret void
}

LLVM IR (-O2):
define void @opcb_66() {
%1 = tail call i32 @bit_hl(i32 4)
ret void
}
/* Type definitions */
struct hlist_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_HLIST_NODE(struct hlist_node *);
int /*<<< orphan*/ __hlist_del(struct hlist_node *);
int /*<<< orphan*/ hlist_unhashed(struct hlist_node *);
__attribute__((always_)) void hlist_del_init(struct hlist_node *n) {
  if (!hlist_unhashed(n)) {
    __hlist_del(n);
    INIT_HLIST_NODE(n);
  }
}


x86 assembly (clang, -O0):
<hlist_del_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <hlist_unhashed@plt>
cmp    $0x0,%eax
jne    1160 <hlist_del_init+0x30>
mov    -0x8(%rbp),%rdi
call   1050 <__hlist_del@plt>
mov    -0x8(%rbp),%rdi
call   1040 <INIT_HLIST_NODE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hlist_del_init>:
push   %rbx
mov    %rdi,%rbx
call   1030 <hlist_unhashed@plt>
test   %eax,%eax
je     113f <hlist_del_init+0xf>
pop    %rbx
ret
mov    %rbx,%rdi
call   1050 <__hlist_del@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <INIT_HLIST_NODE@plt>

LLVM IR (-O0):
%struct.hlist_node = type { i32 }
define void @hlist_del_init(%struct.hlist_node* %0) {
%2 = alloca %struct.hlist_node*
store %struct.hlist_node* %0, %struct.hlist_node** %2
%3 = load %struct.hlist_node*, %struct.hlist_node** %2
%4 = call i32 @hlist_unhashed(%struct.hlist_node* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load %struct.hlist_node*, %struct.hlist_node** %2
%8 = call i32 @__hlist_del(%struct.hlist_node* %7)
%9 = load %struct.hlist_node*, %struct.hlist_node** %2
%10 = call i32 @INIT_HLIST_NODE(%struct.hlist_node* %9)
br label %11
11: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.hlist_node = type { i32 }
define void @hlist_del_init(%struct.hlist_node* %0) {
%2 = tail call i32 @hlist_unhashed(%struct.hlist_node* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @__hlist_del(%struct.hlist_node* %0)
%6 = tail call i32 @INIT_HLIST_NODE(%struct.hlist_node* %0)
br label %7
7: ; preds = %4, %1
ret void
}
int is_alphanum(char c) {
  if (c > 32 && c < 127)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<is_alphanum>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jle    1130 <is_alphanum+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x7f,%eax
jge    1130 <is_alphanum+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <is_alphanum+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alphanum>:
add    $0xdf,%dil
xor    %eax,%eax
cmp    $0x5e,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_alphanum(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sgt i32 %5, 32
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp slt i32 %9, 127
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_alphanum(i8 signext %0) {
%2 = add i8 %0, -33
%3 = icmp ult i8 %2, 94
%4 = zext i1 %3 to i32
ret i32 %4
}
void backtrace_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @backtrace_deinit() {
ret void
}
double transitionCurve(const double v1, const double v2, const double steps,
                       const double position) {
  const double delta = (v2 - v1) / steps;
  return v1 + delta * position;
}


x86 assembly (clang, -O0):
<transitionCurve>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<transitionCurve>:
subsd  %xmm0,%xmm1
divsd  %xmm2,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @transitionCurve(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%10 = load double, double* %6
%11 = load double, double* %5
%12 = fsub double %10, %11
%13 = load double, double* %7
%14 = fdiv double %12, %13
store double %14, double* %9
%15 = load double, double* %5
%16 = load double, double* %9
%17 = load double, double* %8
%18 = call double @llvm.fmuladd.f64(double %16, double %17, double %15)
ret double %18
}

LLVM IR (-O2):
define double @transitionCurve(double %0, double %1, double %2, double %3) {
%5 = fsub double %1, %0
%6 = fdiv double %5, %2
%7 = tail call double @llvm.fmuladd.f64(double %6, double %3, double %0)
ret double %7
}
/* Variables and functions */
double __ocml_j1_f64(double);
double j1(double x) { return __ocml_j1_f64(x); }


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

x86 assembly (clang, -O2):
<j1>:
jmp    1030 <__ocml_j1_f64@plt>

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

LLVM IR (-O2):
define double @j1(double %0) {
%2 = tail call double @__ocml_j1_f64(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ loadFSM(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    printf("SFSM (Scriptable Finite State Machine)");
    printf("\nUsage: sfsm <fsm script>\n");
  } else
    loadFSM(argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    115d <main+0x3d>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
jmp    116a <main+0x4a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <loadFSM@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     1150 <main+0x20>
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
jmp    1159 <main+0x29>
mov    0x8(%rsi),%rdi
call   1050 <loadFSM@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"SFSM (Scriptable Finite State Machine)\00"
@.str.1 = [27 x i8] c"\0AUsage: sfsm <fsm script>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @loadFSM(i8* %14)
br label %16
16: ; preds = %11, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"SFSM (Scriptable Finite State Machine)\00"
@str = [26 x i8] c"\0AUsage: sfsm <fsm script>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @loadFSM(i8* %9)
br label %11
11: ; preds = %7, %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help(void) {
  printf("Usage : -Option\r\n");
  printf("Options\r\n");
  printf("no option         Auto RS485 Half duplex test\r\n");
  printf("-half             Auto RS485 Half duplex test\r\n");
  printf("-full             Auto RS485 Full duplex test\r\n");
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0d(%rip),%rdi
call   1030 <printf@plt>
lea    0xf31(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf30(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Usage : -Option\0D\0A\00"
@.str.1 = [10 x i8] c"Options\0D\0A\00"
@.str.2 = [48 x i8] c"no option Auto RS485 Half duplex test\0D\0A\00"
@.str.3 = [48 x i8] c"-half Auto RS485 Half duplex test\0D\0A\00"
@.str.4 = [48 x i8] c"-full Auto RS485 Full duplex test\0D\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"Usage : -Option\0D\00"
@str.5 = [9 x i8] c"Options\0D\00"
@str.6 = [47 x i8] c"no option Auto RS485 Half duplex test\0D\00"
@str.7 = [47 x i8] c"-half Auto RS485 Half duplex test\0D\00"
@str.8 = [47 x i8] c"-full Auto RS485 Full duplex test\0D\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.8, i64 0, i64 0))
ret void
}
void foo_2_1_2_2_2_1_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_2_2_1_2_2_1() {
ret void
}
/* Variables and functions */
char *parse_quoted_string(char *, char **);
char *parse_token(char *, char **);
char *parse_value(char *value, char **pbuf) {
  char *ret;
  if ((ret = parse_token(value, pbuf)))
    return ret;
  return parse_quoted_string(value, pbuf);
}


x86 assembly (clang, -O0):
<parse_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <parse_token@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1158 <parse_value+0x38>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1169 <parse_value+0x49>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <parse_quoted_string@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_value>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <parse_token@plt>
test   %rax,%rax
je     113c <parse_value+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <parse_quoted_string@plt>

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

LLVM IR (-O2):
define i8* @parse_value(i8* %0, i8** %1) {
%3 = tail call i8* @parse_token(i8* %0, i8** %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i8* @parse_quoted_string(i8* %0, i8** %1)
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ %3, %2 ]
ret i8* %8
}
int my_max(int a, int b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<my_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <my_max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <my_max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @my_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
float test_log1pf(float x) { return __builtin_log1pf(x); }


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

x86 assembly (clang, -O2):
<test_log1pf>:
jmp    1030 <log1pf@plt>

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

LLVM IR (-O2):
define float @test_log1pf(float %0) {
%2 = tail call float @log1pf(float %0)
ret float %2
}
void YM2612_writeSafe(const unsigned short port, const unsigned char data) {
  volatile unsigned char *pb;
  pb = (unsigned char *)0xA04000;
  while (*pb & 0x80)
    ;
  pb[port & 3] = data;
}


x86 assembly (clang, -O0):
<YM2612_writeSafe>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    $0xa04000,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
movzbl %al,%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1136 <YM2612_writeSafe+0x36>
jmp    111a <YM2612_writeSafe+0x1a>
mov    -0x3(%rbp),%dl
mov    -0x10(%rbp),%rax
movzwl -0x2(%rbp),%ecx
and    $0x3,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<YM2612_writeSafe>:
cmpb   $0x0,0xa04000
js     1100 <YM2612_writeSafe>
movzwl %di,%eax
and    $0x3,%eax
mov    %sil,0xa04000(%rax)
ret

LLVM IR (-O0):
define void @YM2612_writeSafe(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
%5 = alloca i8*
store i16 %0, i16* %3
store i8 %1, i8* %4
store i8* inttoptr (i64 10502144 to i8*), i8** %5
br label %6
6: ; preds = %12, %2
%7 = load i8*, i8** %5
%8 = load volatile i8, i8* %7
%9 = zext i8 %8 to i32
%10 = and i32 %9, 128
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %6
br label %6
13: ; preds = %6
%14 = load i8, i8* %4
%15 = load i8*, i8** %5
%16 = load i16, i16* %3
%17 = zext i16 %16 to i32
%18 = and i32 %17, 3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %15, i64 %19
store volatile i8 %14, i8* %20
ret void
}

LLVM IR (-O2):
define void @YM2612_writeSafe(i16 zeroext %0, i8 zeroext %1) {
br label %3
3: ; preds = %3, %2
%4 = load volatile i8, i8* inttoptr (i64 10502144 to i8*)
%5 = icmp sgt i8 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = and i16 %0, 3
%8 = zext i16 %7 to i64
%9 = getelementptr inbounds i8, i8* inttoptr (i64 10502144 to i8*), i64 %8
store volatile i8 %1, i8* %9
ret void
}
void init_uart(void) {
  (*((volatile unsigned long *)0x7F008000)) &= ~0xff;
  (*((volatile unsigned long *)0x7F008000)) |= 0x22;
  (*((volatile unsigned long *)0x7F005000)) = 0x3;
  (*((volatile unsigned long *)0x7F005004)) = 0x5;
  (*((volatile unsigned long *)0x7F005008)) = 0x1;
  (*((volatile unsigned long *)0x7F00500C)) = 0;
  (*((volatile unsigned short *)0x7F005028)) = 35;
  (*((volatile unsigned short *)0x7F00502C)) = 0x1;
}


x86 assembly (clang, -O0):
<init_uart>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008000,%eax
mov    (%rax),%rcx
and    $0xffffffffffffff00,%rcx
mov    $0x7f008000,%eax
mov    %rcx,(%rax)
mov    $0x7f008000,%eax
mov    (%rax),%rcx
or     $0x22,%rcx
mov    $0x7f008000,%eax
mov    %rcx,(%rax)
mov    $0x7f005000,%eax
movq   $0x3,(%rax)
mov    $0x7f005004,%eax
movq   $0x5,(%rax)
mov    $0x7f005008,%eax
movq   $0x1,(%rax)
mov    $0x7f00500c,%eax
movq   $0x0,(%rax)
mov    $0x7f005028,%eax
movw   $0x23,(%rax)
mov    $0x7f00502c,%eax
movw   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_uart>:
andq   $0xffffffffffffff00,0x7f008000
orq    $0x22,0x7f008000
7f 22
movq   $0x3,0x7f005000
movq   $0x5,0x7f005004
movq   $0x1,0x7f005008
movq   $0x0,0x7f00500c
movw   $0x23,0x7f005028
movw   $0x1,0x7f00502c
ret

LLVM IR (-O0):
define void @init_uart() {
%1 = load volatile i64, i64* inttoptr (i64 2130739200 to i64*)
%2 = and i64 %1, -256
store volatile i64 %2, i64* inttoptr (i64 2130739200 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 2130739200 to i64*)
%4 = or i64 %3, 34
store volatile i64 %4, i64* inttoptr (i64 2130739200 to i64*)
store volatile i64 3, i64* inttoptr (i64 2130726912 to i64*)
store volatile i64 5, i64* inttoptr (i64 2130726916 to i64*)
store volatile i64 1, i64* inttoptr (i64 2130726920 to i64*)
store volatile i64 0, i64* inttoptr (i64 2130726924 to i64*)
store volatile i16 35, i16* inttoptr (i64 2130726952 to i16*)
store volatile i16 1, i16* inttoptr (i64 2130726956 to i16*)
ret void
}

LLVM IR (-O2):
define void @init_uart() {
%1 = load volatile i64, i64* inttoptr (i64 2130739200 to i64*)
%2 = and i64 %1, -256
store volatile i64 %2, i64* inttoptr (i64 2130739200 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 2130739200 to i64*)
%4 = or i64 %3, 34
store volatile i64 %4, i64* inttoptr (i64 2130739200 to i64*)
store volatile i64 3, i64* inttoptr (i64 2130726912 to i64*)
store volatile i64 5, i64* inttoptr (i64 2130726916 to i64*)
store volatile i64 1, i64* inttoptr (i64 2130726920 to i64*)
store volatile i64 0, i64* inttoptr (i64 2130726924 to i64*)
store volatile i16 35, i16* inttoptr (i64 2130726952 to i16*)
store volatile i16 1, i16* inttoptr (i64 2130726956 to i16*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alloca(int);
int main(int argc, char *argv[]) { alloca(1); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1030 <alloca@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @alloca(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, int);
int /*<<< orphan*/ stderr;
void error_stop(char *reason, char *file, int line) {
  fprintf(stderr, "--- STOP called - reason: %s - %s line %d ---\n\n", reason,
          file, line);
  exit(1);
}


x86 assembly (clang, -O0):
<error_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_stop>:
push   %rax
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"--- STOP called - reason: %s - %s line %d ---\0A\0A\00"
define void @error_stop(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"--- STOP called - reason: %s - %s line %d ---\0A\0A\00"
define void @error_stop(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void call_reg32(unsigned int reg32) {
  put8(0xFF);
  put8(0xD0 + reg32);
}


x86 assembly (clang, -O0):
<call_reg32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xff,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
add    $0xd0,%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_reg32>:
push   %rbx
mov    %edi,%ebx
mov    $0xff,%edi
call   1030 <put8@plt>
add    $0xd0,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @call_reg32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 255)
%4 = load i32, i32* %2
%5 = add i32 208, %4
%6 = call i32 @put8(i32 %5)
ret void
}

LLVM IR (-O2):
define void @call_reg32(i32 %0) {
%2 = tail call i32 @put8(i32 255)
%3 = add i32 %0, 208
%4 = tail call i32 @put8(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
scalar_t__ malloc(size_t);
void *alloc(size_t s) {
  void *mem;
  if ((mem = (void *)malloc(s)) == 0)
    fatal("");
  return mem;
}


x86 assembly (clang, -O0):
<alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    114f <alloc+0x2f>
lea    0xeb6(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <alloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @fatal(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @alloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = inttoptr i64 %2 to i8*
ret i8* %7
}
/* Variables and functions */
double nordis(double);
double ndens(double val, double mean, double sig) {
  return nordis((val - mean) / sig) / sig;
}


x86 assembly (clang, -O0):
<ndens>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
call   1030 <nordis@plt>
divsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndens>:
push   %rax
movsd  %xmm2,(%rsp)
subsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
call   1030 <nordis@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ndens(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fsub double %7, %8
%10 = load double, double* %6
%11 = fdiv double %9, %10
%12 = call double @nordis(double %11)
%13 = load double, double* %6
%14 = fdiv double %12, %13
ret double %14
}

LLVM IR (-O2):
define double @ndens(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = fdiv double %4, %2
%6 = tail call double @nordis(double %5)
%7 = fdiv double %6, %2
ret double %7
}
void free_flat_id(struct flat_id *id) {
  if (!id)
    return;
  sys_free((id),
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/chiforbogdan/opensips/refs/heads/master/"
           "modules/db_flatstore/flat_id.c",
           __FUNCTION__, 82);
}


x86 assembly (clang, -O0):
<free_flat_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <free_flat_id+0x1c>
jmp    114a <free_flat_id+0x3a>
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
lea    0xf63(%rip),%rdx
mov    $0x52,%ecx
mov    $0x0,%al
call   1030 <sys_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_flat_id>:
test   %rdi,%rdi
je     112f <free_flat_id+0x1f>
lea    0xee4(%rip),%rsi
lea    0xf7e(%rip),%rdx
mov    $0x52,%ecx
xor    %eax,%eax
jmp    1030 <sys_free@plt>
ret

LLVM IR (-O0):
%struct.flat_id = type opaque
@.str = [161 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/chiforbogdan/opensips/refs/heads/master/modules/db_flatstore/flat_id.c\00"
@__FUNCTION__.free_flat_id = [13 x i8] c"free_flat_id\00"
define void @free_flat_id(%struct.flat_id* %0) {
%2 = alloca %struct.flat_id*
store %struct.flat_id* %0, %struct.flat_id** %2
%3 = load %struct.flat_id*, %struct.flat_id** %2
%4 = icmp ne %struct.flat_id* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load %struct.flat_id*, %struct.flat_id** %2
%8 = call i32 (%struct.flat_id*, i8*, i8*, i32, ...) bitcast (i32 (...)* @sys_free to i32 (%struct.flat_id*, i8*, i8*, i32, ...)*)(%struct.flat_id* %7, i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.free_flat_id, i64 0, i64 0), i32 82)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.flat_id = type opaque
@.str = [161 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/chiforbogdan/opensips/refs/heads/master/modules/db_flatstore/flat_id.c\00"
@__FUNCTION__.free_flat_id = [13 x i8] c"free_flat_id\00"
define void @free_flat_id(%struct.flat_id* %0) {
%2 = icmp eq %struct.flat_id* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (%struct.flat_id*, i8*, i8*, i32, ...) bitcast (i32 (...)* @sys_free to i32 (%struct.flat_id*, i8*, i8*, i32, ...)*)(%struct.flat_id* %0, i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.free_flat_id, i64 0, i64 0), i32 82)
br label %5
5: ; preds = %1, %3
ret void
}
int fun1115() { return 1115; }


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

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

LLVM IR (-O0):
define i32 @fun1115() {
ret i32 1115
}

LLVM IR (-O2):
define i32 @fun1115() {
ret i32 1115
}