xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ueBytesFromChar(char);
int ueStrLen(char *str) {
  int length = 0;
  char *strptr = str;
  while (strptr[0] != '\0') {
    strptr += ueBytesFromChar(strptr[0]);
    ++length;
  }
  return length;
}


x86 assembly (clang, -O0):
<ueStrLen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1165 <ueStrLen+0x55>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <ueBytesFromChar@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <ueStrLen+0x1b>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ueStrLen>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     113c <ueStrLen+0x2c>
mov    %rdi,%r14
xor    %ebx,%ebx
nop
movsbl %al,%edi
call   1030 <ueBytesFromChar@plt>
movslq %eax,%rcx
movzbl (%r14,%rcx,1),%eax
add    %rcx,%r14
add    $0x1,%ebx
test   %al,%al
jne    1120 <ueStrLen+0x10>
jmp    113e <ueStrLen+0x2e>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @ueStrLen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = tail call i32 @ueBytesFromChar(i8 signext %5)
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = add nuw nsw i32 %7, 1
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
long double __rinfl(long double);
scalar_t__ signbit(long double);
long double truncl(long double);
long double ceill(long double x) { return signbit(x) ? truncl(x) : __rinfl(x); }


x86 assembly (clang, -O0):
<ceill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <signbit@plt>
cmp    $0x0,%rax
je     116a <ceill+0x3a>
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1050 <truncl@plt>
fstpt  -0x1c(%rbp)
jmp    117a <ceill+0x4a>
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__rinfl@plt>
fstpt  -0x1c(%rbp)
fldt   -0x1c(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceill>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x1c(%rsp)
fstpt  (%rsp)
call   1040 <signbit@plt>
test   %rax,%rax
je     115c <ceill+0x2c>
fldt   0x1c(%rsp)
fstpt  (%rsp)
call   1050 <truncl@plt>
add    $0x28,%rsp
ret
fldt   0x1c(%rsp)
fstpt  (%rsp)
call   1030 <__rinfl@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @ceill(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @signbit(x86_fp80 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load x86_fp80, x86_fp80* %2
%8 = call x86_fp80 @llvm.trunc.f80(x86_fp80 %7)
br label %12
9: ; preds = %1
%10 = load x86_fp80, x86_fp80* %2
%11 = call x86_fp80 @__rinfl(x86_fp80 %10)
br label %12
12: ; preds = %9, %6
%13 = phi x86_fp80 [ %8, %6 ], [ %11, %9 ]
ret x86_fp80 %13
}

LLVM IR (-O2):
define x86_fp80 @ceill(x86_fp80 %0) {
%2 = tail call i64 @signbit(x86_fp80 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call x86_fp80 @llvm.trunc.f80(x86_fp80 %0)
br label %8
6: ; preds = %1
%7 = tail call x86_fp80 @__rinfl(x86_fp80 %0)
br label %8
8: ; preds = %6, %4
%9 = phi x86_fp80 [ %5, %4 ], [ %7, %6 ]
ret x86_fp80 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void readline_destructor(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<readline_destructor>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @readline_destructor(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
float RAND_MAX;
scalar_t__ rand();
float randomFloat(short lowerBound, short upperBound) {
  float x;
  x = (float)rand() / (float)(RAND_MAX / (float)(upperBound - lowerBound));
  x += (float)lowerBound;
  return x;
}


x86 assembly (clang, -O0):
<randomFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2eaf(%rip),%rax
movss  (%rax),%xmm1
movswl -0x4(%rbp),%eax
movswl -0x2(%rbp),%ecx
sub    %ecx,%eax
cvtsi2ss %eax,%xmm2
divss  %xmm2,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movswl -0x2(%rbp),%eax
cvtsi2ss %eax,%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomFloat>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm1
sub    %ebp,%ebx
cvtsi2ss %ebx,%xmm0
mov    0x2eb8(%rip),%rax
movss  (%rax),%xmm2
divss  %xmm0,%xmm2
divss  %xmm2,%xmm1
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
addss  %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global float 0.000000e+00
define float @randomFloat(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca float
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = call i64 (...) @rand()
%7 = sitofp i64 %6 to float
%8 = load float, float* @RAND_MAX
%9 = load i16, i16* %4
%10 = sext i16 %9 to i32
%11 = load i16, i16* %3
%12 = sext i16 %11 to i32
%13 = sub nsw i32 %10, %12
%14 = sitofp i32 %13 to float
%15 = fdiv float %8, %14
%16 = fdiv float %7, %15
store float %16, float* %5
%17 = load i16, i16* %3
%18 = sitofp i16 %17 to float
%19 = load float, float* %5
%20 = fadd float %19, %18
store float %20, float* %5
%21 = load float, float* %5
ret float %21
}

LLVM IR (-O2):
@RAND_MAX = global float 0.000000e+00
define float @randomFloat(i16 signext %0, i16 signext %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to float
%5 = load float, float* @RAND_MAX
%6 = sext i16 %1 to i32
%7 = sext i16 %0 to i32
%8 = sub nsw i32 %6, %7
%9 = sitofp i32 %8 to float
%10 = fdiv float %5, %9
%11 = fdiv float %4, %10
%12 = sitofp i16 %0 to float
%13 = fadd float %11, %12
ret float %13
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
size_t strlen(char const *);
size_t strxfrm(char *restrict dst, const char *restrict src, size_t n) {
  size_t len = strlen(src);
  if (len < n)
    strcpy(dst, src);
  return len;
}


x86 assembly (clang, -O0):
<strxfrm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    115c <strxfrm+0x3c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strxfrm>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbx
cmp    %r12,%rax
jae    114c <strxfrm+0x2c>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @strxfrm(i8* noalias %0, i8* noalias %1, i64 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp ult i64 %4, %2
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @strcpy(i8* %0, i8* %1)
br label %8
8: ; preds = %6, %3
ret i64 %4
}
int ordinal(int input) {
  int one_bits = 0;
  while (input > 0) {
    one_bits += input & 0x1;
    input >>= 1;
  }
  return one_bits;
}


x86 assembly (clang, -O0):
<ordinal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1132 <ordinal+0x32>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <ordinal+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ordinal>:
xor    %eax,%eax
test   %edi,%edi
jle    1120 <ordinal+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <ordinal+0x10>
ret

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

LLVM IR (-O2):
define i32 @ordinal(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %4, %6
%8 = lshr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, unsigned int);
int /*<<< orphan*/ stdout;
void WriteInt_Real(unsigned int x) {
  printf("%+d", x);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<WriteInt_Real>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteInt_Real>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%+d\00"
@stdout = global i32 0
define void @WriteInt_Real(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
unsigned long QEIPositionGet(unsigned long ulBase) {
  DEBUG_ASSERT((ulBase == 0x4002C000) || (ulBase == 0x4002D000));
  return ((*((volatile unsigned long *)(ulBase + 0x00000008))));
}


x86 assembly (clang, -O0):
<QEIPositionGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x4002c000,-0x8(%rbp)
40
mov    %al,-0x9(%rbp)
je     113d <QEIPositionGet+0x2d>
cmpq   $0x4002d000,-0x8(%rbp)
40
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIPositionGet>:
push   %rbx
mov    %rdi,%rbx
mov    %rdi,%rax
and    $0xffffffffffffefff,%rax
xor    %edi,%edi
cmp    $0x4002c000,%rax
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    0x8(%rbx),%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @QEIPositionGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1073922048
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 1073926144
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = load i64, i64* %2
%13 = add i64 %12, 8
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @QEIPositionGet(i64 %0) {
%2 = and i64 %0, -4097
%3 = icmp eq i64 %2, 1073922048
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = add i64 %0, 8
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
ret i64 %8
}
int isprint(int c) { return c >= 0x20 && c <= 0x7e; }


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isprint+0x20>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
void gtk_action_get_proxies() {}


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

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

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

LLVM IR (-O2):
define void @gtk_action_get_proxies() {
ret void
}
int test_imm_AFuint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xAF << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_AFuint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 751619276800
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int main() {
  printf("enter %s\n", __func__);
  mylib1_fct1();
  mylib2_fct2();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
lea    0xec8(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <mylib1_fct1@plt>
mov    $0x0,%al
call   1040 <mylib2_fct2@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xecb(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <mylib1_fct1@plt>
xor    %eax,%eax
call   1040 <mylib2_fct2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"enter %s\0A\00"
@__func__.main = [5 x i8] c"main\00"
define i32 @main() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0))
%2 = call i32 (...) @mylib1_fct1()
%3 = call i32 (...) @mylib2_fct2()
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"enter %s\0A\00"
@__func__.main = [5 x i8] c"main\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0))
%2 = tail call i32 (...) @mylib1_fct1()
%3 = tail call i32 (...) @mylib2_fct2()
ret i32 0
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ write(int, char *, int);
int ft_putchar_fd(char c, int fd) {
  if (write(fd, &c, 1) < 0)
    return (EXIT_FAILURE);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<ft_putchar_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmp    $0x0,%rax
jge    114d <ft_putchar_fd+0x3d>
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <ft_putchar_fd+0x49>
mov    0x2e84(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putchar_fd>:
push   %rax
mov    %esi,%eax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    %eax,%edi
mov    $0x1,%edx
call   1030 <write@plt>
test   %rax,%rax
jns    1137 <ft_putchar_fd+0x27>
mov    0x2eab(%rip),%rax
jmp    113e <ft_putchar_fd+0x2e>
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @ft_putchar_fd(i8 signext %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = call i64 @write(i32 %6, i8* %4, i32 1)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* @EXIT_FAILURE
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* @EXIT_SUCCESS
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @ft_putchar_fd(i8 signext %0, i32 %1) {
%3 = alloca i8
store i8 %0, i8* %3
%4 = call i64 @write(i32 %1, i8* %3, i32 1)
%5 = icmp slt i64 %4, 0
%6 = load i32, i32* @EXIT_FAILURE
%7 = load i32, i32* @EXIT_SUCCESS
%8 = select i1 %5, i32 %6, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalpha(int);
void t_isalpha_0x65() {
  Assert_real((isalpha(101)),
              "/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_isalpha.c",
              510, ("isalpha should be 1 for e"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x65>:
push   %rax
mov    $0x65,%edi
call   1030 <isalpha@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1fe,%edx
pop    %rax
jmp    1040 <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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for e\00"
define void @t_isalpha_0x65() {
%1 = call i32 @isalpha(i32 101)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 510, 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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for e\00"
define void @t_isalpha_0x65() {
%1 = tail call i32 @isalpha(i32 101)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 510, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ perror(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int CreateDgramClientSock() {
  int fd;
  if ((fd = socket(PF_INET, SOCK_DGRAM, 0)) < 0) {
    perror("socket");
    return -1;
  }
  return fd;
}


x86 assembly (clang, -O0):
<CreateDgramClientSock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    1165 <CreateDgramClientSock+0x45>
lea    0xeac(%rip),%rdi
call   1030 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <CreateDgramClientSock+0x4b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreateDgramClientSock>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
test   %eax,%eax
js     1140 <CreateDgramClientSock+0x20>
pop    %rcx
ret
lea    0xeb9(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str = [7 x i8] c"socket\00"
define i32 @CreateDgramClientSock() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @PF_INET
%4 = load i32, i32* @SOCK_DGRAM
%5 = call i32 @socket(i32 %3, i32 %4, i32 0)
store i32 %5, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %11
9: ; preds = %0
%10 = load i32, i32* %2
store i32 %10, i32* %1
br label %11
11: ; preds = %9, %7
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str = [7 x i8] c"socket\00"
define i32 @CreateDgramClientSock() {
%1 = load i32, i32* @PF_INET
%2 = load i32, i32* @SOCK_DGRAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %0, %5
%8 = phi i32 [ -1, %5 ], [ %3, %0 ]
ret i32 %8
}
void breakpoint_hw_destroy(struct task *task) { (void)task; }


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

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

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

LLVM IR (-O2):
%struct.task = type opaque
define void @breakpoint_hw_destroy(%struct.task* nocapture %0) {
ret void
}
void foo019(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo019(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: lastlogin [-f file] [-rt] [user ...]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"usage: lastlogin [-f file] [-rt] [user ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"usage: lastlogin [-f file] [-rt] [user ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
unsigned long lround(int);
unsigned long timespec_to_usec(struct timespec *ts) {
  return lround((ts->tv_sec * 1E9 + ts->tv_nsec) / 1000.0);
}


x86 assembly (clang, -O0):
<timespec_to_usec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdl (%rax),%xmm0
mov    -0x8(%rbp),%rax
cvtsi2sdl 0x4(%rax),%xmm1
movsd  0xed3(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xebb(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <lround@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_to_usec>:
cvtsi2sdl (%rdi),%xmm0
cvtsi2sdl 0x4(%rdi),%xmm1
mulsd  0xedf(%rip),%xmm0
addsd  %xmm1,%xmm0
divsd  0xedb(%rip),%xmm0
cvttsd2si %xmm0,%edi
jmp    1030 <lround@plt>

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i64 @timespec_to_usec(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = load %struct.timespec*, %struct.timespec** %2
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to double
%11 = call double @llvm.fmuladd.f64(double %6, double 1.000000e+09, double %10)
%12 = fdiv double %11, 1.000000e+03
%13 = fptosi double %12 to i32
%14 = call i64 @lround(i32 %13)
ret i64 %14
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i64 @timespec_to_usec(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = tail call double @llvm.fmuladd.f64(double %4, double 1.000000e+09, double %7)
%9 = fdiv double %8, 1.000000e+03
%10 = fptosi double %9 to i32
%11 = tail call i64 @lround(i32 %10)
ret i64 %11
}
/* Variables and functions */
float App_Get_Kp();
int /*<<< orphan*/ File_Fifo_Respond(char *);
int /*<<< orphan*/ sprintf(char *, char *, float);
void File_Fifo_Get_P_Gain(void) {
  char buffer[50];
  float gain;
  gain = App_Get_Kp();
  sprintf(buffer, "1\n%4.2f\n", gain);
  File_Fifo_Respond(buffer);
}


x86 assembly (clang, -O0):
<File_Fifo_Get_P_Gain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    $0x0,%al
call   1040 <App_Get_Kp@plt>
movss  %xmm0,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
movss  -0x44(%rbp),%xmm0
lea    0xeac(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <File_Fifo_Respond@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<File_Fifo_Get_P_Gain>:
push   %rbx
sub    $0x40,%rsp
xor    %eax,%eax
call   1040 <App_Get_Kp@plt>
lea    0xebd(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <File_Fifo_Respond@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"1\0A%4.2f\0A\00"
define void @File_Fifo_Get_P_Gain() {
%1 = alloca [50 x i8]
%2 = alloca float
%3 = call float (...) @App_Get_Kp()
store float %3, float* %2
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%5 = load float, float* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %5)
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%8 = call i32 @File_Fifo_Respond(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"1\0A%4.2f\0A\00"
define void @File_Fifo_Get_P_Gain() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = tail call float (...) @App_Get_Kp()
%4 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %3)
%5 = call i32 @File_Fifo_Respond(i8* %2)
ret void
}
/* Variables and functions */
int cpu_features();
int supported_sse2() { return (cpu_features() >> 26) & 1; }


x86 assembly (clang, -O0):
<supported_sse2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <cpu_features@plt>
sar    $0x1a,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<supported_sse2>:
push   %rax
xor    %eax,%eax
call   1030 <cpu_features@plt>
shr    $0x1a,%eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @supported_sse2() {
%1 = call i32 (...) @cpu_features()
%2 = ashr i32 %1, 26
%3 = and i32 %2, 1
ret i32 %3
}

LLVM IR (-O2):
define i32 @supported_sse2() {
%1 = tail call i32 (...) @cpu_features()
%2 = lshr i32 %1, 26
%3 = and i32 %2, 1
ret i32 %3
}
int *rdar_7523821_f2() {
  int a[3];
  return a;
}


x86 assembly (clang, -O0):
<rdar_7523821_f2>:
push   %rbp
mov    %rsp,%rbp
lea    -0xc(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdar_7523821_f2>:
lea    -0xc(%rsp),%rax
ret

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

LLVM IR (-O2):
define noalias i32* @rdar_7523821_f2() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ McuSleepC__McuPowerState__update();
void HplAtm128SpiP__Mcu__update(void) { McuSleepC__McuPowerState__update(); }


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

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

LLVM IR (-O0):
define void @HplAtm128SpiP__Mcu__update() {
%1 = call i32 (...) @McuSleepC__McuPowerState__update()
ret void
}

LLVM IR (-O2):
define void @HplAtm128SpiP__Mcu__update() {
%1 = tail call i32 (...) @McuSleepC__McuPowerState__update()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ writeDbl(char *, double);
void start() {
  writeDbl("thrust", 0.0);
  writeDbl("aileron", 0.0);
}


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xorps  %xmm0,%xmm0
call   1030 <writeDbl@plt>
lea    0xedd(%rip),%rdi
xorps  %xmm0,%xmm0
call   1030 <writeDbl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<start>:
push   %rax
lea    0xee8(%rip),%rdi
xorps  %xmm0,%xmm0
call   1030 <writeDbl@plt>
lea    0xee0(%rip),%rdi
xorps  %xmm0,%xmm0
pop    %rax
jmp    1030 <writeDbl@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"thrust\00"
@.str.1 = [8 x i8] c"aileron\00"
define void @start() {
%1 = call i32 @writeDbl(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double 0.000000e+00)
%2 = call i32 @writeDbl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double 0.000000e+00)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"thrust\00"
@.str.1 = [8 x i8] c"aileron\00"
define void @start() {
%1 = tail call i32 @writeDbl(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double 0.000000e+00)
%2 = tail call i32 @writeDbl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double 0.000000e+00)
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ spm_internal_free(scalar_t__, scalar_t__);
void spm_free(uint64_t vaddr, uint64_t bytes) {
  spm_internal_free((uint64_t)vaddr, bytes);
  free((void *)vaddr);
}


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

x86 assembly (clang, -O2):
<spm_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <spm_internal_free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @spm_free(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i32 @spm_internal_free(i64 %5, i64 %6)
%8 = load i64, i64* %3
%9 = inttoptr i64 %8 to i8*
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
define void @spm_free(i64 %0, i64 %1) {
%3 = tail call i32 @spm_internal_free(i64 %0, i64 %1)
%4 = inttoptr i64 %0 to i8*
%5 = tail call i32 @free(i8* %4)
ret void
}
int array_compare(int *array1, int *array2) {
  unsigned int len1 = (sizeof(array1) / sizeof(array1[0])),
               len2 = (sizeof(array2) / sizeof(array2[0]));
  if (len2 != len1)
    return -1;
  for (int i = 0; i < len1; ++i) {
    if (array1[i] != array2[i])
      return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<array_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x2,-0x1c(%rbp)
movl   $0x2,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
je     1132 <array_compare+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1187 <array_compare+0x87>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jae    1180 <array_compare+0x80>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
movslq -0x24(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     116d <array_compare+0x6d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1187 <array_compare+0x87>
jmp    1172 <array_compare+0x72>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1139 <array_compare+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_compare>:
mov    (%rdi),%ecx
mov    $0xffffffff,%eax
cmp    (%rsi),%ecx
jne    1118 <array_compare+0x18>
mov    0x4(%rdi),%ecx
xor    %eax,%eax
cmp    0x4(%rsi),%ecx
setne  %al
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @array_compare(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %1, i64 1
%10 = load i32, i32* %9
%11 = icmp ne i32 %8, %10
%12 = sext i1 %11 to i32
br label %13
13: ; preds = %6, %2
%14 = phi i32 [ -1, %2 ], [ %12, %6 ]
ret i32 %14
}
int rec_array_sum(int *arr, int i) {
  if (arr[i] == '\0') {
    return 0;
  } else {
    return arr[i] + rec_array_sum(arr, i + 1);
  }
}


x86 assembly (clang, -O0):
<rec_array_sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    113d <rec_array_sum+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1164 <rec_array_sum+0x54>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
call   1030 <rec_array_sum@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rec_array_sum>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
test   %ecx,%ecx
je     112d <rec_array_sum+0x2d>
lea    (%rdi,%rax,4),%rdx
add    $0x4,%rdx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    %ecx,%eax
mov    (%rdx),%ecx
add    $0x4,%rdx
test   %ecx,%ecx
jne    1120 <rec_array_sum+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @rec_array_sum(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %2, %7
%8 = phi i64 [ %11, %7 ], [ %3, %2 ]
%9 = phi i32 [ %14, %7 ], [ %5, %2 ]
%10 = phi i32 [ %12, %7 ], [ 0, %2 ]
%11 = add i64 %8, 1
%12 = add nsw i32 %9, %10
%13 = getelementptr inbounds i32, i32* %0, i64 %11
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %2
%17 = phi i32 [ 0, %2 ], [ %12, %7 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ r4030_delay();
void r4030_write_reg16(unsigned long addr, unsigned val) {
  *((volatile unsigned short *)addr) = val;
  r4030_delay();
}


x86 assembly (clang, -O0):
<r4030_write_reg16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
mov    $0x0,%al
call   1030 <r4030_delay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r4030_write_reg16>:
mov    %si,(%rdi)
xor    %eax,%eax
jmp    1030 <r4030_delay@plt>

LLVM IR (-O0):
define void @r4030_write_reg16(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = trunc i32 %5 to i16
%7 = load i64, i64* %3
%8 = inttoptr i64 %7 to i16*
store volatile i16 %6, i16* %8
%9 = call i32 (...) @r4030_delay()
ret void
}

LLVM IR (-O2):
define void @r4030_write_reg16(i64 %0, i32 %1) {
%3 = trunc i32 %1 to i16
%4 = inttoptr i64 %0 to i16*
store volatile i16 %3, i16* %4
%5 = tail call i32 (...) @r4030_delay()
ret void
}
int team(long long int a, long long int b) {
  long long int i, f, j = 0;
  f = 0;
  i = a;
  while (f < b) {
    f = i + f;
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<team>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    114f <team+0x4f>
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1124 <team+0x24>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<team>:
mov    %rdi,%rax
test   %rsi,%rsi
jle    111c <team+0x1c>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
add    %rax,%rcx
add    $0x1,%rax
cmp    %rsi,%rcx
jl     1110 <team+0x10>
ret

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

LLVM IR (-O2):
define i32 @team(i64 %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i64 [ %8, %4 ], [ %0, %2 ]
%6 = phi i64 [ %7, %4 ], [ 0, %2 ]
%7 = add nsw i64 %5, %6
%8 = add nsw i64 %5, 1
%9 = icmp slt i64 %7, %1
br i1 %9, label %4, label %10
10: ; preds = %4, %2
%11 = phi i64 [ %0, %2 ], [ %8, %4 ]
%12 = trunc i64 %11 to i32
ret i32 %12
}
void ldbs_poke2(unsigned char *dest, unsigned short val) {
  dest[0] = val & 0xFF;
  dest[1] = (val >> 8) & 0xFF;
}


x86 assembly (clang, -O0):
<ldbs_poke2>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldbs_poke2>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @ldbs_poke2(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i16, i16* %4
%12 = zext i16 %11 to i32
%13 = ashr i32 %12, 8
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
ret void
}

LLVM IR (-O2):
define void @ldbs_poke2(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = trunc i16 %1 to i8
store i8 %3, i8* %0
%4 = lshr i16 %1, 8
%5 = trunc i16 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 0;
  printf("%d\n", i++);
  printf("%d\n", i);
  return 0;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ tokenize(int /*<<< orphan*/ *, int /*<<< orphan*/,
                            int /*<<< orphan*/);
int main(int argc, char **argv) {
  tokenize((uint8_t *)argv[1], strlen(argv[1]), 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <tokenize@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <tokenize@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = bitcast i8* %7 to i32*
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @tokenize(i32* %8, i32 %12, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = bitcast i8* %4 to i32*
%6 = tail call i32 @strlen(i8* %4)
%7 = tail call i32 @tokenize(i32* %5, i32 %6, i32 0)
ret i32 0
}