xunge/DecIR huggingface dataset:
char *strcat(char *dst, const char *src) {
  while (*dst)
    dst++;
  while ((*dst++ = *src++))
    ;
  return dst;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112a <strcat+0x2a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <strcat+0xc>
jmp    112f <strcat+0x2f>
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     115e <strcat+0x5e>
jmp    112f <strcat+0x2f>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @strcat(i8* %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* [ %13, %8 ], [ %4, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %13
}
/* Type definitions */
struct mutex {
  int dummy;
};
struct i40e_spinlock {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mutex_unlock(struct mutex *);
void i40e_release_spinlock_d(struct i40e_spinlock *sp) {
  mutex_unlock((struct mutex *)sp);
}


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

x86 assembly (clang, -O2):
<i40e_release_spinlock_d>:
jmp    1030 <mutex_unlock@plt>

LLVM IR (-O0):
%struct.i40e_spinlock = type { i32 }
%struct.mutex = type { i32 }
define void @i40e_release_spinlock_d(%struct.i40e_spinlock* %0) {
%2 = alloca %struct.i40e_spinlock*
store %struct.i40e_spinlock* %0, %struct.i40e_spinlock** %2
%3 = load %struct.i40e_spinlock*, %struct.i40e_spinlock** %2
%4 = bitcast %struct.i40e_spinlock* %3 to %struct.mutex*
%5 = call i32 @mutex_unlock(%struct.mutex* %4)
ret void
}

LLVM IR (-O2):
%struct.i40e_spinlock = type { i32 }
%struct.mutex = type { i32 }
define void @i40e_release_spinlock_d(%struct.i40e_spinlock* %0) {
%2 = bitcast %struct.i40e_spinlock* %0 to %struct.mutex*
%3 = tail call i32 @mutex_unlock(%struct.mutex* %2)
ret void
}
int eraVersionMinor(void) { return 6; }


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

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

LLVM IR (-O0):
define i32 @eraVersionMinor() {
ret i32 6
}

LLVM IR (-O2):
define i32 @eraVersionMinor() {
ret i32 6
}
void set_realtime_prio() {
  internal_logit("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/christophgysin/moc/refs/"
                 "heads/lyrics/out_buf.c",
                 92, __FUNCTION__,
                 "No sched_get_priority_max() function: "
                 "realtime priority not used.");
}


x86 assembly (clang, -O0):
<set_realtime_prio>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x5c,%esi
lea    0xf62(%rip),%rdx
lea    0xf6d(%rip),%rcx
mov    $0x0,%al
call   1030 <internal_logit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_realtime_prio>:
lea    0xee9(%rip),%rdi
lea    0xf6b(%rip),%rdx
lea    0xf76(%rip),%rcx
mov    $0x5c,%esi
xor    %eax,%eax
jmp    1030 <internal_logit@plt>

LLVM IR (-O0):
@.str = [137 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/christophgysin/moc/refs/heads/lyrics/out_buf.c\00"
@__FUNCTION__.set_realtime_prio = [18 x i8] c"set_realtime_prio\00"
@.str.1 = [66 x i8] c"No sched_get_priority_max() function: realtime priority not used.\00"
define void @set_realtime_prio() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @internal_logit to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i64 0, i64 0), i32 92, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.set_realtime_prio, i64 0, i64 0), i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [137 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/christophgysin/moc/refs/heads/lyrics/out_buf.c\00"
@__FUNCTION__.set_realtime_prio = [18 x i8] c"set_realtime_prio\00"
@.str.1 = [66 x i8] c"No sched_get_priority_max() function: realtime priority not used.\00"
define void @set_realtime_prio() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @internal_logit to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i64 0, i64 0), i32 92, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.set_realtime_prio, i64 0, i64 0), i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
int fputc(int c, FILE *stream) {
  unsigned char ch = c;
  return fwrite(&ch, 1, 1, stream) == 1 ? ch : EOF;
}


x86 assembly (clang, -O0):
<fputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x11(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fwrite@plt>
cmp    $0x1,%eax
jne    114e <fputc+0x3e>
movzbl -0x11(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    115a <fputc+0x4a>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputc>:
push   %rax
mov    %rsi,%rcx
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
cmp    $0x1,%eax
je     113d <fputc+0x2d>
mov    0x2eaf(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret
movzbl 0x7(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @fputc(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32, i32* %3
%7 = trunc i32 %6 to i8
store i8 %7, i8* %5
%8 = load i32*, i32** %4
%9 = call i32 @fwrite(i8* %5, i32 1, i32 1, i32* %8)
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
br label %16
14: ; preds = %2
%15 = load i32, i32* @EOF
br label %16
16: ; preds = %14, %11
%17 = phi i32 [ %13, %11 ], [ %15, %14 ]
ret i32 %17
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @fputc(i32 %0, i32* nocapture %1) {
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = call i32 @fwrite(i8* %3, i32 1, i32 1, i32* %1)
%6 = icmp eq i32 %5, 1
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = load i32, i32* @EOF
%10 = select i1 %6, i32 %8, i32 %9
ret i32 %10
}
unsigned int rotate(unsigned int x, unsigned int n) {
  int len = sizeof(unsigned int) * 8;
  int firstbits = ~(~0 << n) & x;
  int lshift = len - n;
  return (firstbits << lshift) | (x >> n);
}


x86 assembly (clang, -O0):
<rotate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x20,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @rotate(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 32, i32* %5
%8 = load i32, i32* %4
%9 = shl i32 -1, %8
%10 = xor i32 %9, -1
%11 = load i32, i32* %3
%12 = and i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = sub i32 %13, %14
store i32 %15, i32* %7
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = shl i32 %16, %17
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = lshr i32 %19, %20
%22 = or i32 %18, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @rotate(i32 %0, i32 %1) {
%3 = sub i32 32, %1
%4 = shl i32 %0, %3
%5 = lshr i32 %0, %1
%6 = or i32 %4, %5
ret i32 %6
}
float add_float(float num1, float num2) { return num1 + num2; }


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

x86 assembly (clang, -O2):
<add_float>:
addss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @add_float(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
void X509_ALGOR_new(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_ALGOR_new() {
ret void
}
__attribute__((const)) __attribute__((always_)) double fnma(double a, double b,
                                                            double c) {
  return __builtin_fma(-a, b, c);
}


x86 assembly (clang, -O0):
<fnma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <fma@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnma>:
xorps  0xee9(%rip),%xmm0
jmp    1030 <fma@plt>

LLVM IR (-O0):
define double @fnma(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = fneg double %7
%9 = load double, double* %5
%10 = load double, double* %6
%11 = call double @llvm.fma.f64(double %8, double %9, double %10)
ret double %11
}

LLVM IR (-O2):
define double @fnma(double %0, double %1, double %2) {
%4 = fneg double %0
%5 = tail call double @llvm.fma.f64(double %4, double %1, double %2)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ handle_POLL(int /*<<< orphan*/);
int gen_POLL() { handle_POLL(0); }


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

x86 assembly (clang, -O2):
<gen_POLL>:
xor    %edi,%edi
jmp    1030 <handle_POLL@plt>

LLVM IR (-O0):
define i32 @gen_POLL() {
%1 = alloca i32
%2 = call i32 @handle_POLL(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_POLL() {
%1 = tail call i32 @handle_POLL(i32 0)
ret i32 undef
}
/* Variables and functions */
scalar_t__ atoi(char const *);
int main(int argc, const char *argv[]) {
  int i, sum = 0;
  for (i = 1; i < argc; i++)
    sum += atoi(argv[i]);
  return 0;
}


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   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    116c <main+0x5c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <atoi@plt>
mov    %rax,%rcx
movslq -0x18(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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 1, i32* %6
br label %8
8: ; preds = %23, %2
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %26
12: ; preds = %8
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i64 @atoi(i8* %17)
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = add nsw i64 %20, %18
%22 = trunc i64 %21 to i32
store i32 %22, i32* %7
br label %23
23: ; preds = %12
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %8
26: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
ret i32 0
}
void print(char *message, int color) {
  char *mem = (char *)(0xb8000);
  while (*message != 0) {
    *mem = *message;
    mem++;
    message++;
    *mem = (char *)color;
    mem++;
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xb8000,%eax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1165 <print+0x65>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
movslq -0xc(%rbp),%rax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <print+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
mov    (%rdi),%al
test   %al,%al
je     112c <print+0x2c>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %al,0xb8000(%rcx,%rcx,1)
mov    %sil,0xb8001(%rcx,%rcx,1)
movzbl 0x1(%rdi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <print+0x10>
ret

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

LLVM IR (-O2):
define void @print(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %7
%8 = phi i8 [ %3, %5 ], [ %14, %7 ]
%9 = phi i8* [ inttoptr (i64 753664 to i8*), %5 ], [ %13, %7 ]
%10 = phi i8* [ %0, %5 ], [ %12, %7 ]
store i8 %8, i8* %9
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %6, i8* %11
%13 = getelementptr inbounds i8, i8* %9, i64 2
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %2
ret void
}
void m_flush(fd) int fd;
{}


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

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

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

LLVM IR (-O2):
define void @m_flush(i32 %0) {
ret void
}
/* Variables and functions */
int strlen(const char *str) {
  int size = 0;
  while (str[size++] != '\0') {
  }
  return size - 1;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1133 <strlen+0x33>
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %4, %2 ], [ 0, %1 ]
%4 = add nuw i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
void halt() { asm volatile("hlt" : :); }


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

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

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

LLVM IR (-O2):
define void @halt() {
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int INT_MIN;
int test3(int x) { return (x + INT_MIN) ^ 0x1234; }


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed7(%rip),%rcx
add    (%rcx),%eax
xor    $0x1234,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
add    (%rcx),%eax
xor    $0x1234,%eax
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
define i32 @test3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @INT_MIN
%5 = add nsw i32 %3, %4
%6 = xor i32 %5, 4660
ret i32 %6
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define i32 @test3(i32 %0) {
%2 = load i32, i32* @INT_MIN
%3 = add nsw i32 %2, %0
%4 = xor i32 %3, 4660
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ delay_us(int);
int /*<<< orphan*/ i2c_start();
int /*<<< orphan*/ i2c_stop();
int /*<<< orphan*/ i2c_write(unsigned char);
void i2c_send_nibble(unsigned char data) {
  i2c_start();
  delay_us(20);
  i2c_write(0x4E);
  delay_us(20);
  i2c_write(data);
  delay_us(20);
  i2c_stop();
  delay_us(20);
}


x86 assembly (clang, -O0):
<i2c_send_nibble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1060 <i2c_start@plt>
mov    $0x14,%edi
call   1050 <delay_us@plt>
mov    $0x4e,%edi
call   1030 <i2c_write@plt>
mov    $0x14,%edi
call   1050 <delay_us@plt>
movzbl -0x1(%rbp),%edi
call   1030 <i2c_write@plt>
mov    $0x14,%edi
call   1050 <delay_us@plt>
mov    $0x0,%al
call   1040 <i2c_stop@plt>
mov    $0x14,%edi
call   1050 <delay_us@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_send_nibble>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <i2c_start@plt>
mov    $0x14,%edi
call   1050 <delay_us@plt>
mov    $0x4e,%edi
call   1030 <i2c_write@plt>
mov    $0x14,%edi
call   1050 <delay_us@plt>
mov    %ebx,%edi
call   1030 <i2c_write@plt>
mov    $0x14,%edi
call   1050 <delay_us@plt>
xor    %eax,%eax
call   1040 <i2c_stop@plt>
mov    $0x14,%edi
pop    %rbx
jmp    1050 <delay_us@plt>

LLVM IR (-O0):
define void @i2c_send_nibble(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 (...) @i2c_start()
%4 = call i32 @delay_us(i32 20)
%5 = call i32 @i2c_write(i8 zeroext 78)
%6 = call i32 @delay_us(i32 20)
%7 = load i8, i8* %2
%8 = call i32 @i2c_write(i8 zeroext %7)
%9 = call i32 @delay_us(i32 20)
%10 = call i32 (...) @i2c_stop()
%11 = call i32 @delay_us(i32 20)
ret void
}

LLVM IR (-O2):
define void @i2c_send_nibble(i8 zeroext %0) {
%2 = tail call i32 (...) @i2c_start()
%3 = tail call i32 @delay_us(i32 20)
%4 = tail call i32 @i2c_write(i8 zeroext 78)
%5 = tail call i32 @delay_us(i32 20)
%6 = tail call i32 @i2c_write(i8 zeroext %0)
%7 = tail call i32 @delay_us(i32 20)
%8 = tail call i32 (...) @i2c_stop()
%9 = tail call i32 @delay_us(i32 20)
ret void
}
int my_index(S, M)
char *S;
char M;
{
  int i, pos;
  pos = -1;
  for (i = 0; i < strlen(S); i++) {
    if (S[i] == M) {
      pos = i;
      break;
    }
  }
  return pos;
}


x86 assembly (clang, -O0):
<my_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0xffffffff,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
movslq -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jae    1187 <my_index+0x77>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1174 <my_index+0x64>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1187 <my_index+0x77>
jmp    1179 <my_index+0x69>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1130 <my_index+0x20>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_index>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1145 <my_index+0x35>
movsbl %bpl,%esi
xor    %edx,%edx
movsbl (%rbx,%rdx,1),%edi
cmp    %edi,%esi
je     1143 <my_index+0x33>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1130 <my_index+0x20>
jmp    1145 <my_index+0x35>
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @my_index(i8* nocapture %0, i32 %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %19, label %5
5: ; preds = %2
%6 = shl i32 %1, 24
%7 = ashr exact i32 %6, 24
br label %8
8: ; preds = %5, %14
%9 = phi i64 [ 0, %5 ], [ %15, %14 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %7, %12
br i1 %13, label %17, label %14
14: ; preds = %8
%15 = add nuw i64 %9, 1
%16 = icmp eq i64 %15, %3
br i1 %16, label %19, label %8
17: ; preds = %8
%18 = trunc i64 %9 to i32
br label %19
19: ; preds = %14, %17, %2
%20 = phi i32 [ -1, %2 ], [ %18, %17 ], [ -1, %14 ]
ret i32 %20
}
void PWMFaultIntClearExt(unsigned long ulBase, unsigned long ulFaultInts) {
  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x0000001C))) = ulFaultInts;
}


x86 assembly (clang, -O0):
<PWMFaultIntClearExt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMFaultIntClearExt>:
mov    %rsi,0x1c(%rdi)
ret

LLVM IR (-O0):
define void @PWMFaultIntClearExt(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 28
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @PWMFaultIntClearExt(i64 %0, i64 %1) {
%3 = add i64 %0, 28
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
scalar_t__ CallBack2(int, void *, void *);
int SetOperationStrVar(const char *varName, const char *str) {
  return (int)CallBack2(189, (void *)varName, (void *)str);
}


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

x86 assembly (clang, -O2):
<SetOperationStrVar>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xbd,%edi
jmp    1030 <CallBack2@plt>

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

LLVM IR (-O2):
define i32 @SetOperationStrVar(i8* %0, i8* %1) {
%3 = tail call i64 @CallBack2(i32 189, i8* %0, i8* %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int HelpMessage(size_t argc, const char **argv) {
  printf(
      "This is a simple shell for tinyos.\n\nYou can run some simple commands. "
      "Every command takes a\nonly **integer** arguments. The list of commands "
      "and the\nnumber of arguments for each command is shown by\ntyping 'ls'. "
      "\n\nWhen you are tired of playing, type 'exit' to quit.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [266 x i8] c"This is a simple shell for tinyos.\0A\0AYou can run some simple commands. Every command takes a\0Aonly **integer** arguments. The list of commands and the\0Anumber of arguments for each command is shown by\0Atyping 'ls'. \0A\0AWhen you are tired of playing, type 'exit' to quit.\0A\00"
define i32 @HelpMessage(i64 %0, i8** %1) {
%3 = alloca i64
%4 = alloca i8**
store i64 %0, i64* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([266 x i8], [266 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [265 x i8] c"This is a simple shell for tinyos.\0A\0AYou can run some simple commands. Every command takes a\0Aonly **integer** arguments. The list of commands and the\0Anumber of arguments for each command is shown by\0Atyping 'ls'. \0A\0AWhen you are tired of playing, type 'exit' to quit.\00"
define i32 @HelpMessage(i64 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([265 x i8], [265 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int bar(void) {
  int foo(int b);
  return foo(4);
}


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

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

LLVM IR (-O0):
define i32 @bar() {
%1 = call i32 @foo(i32 4)
ret i32 %1
}

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i32 @foo(i32 4)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rate(long long, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, long long *);
void sysiso_query() {
  long long t;
  scanf("%lld", &t);
  printf("%d\n", rate(t, 0));
}


x86 assembly (clang, -O0):
<sysiso_query>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <rate@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysiso_query>:
push   %rax
lea    0xec8(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    (%rsp),%rdi
xor    %esi,%esi
call   1030 <rate@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @sysiso_query() {
%1 = alloca i64
%2 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%3 = load i64, i64* %1
%4 = call i32 @rate(i64 %3, i32 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @sysiso_query() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = call i32 @rate(i64 %4, i32 0)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}
int main(void) {
  int n = 1;
  switch (n) {
  case 1:
    break;
  default:
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
jne    1128 <main+0x28>
jmp    1123 <main+0x23>
jmp    112d <main+0x2d>
jmp    112d <main+0x2d>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %5 [
i32 1, label %4
]
4: ; preds = %0
br label %6
5: ; preds = %0
br label %6
6: ; preds = %5, %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
void GPIOIntDisable(uint32_t ui32Port, uint32_t ui32IntFlags) {
  ;
  (*((volatile uint32_t *)(ui32Port + 0x00000410))) &= ~(ui32IntFlags);
}


x86 assembly (clang, -O0):
<GPIOIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x410(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x410(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOIntDisable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
not    %rax
mov    -0x8(%rsp),%rcx
and    %rax,0x410(%rcx)
ret

LLVM IR (-O0):
define void @GPIOIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add nsw i64 %7, 1040
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @GPIOIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add nsw i64 %7, 1040
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_invasions_header_full() {
  printf("W,\tM,\tT,\ts1,\ts2,\td1,\td2,\tA,\tB,\ta,\tb,\tK,\tk,\t0000,\t0001,"
         "\t0010,\t0011,\t0100,\t0101,\t0110,\t0111,\t1000,\t1001,\t1010,"
         "\t1011,\t1100,\t1101,\t1110,\t1111\n");
}


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

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

LLVM IR (-O0):
@.str = [139 x i8] c"W,\09M,\09T,\09s1,\09s2,\09d1,\09d2,\09A,\09B,\09a,\09b,\09K,\09k,\090000,\090001,\090010,\090011,\090100,\090101,\090110,\090111,\091000,\091001,\091010,\091011,\091100,\091101,\091110,\091111\0A\00"
define void @print_invasions_header_full() {
%1 = call i32 @printf(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [138 x i8] c"W,\09M,\09T,\09s1,\09s2,\09d1,\09d2,\09A,\09B,\09a,\09b,\09K,\09k,\090000,\090001,\090010,\090011,\090100,\090101,\090110,\090111,\091000,\091001,\091010,\091011,\091100,\091101,\091110,\091111\00"
define void @print_invasions_header_full() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([138 x i8], [138 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned char ceq(unsigned char a, unsigned char b) { return a; }


x86 assembly (clang, -O0):
<ceq>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @ceq(i8 returned zeroext %0, i8 zeroext %1) {
ret i8 %0
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_smeanli(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_smeanli(N, x, stride);
  printf("mean: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
call   1040 <stdlib_strided_smeanli@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_smeanli@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [10 x i8] c"mean: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_smeanli(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [10 x i8] c"mean: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_smeanli(i32 4, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int);
scalar_t__ pthread_self();
int /*<<< orphan*/ stderr;
void catch_SIGQUIT(int sig) {
  fprintf(stderr, "my tid  : %u\n", (unsigned)pthread_self());
}


x86 assembly (clang, -O0):
<catch_SIGQUIT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%edx
lea    0xeb6(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<catch_SIGQUIT>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xec8(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"my tid : %u\0A\00"
define void @catch_SIGQUIT(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i64 (...) @pthread_self()
%5 = trunc i64 %4 to i32
%6 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"my tid : %u\0A\00"
define void @catch_SIGQUIT(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i64 (...) @pthread_self()
%4 = trunc i64 %3 to i32
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x09() {
  Assert_real((isxdigit(9) == 0),
              "/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_isxdigit.c",
              50, ("isxdigit should be 0 for 0x09"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x09>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x32,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x09>:
push   %rax
mov    $0x9,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x32,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x09\00"
define void @t_isxdigit_0x09() {
%1 = call i64 @isxdigit(i32 9)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 50, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x09\00"
define void @t_isxdigit_0x09() {
%1 = tail call i64 @isxdigit(i32 9)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 50, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int,
                           char const *);
int /*<<< orphan*/ stderr;
char *zconf_curname();
int zconf_lineno();
void yyerror(const char *err) {
  fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <zconf_curname@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <zconf_lineno@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %eax,%ecx
add    $0x1,%ecx
mov    -0x8(%rbp),%r8
lea    0xe8f(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyerror>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    0x2ea2(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1050 <zconf_curname@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <zconf_lineno@plt>
lea    0x1(%rax),%ecx
lea    0xea5(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %r14,%r8
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"%s:%d: %s\0A\00"
define void @yyerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i8* (...) @zconf_curname()
%5 = call i32 (...) @zconf_lineno()
%6 = add nsw i32 %5, 1
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %6, i8* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"%s:%d: %s\0A\00"
define void @yyerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i8* (...) @zconf_curname()
%4 = tail call i32 (...) @zconf_lineno()
%5 = add nsw i32 %4, 1
%6 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %5, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ junk(int);
void foo(void) {
  int a;
  junk(a = 3);
}


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

x86 assembly (clang, -O2):
<foo>:
mov    $0x3,%edi
jmp    1030 <junk@plt>

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

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @junk(i32 3)
ret void
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};

/* Variables and functions */
char *stringFieldInSubmissionSet(struct sqlConnection *, int, char *);
char *visiGenePublication(struct sqlConnection *conn, int id) {
  return stringFieldInSubmissionSet(conn, id, "publication");
}


x86 assembly (clang, -O0):
<visiGenePublication>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <stringFieldInSubmissionSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<visiGenePublication>:
lea    0xee9(%rip),%rdx
jmp    1030 <stringFieldInSubmissionSet@plt>

LLVM IR (-O0):
%struct.sqlConnection = type { i32 }
@.str = [12 x i8] c"publication\00"
define i8* @visiGenePublication(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca %struct.sqlConnection*
%4 = alloca i32
store %struct.sqlConnection* %0, %struct.sqlConnection** %3
store i32 %1, i32* %4
%5 = load %struct.sqlConnection*, %struct.sqlConnection** %3
%6 = load i32, i32* %4
%7 = call i8* @stringFieldInSubmissionSet(%struct.sqlConnection* %5, i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [12 x i8] c"publication\00"
define i8* @visiGenePublication(%struct.sqlConnection* %0, i32 %1) {
%3 = tail call i8* @stringFieldInSubmissionSet(%struct.sqlConnection* %0, i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
void archinit(void) {}


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

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

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

LLVM IR (-O2):
define void @archinit() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;
typedef enum __ptrace_request {
  ____Placeholder___ptrace_request
} __ptrace_request;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  printf("sizeof(enum __ptrace_request) = %lu\n"
         "sizeof(pid_t) = %lu\n"
         "sizeof(void *) = %lu\n",
         sizeof(enum __ptrace_request), sizeof(pid_t), sizeof(void *));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [78 x i8] c"sizeof(enum __ptrace_request) = %lu\0Asizeof(pid_t) = %lu\0Asizeof(void *) = %lu\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 4, i32 4, i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [78 x i8] c"sizeof(enum __ptrace_request) = %lu\0Asizeof(pid_t) = %lu\0Asizeof(void *) = %lu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 4, i32 4, i32 8)
ret i32 0
}
double c1f(double a1, double b1) {
  double c1;
  c1 = b1 - (1 / a1);
  return (c1);
}


x86 assembly (clang, -O0):
<c1f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xee5(%rip),%xmm1
divsd  -0x8(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<c1f>:
movsd  0xef8(%rip),%xmm2
divsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @c1f(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fdiv double 1.000000e+00, %7
%9 = fsub double %6, %8
store double %9, double* %5
%10 = load double, double* %5
ret double %10
}

LLVM IR (-O2):
define double @c1f(double %0, double %1) {
%3 = fdiv double 1.000000e+00, %0
%4 = fsub double %1, %3
ret double %4
}