xunge/DecIR huggingface dataset:
int cmp(const void *a, const void *b) {
  const float x = **((const float **)a);
  const float y = **((const float **)b);
  return (x < y) - (x > y);
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm1
movss  -0x18(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
movss  -0x14(%rbp),%xmm0
ucomiss -0x18(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%rax
movss  (%rax),%xmm0
mov    (%rsi),%rax
movss  (%rax),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca float
%6 = alloca float
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to float**
%9 = load float*, float** %8
%10 = load float, float* %9
store float %10, float* %5
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to float**
%13 = load float*, float** %12
%14 = load float, float* %13
store float %14, float* %6
%15 = load float, float* %5
%16 = load float, float* %6
%17 = fcmp olt float %15, %16
%18 = zext i1 %17 to i32
%19 = load float, float* %5
%20 = load float, float* %6
%21 = fcmp ogt float %19, %20
%22 = zext i1 %21 to i32
%23 = sub nsw i32 %18, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float**
%4 = load float*, float** %3
%5 = load float, float* %4
%6 = bitcast i8* %1 to float**
%7 = load float*, float** %6
%8 = load float, float* %7
%9 = fcmp olt float %5, %8
%10 = zext i1 %9 to i32
%11 = fcmp ogt float %5, %8
%12 = sext i1 %11 to i32
%13 = add nsw i32 %12, %10
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
void _nakd_mutex_unlock(pthread_mutex_t *lock, const char *lock_name,
                        const char *file, int line) {
  pthread_mutex_unlock(lock);
}


x86 assembly (clang, -O0):
<_nakd_mutex_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_unlock@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nakd_mutex_unlock>:
jmp    1030 <pthread_mutex_unlock@plt>

LLVM IR (-O0):
define void @_nakd_mutex_unlock(i32* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = call i32 @pthread_mutex_unlock(i32* %9)
ret void
}

LLVM IR (-O2):
define void @_nakd_mutex_unlock(i32* %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i32 @pthread_mutex_unlock(i32* %0)
ret void
}
/* Variables and functions */
double pow(double, int);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double x;
  scanf("%lf", &x);
  printf("%.5f\n", pow(x, 1 / x));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xea4(%rip),%xmm1
divsd  -0x10(%rbp),%xmm1
cvttsd2si %xmm1,%edi
call   1050 <pow@plt>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
movsd  0xeb3(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1050 <pow@plt>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [6 x i8] c"%.5f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fdiv double 1.000000e+00, %5
%7 = fptosi double %6 to i32
%8 = call double @pow(double %4, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [6 x i8] c"%.5f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fdiv double 1.000000e+00, %4
%6 = fptosi double %5 to i32
%7 = call double @pow(double %4, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %7)
ret i32 0
}
int f2fs_clear_bit(unsigned int nr, char *addr) {
  int mask;
  int ret;
  addr += (nr >> 3);
  mask = 1 << (7 - (nr & 0x07));
  ret = mask & *addr;
  *addr &= ~mask;
  return ret;
}


x86 assembly (clang, -O0):
<f2fs_clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
shr    $0x3,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7,%eax
mov    $0x7,%ecx
sub    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
and    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edx
xor    $0xffffffff,%edx
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
and    %edx,%ecx
mov    %cl,(%rax)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2fs_clear_bit>:
mov    %edi,%ecx
mov    %edi,%edx
shr    $0x3,%rdx
not    %cl
and    $0x7,%cl
mov    $0x1,%edi
shl    %cl,%edi
movzbl (%rsi,%rdx,1),%ecx
mov    %ecx,%eax
and    %edi,%eax
not    %dil
and    %cl,%dil
mov    %dil,(%rsi,%rdx,1)
ret

LLVM IR (-O0):
define i32 @f2fs_clear_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = load i32, i32* %3
%8 = lshr i32 %7, 3
%9 = load i8*, i8** %4
%10 = zext i32 %8 to i64
%11 = getelementptr inbounds i8, i8* %9, i64 %10
store i8* %11, i8** %4
%12 = load i32, i32* %3
%13 = and i32 %12, 7
%14 = sub i32 7, %13
%15 = shl i32 1, %14
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = load i8*, i8** %4
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = and i32 %16, %19
store i32 %20, i32* %6
%21 = load i32, i32* %5
%22 = xor i32 %21, -1
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = and i32 %25, %22
%27 = trunc i32 %26 to i8
store i8 %27, i8* %23
%28 = load i32, i32* %6
ret i32 %28
}

LLVM IR (-O2):
define i32 @f2fs_clear_bit(i32 %0, i8* nocapture %1) {
%3 = lshr i32 %0, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = and i32 %0, 7
%7 = xor i32 %6, 7
%8 = shl nuw i32 1, %7
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = and i32 %8, %10
%12 = trunc i32 %8 to i8
%13 = xor i8 %12, -1
%14 = and i8 %9, %13
store i8 %14, i8* %5
ret i32 %11
}
int test_imm_B8int8_reg(signed char val) {
  return ((val) & (-0xB8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B8int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff48,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B8int8_reg>:
test   $0xffffff48,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B8int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -184
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int socketcall(int (*)(int, struct sockaddr *, int /*<<< orphan*/ *), int,
               struct sockaddr *, int /*<<< orphan*/ *, int /*<<< orphan*/,
               int /*<<< orphan*/, int /*<<< orphan*/);
int getsockname(int fd, struct sockaddr *addr, socklen_t *len) {
  return socketcall(getsockname, fd, addr, len, 0, 0, 0);
}


x86 assembly (clang, -O0):
<getsockname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    0x2eab(%rip),%rdi
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <socketcall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsockname>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
movl   $0x0,(%rsp)
mov    0x2eb9(%rip),%rdi
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <socketcall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @getsockname(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32*
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load %struct.sockaddr*, %struct.sockaddr** %5
%9 = load i32*, i32** %6
%10 = call i32 @socketcall(i32 (i32, %struct.sockaddr*, i32*)* @getsockname, i32 %7, %struct.sockaddr* %8, i32* %9, i32 0, i32 0, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @getsockname(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = tail call i32 @socketcall(i32 (i32, %struct.sockaddr*, i32*)* @getsockname, i32 %0, %struct.sockaddr* %1, i32* %2, i32 0, i32 0, i32 0)
ret i32 %4
}
char transform(char a) {
  if (a >= 'a' && a <= 'm')
    return a + a - 'a' + 1;
  if (a >= 'n' && a <= 'z')
    return a + a + 1 - 'a' - 26;
}


x86 assembly (clang, -O0):
<transform>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     113c <transform+0x3c>
movsbl -0x2(%rbp),%eax
cmp    $0x6d,%eax
jg     113c <transform+0x3c>
movsbl -0x2(%rbp),%eax
movsbl -0x2(%rbp),%ecx
add    %ecx,%eax
sub    $0x61,%eax
add    $0x1,%eax
mov    %al,-0x1(%rbp)
jmp    116c <transform+0x6c>
movsbl -0x2(%rbp),%eax
cmp    $0x6e,%eax
jl     116c <transform+0x6c>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     116c <transform+0x6c>
movsbl -0x2(%rbp),%eax
movsbl -0x2(%rbp),%ecx
add    %ecx,%eax
add    $0x1,%eax
sub    $0x61,%eax
sub    $0x1a,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<transform>:
mov    %edi,%eax
lea    -0x61(%rax),%ecx
cmp    $0xc,%cl
ja     110f <transform+0xf>
add    %al,%al
add    $0xa0,%al
ret
lea    -0x6e(%rax),%ecx
cmp    $0xc,%cl
ja     111b <transform+0x1b>
add    %al,%al
add    $0x86,%al
ret

LLVM IR (-O0):
define signext i8 @transform(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %20
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 109
br i1 %10, label %11, label %20
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = add nsw i32 %13, %15
%17 = sub nsw i32 %16, 97
%18 = add nsw i32 %17, 1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %2
br label %38
20: ; preds = %7, %1
%21 = load i8, i8* %3
%22 = sext i8 %21 to i32
%23 = icmp sge i32 %22, 110
br i1 %23, label %24, label %38
24: ; preds = %20
%25 = load i8, i8* %3
%26 = sext i8 %25 to i32
%27 = icmp sle i32 %26, 122
br i1 %27, label %28, label %38
28: ; preds = %24
%29 = load i8, i8* %3
%30 = sext i8 %29 to i32
%31 = load i8, i8* %3
%32 = sext i8 %31 to i32
%33 = add nsw i32 %30, %32
%34 = add nsw i32 %33, 1
%35 = sub nsw i32 %34, 97
%36 = sub nsw i32 %35, 26
%37 = trunc i32 %36 to i8
store i8 %37, i8* %2
br label %38
38: ; preds = %11, %28, %24, %20
%39 = load i8, i8* %2
ret i8 %39
}

LLVM IR (-O2):
define signext i8 @transform(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 13
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = shl nuw i8 %0, 1
%6 = add i8 %5, -96
br label %13
7: ; preds = %1
%8 = add i8 %0, -110
%9 = icmp ult i8 %8, 13
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = shl nuw i8 %0, 1
%12 = add i8 %11, -122
br label %13
13: ; preds = %4, %10, %7
%14 = phi i8 [ %6, %4 ], [ %12, %10 ], [ undef, %7 ]
ret i8 %14
}
XSetInputFocus() {}


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

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

LLVM IR (-O0):
define i32 @XSetInputFocus() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XSetInputFocus() {
ret i32 undef
}
void handle_DANGER(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_DANGER(i32 %0) {
ret void
}
/* Variables and functions */
int rand();
void fillList(int *list) {
  int loop;
  for (loop = 0; loop < 25; loop++) {
    *(list + loop) = (rand() % 900) + 100;
  }
}


x86 assembly (clang, -O0):
<fillList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x19,-0xc(%rbp)
jge    1158 <fillList+0x48>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x384,%ecx
cltd
idiv   %ecx
add    $0x64,%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <fillList+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillList>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff91a2b3c5,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x9,%ecx
add    %edx,%ecx
imul   $0x384,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x64,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    $0x19,%rbx
jne    1120 <fillList+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @fillList(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %15, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 25
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = call i32 (...) @rand()
%9 = srem i32 %8, 900
%10 = add nsw i32 %9, 100
%11 = load i32*, i32** %2
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
store i32 %10, i32* %14
br label %15
15: ; preds = %7
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %4
18: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @fillList(i32* nocapture writeonly %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %8, %2 ]
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 900
%6 = add nsw i32 %5, 100
%7 = getelementptr inbounds i32, i32* %0, i64 %3
store i32 %6, i32* %7
%8 = add nuw nsw i64 %3, 1
%9 = icmp eq i64 %8, 25
br i1 %9, label %10, label %2
10: ; preds = %2
ret void
}
unsigned SetBits(unsigned x, int p, int n, unsigned y) {
  unsigned one = ~0;
  unsigned nzero = one << n;
  unsigned none = ~nzero;
  unsigned mask = none << p - n + 1;
  mask = ~mask;
  x &= mask;
  unsigned mask2 = none & y;
  mask2 <<= p - n + 1;
  x = x | mask2;
  return x;
}


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

x86 assembly (clang, -O2):
<SetBits>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
sub    %edx,%esi
lea    0x1(%rsi),%ecx
mov    %eax,%edx
shl    %cl,%edx
not    %edx
and    %edi,%edx
and    %r8d,%eax
shl    %cl,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @SetBits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 -1, i32* %9
%14 = load i32, i32* %9
%15 = load i32, i32* %7
%16 = shl i32 %14, %15
store i32 %16, i32* %10
%17 = load i32, i32* %10
%18 = xor i32 %17, -1
store i32 %18, i32* %11
%19 = load i32, i32* %11
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = sub nsw i32 %20, %21
%23 = add nsw i32 %22, 1
%24 = shl i32 %19, %23
store i32 %24, i32* %12
%25 = load i32, i32* %12
%26 = xor i32 %25, -1
store i32 %26, i32* %12
%27 = load i32, i32* %12
%28 = load i32, i32* %5
%29 = and i32 %28, %27
store i32 %29, i32* %5
%30 = load i32, i32* %11
%31 = load i32, i32* %8
%32 = and i32 %30, %31
store i32 %32, i32* %13
%33 = load i32, i32* %6
%34 = load i32, i32* %7
%35 = sub nsw i32 %33, %34
%36 = add nsw i32 %35, 1
%37 = load i32, i32* %13
%38 = shl i32 %37, %36
store i32 %38, i32* %13
%39 = load i32, i32* %5
%40 = load i32, i32* %13
%41 = or i32 %39, %40
store i32 %41, i32* %5
%42 = load i32, i32* %5
ret i32 %42
}

LLVM IR (-O2):
define i32 @SetBits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl nsw i32 -1, %2
%6 = xor i32 %5, -1
%7 = sub nsw i32 %1, %2
%8 = add nsw i32 %7, 1
%9 = shl i32 %6, %8
%10 = xor i32 %9, -1
%11 = and i32 %10, %0
%12 = and i32 %6, %3
%13 = shl i32 %12, %8
%14 = or i32 %11, %13
ret i32 %14
}
/* Type definitions */
struct pipeline {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct pipeline *);
int /*<<< orphan*/ sb_destroy_pipeline(struct pipeline *);
void sb_destroy_and_free_pipeline(struct pipeline *p) {
  sb_destroy_pipeline(p);
  free(p);
}


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

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

LLVM IR (-O0):
%struct.pipeline = type { i32 }
define void @sb_destroy_and_free_pipeline(%struct.pipeline* %0) {
%2 = alloca %struct.pipeline*
store %struct.pipeline* %0, %struct.pipeline** %2
%3 = load %struct.pipeline*, %struct.pipeline** %2
%4 = call i32 @sb_destroy_pipeline(%struct.pipeline* %3)
%5 = load %struct.pipeline*, %struct.pipeline** %2
%6 = call i32 @free(%struct.pipeline* %5)
ret void
}

LLVM IR (-O2):
%struct.pipeline = type { i32 }
define void @sb_destroy_and_free_pipeline(%struct.pipeline* %0) {
%2 = tail call i32 @sb_destroy_pipeline(%struct.pipeline* %0)
%3 = tail call i32 @free(%struct.pipeline* %0)
ret void
}
int minimo(int num1, int num2) {
  if (num1 <= num2) {
    return num1;
  } else {
    return num2;
  }
}


x86 assembly (clang, -O0):
<minimo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1121 <minimo+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <minimo+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minimo>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @minimo(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 = icmp sle i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @minimo(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ applicationInit();
int /*<<< orphan*/ applicationTask();
int /*<<< orphan*/ systemInit();
void main() {
  systemInit();
  applicationInit();
  while (1) {
    applicationTask();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <systemInit@plt>
mov    $0x0,%al
call   1040 <applicationInit@plt>
mov    $0x0,%al
call   1050 <applicationTask@plt>
jmp    1142 <main+0x12>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <systemInit@plt>
xor    %eax,%eax
call   1040 <applicationInit@plt>
nop
xor    %eax,%eax
call   1050 <applicationTask@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @systemInit()
%2 = call i32 (...) @applicationInit()
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @applicationTask()
br label %3
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @systemInit()
%2 = tail call i32 (...) @applicationInit()
br label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @applicationTask()
br label %3
}
/* Variables and functions */
int __builtin_mips_cabs_ngl_s(float, float);
int test11(float a, float b) { return __builtin_mips_cabs_ngl_s(a, b); }


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

x86 assembly (clang, -O2):
<test11>:
jmp    1030 <__builtin_mips_cabs_ngl_s@plt>

LLVM IR (-O0):
define i32 @test11(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 = call i32 @__builtin_mips_cabs_ngl_s(float %5, float %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test11(float %0, float %1) {
%3 = tail call i32 @__builtin_mips_cabs_ngl_s(float %0, float %1)
ret i32 %3
}
int containsChar(char *s, char c) {
  int result;
  result = 0;
  while ((*s != '\0') && (result == 0)) {
    if (*s == c) {
      result = 1;
    }
    s++;
  }
  return result;
}


x86 assembly (clang, -O0):
<containsChar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1134 <containsChar+0x34>
cmpl   $0x0,-0x10(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1144 <containsChar+0x44>
jmp    116f <containsChar+0x6f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    115e <containsChar+0x5e>
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <containsChar+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<containsChar>:
mov    (%rdi),%al
test   %al,%al
je     112b <containsChar+0x2b>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
mov    %eax,%ecx
cmp    %sil,%al
je     1122 <containsChar+0x22>
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <containsChar+0x10>
xor    %eax,%eax
cmp    %sil,%cl
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @containsChar(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
store i32 0, i32* %5
br label %6
6: ; preds = %24, %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 %14
11: ; preds = %6
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %11, %6
%15 = phi i1 [ false, %6 ], [ %13, %11 ]
br i1 %15, label %16, label %27
16: ; preds = %14
%17 = load i8*, i8** %3
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = load i8, i8* %4
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %19, %21
br i1 %22, label %23, label %24
23: ; preds = %16
store i32 1, i32* %5
br label %24
24: ; preds = %23, %16
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %3
br label %6
27: ; preds = %14
%28 = load i32, i32* %5
ret i32 %28
}

LLVM IR (-O2):
define i32 @containsChar(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %10, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = icmp eq i8 %6, %1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
%12 = or i1 %8, %11
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = zext i1 %8 to i32
br label %15
15: ; preds = %13, %2
%16 = phi i32 [ 0, %2 ], [ %14, %13 ]
ret i32 %16
}
void replace_env(str) char *str;
{
  char **envp;
  envp = find_env(str);
  xfree((void *)(*envp),
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/gary9872/tf40s1/refs/heads/master/src/"
        "variable.c",
        314);
  *envp = str;
}


x86 assembly (clang, -O0):
<replace_env>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <find_env@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xeb5(%rip),%rsi
mov    $0x13a,%edx
mov    $0x0,%al
call   1030 <xfree@plt>
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_env>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <find_env@plt>
movslq %eax,%rbx
mov    (%rbx),%rdi
lea    0xec5(%rip),%rsi
mov    $0x13a,%edx
xor    %eax,%eax
call   1030 <xfree@plt>
mov    %r14,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/gary9872/tf40s1/refs/heads/master/src/variable.c\00"
define void @replace_env(i8* %0) {
%2 = alloca i8*
%3 = alloca i8**
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @find_env to i32 (i8*, ...)*)(i8* %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8**
store i8** %7, i8*** %3
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
%10 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @xfree to i32 (i8*, i8*, i32, ...)*)(i8* %9, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 314)
%11 = load i8*, i8** %2
%12 = load i8**, i8*** %3
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
@.str = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/gary9872/tf40s1/refs/heads/master/src/variable.c\00"
define void @replace_env(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @find_env to i32 (i8*, ...)*)(i8* %0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8**
%5 = load i8*, i8** %4
%6 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @xfree to i32 (i8*, i8*, i32, ...)*)(i8* %5, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 314)
store i8* %0, i8** %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ report(char const *);
void fatal(const char *label) {
  report(label);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <report@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
call   1040 <report@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @report(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @fatal(i8* %0) {
%2 = tail call i32 @report(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ read_interrupt_capture(char, int);
void reset_interrupts(char address) {
  read_interrupt_capture(address, 0);
  read_interrupt_capture(address, 1);
}


x86 assembly (clang, -O0):
<reset_interrupts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %esi,%esi
movsbl -0x1(%rbp),%edi
call   1030 <read_interrupt_capture@plt>
mov    $0x1,%esi
movsbl -0x1(%rbp),%edi
call   1030 <read_interrupt_capture@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_interrupts>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
call   1030 <read_interrupt_capture@plt>
mov    %ebx,%edi
mov    $0x1,%esi
pop    %rbx
jmp    1030 <read_interrupt_capture@plt>

LLVM IR (-O0):
define void @reset_interrupts(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @read_interrupt_capture(i8 signext %3, i32 0)
%5 = load i8, i8* %2
%6 = call i32 @read_interrupt_capture(i8 signext %5, i32 1)
ret void
}

LLVM IR (-O2):
define void @reset_interrupts(i8 signext %0) {
%2 = tail call i32 @read_interrupt_capture(i8 signext %0, i32 0)
%3 = tail call i32 @read_interrupt_capture(i8 signext %0, i32 1)
ret void
}
char encode(int plainChar, char *permutation) {
  int charPosition = plainChar;
  int encodedChar = 0;
  if ((plainChar >= 97) && (plainChar <= 122)) {
    charPosition = plainChar - 97;
    encodedChar = permutation[charPosition];
  } else {
    encodedChar = plainChar;
  }
  return encodedChar;
}


x86 assembly (clang, -O0):
<encode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1149 <encode+0x49>
cmpl   $0x7a,-0x4(%rbp)
jg     1149 <encode+0x49>
mov    -0x4(%rbp),%eax
sub    $0x61,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x18(%rbp)
jmp    114f <encode+0x4f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode>:
mov    %edi,%eax
lea    -0x61(%rax),%ecx
cmp    $0x19,%ecx
ja     1110 <encode+0x10>
mov    %ecx,%eax
movzbl (%rsi,%rax,1),%eax
ret

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

LLVM IR (-O2):
define signext i8 @encode(i32 %0, i8* nocapture %1) {
%3 = add i32 %0, -97
%4 = icmp ult i32 %3, 26
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = zext i32 %3 to i64
%7 = getelementptr inbounds i8, i8* %1, i64 %6
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
br label %10
10: ; preds = %2, %5
%11 = phi i32 [ %9, %5 ], [ %0, %2 ]
%12 = trunc i32 %11 to i8
ret i8 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned char);
void fprint_mov_to_atRi(FILE *stream, unsigned char i) {
  fprintf(stream, "MOV   @R%X, A                    ", i);
}


x86 assembly (clang, -O0):
<fprint_mov_to_atRi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed3(%rip),%rsi
movzbl -0x9(%rbp),%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_mov_to_atRi>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"MOV @R%X, A \00"
define void @fprint_mov_to_atRi(i32* %0, i8 zeroext %1) {
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
store i8 %1, i8* %4
%5 = load i32*, i32** %3
%6 = load i8, i8* %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %6)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"MOV @R%X, A \00"
define void @fprint_mov_to_atRi(i32* nocapture %0, i8 zeroext %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_Rotate_init(void) {
  _hmt_register_covercase("HMM_Rotate", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_Rotate_init>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"HMM_Rotate\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_Rotate_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"HMM_Rotate\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_Rotate_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_atoi_safe();
int main() {
  check_atoi_safe();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <check_atoi_safe@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <check_atoi_safe@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @check_atoi_safe()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_atoi_safe()
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
int *allocate(int n) {
  int *allocated = (int *)malloc(n * sizeof(int));
  return allocated;
}


x86 assembly (clang, -O0):
<allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate>:
shl    $0x2,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @allocate(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 4
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %3
%10 = load i32*, i32** %3
ret i32* %10
}

LLVM IR (-O2):
define i32* @allocate(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to i32*
ret i32* %4
}
int div(int x, int y) { return x / y; }


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

x86 assembly (clang, -O2):
<div>:
mov    %edi,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @div(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
void __attribute__((always_)) array_clear(double *peel, int elemc) {
  int i;
  for (i = 0; i < elemc; i++) {
    peel[i] = 0;
  }
}


x86 assembly (clang, -O0):
<array_clear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113c <array_clear+0x3c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <array_clear+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_clear>:
test   %esi,%esi
jle    1126 <array_clear+0x16>
push   %rax
mov    %esi,%edx
shl    $0x3,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @array_clear(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load double*, double** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
store double 0.000000e+00, double* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @array_clear(double* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast double* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 3
br label %8
8: ; preds = %4, %2
ret void
}
void raid6_put_fpu(unsigned long cr0) { (void)cr0; }


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

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

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

LLVM IR (-O2):
define void @raid6_put_fpu(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void gotcha_printf(void) {
  char *format = "1234567890!a@s#d$f%s^h&j*k(l);";
  printf("printing a string:\n");
  printf("%s\n", format);
  printf("1234567890!a@s#d$f%s^h&j*k(l)");
  printf("\n");
}


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

x86 assembly (clang, -O2):
<gotcha_printf>:
push   %rax
lea    0xf05(%rip),%rdi
call   1040 <puts@plt>
lea    0xebc(%rip),%rdi
call   1040 <puts@plt>
lea    0xecf(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"1234567890!a@s#d$f%s^h&j*k(l);\00"
@.str.1 = [20 x i8] c"printing a string:\0A\00"
@.str.2 = [4 x i8] c"%s\0A\00"
@.str.3 = [30 x i8] c"1234567890!a@s#d$f%s^h&j*k(l)\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @gotcha_printf() {
%1 = alloca i8*
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%3 = load i8*, i8** %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"1234567890!a@s#d$f%s^h&j*k(l);\00"
@.str.3 = [30 x i8] c"1234567890!a@s#d$f%s^h&j*k(l)\00"
@str = [19 x i8] c"printing a string:\00"
define void @gotcha_printf() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, long);
void main() {
  long cnt;
  cnt = 0;
  while (getchar() != EOF) {
    ++cnt;
  }
  printf("%ld\n", cnt);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eaa(%rip),%rcx
cmp    (%rcx),%rax
je     1158 <main+0x38>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1130 <main+0x10>
mov    -0x8(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffffffffffff,%rbx
mov    0x2eb6(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%rbx
cmp    (%r14),%rax
jne    1140 <main+0x20>
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@EOF = global i64 0
@.str = [5 x i8] c"%ld\0A\00"
define void @main() {
%1 = alloca i64
store i64 0, i64* %1
br label %2
2: ; preds = %6, %0
%3 = call i64 (...) @getchar()
%4 = load i64, i64* @EOF
%5 = icmp ne i64 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i64, i64* %1
%8 = add nsw i64 %7, 1
store i64 %8, i64* %1
br label %2
9: ; preds = %2
%10 = load i64, i64* %1
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %10)
ret void
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [5 x i8] c"%ld\0A\00"
define void @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i64 (...) @getchar()
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
%6 = add nuw nsw i64 %2, 1
br i1 %5, label %7, label %1
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ proto(double);
int /*<<< orphan*/ stub1(double);
void use_proto() {
  proto(42.1);
  (&proto)(42.1);
}


x86 assembly (clang, -O0):
<use_proto>:
push   %rbp
mov    %rsp,%rbp
movsd  0xee4(%rip),%xmm0
call   1030 <proto@plt>
movsd  0xed7(%rip),%xmm0
call   1030 <proto@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<use_proto>:
push   %rax
movsd  0xee7(%rip),%xmm0
call   1030 <proto@plt>
movsd  0xeda(%rip),%xmm0
pop    %rax
jmp    1030 <proto@plt>

LLVM IR (-O0):
define void @use_proto() {
%1 = call i32 @proto(double 4.210000e+01)
%2 = call i32 @proto(double 4.210000e+01)
ret void
}

LLVM IR (-O2):
define void @use_proto() {
%1 = tail call i32 @proto(double 4.210000e+01)
%2 = tail call i32 @proto(double 4.210000e+01)
ret void
}
int function(int arguments) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @function(i32 %0) {
ret i32 0
}
int test_signbitl(long double x) { return __builtin_signbitl(x); }


x86 assembly (clang, -O0):
<test_signbitl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
movzwl -0x8(%rbp),%eax
shr    $0xf,%rax
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_signbitl>:
movzwl 0x10(%rsp),%eax
shr    $0xf,%rax
ret

LLVM IR (-O0):
define i32 @test_signbitl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = bitcast x86_fp80 %3 to i80
%5 = icmp slt i80 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test_signbitl(x86_fp80 %0) {
%2 = bitcast x86_fp80 %0 to i80
%3 = lshr i80 %2, 79
%4 = trunc i80 %3 to i32
ret i32 %4
}
void GPMCADVTimingConfig(unsigned int baseAddr, unsigned int csNum,
                         unsigned int conf) {
  (*((volatile unsigned int *)(baseAddr + (0x68 + (csNum * (0x30)))))) = conf;
}


x86 assembly (clang, -O0):
<GPMCADVTimingConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
imul   $0x30,-0x8(%rbp),%edx
add    $0x68,%edx
add    %edx,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCADVTimingConfig>:
lea    (%rsi,%rsi,2),%eax
shl    $0x4,%eax
add    %edi,%eax
add    $0x68,%eax
mov    %edx,(%rax)
ret

LLVM IR (-O0):
define void @GPMCADVTimingConfig(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = mul i32 %9, 48
%11 = add i32 104, %10
%12 = add i32 %8, %11
%13 = zext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
store volatile i32 %7, i32* %14
ret void
}

LLVM IR (-O2):
define void @GPMCADVTimingConfig(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %1, 48
%5 = add i32 %0, 104
%6 = add i32 %5, %4
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %2, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
char *strdup(char const *);
char *xstrdup(const char *s) {
  char *p = strdup(s);
  if (!p)
    die("xstrdup failed\n");
  return p;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <xstrdup+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xstrdup+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"xstrdup failed\0A\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @die(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [16 x i8] c"xstrdup failed\0A\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}