xunge/DecIR huggingface dataset:
void RTAvlrooGCPtrDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrooGCPtrDestroy() {
ret void
}
/* Variables and functions */
double fun(int, int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int m, n;
  scanf("%d%d", &m, &n);
  printf("x*x*x-5*x*x+16*x-80 µÄ½â x= %f\n", fun(m, n));
  getchar();
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1060 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <fun@plt>
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <fun@plt>
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [36 x i8] c"x*x*x-5*x*x+16*x-80 \C2\B5\C3\84\C2\BD\C3\A2 x= %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call double @fun(i32 %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), double %7)
%9 = call i32 (...) @getchar()
%10 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [36 x i8] c"x*x*x-5*x*x+16*x-80 \C2\B5\C3\84\C2\BD\C3\A2 x= %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call double @fun(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), double %8)
%10 = call i32 (...) @getchar()
%11 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int EOF;
int getchar();
int main(void) {
  int i, c;
  char s[100];
  i = c = 0;
  while (i < 100 - 1) {
    c = getchar();
    if (c != EOF)
      if (c != '\n')
        s[i++] = c;
  }
  s[i] = '\0';
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x63,-0x8(%rbp)
jge    117d <main+0x6d>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e9d(%rip),%rcx
cmp    (%rcx),%eax
je     1178 <main+0x68>
cmpl   $0xa,-0xc(%rbp)
je     1173 <main+0x63>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
cltq
mov    %cl,-0x70(%rbp,%rax,1)
jmp    1178 <main+0x68>
jmp    112d <main+0x1d>
movslq -0x8(%rbp),%rax
movb   $0x0,-0x70(%rbp,%rax,1)
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ece(%rip),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    (%rbx),%eax
setne  %cl
cmp    $0xa,%eax
setne  %al
and    %cl,%al
movzbl %al,%eax
add    %eax,%ebp
cmp    $0x63,%ebp
jb     1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [100 x i8]
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %2
br label %5
5: ; preds = %24, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 99
br i1 %7, label %8, label %25
8: ; preds = %5
%9 = call i32 (...) @getchar()
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32, i32* @EOF
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %24
13: ; preds = %8
%14 = load i32, i32* %3
%15 = icmp ne i32 %14, 10
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = load i32, i32* %3
%18 = trunc i32 %17 to i8
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
%21 = sext i32 %19 to i64
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 %21
store i8 %18, i8* %22
br label %23
23: ; preds = %16, %13
br label %24
24: ; preds = %23, %8
br label %5
25: ; preds = %5
%26 = load i32, i32* %2
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 %27
store i8 0, i8* %28
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %9, %1 ]
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
%6 = icmp ne i32 %3, 10
%7 = and i1 %6, %5
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %2, %8
%10 = icmp ult i32 %9, 99
br i1 %10, label %1, label %11
11: ; preds = %1
ret i32 0
}
int has_highbit(const char *s) {
  if (s) {
    do
      if (*s & 0200)
        return 1;
    while (*s++ != '\0');
  }
  return 0;
}


x86 assembly (clang, -O0):
<has_highbit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115e <has_highbit+0x5e>
jmp    1118 <has_highbit+0x18>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1139 <has_highbit+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1165 <has_highbit+0x65>
jmp    113e <has_highbit+0x3e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1118 <has_highbit+0x18>
jmp    115e <has_highbit+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_highbit>:
xor    %eax,%eax
test   %rdi,%rdi
je     111f <has_highbit+0x1f>
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
test   %cl,%cl
js     1120 <has_highbit+0x20>
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <has_highbit+0x10>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @has_highbit(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %22
6: ; preds = %1
br label %7
7: ; preds = %15, %6
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = and i32 %10, 128
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %7
store i32 1, i32* %2
br label %23
14: ; preds = %7
br label %15
15: ; preds = %14
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %3
%18 = load i8, i8* %16
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 0
br i1 %20, label %7, label %21
21: ; preds = %15
br label %22
22: ; preds = %21, %1
store i32 0, i32* %2
br label %23
23: ; preds = %22, %13
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @has_highbit(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1, %7
%4 = phi i8* [ %8, %7 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = icmp sgt i8 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = icmp eq i8 %5, 0
br i1 %9, label %10, label %3
10: ; preds = %7, %3, %1
%11 = phi i32 [ 0, %1 ], [ 0, %7 ], [ 1, %3 ]
ret i32 %11
}
/* Variables and functions */
double M_PI;
double sunmodel_geom_mean_anomaly_sun(double t) {
  double m;
  m = (M_PI * (357.52911 + t * (35999.05029 - 0.0001537 * t)) / 180.0);
  return m;
}


x86 assembly (clang, -O0):
<sunmodel_geom_mean_anomaly_sun>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ed8(%rip),%rax
movsd  (%rax),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  0xeea(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xee6(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xec6(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeae(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sunmodel_geom_mean_anomaly_sun>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef4(%rip),%xmm1
mov    0x2ecd(%rip),%rax
mulsd  %xmm1,%xmm0
addsd  0xee9(%rip),%xmm0
mulsd  (%rax),%xmm0
divsd  0xee5(%rip),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @sunmodel_geom_mean_anomaly_sun(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* @M_PI
%5 = load double, double* %2
%6 = load double, double* %2
%7 = call double @llvm.fmuladd.f64(double -1.537000e-04, double %6, double 0x40E193E19BF9C62A)
%8 = call double @llvm.fmuladd.f64(double %5, double %7, double 0x407658773C0C1FC9)
%9 = fmul double %4, %8
%10 = fdiv double %9, 1.800000e+02
store double %10, double* %3
%11 = load double, double* %3
ret double %11
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @sunmodel_geom_mean_anomaly_sun(double %0) {
%2 = load double, double* @M_PI
%3 = tail call double @llvm.fmuladd.f64(double %0, double -1.537000e-04, double 0x40E193E19BF9C62A)
%4 = tail call double @llvm.fmuladd.f64(double %0, double %3, double 0x407658773C0C1FC9)
%5 = fmul double %4, %2
%6 = fdiv double %5, 1.800000e+02
ret double %6
}
/* Type definitions */
struct bufferevent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ xkcp_tcp_event_cb(struct bufferevent *, short, void *);
void tcp_proxy_event_cb(struct bufferevent *bev, short what, void *ctx) {
  xkcp_tcp_event_cb(bev, what, ctx);
}


x86 assembly (clang, -O0):
<tcp_proxy_event_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%ax
mov    -0x18(%rbp),%rdx
movswl %ax,%esi
call   1030 <xkcp_tcp_event_cb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcp_proxy_event_cb>:
jmp    1030 <xkcp_tcp_event_cb@plt>

LLVM IR (-O0):
%struct.bufferevent = type { i32 }
define void @tcp_proxy_event_cb(%struct.bufferevent* %0, i16 signext %1, i8* %2) {
%4 = alloca %struct.bufferevent*
%5 = alloca i16
%6 = alloca i8*
store %struct.bufferevent* %0, %struct.bufferevent** %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%7 = load %struct.bufferevent*, %struct.bufferevent** %4
%8 = load i16, i16* %5
%9 = load i8*, i8** %6
%10 = call i32 @xkcp_tcp_event_cb(%struct.bufferevent* %7, i16 signext %8, i8* %9)
ret void
}

LLVM IR (-O2):
%struct.bufferevent = type { i32 }
define void @tcp_proxy_event_cb(%struct.bufferevent* %0, i16 signext %1, i8* %2) {
%4 = tail call i32 @xkcp_tcp_event_cb(%struct.bufferevent* %0, i16 signext %1, i8* %2)
ret void
}
int secondsSinceTwelve(int hours, int minutes, int seconds) {
  if (hours >= 12)
    hours -= 12;
  minutes += (hours * 60);
  seconds += (minutes * 60);
  return seconds;
}


x86 assembly (clang, -O0):
<secondsSinceTwelve>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0xc,-0x4(%rbp)
jl     1120 <secondsSinceTwelve+0x20>
mov    -0x4(%rbp),%eax
sub    $0xc,%eax
mov    %eax,-0x4(%rbp)
imul   $0x3c,-0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
imul   $0x3c,-0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<secondsSinceTwelve>:
lea    -0xc(%rdi),%eax
cmp    $0xc,%edi
cmovl  %edi,%eax
imul   $0x3c,%eax,%eax
add    %esi,%eax
imul   $0x3c,%eax,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @secondsSinceTwelve(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 12
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %10, 12
store i32 %11, i32* %4
br label %12
12: ; preds = %9, %3
%13 = load i32, i32* %4
%14 = mul nsw i32 %13, 60
%15 = load i32, i32* %5
%16 = add nsw i32 %15, %14
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = mul nsw i32 %17, 60
%19 = load i32, i32* %6
%20 = add nsw i32 %19, %18
store i32 %20, i32* %6
%21 = load i32, i32* %6
ret i32 %21
}

LLVM IR (-O2):
define i32 @secondsSinceTwelve(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, 11
%5 = add nsw i32 %0, -12
%6 = select i1 %4, i32 %5, i32 %0
%7 = mul nsw i32 %6, 60
%8 = add nsw i32 %7, %1
%9 = mul nsw i32 %8, 60
%10 = add nsw i32 %9, %2
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
ssize_t read(int fd, void *buf, size_t count) { return 0; }


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @read(i32 %0, i8* nocapture readnone %1, i64 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_std_qh_line();
int /*<<< orphan*/ printf(char *, char *);
void print_std_panel(char *info) {
  print_std_qh_line();
  printf("\n  %s", info);
  print_std_qh_line();
}


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

x86 assembly (clang, -O2):
<print_std_panel>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <print_std_qh_line@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <print_std_qh_line@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"\0A %s\00"
define void @print_std_panel(i8* %0) {
%2 = tail call i32 (...) @print_std_qh_line()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @print_std_qh_line()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ reqbuf;

/* Variables and functions */
int ph_rpc(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, int, int);
int phSendDtmf(int cid, int dtmfEvent, int mode) {
  char reqbuf[64];
  snprintf(reqbuf, sizeof(reqbuf), "DTMF CID=%d E=%d MODE=%d", cid, dtmfEvent,
           mode);
  return ph_rpc(reqbuf);
}


x86 assembly (clang, -O0):
<phSendDtmf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    -0xc(%rbp),%r9d
mov    $0x40,%esi
lea    0xeb4(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x50(%rbp),%rdi
call   1040 <ph_rpc@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phSendDtmf>:
push   %rbx
sub    $0x40,%rsp
mov    %edx,%r9d
mov    %esi,%r8d
mov    %edi,%ecx
lea    0xecc(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <ph_rpc@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"DTMF CID=%d E=%d MODE=%d\00"
define i32 @phSendDtmf(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [64 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @snprintf(i8* %8, i32 64, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
%13 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%14 = call i32 @ph_rpc(i8* %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [25 x i8] c"DTMF CID=%d E=%d MODE=%d\00"
define i32 @phSendDtmf(i32 %0, i32 %1, i32 %2) {
%4 = alloca [64 x i8]
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 64, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
%7 = call i32 @ph_rpc(i8* %5)
ret i32 %7
}
int mlock_null(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mlock_null() {
ret i32 0
}
int test_imm_56int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x56 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_56int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 369367187456
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void _set_bold(int enable) {
  if (enable)
    fprintf(stdout, "\x1B[1m");
  else
    fprintf(stdout, "\x1B[22m");
}


x86 assembly (clang, -O0):
<_set_bold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113f <_set_bold+0x2f>
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1154 <_set_bold+0x44>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_set_bold>:
test   %edi,%edi
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xee3(%rip),%rax
lea    0xed7(%rip),%rsi
cmove  %rax,%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [5 x i8] c"\1B[1m\00"
@.str.1 = [6 x i8] c"\1B[22m\00"
define void @_set_bold(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @stdout
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %1
%9 = load i32, i32* @stdout
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"\1B[1m\00"
@.str.1 = [6 x i8] c"\1B[22m\00"
define void @_set_bold(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = load i32, i32* @stdout
%4 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
%5 = tail call i32 @fprintf(i32 %3, i8* %4)
ret void
}
int test_imm_F1int64_lowword_mem(long long *val) {
  return ((*val) & (0xF1 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F1int64_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, 241
%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_F1int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 241
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void machine_callstack(const unsigned long *buf, int callstack_max) {}


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

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

LLVM IR (-O0):
define void @machine_callstack(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @machine_callstack(i64* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(void) {
  fprintf(stderr, "should add these lines:\n#include <...>\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"should add these lines:\0A#include <...>\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"should add these lines:\0A#include <...>\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void cellgen_timer_begin() {}


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

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

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

LLVM IR (-O2):
define void @cellgen_timer_begin() {
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ rcx;

/* Variables and functions */
int /*<<< orphan*/ cpuid(int, int *, int *, int *, int *);
bool cpuid_MPERF_and_APERF() {
  uint64_t rax, rbx, rcx, rdx;
  int leaf = 6;
  cpuid(leaf, &rax, &rbx, &rcx, &rdx);
  if ((((uint64_t)(rcx) &
        ((((uint64_t)1 << (((0)) - ((0)) + 1)) - 1) << ((0)))) >>
       (0)) == 1) {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<cpuid_MPERF_and_APERF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x6,-0x18(%rbp)
mov    -0x18(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <cpuid@plt>
mov    -0x10(%rbp),%eax
and    $0x1,%eax
sar    $0x0,%eax
cmp    $0x1,%eax
jne    1155 <cpuid_MPERF_and_APERF+0x45>
movl   $0x1,-0x4(%rbp)
jmp    115c <cpuid_MPERF_and_APERF+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_MPERF_and_APERF>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    $0x6,%edi
call   1030 <cpuid@plt>
mov    0x8(%rsp),%eax
and    $0x1,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @cpuid_MPERF_and_APERF() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @cpuid(i32 6, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %3
%11 = and i32 %10, 1
ret i32 %11
}
int xmlUCSIsSupplementalArrowsA(int code) {
  return (((code >= 0x27F0) && (code <= 0x27FF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsSupplementalArrowsA>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x27f0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsSupplementalArrowsA+0x26>
cmpl   $0x27ff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsSupplementalArrowsA>:
and    $0xfffffff0,%edi
xor    %eax,%eax
cmp    $0x27f0,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsSupplementalArrowsA(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 10224
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 10239
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsSupplementalArrowsA(i32 %0) {
%2 = and i32 %0, -16
%3 = icmp eq i32 %2, 10224
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned int ccNextPOT(unsigned int x) {
  x = x - 1;
  x = x | (x >> 1);
  x = x | (x >> 2);
  x = x | (x >> 4);
  x = x | (x >> 8);
  x = x | (x >> 16);
  return x + 1;
}


x86 assembly (clang, -O0):
<ccNextPOT>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccNextPOT>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
shr    %ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
shr    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
shr    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ccNextPOT(i32 %0) {
%2 = add i32 %0, -1
%3 = lshr i32 %2, 1
%4 = or i32 %3, %2
%5 = lshr i32 %4, 2
%6 = or i32 %5, %4
%7 = lshr i32 %6, 4
%8 = or i32 %7, %6
%9 = lshr i32 %8, 8
%10 = or i32 %9, %8
%11 = lshr i32 %10, 16
%12 = or i32 %11, %10
%13 = add i32 %12, 1
ret i32 %13
}
void seek_table_init(unsigned long *seek_table, unsigned long len,
                     unsigned long data_offset) {
  unsigned long *st, frame_len;
  for (st = seek_table; st < (seek_table + len); st++) {
    frame_len = (*st);
    *st = data_offset;
    data_offset += frame_len;
  }
}


x86 assembly (clang, -O0):
<seek_table_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rdx
shl    $0x3,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jae    1167 <seek_table_init+0x67>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <seek_table_init+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<seek_table_init>:
test   %rsi,%rsi
jle    1125 <seek_table_init+0x25>
lea    (%rdi,%rsi,8),%rax
nopl   0x0(%rax)
mov    (%rdi),%rcx
add    %rdx,%rcx
mov    %rdx,(%rdi)
add    $0x8,%rdi
mov    %rcx,%rdx
cmp    %rax,%rdi
jb     1110 <seek_table_init+0x10>
ret

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

LLVM IR (-O2):
define void @seek_table_init(i64* %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i64, i64* %0, i64 %1
%5 = icmp sgt i64 %1, 0
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = phi i64 [ %10, %6 ], [ %2, %3 ]
%8 = phi i64* [ %11, %6 ], [ %0, %3 ]
%9 = load i64, i64* %8
store i64 %7, i64* %8
%10 = add i64 %9, %7
%11 = getelementptr inbounds i64, i64* %8, i64 1
%12 = icmp ult i64* %11, %4
br i1 %12, label %6, label %13
13: ; preds = %6, %3
ret void
}
int driveFR(int forwardPower, int turnPower) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @driveFR(i32 %0, i32 %1) {
ret i32 0
}
void tell(fd, s) int fd;
char *s;
{ write(fd, s, strlen(s)); }


x86 assembly (clang, -O0):
<tell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
mov    $0x0,%al
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tell>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @tell(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 %5, i8* %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @tell(i32 %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = tail call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 %0, i8* %1, i64 %3)
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
void main() { int64_t a = 3, b = 2, c; }


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

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int spi_send_command(int, char *);
int nrf_reuse_tx_pl(char *retstatus) {
  return spi_send_command(0xE3, retstatus);
}


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

x86 assembly (clang, -O2):
<nrf_reuse_tx_pl>:
mov    %rdi,%rsi
mov    $0xe3,%edi
jmp    1030 <spi_send_command@plt>

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

LLVM IR (-O2):
define i32 @nrf_reuse_tx_pl(i8* %0) {
%2 = tail call i32 @spi_send_command(i32 227, i8* %0)
ret i32 %2
}
int utc_offset_parse_char(const char c) {
  switch (c) {
  case '0':
    return 0;
  case '1':
    return 1;
  case '2':
    return 2;
  case '3':
    return 3;
  case '4':
    return 4;
  case '5':
    return 5;
  case '6':
    return 6;
  case '7':
    return 7;
  case '8':
    return 8;
  case '9':
    return 9;
  }
  return -1;
}


x86 assembly (clang, -O0):
<utc_offset_parse_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffd0,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x9,%eax
ja     11ac <utc_offset_parse_char+0xac>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    11b3 <utc_offset_parse_char+0xb3>
movl   $0x1,-0x4(%rbp)
jmp    11b3 <utc_offset_parse_char+0xb3>
movl   $0x2,-0x4(%rbp)
jmp    11b3 <utc_offset_parse_char+0xb3>
movl   $0x3,-0x4(%rbp)
jmp    11b3 <utc_offset_parse_char+0xb3>
movl   $0x4,-0x4(%rbp)
jmp    11b3 <utc_offset_parse_char+0xb3>
movl   $0x5,-0x4(%rbp)
jmp    11b3 <utc_offset_parse_char+0xb3>
movl   $0x6,-0x4(%rbp)
jmp    11b3 <utc_offset_parse_char+0xb3>
movl   $0x7,-0x4(%rbp)
jmp    11b3 <utc_offset_parse_char+0xb3>
movl   $0x8,-0x4(%rbp)
jmp    11b3 <utc_offset_parse_char+0xb3>
movl   $0x9,-0x4(%rbp)
jmp    11b3 <utc_offset_parse_char+0xb3>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utc_offset_parse_char>:
lea    -0x30(%rdi),%ecx
cmp    $0xa,%ecx
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @utc_offset_parse_char(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
switch i32 %5, label %16 [
i32 48, label %6
i32 49, label %7
i32 50, label %8
i32 51, label %9
i32 52, label %10
i32 53, label %11
i32 54, label %12
i32 55, label %13
i32 56, label %14
i32 57, label %15
]
6: ; preds = %1
store i32 0, i32* %2
br label %17
7: ; preds = %1
store i32 1, i32* %2
br label %17
8: ; preds = %1
store i32 2, i32* %2
br label %17
9: ; preds = %1
store i32 3, i32* %2
br label %17
10: ; preds = %1
store i32 4, i32* %2
br label %17
11: ; preds = %1
store i32 5, i32* %2
br label %17
12: ; preds = %1
store i32 6, i32* %2
br label %17
13: ; preds = %1
store i32 7, i32* %2
br label %17
14: ; preds = %1
store i32 8, i32* %2
br label %17
15: ; preds = %1
store i32 9, i32* %2
br label %17
16: ; preds = %1
store i32 -1, i32* %2
br label %17
17: ; preds = %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @utc_offset_parse_char(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
%4 = icmp ult i32 %3, 10
%5 = select i1 %4, i32 %3, i32 -1
ret i32 %5
}
void __mix2(void) {}


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

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

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

LLVM IR (-O2):
define void @__mix2() {
ret void
}
int sysrq_on(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sysrq_on() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ create_drive(int, int /*<<< orphan*/);
int /*<<< orphan*/ create_drive_direct(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ msleep(int);
void turnRight(int degrees) {
  int rad = 0.5 * 3.1415926;
  create_drive(-50, 0);
  msleep(rad * 4000 * degrees / 90);
  create_drive_direct(0, 0);
}


x86 assembly (clang, -O0):
<turnRight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    $0xffffffce,%edi
xor    %esi,%esi
call   1030 <create_drive@plt>
imul   $0xfa0,-0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    $0x5a,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <msleep@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1050 <create_drive_direct@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<turnRight>:
push   %rbx
mov    %edi,%ebx
mov    $0xffffffce,%edi
xor    %esi,%esi
call   1030 <create_drive@plt>
imul   $0xfa0,%ebx,%eax
movslq %eax,%rdi
imul   $0xffffffffb60b60b7,%rdi,%rax
shr    $0x20,%rax
add    %eax,%edi
mov    %edi,%eax
shr    $0x1f,%eax
sar    $0x6,%edi
add    %eax,%edi
call   1040 <msleep@plt>
xor    %edi,%edi
xor    %esi,%esi
pop    %rbx
jmp    1050 <create_drive_direct@plt>

LLVM IR (-O0):
define void @turnRight(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = call i32 @create_drive(i32 -50, i32 0)
%5 = load i32, i32* %3
%6 = mul nsw i32 %5, 4000
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
%9 = sdiv i32 %8, 90
%10 = call i32 @msleep(i32 %9)
%11 = call i32 @create_drive_direct(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @turnRight(i32 %0) {
%2 = tail call i32 @create_drive(i32 -50, i32 0)
%3 = mul nsw i32 %0, 4000
%4 = sdiv i32 %3, 90
%5 = tail call i32 @msleep(i32 %4)
%6 = tail call i32 @create_drive_direct(i32 0, i32 0)
ret void
}
int isPower2(int x) {
  int y = ~x + 1;
  return !!x & !((x >> 31) & 1) & !(x & y + y);
}


x86 assembly (clang, -O0):
<isPower2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    -0x4(%rbp),%ecx
sar    $0x1f,%ecx
and    $0x1,%ecx
cmp    $0x0,%ecx
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%edx
add    -0x8(%rbp),%edx
and    %edx,%ecx
cmp    $0x0,%ecx
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPower2>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
mov    %edi,%ecx
not    %ecx
shr    $0x1f,%ecx
and    %eax,%ecx
lea    (%rdi,%rdi,1),%edx
neg    %edx
xor    %eax,%eax
test   %edi,%edx
sete   %al
and    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @isPower2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = xor i32 %4, -1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
%12 = load i32, i32* %2
%13 = ashr i32 %12, 31
%14 = and i32 %13, 1
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
%17 = zext i1 %16 to i32
%18 = and i32 %11, %17
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = load i32, i32* %3
%22 = add nsw i32 %20, %21
%23 = and i32 %19, %22
%24 = icmp ne i32 %23, 0
%25 = xor i1 %24, true
%26 = zext i1 %25 to i32
%27 = and i32 %18, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @isPower2(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = xor i32 %0, -1
%5 = lshr i32 %4, 31
%6 = and i32 %5, %3
%7 = mul i32 %0, -2
%8 = and i32 %7, %0
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = and i32 %6, %10
ret i32 %11
}
/* Variables and functions */
float exp10f(float);
float Sleef_exp10f_u10(float x) { return exp10f(x); }


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

x86 assembly (clang, -O2):
<Sleef_exp10f_u10>:
jmp    1030 <exp10f@plt>

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

LLVM IR (-O2):
define float @Sleef_exp10f_u10(float %0) {
%2 = tail call float @exp10f(float %0)
ret float %2
}
/* Variables and functions */
void *W_CacheLumpNum(int /*<<< orphan*/, int);
int /*<<< orphan*/ W_GetNumForName(char *);
void *W_CacheLumpName(char *name, int tag) {
  return W_CacheLumpNum(W_GetNumForName(name), tag);
}


x86 assembly (clang, -O0):
<W_CacheLumpName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <W_GetNumForName@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1040 <W_CacheLumpNum@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<W_CacheLumpName>:
push   %rbx
mov    %esi,%ebx
call   1030 <W_GetNumForName@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <W_CacheLumpNum@plt>

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

LLVM IR (-O2):
define i8* @W_CacheLumpName(i8* %0, i32 %1) {
%3 = tail call i32 @W_GetNumForName(i8* %0)
%4 = tail call i8* @W_CacheLumpNum(i32 %3, i32 %1)
ret i8* %4
}
int test_imm_77uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x77 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_77uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 119
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ equals(int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ quad(int, int /*<<< orphan*/, int);
int main(int argc, char *argv[]) {
  equals(-3, quad(1, 0, -9));
  printf("good work\n");
  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)
mov    $0x1,%edi
xor    %esi,%esi
mov    $0xfffffff7,%edx
call   1040 <quad@plt>
mov    %eax,%esi
mov    $0xfffffffd,%edi
call   1050 <equals@plt>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
mov    $0xfffffff7,%edx
call   1040 <quad@plt>
mov    $0xfffffffd,%edi
mov    %eax,%esi
call   1050 <equals@plt>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"good work\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 = call i32 @quad(i32 1, i32 0, i32 -9)
%7 = call i32 @equals(i32 -3, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [10 x i8] c"good work\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @quad(i32 1, i32 0, i32 -9)
%4 = tail call i32 @equals(i32 -3, i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ f();
int /*<<< orphan*/ printf(char *);
void call_f(void) {
  f();
  printf("hello, this is \"call_f\"\n");
  exit(0);
}


x86 assembly (clang, -O0):
<call_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <f@plt>
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O0):
@.str = [25 x i8] c"hello, this is \22call_f\22\0A\00"
define void @call_f() {
%1 = call i32 (...) @f()
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [24 x i8] c"hello, this is \22call_f\22\00"
define void @call_f() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
signed int f1(signed int v_a, signed int v_b) {
  signed int v_anda = v_a & -15;
  signed int v_andb = v_b & 14;
  signed int v_or = v_anda | v_andb;
  return v_or;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfffffff1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xe,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
and    $0xfffffff1,%edi
and    $0xe,%esi
lea    (%rsi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1) {
%3 = and i32 %0, -15
%4 = and i32 %1, 14
%5 = or i32 %4, %3
ret i32 %5
}