xunge/DecIR huggingface dataset:
void increase_speed(double *sleep) { *sleep = *sleep * 1.5; }


x86 assembly (clang, -O0):
<increase_speed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeec(%rip),%xmm0
mulsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<increase_speed>:
movsd  (%rdi),%xmm0
mulsd  0xef4(%rip),%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @increase_speed(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double, double* %3
%5 = fmul double %4, 1.500000e+00
%6 = load double*, double** %2
store double %5, double* %6
ret void
}

LLVM IR (-O2):
define void @increase_speed(double* nocapture %0) {
%2 = load double, double* %0
%3 = fmul double %2, 1.500000e+00
store double %3, double* %0
ret void
}
int __ocl_bitselect_int(int a, int b, int c) { return (b & c) | (a & (~c)); }


x86 assembly (clang, -O0):
<__ocl_bitselect_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__ocl_bitselect_int(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 = load i32, i32* %6
%9 = and i32 %7, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %6
%12 = xor i32 %11, -1
%13 = and i32 %10, %12
%14 = or i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @__ocl_bitselect_int(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %2, %1
%5 = xor i32 %2, -1
%6 = and i32 %5, %0
%7 = or i32 %4, %6
ret i32 %7
}
void distance_vec(float *x, float *y, float *z, float *d, int n) {}


x86 assembly (clang, -O0):
<distance_vec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @distance_vec(float* %0, float* %1, float* %2, float* %3, i32 %4) {
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca i32
store float* %0, float** %6
store float* %1, float** %7
store float* %2, float** %8
store float* %3, float** %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
define void @distance_vec(float* nocapture %0, float* nocapture %1, float* nocapture %2, float* nocapture %3, i32 %4) {
ret void
}
/* Variables and functions */
double fabs(double);
double log(double);
double EClog(double x) {
  double y;
  double r;
  y = fabs(x);
  if (y < 1.e-70)
    return log(1.e-70);
  r = log(y);
  return (r);
}


x86 assembly (clang, -O0):
<EClog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps 0xee7(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xec6(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    115c <EClog+0x4c>
movsd  0xeb3(%rip),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1175 <EClog+0x65>
movsd  -0x18(%rbp),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EClog>:
andpd  0xee8(%rip),%xmm0
movsd  0xef0(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    112f <EClog+0x1f>
movsd  0xeea(%rip),%xmm0
ret
jmp    1030 <log@plt>

LLVM IR (-O0):
define double @EClog(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
%6 = load double, double* %3
%7 = call double @llvm.fabs.f64(double %6)
store double %7, double* %4
%8 = load double, double* %4
%9 = fcmp olt double %8, 0x316615E91D8F359D
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call double @log(double 0x316615E91D8F359D)
store double %11, double* %2
br label %16
12: ; preds = %1
%13 = load double, double* %4
%14 = call double @log(double %13)
store double %14, double* %5
%15 = load double, double* %5
store double %15, double* %2
br label %16
16: ; preds = %12, %10
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @EClog(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = fcmp olt double %2, 0x316615E91D8F359D
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call double @log(double %2)
br label %6
6: ; preds = %1, %4
%7 = phi double [ %5, %4 ], [ 0xC06425CA654E5510, %1 ]
ret double %7
}
/* Variables and functions */
unsigned int f09(unsigned int);
unsigned int f10(unsigned int a) { return f09(f09(a)); }


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

x86 assembly (clang, -O2):
<f10>:
push   %rax
call   1030 <f09@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <f09@plt>

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

LLVM IR (-O2):
define i32 @f10(i32 %0) {
%2 = tail call i32 @f09(i32 %0)
%3 = tail call i32 @f09(i32 %2)
ret i32 %3
}
void PutErrString(s) char *s;
{
  if (strcmp(s, "Interrupted") == 0)
    putchar('\n');
  printf("--- %s ---\n", s);
}


x86 assembly (clang, -O0):
<PutErrString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1161 <PutErrString+0x31>
mov    $0xa,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rsi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PutErrString>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    1150 <PutErrString+0x20>
mov    $0xa,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
lea    0xeb5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Interrupted\00"
@.str.1 = [12 x i8] c"--- %s ---\0A\00"
define void @PutErrString(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcmp(i8* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 10)
br label %8
8: ; preds = %6, %1
%9 = load i8*, i8** %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Interrupted\00"
@.str.1 = [12 x i8] c"--- %s ---\0A\00"
define void @PutErrString(i8* %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(12) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 10)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int test9(int n) {
  int x;
  for (unsigned i = 0; i < n; ++i) {
    if (i == n - 1)
      break;
    x = 1;
  }
  return x;
}


x86 assembly (clang, -O0):
<test9>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1145 <test9+0x45>
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    1130 <test9+0x30>
jmp    1145 <test9+0x45>
movl   $0x1,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <test9+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test9(i32 %0) {
ret i32 1
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strrev(char *);
int isPalindrome2(char str[100]) {
  char revStr[100];
  strcpy(revStr, str);
  strrev(revStr);
  if (strcmp(str, revStr) == 0) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isPalindrome2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x80(%rbp),%rdi
call   1050 <strrev@plt>
mov    -0x10(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1178 <isPalindrome2+0x48>
movl   $0x0,-0x4(%rbp)
jmp    117f <isPalindrome2+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPalindrome2>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1050 <strrev@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @isPalindrome2(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [100 x i8]
store i8* %0, i8** %3
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%6 = load i8*, i8** %3
%7 = call i32 @strcpy(i8* %5, i8* %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%9 = call i32 @strrev(i8* %8)
%10 = load i8*, i8** %3
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%12 = call i64 @strcmp(i8* %10, i8* %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %1
store i32 0, i32* %2
br label %16
15: ; preds = %1
store i32 1, i32* %2
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @isPalindrome2(i8* %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
%5 = call i32 @strrev(i8* %3)
%6 = call i64 @strcmp(i8* %0, i8* %3)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
int powerOf2(int exponent) { return 1 << exponent; }


x86 assembly (clang, -O0):
<powerOf2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<powerOf2>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @powerOf2(i32 %0) {
%2 = shl nuw i32 1, %0
ret i32 %2
}
/* Type definitions */
struct timespec {
  unsigned long tv_sec;
  unsigned long tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void nsleep(unsigned long seconds, unsigned long nanoseconds) {
  struct timespec s;
  s.tv_sec = seconds;
  s.tv_nsec = nanoseconds;
  nanosleep(&s, NULL);
}


x86 assembly (clang, -O0):
<nsleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsleep>:
sub    $0x18,%rsp
mov    %rdi,0x8(%rsp)
mov    %rsi,0x10(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @nsleep(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca %struct.timespec
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
store i64 %6, i64* %7
%8 = load i64, i64* %4
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
store i64 %8, i64* %9
%10 = call i32 @nanosleep(%struct.timespec* %5, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @nsleep(i64 %0, i64 %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to i8*
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 0
store i64 %0, i64* %5
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 1
store i64 %1, i64* %6
%7 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t intlen(uint64_t i) {
  uint64_t len;
  for (len = 1; i >= 10; len += ((i /= 10), 1))
    ;
  return len;
}


x86 assembly (clang, -O0):
<intlen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     1139 <intlen+0x39>
jmp    111d <intlen+0x1d>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <intlen+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intlen>:
mov    $0x1,%eax
cmp    $0xa,%edi
jl     1134 <intlen+0x34>
mov    $0x1,%eax
mov    $0xcccccccd,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0x63,%edi
mov    %edx,%edi
ja     1120 <intlen+0x20>
ret

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

LLVM IR (-O2):
define i32 @intlen(i32 %0) {
%2 = icmp sgt i32 %0, 9
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = udiv i32 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = icmp ugt i32 %5, 99
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %10
}
int float_to_int(float f) {
  union {
    float f;
    int i;
  } c;
  c.f = f;
  return c.i;
}


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

x86 assembly (clang, -O2):
<float_to_int>:
movd   %xmm0,%eax
ret

LLVM IR (-O0):
%union.anon = type { float }
define i32 @float_to_int(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.anon* %3 to float*
store float %4, float* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @float_to_int(float %0) {
%2 = bitcast float %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ decode(char *);
int read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ write(int, char *, int);
int main() {
  int nbytes;
  char buf[16];
  for (;;) {
    nbytes = read(0, buf, 16);
    if (nbytes <= 0)
      break;
    decode(buf);
    write(1, buf, nbytes);
    if (nbytes < 16)
      break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rsi
xor    %edi,%edi
mov    $0x10,%edx
call   1040 <read@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1161 <main+0x31>
jmp    118f <main+0x5f>
lea    -0x20(%rbp),%rdi
call   1050 <decode@plt>
lea    -0x20(%rbp),%rsi
mov    -0x8(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
cmpl   $0x10,-0x8(%rbp)
jge    118a <main+0x5a>
jmp    118f <main+0x5f>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %rsp,%rbx
nopl   0x0(%rax)
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1040 <read@plt>
test   %eax,%eax
jle    1171 <main+0x41>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <decode@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <write@plt>
cmp    $0xf,%ebp
ja     1140 <main+0x10>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [16 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %19, %0
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%6 = call i32 @read(i32 0, i8* %5, i32 16)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %4
br label %20
10: ; preds = %4
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%12 = call i32 @decode(i8* %11)
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%14 = load i32, i32* %2
%15 = call i32 @write(i32 1, i8* %13, i32 %14)
%16 = load i32, i32* %2
%17 = icmp slt i32 %16, 16
br i1 %17, label %18, label %19
18: ; preds = %10
br label %20
19: ; preds = %10
br label %4
20: ; preds = %18, %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %6, %0
%4 = call i32 @read(i32 0, i8* %2, i32 16)
%5 = icmp slt i32 %4, 1
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = call i32 @decode(i8* %2)
%8 = call i32 @write(i32 1, i8* %2, i32 %4)
%9 = icmp ult i32 %4, 16
br i1 %9, label %10, label %3
10: ; preds = %6, %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x27() {
  Assert_real((isgraph(39)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              200, ("isgraph should be 1 for '"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x27>:
push   %rbp
mov    %rsp,%rbp
mov    $0x27,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xc8,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x27>:
push   %rax
mov    $0x27,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xc8,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for '\00"
define void @t_isgraph_0x27() {
%1 = call i32 @isgraph(i32 39)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 200, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for '\00"
define void @t_isgraph_0x27() {
%1 = tail call i32 @isgraph(i32 39)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 200, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func(int, int, int, int);
main() { func(2, 1., 2., 3.); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edx
mov    $0x1,%esi
mov    $0x3,%ecx
mov    %edx,%edi
call   1030 <func@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @func(i32 2, i32 1, i32 2, i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func(i32 2, i32 1, i32 2, i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test_first_diff(void) {
  float fcounter = 0;
  int icounter = 0;
  while (fcounter == icounter) {
    fcounter = fcounter + 1;
    icounter = icounter + 1;
  }
  printf("integer %d cannot be represented\n"
         "exactly as a float.\n\n",
         icounter);
}


x86 assembly (clang, -O0):
<test_first_diff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
ucomiss %xmm1,%xmm0
jne    1160 <test_first_diff+0x50>
jp     1160 <test_first_diff+0x50>
movss  0xeb8(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1127 <test_first_diff+0x17>
mov    -0x8(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_first_diff>:
xorps  %xmm0,%xmm0
xor    %esi,%esi
movss  0xee3(%rip),%xmm1
nopl   (%rax)
add    $0x1,%esi
xorps  %xmm2,%xmm2
cvtsi2ss %esi,%xmm2
addss  %xmm1,%xmm0
ucomiss %xmm2,%xmm0
jne    1135 <test_first_diff+0x25>
jnp    1120 <test_first_diff+0x10>
lea    0xec8(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"integer %d cannot be represented\0Aexactly as a float.\0A\0A\00"
define void @test_first_diff() {
%1 = alloca float
%2 = alloca i32
store float 0.000000e+00, float* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load float, float* %1
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to float
%7 = fcmp oeq float %4, %6
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load float, float* %1
%10 = fadd float %9, 1.000000e+00
store float %10, float* %1
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
%14 = load i32, i32* %2
%15 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"integer %d cannot be represented\0Aexactly as a float.\0A\0A\00"
define void @test_first_diff() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = phi float [ 0.000000e+00, %0 ], [ %4, %1 ]
%4 = fadd float %3, 1.000000e+00
%5 = add nuw nsw i32 %2, 1
%6 = sitofp i32 %5 to float
%7 = fcmp oeq float %4, %6
br i1 %7, label %1, label %8
8: ; preds = %1
%9 = tail call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int isatty(int file) {
  errno = ENOSYS;
  return 0;
}


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

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

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

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @isatty(i32 %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 0
}
int __attribute__((stdcall)) __stub_zero_std_12(int a, int b, int c) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @__stub_zero_std_12(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
ret i32 0
}

LLVM IR (-O2):
define i32 @__stub_zero_std_12(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
/* Type definitions */
struct YsGLSL3DRenderer {
  int dummy;
};

/* Variables and functions */
struct YsGLSL3DRenderer *YsGLSLCreateVariColorPerPixShading3DRenderer();
struct YsGLSL3DRenderer *YsGLSLCreateMonoColorPerPixShading3DRenderer(void) {
  return YsGLSLCreateVariColorPerPixShading3DRenderer();
}


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

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

LLVM IR (-O0):
%struct.YsGLSL3DRenderer = type { i32 }
define %struct.YsGLSL3DRenderer* @YsGLSLCreateMonoColorPerPixShading3DRenderer() {
%1 = call %struct.YsGLSL3DRenderer* (...) @YsGLSLCreateVariColorPerPixShading3DRenderer()
ret %struct.YsGLSL3DRenderer* %1
}

LLVM IR (-O2):
%struct.YsGLSL3DRenderer = type { i32 }
define %struct.YsGLSL3DRenderer* @YsGLSLCreateMonoColorPerPixShading3DRenderer() {
%1 = tail call %struct.YsGLSL3DRenderer* (...) @YsGLSLCreateVariColorPerPixShading3DRenderer()
ret %struct.YsGLSL3DRenderer* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(char *command) {
  printf("Usage: %s file.data int_0 int_1 int_2 ... int_n\n\n", command);
  printf("Create a binary file with sequential numbers int_0, int_1, int_2, "
         "..., int_n\n\n");
  printf("Example: %s file.data 2 6 5\n", command);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf13(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"Usage: %s file.data int_0 int_1 int_2 ... int_n\0A\0A\00"
@.str.1 = [79 x i8] c"Create a binary file with sequential numbers int_0, int_1, int_2, ..., int_n\0A\0A\00"
@.str.2 = [29 x i8] c"Example: %s file.data 2 6 5\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.1, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"Usage: %s file.data int_0 int_1 int_2 ... int_n\0A\0A\00"
@.str.2 = [29 x i8] c"Example: %s file.data 2 6 5\0A\00"
@str = [78 x i8] c"Create a binary file with sequential numbers int_0, int_1, int_2, ..., int_n\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int test(int, char **, int);
int main(int argc, char **argv) {
  int i, r = 0;
  for (i = 0; i < 1; i++) {
    r = test(argc, argv, i);
    if (r) {
      break;
    }
  }
  return r;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jge    1172 <main+0x62>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <test@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     115f <main+0x4f>
jmp    1172 <main+0x62>
jmp    1164 <main+0x54>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <main+0x24>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %edx,%edx
jmp    1030 <test@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @test(i32 %0, i8** %1, i32 0)
ret i32 %3
}
void computeLaunchProfile() {}


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

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

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

LLVM IR (-O2):
define void @computeLaunchProfile() {
ret void
}
void SteamAPI_ISteamMusic_PlayNext(void *self) {
  xlogf("%s(self = %p)", __func__, self);
}


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

x86 assembly (clang, -O2):
<SteamAPI_ISteamMusic_PlayNext>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%s(self = %p)\00"
@__func__.SteamAPI_ISteamMusic_PlayNext = [30 x i8] c"SteamAPI_ISteamMusic_PlayNext\00"
define void @SteamAPI_ISteamMusic_PlayNext(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @__func__.SteamAPI_ISteamMusic_PlayNext, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s(self = %p)\00"
@__func__.SteamAPI_ISteamMusic_PlayNext = [30 x i8] c"SteamAPI_ISteamMusic_PlayNext\00"
define void @SteamAPI_ISteamMusic_PlayNext(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @__func__.SteamAPI_ISteamMusic_PlayNext, i64 0, i64 0), i8* %0)
ret void
}
char *skipwhitespace(char *str) {
  while (*str == ' ' || *str == '\t' || *str == '\n' || *str == '\r')
    str++;
  return str;
}


x86 assembly (clang, -O0):
<skipwhitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     1157 <skipwhitespace+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x9(%rbp)
je     1157 <skipwhitespace+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x9(%rbp)
je     1157 <skipwhitespace+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1167 <skipwhitespace+0x67>
jmp    1178 <skipwhitespace+0x78>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skipwhitespace+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipwhitespace>:
mov    %rdi,%rax
movabs $0x100002600,%rcx
nopl   (%rax)
movzbl (%rax),%edx
cmp    $0x20,%rdx
ja     1125 <skipwhitespace+0x25>
bt     %rdx,%rcx
jae    1125 <skipwhitespace+0x25>
add    $0x1,%rax
jmp    1110 <skipwhitespace+0x10>
ret

LLVM IR (-O0):
define i8* @skipwhitespace(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %25, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 32
br i1 %7, label %23, label %8
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 9
br i1 %12, label %23, label %13
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 10
br i1 %17, label %23, label %18
18: ; preds = %13
%19 = load i8*, i8** %2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 13
br label %23
23: ; preds = %18, %13, %8, %3
%24 = phi i1 [ true, %13 ], [ true, %8 ], [ true, %3 ], [ %22, %18 ]
br i1 %24, label %25, label %28
25: ; preds = %23
%26 = load i8*, i8** %2
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %2
br label %3
28: ; preds = %23
%29 = load i8*, i8** %2
ret i8* %29
}

LLVM IR (-O2):
define i8* @skipwhitespace(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
i8 10, label %5
i8 13, label %5
]
5: ; preds = %2, %2, %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void y() { exit(-2); }


x86 assembly (clang, -O0):
<y>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffe,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<y>:
push   %rax
mov    $0xfffffffe,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @y() {
%1 = call i32 @exit(i32 -2)
unreachable
}

LLVM IR (-O2):
define void @y() {
%1 = tail call i32 @exit(i32 -2)
unreachable
}
void quicktime_copy_char32(char *output, char *input) {
  *output++ = *input++;
  *output++ = *input++;
  *output++ = *input++;
  *output = *input;
}


x86 assembly (clang, -O0):
<quicktime_copy_char32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicktime_copy_char32>:
mov    (%rsi),%al
mov    %al,(%rdi)
mov    0x1(%rsi),%al
mov    %al,0x1(%rdi)
mov    0x2(%rsi),%al
mov    %al,0x2(%rdi)
mov    0x3(%rsi),%al
mov    %al,0x3(%rdi)
ret

LLVM IR (-O0):
define void @quicktime_copy_char32(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 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %4
%7 = load i8, i8* %5
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %3
store i8 %7, i8* %8
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %4
%12 = load i8, i8* %10
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
store i8 %12, i8* %13
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %4
%17 = load i8, i8* %15
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
store i8 %17, i8* %18
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = load i8*, i8** %3
store i8 %21, i8* %22
ret void
}

LLVM IR (-O2):
define void @quicktime_copy_char32(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 1
%4 = load i8, i8* %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %4, i8* %0
%6 = getelementptr inbounds i8, i8* %1, i64 2
%7 = load i8, i8* %3
%8 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %7, i8* %5
%9 = getelementptr inbounds i8, i8* %1, i64 3
%10 = load i8, i8* %6
%11 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %10, i8* %8
%12 = load i8, i8* %9
store i8 %12, i8* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblockq_seek() {
  printf("NOT IMPLEMENTED:"
         "pa_memblockq_seek"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_memblockq_seek\00"
define i32 @pa_memblockq_seek() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int strlen(char const *);
int string_ends_with(const char *s, const char *suffix) {
  int sLength = strlen(s);
  int suffixLength = strlen(suffix);
  return (sLength >= suffixLength) &&
         (strcmp(s + (sLength - suffixLength), suffix) == 0);
}


x86 assembly (clang, -O0):
<string_ends_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
xor    %eax,%eax
cmp    -0x18(%rbp),%ecx
mov    %al,-0x19(%rbp)
jl     117b <string_ends_with+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
cltq
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_ends_with>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%ebp
jl     115d <string_ends_with+0x3d>
movslq %ebp,%rax
add    %rax,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @string_ends_with(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = icmp sge i32 %11, %12
br i1 %13, label %14, label %24
14: ; preds = %2
%15 = load i8*, i8** %3
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = sub nsw i32 %16, %17
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %15, i64 %19
%21 = load i8*, i8** %4
%22 = call i64 @strcmp(i8* %20, i8* %21)
%23 = icmp eq i64 %22, 0
br label %24
24: ; preds = %14, %2
%25 = phi i1 [ false, %2 ], [ %23, %14 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @string_ends_with(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp slt i32 %3, %4
br i1 %5, label %13, label %6
6: ; preds = %2
%7 = sub nsw i32 %3, %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = tail call i64 @strcmp(i8* %9, i8* %1)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %6, %2
%14 = phi i32 [ 0, %2 ], [ %12, %6 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
char *asctime(struct tm *);
struct tm *localtime(int /*<<< orphan*/ *);
int strlen(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *get_date() {
  time_t rawtime;
  struct tm *timeinfo;
  char *timechar;
  time(&rawtime);
  timeinfo = localtime(&rawtime);
  timechar = asctime(timeinfo);
  timechar[strlen(timechar) - 1] = 0;
  return timechar;
}


x86 assembly (clang, -O0):
<get_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x4(%rbp),%rdi
call   1060 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <asctime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_date>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    %rax,%rdi
call   1050 <asctime@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i8* @get_date() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = alloca i8*
%4 = call i32 @time(i32* %1)
%5 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %5, %struct.tm** %2
%6 = load %struct.tm*, %struct.tm** %2
%7 = call i8* @asctime(%struct.tm* %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
%11 = sub nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %8, i64 %12
store i8 0, i8* %13
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i8* @get_date() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
%5 = call i8* @asctime(%struct.tm* %4)
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, -1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
store i8 0, i8* %9
ret i8* %5
}
OP(dd, ea) { op_ea(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_ea()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  char s[] = "hello\n";
  s[0] = 'x';
  printf("hello\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x5(%rbp)
movb   $0x78,-0xb(%rbp)
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.s = [7 x i8] c"hello\0A\00"
@.str = [7 x i8] c"hello\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
store i32 0, i32* %1
%3 = bitcast [7 x i8]* %2 to i8*
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
store i8 120, i8* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test03(int a, int b) { return ((a & b) == 0) ? 0x7FFFFFFF : 0x80000000; }


x86 assembly (clang, -O0):
<test03>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
and    -0x8(%rbp),%edx
mov    $0x80000000,%eax
mov    $0x7fffffff,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test03>:
and    %esi,%edi
cmp    $0x1,%edi
mov    $0x80000000,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @test03(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = and i32 %5, %6
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 2147483647, i32 -2147483648
ret i32 %10
}

LLVM IR (-O2):
define i32 @test03(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 2147483647, i32 -2147483648
ret i32 %5
}