xunge/DecIR huggingface dataset:
int foo2(arg)
int arg;
{ return arg; }


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

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

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

LLVM IR (-O2):
define i32 @foo2(i32 returned %0) {
ret i32 %0
}
char *strcat(char *dest, const char *src) {
  char *s = dest;
  while (*dest) {
    dest++;
  }
  while ((*dest++ = *src++))
    ;
  return s;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <strcat+0x32>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcat+0x14>
jmp    1137 <strcat+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1166 <strcat+0x66>
jmp    1137 <strcat+0x37>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

LLVM IR (-O0):
define i8* @strcat(i8* %0, i8* %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** %3
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %3
br label %7
14: ; preds = %7
br label %15
15: ; preds = %22, %14
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %4
%18 = load i8, i8* %16
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
store i8 %18, i8* %19
%21 = icmp ne i8 %18, 0
br i1 %21, label %22, label %23
22: ; preds = %15
br label %15
23: ; preds = %15
%24 = load i8*, i8** %5
ret i8* %24
}

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint8_t mem_is_zero(uint8_t *src, uint16_t len) {
  while (len--) {
    if (*src++) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<mem_is_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     1148 <mem_is_zero+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
cmpl   $0x0,(%rax)
je     1143 <mem_is_zero+0x43>
movl   $0x1,-0x4(%rbp)
jmp    114f <mem_is_zero+0x4f>
jmp    110b <mem_is_zero+0xb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_is_zero>:
mov    %esi,%ecx
xor    %eax,%eax
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
cmp    %edx,%ecx
je     1123 <mem_is_zero+0x23>
cmpl   $0x0,(%rdi,%rdx,4)
lea    0x1(%rdx),%rdx
je     1110 <mem_is_zero+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @mem_is_zero(i32* nocapture %0, i32 %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i32* [ %0, %2 ], [ %9, %7 ]
%5 = phi i32 [ %1, %2 ], [ %8, %7 ]
%6 = icmp eq i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = add nsw i32 %5, -1
%9 = getelementptr inbounds i32, i32* %4, i64 1
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 0
br i1 %11, label %3, label %12
12: ; preds = %3, %7
%13 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %13
}
int fbitcount(int x) {
  int b;
  if (!x)
    return 0;
  for (b = 1; x &= (x - 1); b++)
    ;
  return b;
}


x86 assembly (clang, -O0):
<fbitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <fbitcount+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1152 <fbitcount+0x52>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     114c <fbitcount+0x4c>
jmp    113e <fbitcount+0x3e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <fbitcount+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fbitcount>:
xor    %eax,%eax
test   %edi,%edi
je     111c <fbitcount+0x1c>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <fbitcount+0x10>
ret

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

LLVM IR (-O2):
define i32 @fbitcount(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 1, %1 ]
%6 = add nsw i32 %4, -1
%7 = and i32 %6, %4
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %5, 1
br i1 %8, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %5, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ LOG_DEBUG;
int /*<<< orphan*/ LOG_USER;
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ openlog(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char *);
int main() {
  openlog("myapp", 0, LOG_USER);
  syslog(LOG_DEBUG, "Called main() in %s",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/dspinellis/effective-debugging/refs/heads/"
         "master/logging/Unix/eventlog.c");
  closelog();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
lea    0xebc(%rip),%rdi
xor    %esi,%esi
call   1050 <openlog@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
lea    0xeb8(%rip),%rdx
call   1040 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
lea    0xebf(%rip),%rdi
xor    %esi,%esi
call   1050 <openlog@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
lea    0xebb(%rip),%rdx
call   1040 <syslog@plt>
xor    %eax,%eax
call   1030 <closelog@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"myapp\00"
@LOG_USER = global i32 0
@LOG_DEBUG = global i32 0
@.str.1 = [20 x i8] c"Called main() in %s\00"
@.str.2 = [163 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/dspinellis/effective-debugging/refs/heads/master/logging/Unix/eventlog.c\00"
define i32 @main() {
%1 = load i32, i32* @LOG_USER
%2 = call i32 @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 0, i32 %1)
%3 = load i32, i32* @LOG_DEBUG
%4 = call i32 @syslog(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 (...) @closelog()
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"myapp\00"
@LOG_USER = global i32 0
@LOG_DEBUG = global i32 0
@.str.1 = [20 x i8] c"Called main() in %s\00"
@.str.2 = [163 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/dspinellis/effective-debugging/refs/heads/master/logging/Unix/eventlog.c\00"
define i32 @main() {
%1 = load i32, i32* @LOG_USER
%2 = tail call i32 @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 0, i32 %1)
%3 = load i32, i32* @LOG_DEBUG
%4 = tail call i32 @syslog(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 (...) @closelog()
ret i32 0
}
/* Variables and functions */
double sqrt(double);
double c(double t, double y) { return -1 * y + t * sqrt(y); }


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

x86 assembly (clang, -O2):
<c>:
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     1127 <c+0x17>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    1150 <c+0x40>
sub    $0x18,%rsp
movapd %xmm1,%xmm0
movsd  %xmm1,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
call   1030 <sqrt@plt>
movsd  0x8(%rsp),%xmm2
movsd  0x10(%rsp),%xmm1
add    $0x18,%rsp
mulsd  %xmm2,%xmm0
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @c(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = call double @sqrt(double %7)
%9 = fmul double %6, %8
%10 = call double @llvm.fmuladd.f64(double -1.000000e+00, double %5, double %9)
ret double %10
}

LLVM IR (-O2):
define double @c(double %0, double %1) {
%3 = tail call double @sqrt(double %1)
%4 = fmul double %3, %0
%5 = tail call double @llvm.fmuladd.f64(double %1, double -1.000000e+00, double %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int indexof_featuremap_coeff(int num_detector, int detector, int pos) {
  assert(detector >= 0);
  assert(pos >= 0);
  return detector + num_detector * pos;
}


x86 assembly (clang, -O0):
<indexof_featuremap_coeff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indexof_featuremap_coeff>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
mov    %esi,%edi
not    %edi
shr    $0x1f,%edi
call   1030 <assert@plt>
mov    %ebx,%edi
not    %edi
shr    $0x1f,%edi
call   1030 <assert@plt>
imul   %ebx,%ebp
add    %r14d,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @indexof_featuremap_coeff(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* %5
%8 = icmp sge i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %6
%12 = icmp sge i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32, i32* %5
%16 = load i32, i32* %4
%17 = load i32, i32* %6
%18 = mul nsw i32 %16, %17
%19 = add nsw i32 %15, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @indexof_featuremap_coeff(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %1, -1
%5 = lshr i32 %4, 31
%6 = tail call i32 @assert(i32 %5)
%7 = xor i32 %2, -1
%8 = lshr i32 %7, 31
%9 = tail call i32 @assert(i32 %8)
%10 = mul nsw i32 %2, %0
%11 = add nsw i32 %10, %1
ret i32 %11
}
int f5(int c, long long shamt) { return c << shamt; }


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
mov    %rsi,%rcx
mov    %edi,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f5(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = shl i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @f5(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl i32 %0, %3
ret i32 %4
}
void GET_PROMPT_CHR(c, s) int *c;
char *s;
{
  puts((char *)s);
  GET_CHR(c);
}


x86 assembly (clang, -O0):
<GET_PROMPT_CHR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <GET_CHR@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GET_PROMPT_CHR>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <GET_CHR@plt>

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

LLVM IR (-O2):
define void @GET_PROMPT_CHR(i32* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %1)
%4 = tail call i32 (i32*, ...) bitcast (i32 (...)* @GET_CHR to i32 (i32*, ...)*)(i32* %0)
ret void
}
double simplePow(double number, unsigned int exponent) {
  double result = number;
  for (unsigned int i = 1; i < exponent; i++)
    result *= number;
  return result;
}


x86 assembly (clang, -O0):
<simplePow>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1146 <simplePow+0x46>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111d <simplePow+0x1d>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<simplePow>:
cmp    $0x2,%edi
jb     115d <simplePow+0x5d>
lea    -0x1(%rdi),%ecx
add    $0xfffffffe,%edi
mov    %ecx,%eax
and    $0x7,%eax
movapd %xmm0,%xmm1
cmp    $0x7,%edi
jb     1145 <simplePow+0x45>
and    $0xfffffff8,%ecx
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
add    $0xfffffff8,%ecx
jne    1120 <simplePow+0x20>
test   %eax,%eax
je     1159 <simplePow+0x59>
nopl   0x0(%rax)
mulsd  %xmm0,%xmm1
add    $0xffffffff,%eax
jne    1150 <simplePow+0x50>
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @simplePow(double %0, i32 %1) {
%3 = icmp ugt i32 %1, 1
br i1 %3, label %4, label %21
4: ; preds = %2
%5 = add i32 %1, -1
%6 = add i32 %1, -2
%7 = and i32 %5, 7
%8 = icmp ult i32 %6, 7
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = and i32 %5, -8
br label %23
11: ; preds = %23, %4
%12 = phi double [ undef, %4 ], [ %33, %23 ]
%13 = phi double [ %0, %4 ], [ %33, %23 ]
%14 = icmp eq i32 %7, 0
br i1 %14, label %21, label %15
15: ; preds = %11, %15
%16 = phi double [ %18, %15 ], [ %13, %11 ]
%17 = phi i32 [ %19, %15 ], [ 0, %11 ]
%18 = fmul double %16, %0
%19 = add i32 %17, 1
%20 = icmp eq i32 %19, %7
br i1 %20, label %21, label %15
21: ; preds = %11, %15, %2
%22 = phi double [ %0, %2 ], [ %12, %11 ], [ %18, %15 ]
ret double %22
23: ; preds = %23, %9
%24 = phi double [ %0, %9 ], [ %33, %23 ]
%25 = phi i32 [ 0, %9 ], [ %34, %23 ]
%26 = fmul double %24, %0
%27 = fmul double %26, %0
%28 = fmul double %27, %0
%29 = fmul double %28, %0
%30 = fmul double %29, %0
%31 = fmul double %30, %0
%32 = fmul double %31, %0
%33 = fmul double %32, %0
%34 = add i32 %25, 8
%35 = icmp eq i32 %34, %10
br i1 %35, label %11, label %23
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ perror(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void showError(char *errmsg) {
  if (errno)
    perror(NULL);
  if (errmsg)
    fprintf(stderr, "%s\n", errmsg);
}


x86 assembly (clang, -O0):
<showError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
cmpq   $0x0,(%rax)
je     1146 <showError+0x26>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <perror@plt>
cmpq   $0x0,-0x8(%rbp)
je     116a <showError+0x4a>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showError>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ead(%rip),%rax
cmpq   $0x0,(%rax)
jne    114f <showError+0x2f>
test   %rbx,%rbx
je     115b <showError+0x3b>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <perror@plt>
test   %rbx,%rbx
jne    1136 <showError+0x16>
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i64 0
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @showError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @errno
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @perror(i32* null)
br label %7
7: ; preds = %5, %1
%8 = load i8*, i8** %2
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %2
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@errno = global i64 0
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @showError(i8* %0) {
%2 = load i64, i64* @errno
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i32* null)
br label %6
6: ; preds = %4, %1
%7 = icmp eq i8* %0, null
br i1 %7, label %11, label %8
8: ; preds = %6
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %11
11: ; preds = %8, %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ payload;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(void **, int, int, int /*<<< orphan*/ *);
int defaultSerializer(FILE *f, void *payload) {
  fwrite(&payload, sizeof(payload), 1, f);
  return 0;
}


x86 assembly (clang, -O0):
<defaultSerializer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0x10(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<defaultSerializer>:
push   %rax
mov    %rdi,%rcx
mov    %rsi,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @defaultSerializer(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 = call i32 @fwrite(i8** %4, i32 8, i32 1, i32* %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @defaultSerializer(i32* nocapture %0, i8* %1) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = call i32 @fwrite(i8** %3, i32 8, i32 1, i32* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EPOLL_CTL_DEL;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ epoll_ctl(int, int /*<<< orphan*/, int, int /*<<< orphan*/);
void clean_client_fd(int cli_fd, int epoll_fd) {
  epoll_ctl(epoll_fd, EPOLL_CTL_DEL, cli_fd, 0);
  close(cli_fd);
}


x86 assembly (clang, -O0):
<clean_client_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
call   1040 <epoll_ctl@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_client_fd>:
push   %rbx
mov    %esi,%eax
mov    %edi,%ebx
mov    0x2ecc(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
mov    %ebx,%edx
xor    %ecx,%ecx
call   1040 <epoll_ctl@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <close@plt>

LLVM IR (-O0):
@EPOLL_CTL_DEL = global i32 0
define void @clean_client_fd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* @EPOLL_CTL_DEL
%7 = load i32, i32* %3
%8 = call i32 @epoll_ctl(i32 %5, i32 %6, i32 %7, i32 0)
%9 = load i32, i32* %3
%10 = call i32 @close(i32 %9)
ret void
}

LLVM IR (-O2):
@EPOLL_CTL_DEL = global i32 0
define void @clean_client_fd(i32 %0, i32 %1) {
%3 = load i32, i32* @EPOLL_CTL_DEL
%4 = tail call i32 @epoll_ctl(i32 %1, i32 %3, i32 %0, i32 0)
%5 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hdd_image_unload(int, int);
void scsi_unloadhd(int scsi_id, int scsi_lun, int id) {
  hdd_image_unload(id, 1);
}


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

x86 assembly (clang, -O2):
<scsi_unloadhd>:
mov    %edx,%edi
mov    $0x1,%esi
jmp    1030 <hdd_image_unload@plt>

LLVM IR (-O0):
define void @scsi_unloadhd(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* %6
%8 = call i32 @hdd_image_unload(i32 %7, i32 1)
ret void
}

LLVM IR (-O2):
define void @scsi_unloadhd(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @hdd_image_unload(i32 %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EvbKeyConfig();
int /*<<< orphan*/ EvbLedConfig();
int /*<<< orphan*/ EvbUart1Config();
void EvbSetupEntry(void) {
  EvbUart1Config();
  EvbLedConfig();
  EvbKeyConfig();
}


x86 assembly (clang, -O0):
<EvbSetupEntry>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <EvbUart1Config@plt>
mov    $0x0,%al
call   1040 <EvbLedConfig@plt>
mov    $0x0,%al
call   1050 <EvbKeyConfig@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EvbSetupEntry>:
push   %rax
xor    %eax,%eax
call   1030 <EvbUart1Config@plt>
xor    %eax,%eax
call   1040 <EvbLedConfig@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <EvbKeyConfig@plt>

LLVM IR (-O0):
define void @EvbSetupEntry() {
%1 = call i32 (...) @EvbUart1Config()
%2 = call i32 (...) @EvbLedConfig()
%3 = call i32 (...) @EvbKeyConfig()
ret void
}

LLVM IR (-O2):
define void @EvbSetupEntry() {
%1 = tail call i32 (...) @EvbUart1Config()
%2 = tail call i32 (...) @EvbLedConfig()
%3 = tail call i32 (...) @EvbKeyConfig()
ret void
}
void INT_Excep_RIIC2_RXI2(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_RIIC2_RXI2() {
ret void
}
void test_fancy(void) {}


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

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

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

LLVM IR (-O2):
define void @test_fancy() {
ret void
}
void simpccard(char *controller, int insert) {}


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

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

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

LLVM IR (-O2):
define void @simpccard(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int girls = 12;
  int boys = 11;
  printf("girls: %d  boys: %d\n", girls, boys);
  int tmp = girls;
  girls = boys;
  boys = tmp;
  ;
  printf("girls: %d  boys: %d\n", girls, boys);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [21 x i8] c"girls: %d boys: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 12, i32 11)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 11, i32 12)
ret i32 0
}
void gtk_tree_store_prepend() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_store_prepend() {
ret void
}
int fun214() { return 214; }


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

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

LLVM IR (-O0):
define i32 @fun214() {
ret i32 214
}

LLVM IR (-O2):
define i32 @fun214() {
ret i32 214
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void Usage(const char *progname) {
  fprintf(stderr, "Usage: %s [opts] <regiondir>\n", progname);
  fprintf(stderr, "\n"
                  "-b  : Block ID to search for (Defaults to "
                  "47"
                  "/Bookshelf)\n");
}


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

x86 assembly (clang, -O2):
<Usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeea(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Usage: %s [opts] <regiondir>\0A\00"
@.str.1 = [58 x i8] c"\0A-b : Block ID to search for (Defaults to 47/Bookshelf)\0A\00"
define void @Usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Usage: %s [opts] <regiondir>\0A\00"
@.str.1 = [58 x i8] c"\0A-b : Block ID to search for (Defaults to 47/Bookshelf)\0A\00"
define void @Usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bar_v2(void) { printf("weak_as_needed_c: bar_v2\n"); }


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

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

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

LLVM IR (-O2):
@str = [25 x i8] c"weak_as_needed_c: bar_v2\00"
define void @bar_v2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void delay_ns(uint32_t ns) {
  for (volatile uint32_t i = 0; i < ns / 10; i++) {
  }
}


x86 assembly (clang, -O0):
<delay_ns>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cmp    %ecx,%eax
jge    113f <delay_ns+0x3f>
jmp    1131 <delay_ns+0x31>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <delay_ns+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_ns>:
movl   $0x0,-0x4(%rsp)
movslq %edi,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
nop
mov    -0x4(%rsp),%ecx
cmp    %eax,%ecx
jge    112f <delay_ns+0x2f>
addl   $0x1,-0x4(%rsp)
jmp    1120 <delay_ns+0x20>
ret

LLVM IR (-O0):
define void @delay_ns(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store volatile i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load volatile i32, i32* %3
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 10
%8 = icmp slt i32 %5, %7
br i1 %8, label %9, label %13
9: ; preds = %4
br label %10
10: ; preds = %9
%11 = load volatile i32, i32* %3
%12 = add nsw i32 %11, 1
store volatile i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @delay_ns(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %2
%4 = sdiv i32 %0, 10
%5 = load volatile i32, i32* %2
%6 = icmp slt i32 %5, %4
br i1 %6, label %8, label %7
7: ; preds = %8, %1
ret void
8: ; preds = %1, %8
%9 = load volatile i32, i32* %2
%10 = add nsw i32 %9, 1
store volatile i32 %10, i32* %2
%11 = load volatile i32, i32* %2
%12 = icmp slt i32 %11, %4
br i1 %12, label %8, label %7
}
int fill_one_span_read(unsigned char *start_ptr, unsigned char *end_ptr) {
  unsigned char sum, *p;
  sum = 0;
  p = start_ptr;
  while (p < end_ptr) {
    sum += *p;
    p += ((64) / 2);
  }
  return sum;
}


x86 assembly (clang, -O0):
<fill_one_span_read>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1147 <fill_one_span_read+0x47>
mov    -0x20(%rbp),%rax
movzbl (%rax),%ecx
movzbl -0x11(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x11(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <fill_one_span_read+0x18>
movzbl -0x11(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_one_span_read>:
xor    %eax,%eax
cmp    %rsi,%rdi
jae    1121 <fill_one_span_read+0x21>
xor    %eax,%eax
nopl   0x0(%rax)
movzbl (%rdi),%ecx
add    %eax,%ecx
add    $0x20,%rdi
movzbl %cl,%eax
cmp    %rsi,%rdi
jb     1110 <fill_one_span_read+0x10>
ret

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

LLVM IR (-O2):
define i32 @fill_one_span_read(i8* %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
br i1 %3, label %4, label %13
4: ; preds = %2, %4
%5 = phi i8* [ %10, %4 ], [ %0, %2 ]
%6 = phi i32 [ %11, %4 ], [ 0, %2 ]
%7 = load i8, i8* %5
%8 = zext i8 %7 to i32
%9 = add nuw nsw i32 %6, %8
%10 = getelementptr inbounds i8, i8* %5, i64 32
%11 = and i32 %9, 255
%12 = icmp ult i8* %10, %1
br i1 %12, label %4, label %13
13: ; preds = %4, %2
%14 = phi i32 [ 0, %2 ], [ %11, %4 ]
ret i32 %14
}
/* Variables and functions */
int any_decrqss(char const *, char *);
int rpt_DECSCL(const char *the_title) { return any_decrqss(the_title, "\"p"); }


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

x86 assembly (clang, -O2):
<rpt_DECSCL>:
lea    0xee9(%rip),%rsi
jmp    1030 <any_decrqss@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"\22p\00"
define i32 @rpt_DECSCL(i8* %0) {
%2 = tail call i32 @any_decrqss(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
double double_sum(double entry, double sum) { return sum + entry; }


x86 assembly (clang, -O0):
<double_sum>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_sum>:
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @double_sum(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
void UARTDMAEnable(unsigned int baseAdd, unsigned int dmaModeFlag) {
  (*((volatile unsigned int *)(baseAdd + (0x40)))) |= ((0x00000001u));
  (*((volatile unsigned int *)(baseAdd + (0x40)))) &= ~((0x00000006u));
  (*((volatile unsigned int *)(baseAdd + (0x40)))) |=
      ((dmaModeFlag << (0x00000001u)) & (0x00000006u));
}


x86 assembly (clang, -O0):
<UARTDMAEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x40,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffff9,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
shl    $0x1,%edx
and    $0x6,%edx
mov    -0x4(%rbp),%eax
add    $0x40,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTDMAEnable>:
add    $0x40,%edi
orl    $0x1,(%rdi)
andl   $0xfffffff9,(%rdi)
add    %esi,%esi
and    $0x6,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @UARTDMAEnable(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 = add i32 %5, 64
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = or i32 %9, 1
store volatile i32 %10, i32* %8
%11 = load i32, i32* %3
%12 = add i32 %11, 64
%13 = zext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
%15 = load volatile i32, i32* %14
%16 = and i32 %15, -7
store volatile i32 %16, i32* %14
%17 = load i32, i32* %4
%18 = shl i32 %17, 1
%19 = and i32 %18, 6
%20 = load i32, i32* %3
%21 = add i32 %20, 64
%22 = zext i32 %21 to i64
%23 = inttoptr i64 %22 to i32*
%24 = load volatile i32, i32* %23
%25 = or i32 %24, %19
store volatile i32 %25, i32* %23
ret void
}

LLVM IR (-O2):
define void @UARTDMAEnable(i32 %0, i32 %1) {
%3 = add i32 %0, 64
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = or i32 %6, 1
store volatile i32 %7, i32* %5
%8 = load volatile i32, i32* %5
%9 = and i32 %8, -7
store volatile i32 %9, i32* %5
%10 = shl i32 %1, 1
%11 = and i32 %10, 6
%12 = load volatile i32, i32* %5
%13 = or i32 %12, %11
store volatile i32 %13, i32* %5
ret void
}
extern char *strcpy(char *dest, const char *src) {
  __asm__("cld\n"
          "1:\tlodsb\n\t"
          "stosb\n\t"
          "testb %%al,%%al\n\t"
          "jne 1b"
          :
          : "S"(src), "D"(dest)
          : "%al");
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdi
cld
lods   %ds:(%rsi),%al
stos   %al,%es:(%rdi)
test   %al,%al
jne    1115 <strcpy+0x15>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
cld
lods   %ds:(%rsi),%al
stos   %al,%es:(%rdi)
test   %al,%al
jne    1101 <strcpy+0x1>
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned %0, i8* %1) {
tail call void asm sideeffect "cld\0A1:\09lodsb\0A\09stosb\0A\09testb %al,%al\0A\09jne 1b", "{si},{di},~{al},~{dirflag},~{fpsr},~{flags}"(i8* %1, i8* %0)
ret i8* %0
}
/* Type definitions */
struct forth_instance {
  int dummy;
};

/* Variables and functions */
intptr_t st_pop(struct forth_instance *);
int /*<<< orphan*/ st_push(struct forth_instance *, intptr_t);
void minus(struct forth_instance *fi) {
  intptr_t tp = st_pop(fi);
  st_push(fi, st_pop(fi) - tp);
}


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

x86 assembly (clang, -O2):
<minus>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <st_pop@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <st_pop@plt>
sub    %r14,%rax
mov    %rbx,%rdi
mov    %rax,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <st_push@plt>

LLVM IR (-O0):
%struct.forth_instance = type { i32 }
define void @minus(%struct.forth_instance* %0) {
%2 = alloca %struct.forth_instance*
%3 = alloca i64
store %struct.forth_instance* %0, %struct.forth_instance** %2
%4 = load %struct.forth_instance*, %struct.forth_instance** %2
%5 = call i64 @st_pop(%struct.forth_instance* %4)
store i64 %5, i64* %3
%6 = load %struct.forth_instance*, %struct.forth_instance** %2
%7 = load %struct.forth_instance*, %struct.forth_instance** %2
%8 = call i64 @st_pop(%struct.forth_instance* %7)
%9 = load i64, i64* %3
%10 = sub nsw i64 %8, %9
%11 = call i32 @st_push(%struct.forth_instance* %6, i64 %10)
ret void
}

LLVM IR (-O2):
%struct.forth_instance = type { i32 }
define void @minus(%struct.forth_instance* %0) {
%2 = tail call i64 @st_pop(%struct.forth_instance* %0)
%3 = tail call i64 @st_pop(%struct.forth_instance* %0)
%4 = sub nsw i64 %3, %2
%5 = tail call i32 @st_push(%struct.forth_instance* %0, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_RenderingControl_GetSharpness(void *, int);
int /*<<< orphan*/ printf(char *, unsigned int);
void UPnPRenderingControl_GetSharpness(void *upnptoken,
                                       unsigned int InstanceID) {
  printf("Invoke: UPnPRenderingControl_GetSharpness(%u);\r\n", InstanceID);
  UPnPResponse_RenderingControl_GetSharpness(upnptoken, 250);
}


x86 assembly (clang, -O0):
<UPnPRenderingControl_GetSharpness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0xfa,%esi
call   1040 <UPnPResponse_RenderingControl_GetSharpness@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPRenderingControl_GetSharpness>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xfa,%esi
pop    %rbx
jmp    1040 <UPnPResponse_RenderingControl_GetSharpness@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"Invoke: UPnPRenderingControl_GetSharpness(%u);\0D\0A\00"
define void @UPnPRenderingControl_GetSharpness(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @UPnPResponse_RenderingControl_GetSharpness(i8* %7, i32 250)
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"Invoke: UPnPRenderingControl_GetSharpness(%u);\0D\0A\00"
define void @UPnPRenderingControl_GetSharpness(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @UPnPResponse_RenderingControl_GetSharpness(i8* %0, i32 250)
ret void
}
int test_imm_D2uint16_mem(unsigned short *val) {
  return ((*val) & (-0xD2 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_D2uint16_mem>:
movzwl (%rdi),%eax
test   $0xff2e,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D2uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -210
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long, char *, char *);
int /*<<< orphan*/ sendCallback(char *, long, char *);
int messageHandler(char *caller, char *message_name, long msg_id,
                   char *arguments) {
  printf("World module handler: %ul %s  from: %s v3 \n\n", msg_id, arguments,
         caller);
  sendCallback(caller, msg_id, "message");
  return 1;
}


x86 assembly (clang, -O0):
<messageHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xece(%rip),%rdx
call   1040 <sendCallback@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<messageHandler>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %rbx,%rcx
call   1030 <printf@plt>
lea    0xee7(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <sendCallback@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [45 x i8] c"World module handler: %ul %s from: %s v3 \0A\0A\00"
@.str.1 = [8 x i8] c"message\00"
define i32 @messageHandler(i8* %0, i8* %1, i64 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%9 = load i64, i64* %7
%10 = load i8*, i8** %8
%11 = load i8*, i8** %5
%12 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i64 %9, i8* %10, i8* %11)
%13 = load i8*, i8** %5
%14 = load i64, i64* %7
%15 = call i32 @sendCallback(i8* %13, i64 %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [45 x i8] c"World module handler: %ul %s from: %s v3 \0A\0A\00"
@.str.1 = [8 x i8] c"message\00"
define i32 @messageHandler(i8* %0, i8* nocapture readnone %1, i64 %2, i8* %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i64 %2, i8* %3, i8* %0)
%6 = tail call i32 @sendCallback(i8* %0, i64 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}