xunge/DecIR huggingface dataset:
unsigned xrop3_47_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = S | stk3;
  stk1 = T & stk2;
  stk1 = ~stk1;
  return stk1;
}


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

x86 assembly (clang, -O2):
<xrop3_47_0_0>:
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
lea    -0x100(%rdi),%eax
and    %ecx,%eax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_47_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = mul nuw nsw i32 %4, 257
%6 = or i32 %3, -256
%7 = and i32 %5, %6
%8 = xor i32 %7, -1
ret i32 %8
}
int main(void) {
  int a = 4;
  a += 0;
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *, int);
void main() {
  int buf[100];
  foo(buf, 100);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
lea    -0x190(%rbp),%rdi
mov    $0x64,%esi
call   1030 <foo@plt>
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x198,%rsp
mov    %rsp,%rdi
mov    $0x64,%esi
call   1030 <foo@plt>
add    $0x198,%rsp
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca [100 x i32]
%2 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%3 = call i32 @foo(i32* %2, i32 100)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = alloca [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
%3 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%4 = call i32 @foo(i32* %3, i32 100)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Skipping test on non-mmu host!\n");
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"Skipping test on non-mmu host!\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [31 x i8] c"Skipping test on non-mmu host!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int readint(FILE *fp) {
  int val;
  fscanf(fp, "%d", &val);
  return (val);
}


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

x86 assembly (clang, -O2):
<readint>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <fscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @readint(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @readint(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
double third_order_polynomial(double, double, double, double, double);
double mean_anomaly_moon(double jce) {
  return third_order_polynomial(1.0 / 56250.0, 0.0086972, 477198.867398,
                                134.96298, jce);
}


x86 assembly (clang, -O0):
<mean_anomaly_moon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm4
movsd  0xed6(%rip),%xmm0
movsd  0xed6(%rip),%xmm1
movsd  0xed6(%rip),%xmm2
movsd  0xed6(%rip),%xmm3
call   1030 <third_order_polynomial@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mean_anomaly_moon>:
movaps %xmm0,%xmm4
movsd  0xee5(%rip),%xmm0
movsd  0xee5(%rip),%xmm1
movsd  0xee5(%rip),%xmm2
movsd  0xee5(%rip),%xmm3
jmp    1030 <third_order_polynomial@plt>

LLVM IR (-O0):
define double @mean_anomaly_moon(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @third_order_polynomial(double 0x3EF2A42F961F79B9, double 8.697200e-03, double 0x411D203B78372E6A, double 0x4060DED0BB6ED677, double %3)
ret double %4
}

LLVM IR (-O2):
define double @mean_anomaly_moon(double %0) {
%2 = tail call double @third_order_polynomial(double 0x3EF2A42F961F79B9, double 8.697200e-03, double 0x411D203B78372E6A, double 0x4060DED0BB6ED677, double %0)
ret double %2
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *shortname(const char *longname) {
  const char *last = strrchr(longname, '.');
  return last ? last + 1 : longname;
}


x86 assembly (clang, -O0):
<shortname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <shortname+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <shortname+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shortname>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @shortname(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 46)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @shortname(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
int stationLocationIsKnown(double x, double y) {
  if (x == 0.0 && y == 0.0)
    return (0);
  if (x < -1.0e20 / 2.0 || y < -1.0e20 / 2.0)
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<stationLocationIsKnown>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    114a <stationLocationIsKnown+0x4a>
jp     114a <stationLocationIsKnown+0x4a>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    114a <stationLocationIsKnown+0x4a>
jp     114a <stationLocationIsKnown+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1183 <stationLocationIsKnown+0x83>
movsd  0xeae(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
ja     1170 <stationLocationIsKnown+0x70>
movsd  0xe9b(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    117c <stationLocationIsKnown+0x7c>
movl   $0x0,-0x4(%rbp)
jmp    1183 <stationLocationIsKnown+0x83>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stationLocationIsKnown>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
setp   %al
setne  %cl
or     %al,%cl
ucomisd %xmm2,%xmm1
setp   %al
setne  %dl
or     %al,%dl
movsd  0xedc(%rip),%xmm2
ucomisd %xmm0,%xmm2
setbe  %sil
ucomisd %xmm1,%xmm2
setbe  %al
and    %sil,%al
or     %cl,%dl
and    %al,%dl
movzbl %dl,%eax
ret

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

LLVM IR (-O2):
define i32 @stationLocationIsKnown(double %0, double %1) {
%3 = fcmp une double %0, 0.000000e+00
%4 = fcmp une double %1, 0.000000e+00
%5 = fcmp uge double %0, -5.000000e+19
%6 = fcmp uge double %1, -5.000000e+19
%7 = and i1 %5, %6
%8 = or i1 %3, %4
%9 = and i1 %8, %7
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
char *String_concat(char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ setClassSearchPath(char *);
void arg_setClassSearchPath(char *s) {
  char *csp = String_concat(s, "/", NULL);
  setClassSearchPath(csp);
}


x86 assembly (clang, -O0):
<arg_setClassSearchPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <String_concat@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <setClassSearchPath@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg_setClassSearchPath>:
push   %rax
lea    0xed8(%rip),%rsi
xor    %edx,%edx
call   1030 <String_concat@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <setClassSearchPath@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define void @arg_setClassSearchPath(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @String_concat(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* null)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @setClassSearchPath(i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define void @arg_setClassSearchPath(i8* %0) {
%2 = tail call i8* @String_concat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* null)
%3 = tail call i32 @setClassSearchPath(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strerr_die(int, char *, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
void usage(void) {
  strerr_die((100),
             ("tcpclient: usage: tcpclient [ -hHrRdDqQv ] [ -i localip ] [ -p "
              "localport ] [ -T timeoutconn ] [ -l localname ] [ -t "
              "timeoutinfo ] host port program"),
             0, 0, 0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
lea    0xedc(%rip),%rsi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <strerr_die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x64,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
call   1030 <strerr_die@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [148 x i8] c"tcpclient: usage: tcpclient [ -hHrRdDqQv ] [ -i localip ] [ -p localport ] [ -T timeoutconn ] [ -l localname ] [ -t timeoutinfo ] host port program\00"
define void @usage() {
%1 = call i32 @strerr_die(i32 100, i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [148 x i8] c"tcpclient: usage: tcpclient [ -hHrRdDqQv ] [ -i localip ] [ -p localport ] [ -T timeoutconn ] [ -l localname ] [ -t timeoutinfo ] host port program\00"
define void @usage() {
%1 = tail call i32 @strerr_die(i32 100, i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ logger_register_service_with_id(int, char const *);
int variant_get_next_user_type();
void logger_register_service(int *serviceId, const char *name) {
  *serviceId = variant_get_next_user_type();
  logger_register_service_with_id(*serviceId, name);
}


x86 assembly (clang, -O0):
<logger_register_service>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <variant_get_next_user_type@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1040 <logger_register_service_with_id@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logger_register_service>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <variant_get_next_user_type@plt>
mov    %eax,(%rbx)
mov    %eax,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <logger_register_service_with_id@plt>

LLVM IR (-O0):
define void @logger_register_service(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = call i32 (...) @variant_get_next_user_type()
%6 = load i32*, i32** %3
store i32 %5, i32* %6
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = load i8*, i8** %4
%10 = call i32 @logger_register_service_with_id(i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
define void @logger_register_service(i32* nocapture writeonly %0, i8* %1) {
%3 = tail call i32 (...) @variant_get_next_user_type()
store i32 %3, i32* %0
%4 = tail call i32 @logger_register_service_with_id(i32 %3, i8* %1)
ret void
}
/* Variables and functions */
int fran();
int getRandomInt(int min, int max) {
  return (((int)(fran() * (max - min + 1))) + min);
}


x86 assembly (clang, -O0):
<getRandomInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <fran@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandomInt>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <fran@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
imul   %ebx,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getRandomInt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @fran()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = mul nsw i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @getRandomInt(i32 %0, i32 %1) {
%3 = tail call i32 (...) @fran()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = mul nsw i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
int f(double d) { return !__builtin_isnan(d); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm0,%xmm0
setp   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
ucomisd %xmm0,%xmm0
setnp  %al
ret

LLVM IR (-O0):
define i32 @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp uno double %3, %3
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f(double %0) {
%2 = fcmp ord double %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ mill_sleep(scalar_t__);
scalar_t__ now();
int /*<<< orphan*/ printf(char *, char);
__attribute__((no)) void dot(char c, int *done) {
  while (!*done) {
    printf("%c", c);
    mill_sleep(now() + 5);
  }
}


x86 assembly (clang, -O0):
<dot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    115b <dot+0x2b>
jmp    1183 <dot+0x53>
lea    0xe9e(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <now@plt>
mov    %rax,%rdi
add    $0x5,%rdi
call   1040 <mill_sleep@plt>
jmp    1142 <dot+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot>:
push   %rbp
push   %r14
push   %rbx
cmpl   $0x0,(%rsi)
jne    116f <dot+0x3f>
mov    %rsi,%rbx
movsbl %dil,%ebp
lea    0xeb9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <now@plt>
lea    0x5(%rax),%rdi
call   1040 <mill_sleep@plt>
cmpl   $0x0,(%rbx)
je     1150 <dot+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @dot(i8 signext %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %2, %5
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%7 = tail call i64 (...) @now()
%8 = add nsw i64 %7, 5
%9 = tail call i32 @mill_sleep(i64 %8)
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 0
br i1 %11, label %5, label %12
12: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kitsune_register_var(char *, char *, char *,
                                        int /*<<< orphan*/, char *, int, int);
int /*<<< orphan*/ printf(char *);
void __kitsune_register_symbols(void) {
  printf("pluginv1: inside kit_reg_symbols, calling kit_reg_var\n");
  kitsune_register_var("buf_num", "ObfuscateIpToText", "pluginv1.c", 0,
                       "pluginv1", 10, 1);
}


x86 assembly (clang, -O0):
<__kitsune_register_symbols>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
lea    0xefd(%rip),%rsi
lea    0xf08(%rip),%rdx
xor    %ecx,%ecx
lea    0xf0a(%rip),%r8
mov    $0xa,%r9d
movl   $0x1,(%rsp)
call   1040 <kitsune_register_var@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__kitsune_register_symbols>:
push   %rax
lea    0xf06(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,(%rsp)
lea    0xec5(%rip),%rdi
lea    0xec6(%rip),%rsi
lea    0xed1(%rip),%rdx
lea    0xed5(%rip),%r8
xor    %ecx,%ecx
mov    $0xa,%r9d
call   1040 <kitsune_register_var@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [55 x i8] c"pluginv1: inside kit_reg_symbols, calling kit_reg_var\0A\00"
@.str.1 = [8 x i8] c"buf_num\00"
@.str.2 = [18 x i8] c"ObfuscateIpToText\00"
@.str.3 = [11 x i8] c"pluginv1.c\00"
@.str.4 = [9 x i8] c"pluginv1\00"
define void @__kitsune_register_symbols() {
%1 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @kitsune_register_var(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 10, i32 1)
ret void
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"buf_num\00"
@.str.2 = [18 x i8] c"ObfuscateIpToText\00"
@.str.3 = [11 x i8] c"pluginv1.c\00"
@.str.4 = [9 x i8] c"pluginv1\00"
@str = [54 x i8] c"pluginv1: inside kit_reg_symbols, calling kit_reg_var\00"
define void @__kitsune_register_symbols() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @kitsune_register_var(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 10, i32 1)
ret void
}
long fibonacci(int n) {
  if (n <= 2)
    return 1;
  return fibonacci(n - 1) + fibonacci(n - 2);
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jg     1132 <fibonacci+0x22>
movq   $0x1,-0x8(%rbp)
jmp    115a <fibonacci+0x4a>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%r14d
cmp    $0x3,%edi
jl     1147 <fibonacci+0x37>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
lea    -0x3(%rbx),%edi
call   1030 <fibonacci@plt>
add    %rax,%r14
add    $0xfffffffe,%ebx
cmp    $0x4,%ebx
ja     1130 <fibonacci+0x20>
add    $0x1,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @fibonacci(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i64 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i64 @fibonacci(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i64 %7, %5
%10 = icmp ult i32 %4, 5
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i64 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i64 [ 1, %1 ], [ %12, %11 ]
ret i64 %14
}
/* Variables and functions */
char *realloc(int /*<<< orphan*/, int);
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  char *x;
  write(1, "A\n", 2);
  x = realloc(0, 8);
  write(1, "B\n", 2);
  *x = 10;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    0xec5(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
xor    %edi,%edi
mov    $0x8,%esi
call   1040 <realloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x1,%edi
lea    0xea2(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
mov    -0x10(%rbp),%rax
movb   $0xa,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
mov    $0x2,%edx
call   1030 <write@plt>
xor    %edi,%edi
mov    $0x8,%esi
call   1040 <realloc@plt>
mov    %rax,%rbx
lea    0xeb6(%rip),%rsi
mov    $0x1,%edi
mov    $0x2,%edx
call   1030 <write@plt>
movb   $0xa,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"A\0A\00"
@.str.1 = [3 x i8] c"B\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = call i8* @realloc(i32 0, i32 8)
store i8* %4, i8** %2
%5 = call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%6 = load i8*, i8** %2
store i8 10, i8* %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"A\0A\00"
@.str.1 = [3 x i8] c"B\0A\00"
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i8* @realloc(i32 0, i32 8)
%3 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
store i8 10, i8* %2
ret i32 0
}
void modem_pintrl_config(int mode) { return; }


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

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

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

LLVM IR (-O2):
define void @modem_pintrl_config(i32 %0) {
ret void
}
/* Type definitions */
struct dirent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ util_ptr_vec_free(void **, int);
void util_scandir_free(struct dirent **de_vec, int count) {
  util_ptr_vec_free((void **)de_vec, count);
}


x86 assembly (clang, -O0):
<util_scandir_free>:
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 <util_ptr_vec_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_scandir_free>:
jmp    1030 <util_ptr_vec_free@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define void @util_scandir_free(%struct.dirent** %0, i32 %1) {
%3 = alloca %struct.dirent**
%4 = alloca i32
store %struct.dirent** %0, %struct.dirent*** %3
store i32 %1, i32* %4
%5 = load %struct.dirent**, %struct.dirent*** %3
%6 = bitcast %struct.dirent** %5 to i8**
%7 = load i32, i32* %4
%8 = call i32 @util_ptr_vec_free(i8** %6, i32 %7)
ret void
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define void @util_scandir_free(%struct.dirent** %0, i32 %1) {
%3 = bitcast %struct.dirent** %0 to i8**
%4 = tail call i32 @util_ptr_vec_free(i8** %3, i32 %1)
ret void
}
int format_cents(int dollar, int cents) { return (dollar * 100) + cents; }


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

x86 assembly (clang, -O2):
<format_cents>:
imul   $0x64,%edi,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @format_cents(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 = mul nsw i32 %5, 100
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @format_cents(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 100
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int sigsetmask(int mask) {
  ;
  errno = ENOSYS;
  return -1;
  ;
}


x86 assembly (clang, -O0):
<sigsetmask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec1(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigsetmask>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @sigsetmask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @sigsetmask(i32 %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char str[32766];
  memset(str, '\n', 32765);
  str[32765] = 0;
  printf("%s(p7) hint @pause\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x8010,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8010(%rbp),%rdi
mov    $0xa,%esi
mov    $0x7ffd,%edx
call   1040 <memset@plt>
movb   $0x0,-0x13(%rbp)
lea    -0x8010(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x8000,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x7ffd,%edx
call   1040 <memset@plt>
movb   $0x0,0x7ffd(%rsp)
lea    0xeb4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"%s(p7) hint @pause\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [32766 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [32766 x i8], [32766 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i8 signext 10, i32 32765)
%5 = getelementptr inbounds [32766 x i8], [32766 x i8]* %2, i64 0, i64 32765
store i8 0, i8* %5
%6 = getelementptr inbounds [32766 x i8], [32766 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"%s(p7) hint @pause\0A\00"
define i32 @main() {
%1 = alloca [32766 x i8]
%2 = getelementptr inbounds [32766 x i8], [32766 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i8 signext 10, i32 32765)
%4 = getelementptr inbounds [32766 x i8], [32766 x i8]* %1, i64 0, i64 32765
store i8 0, i8* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __builtin_wrctl(int, int);
void _Nios2_Set_ctlreg_estatus(uint32_t value) {
  __builtin_wrctl(1, (int)value);
}


x86 assembly (clang, -O0):
<_Nios2_Set_ctlreg_estatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
mov    $0x1,%edi
call   1030 <__builtin_wrctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Nios2_Set_ctlreg_estatus>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <__builtin_wrctl@plt>

LLVM IR (-O0):
define void @_Nios2_Set_ctlreg_estatus(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = call i32 @__builtin_wrctl(i32 1, i32 %4)
ret void
}

LLVM IR (-O2):
define void @_Nios2_Set_ctlreg_estatus(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @__builtin_wrctl(i32 1, i32 %2)
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
float _prim_int_float(int64_t p1) { return (float)p1; }


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

x86 assembly (clang, -O2):
<_prim_int_float>:
cvtsi2ss %rdi,%xmm0
ret

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

LLVM IR (-O2):
define float @_prim_int_float(i64 %0) {
%2 = sitofp i64 %0 to float
ret float %2
}
void deallocate_TxnHeader(struct TxnHeader *v) {}


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

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

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

LLVM IR (-O2):
%struct.TxnHeader = type opaque
define void @deallocate_TxnHeader(%struct.TxnHeader* nocapture %0) {
ret void
}
/* Variables and functions */
long long __builtin_wasm_trunc_s_i64_f64(double);
long long trunc_s_i64_f64(double f) {
  return __builtin_wasm_trunc_s_i64_f64(f);
}


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

x86 assembly (clang, -O2):
<trunc_s_i64_f64>:
jmp    1030 <__builtin_wasm_trunc_s_i64_f64@plt>

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

LLVM IR (-O2):
define i64 @trunc_s_i64_f64(double %0) {
%2 = tail call i64 @__builtin_wasm_trunc_s_i64_f64(double %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ wFileExists(char *);
char *wPopString();
int /*<<< orphan*/ wPushNumber(int /*<<< orphan*/);
void wBasFileExists() {
  char *fname;
  fname = wPopString();
  wPushNumber(wFileExists(fname));
  free(fname);
}


x86 assembly (clang, -O0):
<wBasFileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <wPopString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <wFileExists@plt>
mov    %eax,%edi
call   1050 <wPushNumber@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasFileExists>:
push   %rbx
xor    %eax,%eax
call   1040 <wPopString@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <wFileExists@plt>
mov    %eax,%edi
call   1050 <wPushNumber@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @wBasFileExists() {
%1 = alloca i8*
%2 = call i8* (...) @wPopString()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @wFileExists(i8* %3)
%5 = call i32 @wPushNumber(i32 %4)
%6 = load i8*, i8** %1
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @wBasFileExists() {
%1 = tail call i8* (...) @wPopString()
%2 = tail call i32 @wFileExists(i8* %1)
%3 = tail call i32 @wPushNumber(i32 %2)
%4 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ strncmp(char const *, char const *, int /*<<< orphan*/);
int prefix(const char *line, const char *prefix) {
  return !strncmp(line, prefix, strlen(prefix));
}


x86 assembly (clang, -O0):
<prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @prefix(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @prefix(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
unsigned long long _bzhi_u64(unsigned long long, int);
unsigned long long f24(unsigned long long x) { return _bzhi_u64(x, 5); }


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

x86 assembly (clang, -O2):
<f24>:
mov    $0x5,%esi
jmp    1030 <_bzhi_u64@plt>

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

LLVM IR (-O2):
define i64 @f24(i64 %0) {
%2 = tail call i64 @_bzhi_u64(i64 %0, i32 5)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *replace_spaces(char *);
int main() {
  char *url = "http://sample.com/foo   bar ish ";
  printf("%s\n", url);
  printf("%s\n", replace_spaces(url));
}


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

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xef6(%rip),%r14
lea    0xece(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <replace_spaces@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [33 x i8] c"http://sample.com/foo bar ish \00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i8*
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = load i8*, i8** %1
%5 = call i8* @replace_spaces(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"http://sample.com/foo bar ish \00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @replace_spaces(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
int foo(int a, int b) { return (a & (a == 0)) | (b & !b); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmpl   $0x0,-0x4(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
cmpl   $0x0,-0x8(%rbp)
setne  %dl
xor    $0xff,%dl
and    $0x1,%dl
movzbl %dl,%edx
and    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %ecx,%ecx
test   %edi,%edi
sete   %cl
and    %edi,%ecx
xor    %eax,%eax
test   %esi,%esi
sete   %al
and    %esi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @foo(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* %3
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = and i32 %5, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
%15 = and i32 %10, %14
%16 = or i32 %9, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = zext i1 %3 to i32
%5 = and i32 %4, %0
%6 = icmp eq i32 %1, 0
%7 = zext i1 %6 to i32
%8 = and i32 %7, %1
%9 = or i32 %8, %5
ret i32 %9
}
char *strcpy(char *restrict d, const char *restrict s) {
  char *vd = d;
  while (*s)
    *(vd++) = *(s++);
  *vd = 0;
  return d;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <strcpy+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <strcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <strcpy+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* noalias returned writeonly %0, i8* noalias nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned long);
void delay(unsigned long milliseconds) { usleep(milliseconds * 1000); }


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

x86 assembly (clang, -O2):
<delay>:
imul   $0x3e8,%rdi,%rdi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @delay(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 1000
%5 = call i32 @usleep(i64 %4)
ret void
}

LLVM IR (-O2):
define void @delay(i64 %0) {
%2 = mul i64 %0, 1000
%3 = tail call i32 @usleep(i64 %2)
ret void
}
/* Variables and functions */
scalar_t__ pthread_self();
void *hybris_get_thread_id() { return (void *)pthread_self(); }


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

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

LLVM IR (-O0):
define i8* @hybris_get_thread_id() {
%1 = call i64 (...) @pthread_self()
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}

LLVM IR (-O2):
define i8* @hybris_get_thread_id() {
%1 = tail call i64 (...) @pthread_self()
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
unsigned long add(unsigned long a) { return a + 0x12345U; }


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

x86 assembly (clang, -O2):
<add>:
lea    0x12345(%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @add(i64 %0) {
%2 = add i64 %0, 74565
ret i64 %2
}
void storecmds(char *cmd) {}


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

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

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

LLVM IR (-O2):
define void @storecmds(i8* nocapture %0) {
ret void
}
/* Variables and functions */
float readFloat();
int /*<<< orphan*/ writeCommand(char *);
float acceleroZ() {
  float value = 0;
  writeCommand("ACCZ");
  value = readFloat();
  return value;
}


x86 assembly (clang, -O0):
<acceleroZ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <writeCommand@plt>
mov    $0x0,%al
call   1040 <readFloat@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acceleroZ>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <writeCommand@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <readFloat@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"ACCZ\00"
define float @acceleroZ() {
%1 = alloca float
store float 0.000000e+00, float* %1
%2 = call i32 @writeCommand(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = call float (...) @readFloat()
store float %3, float* %1
%4 = load float, float* %1
ret float %4
}

LLVM IR (-O2):
@.str = [5 x i8] c"ACCZ\00"
define float @acceleroZ() {
%1 = tail call i32 @writeCommand(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call float (...) @readFloat()
ret float %2
}