xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ rc4_crypt(unsigned char *, unsigned char *, int);
int /*<<< orphan*/ rc4_setup(unsigned char *, unsigned char *, int);
void RC4_Sample(unsigned char *key, int key_len, unsigned char *data,
                int data_len) {
  unsigned char sbox[256] = {0};
  rc4_setup(sbox, key, key_len);
  rc4_crypt(sbox, data, data_len);
}


x86 assembly (clang, -O0):
<RC4_Sample>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    -0x120(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1030 <memset@plt>
lea    -0x120(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1050 <rc4_setup@plt>
lea    -0x120(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <rc4_crypt@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RC4_Sample>:
push   %rbp
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %esi,%edx
mov    %rdi,%rsi
xorps  %xmm0,%xmm0
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%rbp
mov    %rbp,%rdi
call   1040 <rc4_setup@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <rc4_crypt@plt>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @RC4_Sample(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [256 x i8]
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = bitcast [256 x i8]* %9 to i8*
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = call i32 @rc4_setup(i8* %11, i8* %12, i32 %13)
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%16 = load i8*, i8** %7
%17 = load i32, i32* %8
%18 = call i32 @rc4_crypt(i8* %15, i8* %16, i32 %17)
ret void
}

LLVM IR (-O2):
define void @RC4_Sample(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca [256 x i8]
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = call i32 @rc4_setup(i8* %6, i8* %0, i32 %1)
%8 = call i32 @rc4_crypt(i8* %6, i8* %2, i32 %3)
ret void
}
/* Type definitions */
typedef scalar_t__ us;

/* Variables and functions */
int write(int, unsigned char *, int);
int wbshort(int fd, unsigned short us) {
  unsigned char data[2];
  data[0] = (char)(us >> 8) & 0xff;
  data[1] = (char)(us)&0xff;
  return write(fd, data, 2);
}


x86 assembly (clang, -O0):
<wbshort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
sar    $0x8,%eax
movsbl %al,%eax
and    $0xff,%eax
mov    %al,-0x8(%rbp)
mov    -0x6(%rbp),%ax
movsbl %al,%eax
and    $0xff,%eax
mov    %al,-0x7(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wbshort>:
push   %rax
rol    $0x8,%si
mov    %si,0x6(%rsp)
lea    0x6(%rsp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @wbshort(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
%5 = alloca [2 x i8]
store i32 %0, i32* %3
store i16 %1, i16* %4
%6 = load i16, i16* %4
%7 = zext i16 %6 to i32
%8 = ashr i32 %7, 8
%9 = trunc i32 %8 to i8
%10 = sext i8 %9 to i32
%11 = and i32 %10, 255
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %12, i8* %13
%14 = load i16, i16* %4
%15 = trunc i16 %14 to i8
%16 = sext i8 %15 to i32
%17 = and i32 %16, 255
%18 = trunc i32 %17 to i8
%19 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 %18, i8* %19
%20 = load i32, i32* %3
%21 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%22 = call i32 @write(i32 %20, i8* %21, i32 2)
ret i32 %22
}

LLVM IR (-O2):
define i32 @wbshort(i32 %0, i16 zeroext %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = lshr i16 %1, 8
%6 = trunc i16 %5 to i8
store i8 %6, i8* %4
%7 = trunc i16 %1 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %7, i8* %8
%9 = call i32 @write(i32 %0, i8* %4, i32 2)
ret i32 %9
}
/* Variables and functions */
int random();
int /*<<< orphan*/ srandom(int);
int time(int /*<<< orphan*/ *);
int getOrdersize() {
  srandom(time(NULL) * random());
  return random() % (2000 + 1 - 1000) + 1000;
}


x86 assembly (clang, -O0):
<getOrdersize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <random@plt>
mov    -0x4(%rbp),%edi
imul   %eax,%edi
call   1030 <srandom@plt>
mov    $0x0,%al
call   1050 <random@plt>
mov    $0x3e9,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x3e8,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getOrdersize>:
push   %rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <random@plt>
imul   %eax,%ebx
mov    %ebx,%edi
call   1030 <srandom@plt>
xor    %eax,%eax
call   1050 <random@plt>
cltq
imul   $0x4178749f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x28,%rcx
add    %edx,%ecx
imul   $0x3e9,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x3e8,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getOrdersize() {
%1 = call i32 @time(i32* null)
%2 = call i32 (...) @random()
%3 = mul nsw i32 %1, %2
%4 = call i32 @srandom(i32 %3)
%5 = call i32 (...) @random()
%6 = srem i32 %5, 1001
%7 = add nsw i32 %6, 1000
ret i32 %7
}

LLVM IR (-O2):
define i32 @getOrdersize() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 (...) @random()
%3 = mul nsw i32 %2, %1
%4 = tail call i32 @srandom(i32 %3)
%5 = tail call i32 (...) @random()
%6 = srem i32 %5, 1001
%7 = add nsw i32 %6, 1000
ret i32 %7
}
/* Variables and functions */
double exponencial(double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
main() {
  double exp, x;
  printf("Valor de x: ");
  scanf("%lf", &x);
  exp = exponencial(x);
  printf("exp(%g) = %g\n", x, exp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
call   1040 <exponencial@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
lea    0xe9b(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
call   1040 <exponencial@plt>
movaps %xmm0,%xmm1
movsd  (%rsp),%xmm0
lea    0xeaa(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Valor de x: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [14 x i8] c"exp(%g) = %g\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = call double @exponencial(double %5)
store double %6, double* %1
%7 = load double, double* %2
%8 = load double, double* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %7, double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Valor de x: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [14 x i8] c"exp(%g) = %g\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = call double @exponencial(double %5)
%7 = load double, double* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %7, double %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fn(int n) { printf("h"); }


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

x86 assembly (clang, -O2):
<fn>:
mov    $0x68,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"h\00"
define void @fn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @fn(i32 %0) {
%2 = tail call i32 @putchar(i32 104)
ret void
}
/* Variables and functions */
int fib(int);
int fib_serial(int n) {
  int x, y;
  if (n < 2)
    return n;
  else {
    x = fib(n - 1);
    y = fib(n - 2);
    return (x + y);
  }
}


x86 assembly (clang, -O0):
<fib_serial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1130 <fib_serial+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <fib_serial+0x45>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib_serial>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
cmp    $0x2,%edi
jl     1132 <fib_serial+0x22>
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
mov    %eax,%ebp
add    $0xfffffffe,%ebx
mov    %ebx,%edi
call   1030 <fib@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib_serial(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @fib(i32 %4)
%6 = add nsw i32 %0, -2
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %7, %5
br label %9
9: ; preds = %1, %3
%10 = phi i32 [ %8, %3 ], [ %0, %1 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ s0;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ assert(int);
int main(void) {
  struct s {};
  struct s s0;
  assert(sizeof(s0) == 0);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <assert@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.s = type {}
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.s
store i32 0, i32* %1
%3 = call i32 @assert(i32 1)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}

LLVM IR (-O2):
%struct.s = type {}
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
int is_sorted(int n, double *arr) {
  int i;
  for (i = 0; i < n - 1; i++) {
    if (arr[i] > arr[i + 1])
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_sorted>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1167 <is_sorted+0x67>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
ucomisd (%rax,%rcx,8),%xmm0
jbe    1154 <is_sorted+0x54>
movl   $0x0,-0x4(%rbp)
jmp    116e <is_sorted+0x6e>
jmp    1159 <is_sorted+0x59>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <is_sorted+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_sorted>:
add    $0xffffffff,%edi
xor    %eax,%eax
test   %edi,%edi
cmovle %eax,%edi
nopw   0x0(%rax,%rax,1)
cmp    %rax,%rdi
je     1129 <is_sorted+0x29>
movsd  (%rsi,%rax,8),%xmm0
ucomisd 0x8(%rsi,%rax,8),%xmm0
lea    0x1(%rax),%rax
jbe    1110 <is_sorted+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_sorted(i32 %0, double* nocapture %1) {
%3 = add i32 %0, -1
%4 = call i32 @llvm.smax.i32(i32 %3, i32 0)
%5 = zext i32 %4 to i64
br label %6
6: ; preds = %9, %2
%7 = phi i64 [ %12, %9 ], [ 0, %2 ]
%8 = icmp eq i64 %7, %5
br i1 %8, label %16, label %9
9: ; preds = %6
%10 = getelementptr inbounds double, double* %1, i64 %7
%11 = load double, double* %10
%12 = add nuw nsw i64 %7, 1
%13 = getelementptr inbounds double, double* %1, i64 %12
%14 = load double, double* %13
%15 = fcmp ogt double %11, %14
br i1 %15, label %16, label %6
16: ; preds = %6, %9
%17 = phi i32 [ 0, %9 ], [ 1, %6 ]
ret i32 %17
}
int exact_square(int num) {
  int i;
  for (i = 0; i < num; i++) {
    if (i * i == num) {
      return 1;
    }
    if (i * i > num) {
      return 0;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<exact_square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1165 <exact_square+0x65>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1136 <exact_square+0x36>
movl   $0x1,-0x4(%rbp)
jmp    116c <exact_square+0x6c>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1152 <exact_square+0x52>
movl   $0x0,-0x4(%rbp)
jmp    116c <exact_square+0x6c>
jmp    1157 <exact_square+0x57>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <exact_square+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact_square>:
xor    %eax,%eax
test   %edi,%edi
jle    1125 <exact_square+0x25>
mov    $0x1,%ecx
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rcx),%edx
imul   %edx,%edx
cmp    %edi,%edx
je     1126 <exact_square+0x26>
jg     1125 <exact_square+0x25>
lea    0x1(%rcx),%edx
cmp    %edi,%ecx
mov    %edx,%ecx
jl     1110 <exact_square+0x10>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @exact_square(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %24, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %27
9: ; preds = %5
%10 = load i32, i32* %4
%11 = load i32, i32* %4
%12 = mul nsw i32 %10, %11
%13 = load i32, i32* %3
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %9
store i32 1, i32* %2
br label %28
16: ; preds = %9
%17 = load i32, i32* %4
%18 = load i32, i32* %4
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %3
%21 = icmp sgt i32 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %16
store i32 0, i32* %2
br label %28
23: ; preds = %16
br label %24
24: ; preds = %23
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %5
27: ; preds = %5
store i32 0, i32* %2
br label %28
28: ; preds = %27, %22, %15
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @exact_square(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %12
3: ; preds = %1, %7
%4 = phi i32 [ %9, %7 ], [ 0, %1 ]
%5 = mul nsw i32 %4, %4
%6 = icmp eq i32 %5, %0
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = icmp sle i32 %5, %0
%9 = add nuw nsw i32 %4, 1
%10 = icmp slt i32 %9, %0
%11 = select i1 %8, i1 %10, i1 false
br i1 %11, label %3, label %12
12: ; preds = %3, %7, %1
%13 = phi i32 [ 0, %1 ], [ 0, %7 ], [ 1, %3 ]
ret i32 %13
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ execl(char *, char *, char *, char const *,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
scalar_t__ fork();
int /*<<< orphan*/ init_wait_cb();
void jb_shell(const char *command) {
  if (fork() == 0) {
    errno = 0;
    execl("/bin/sh", "sh", "-c", command, NULL);
    exit(1);
  } else
    init_wait_cb();
}


x86 assembly (clang, -O0):
<jb_shell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1060 <fork@plt>
cmp    $0x0,%rax
jne    1198 <jb_shell+0x58>
mov    0x2e7c(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rcx
lea    0xe8a(%rip),%rdi
lea    0xe88(%rip),%rsi
lea    0xe84(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r8d
call   1050 <execl@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    $0x0,%al
call   1030 <init_wait_cb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jb_shell>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
je     1158 <jb_shell+0x18>
xor    %eax,%eax
pop    %rbx
jmp    1030 <init_wait_cb@plt>
mov    0x2e81(%rip),%rax
movq   $0x0,(%rax)
lea    0xe93(%rip),%rdi
lea    0xe91(%rip),%rsi
lea    0xe8d(%rip),%rdx
mov    %rbx,%rcx
xor    %r8d,%r8d
call   1050 <execl@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@errno = global i64 0
@.str = [8 x i8] c"/bin/sh\00"
@.str.1 = [3 x i8] c"sh\00"
@.str.2 = [3 x i8] c"-c\00"
define void @jb_shell(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 (...) @fork()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
store i64 0, i64* @errno
%6 = load i8*, i8** %2
%7 = call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %6, i32* null)
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = call i32 (...) @init_wait_cb()
br label %11
11: ; preds = %9
ret void
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [8 x i8] c"/bin/sh\00"
@.str.1 = [3 x i8] c"sh\00"
@.str.2 = [3 x i8] c"-c\00"
define void @jb_shell(i8* %0) {
%2 = tail call i64 (...) @fork()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
store i64 0, i64* @errno
%5 = tail call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %0, i32* null)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = tail call i32 (...) @init_wait_cb()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ b2a(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n;
  printf("Enter a number to be converted to ASCII: ");
  scanf("%d", &n);
  b2a(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <b2a@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <b2a@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Enter a number to be converted to ASCII: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @b2a(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [42 x i8] c"Enter a number to be converted to ASCII: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @b2a(i32 %5)
ret i32 0
}
/* Variables and functions */
unsigned long clz(unsigned long);
unsigned long log2i(unsigned long x) {
  if (x != 0)
    return sizeof(unsigned long) * 8 - 1 - clz(x);
  else
    return 0;
}


x86 assembly (clang, -O0):
<log2i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1144 <log2i+0x34>
mov    -0x10(%rbp),%rdi
call   1030 <clz@plt>
mov    %rax,%rcx
mov    $0x3f,%eax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    114c <log2i+0x3c>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2i>:
test   %rdi,%rdi
je     112b <log2i+0x1b>
push   %rax
call   1030 <clz@plt>
mov    %rax,%rcx
mov    $0x3f,%eax
sub    %rcx,%rax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @log2i(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i64, i64* %3
%8 = call i64 @clz(i64 %7)
%9 = sub i64 63, %8
store i64 %9, i64* %2
br label %11
10: ; preds = %1
store i64 0, i64* %2
br label %11
11: ; preds = %10, %6
%12 = load i64, i64* %2
ret i64 %12
}

LLVM IR (-O2):
define i64 @log2i(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i64 @clz(i64 %0)
%5 = sub i64 63, %4
br label %6
6: ; preds = %1, %3
%7 = phi i64 [ %5, %3 ], [ 0, %1 ]
ret i64 %7
}
/* Variables and functions */
int Set_DSP_CPUID(unsigned char);
int Set_Ethernet_DSP_ID(unsigned char dsp_id) { return Set_DSP_CPUID(dsp_id); }


x86 assembly (clang, -O0):
<Set_Ethernet_DSP_ID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <Set_DSP_CPUID@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Set_Ethernet_DSP_ID>:
jmp    1030 <Set_DSP_CPUID@plt>

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

LLVM IR (-O2):
define i32 @Set_Ethernet_DSP_ID(i8 zeroext %0) {
%2 = tail call i32 @Set_DSP_CPUID(i8 zeroext %0)
ret i32 %2
}
unsigned xrop3_191_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T & S;
  stk2 = ~stk2;
  stk1 = D | stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_191_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_191_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_191_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %5
%28 = load i32, i32* %9
%29 = or i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %5
%35 = load i32, i32* %6
%36 = and i32 %34, %35
%37 = or i32 %33, %36
ret i32 %37
}

LLVM IR (-O2):
define i32 @xrop3_191_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = xor i32 %4, -1
ret i32 %5
}
int main() {
  typedef int my_int;
  static signed short a;
  register unsigned char b;
  auto long c;
  double d;
  _Bool e;
  my_int g;
  struct {
    _Complex f;
  } s;
  enum { first } h;
  int f;
}


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

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

LLVM IR (-O0):
%struct.anon = type { { double, double } }
@main.a = internal global i16 0
define i32 @main() {
%1 = alloca i8
%2 = alloca i64
%3 = alloca double
%4 = alloca i8
%5 = alloca i32
%6 = alloca %struct.anon
%7 = alloca i32
%8 = alloca i32
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void exec_three(void) {}


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

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

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

LLVM IR (-O2):
define void @exec_three() {
ret void
}
/* Variables and functions */
int write_bytes(int, unsigned char *, int);
int /*<<< orphan*/ write_weird_midi_int(int, unsigned long);
int write_end_of_track(int fd) {
  unsigned char eot[] = {0xFF, 0x2F, 0x00};
  unsigned long ms = 0;
  write_weird_midi_int(fd, ms);
  return (write_bytes(fd, eot, 3) != 3);
}


x86 assembly (clang, -O0):
<write_end_of_track>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0x5(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <write_weird_midi_int@plt>
mov    -0x4(%rbp),%edi
lea    -0x7(%rbp),%rsi
mov    $0x3,%edx
call   1040 <write_bytes@plt>
cmp    $0x3,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_end_of_track>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movb   $0x0,0xe(%rsp)
movw   $0x2fff,0xc(%rsp)
xor    %esi,%esi
call   1030 <write_weird_midi_int@plt>
lea    0xc(%rsp),%rsi
mov    %ebx,%edi
mov    $0x3,%edx
call   1040 <write_bytes@plt>
xor    %ecx,%ecx
cmp    $0x3,%eax
setne  %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.write_end_of_track.eot = [3 x i8] c"\FF/\00"
define i32 @write_end_of_track(i32 %0) {
%2 = alloca i32
%3 = alloca [3 x i8]
%4 = alloca i64
store i32 %0, i32* %2
%5 = bitcast [3 x i8]* %3 to i8*
store i64 0, i64* %4
%6 = load i32, i32* %2
%7 = load i64, i64* %4
%8 = call i32 @write_weird_midi_int(i32 %6, i64 %7)
%9 = load i32, i32* %2
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%11 = call i32 @write_bytes(i32 %9, i8* %10, i32 3)
%12 = icmp ne i32 %11, 3
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@__const.write_end_of_track.eot = [3 x i8] c"\FF/\00"
define i32 @write_end_of_track(i32 %0) {
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @write_weird_midi_int(i32 %0, i64 0)
%5 = call i32 @write_bytes(i32 %0, i8* %3, i32 3)
%6 = icmp ne i32 %5, 3
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Msp430TimerP__1__VectorTimerX1__fired();
void Msp430TimerCommonP__VectorTimerB1__fired(void) {
  Msp430TimerP__1__VectorTimerX1__fired();
}


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

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

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

LLVM IR (-O2):
define void @Msp430TimerCommonP__VectorTimerB1__fired() {
%1 = tail call i32 (...) @Msp430TimerP__1__VectorTimerX1__fired()
ret void
}
void gpio_toggle_green_led(void) {}


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

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

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

LLVM IR (-O2):
define void @gpio_toggle_green_led() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
void addAND(char *the_query, int nbAnd) {
  if (nbAnd == 0)
    strcat(the_query, " WHERE ");
  else
    strcat(the_query, " AND ");
}


x86 assembly (clang, -O0):
<addAND>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    113e <addAND+0x2e>
mov    -0x8(%rbp),%rdi
lea    0xecc(%rip),%rsi
call   1030 <strcat@plt>
jmp    114e <addAND+0x3e>
mov    -0x8(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1030 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addAND>:
test   %esi,%esi
lea    0xee7(%rip),%rax
lea    0xee8(%rip),%rsi
cmove  %rax,%rsi
jmp    1030 <strcat@plt>

LLVM IR (-O0):
@.str = [8 x i8] c" WHERE \00"
@.str.1 = [6 x i8] c" AND \00"
define void @addAND(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @strcat(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %13
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = call i32 @strcat(i8* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c" WHERE \00"
@.str.1 = [6 x i8] c" AND \00"
define void @addAND(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @strcat(i8* %0, i8* %4)
ret void
}
/* Variables and functions */
void *realloc(void *, size_t);
void *wmalloc(size_t);
void *wrealloc(void *ptr, size_t oldSize, size_t newSize) {
  if (!ptr)
    return wmalloc(newSize);
  return realloc(ptr, newSize);
}


x86 assembly (clang, -O0):
<wrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1151 <wrealloc+0x31>
mov    -0x20(%rbp),%rdi
call   1030 <wmalloc@plt>
mov    %rax,-0x8(%rbp)
jmp    1162 <wrealloc+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrealloc>:
test   %rdi,%rdi
je     112d <wrealloc+0xd>
mov    %rdx,%rsi
jmp    1040 <realloc@plt>
mov    %rdx,%rdi
jmp    1030 <wmalloc@plt>

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

LLVM IR (-O2):
define i8* @wrealloc(i8* %0, i64 %1, i64 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i8* @wmalloc(i64 %2)
br label %9
7: ; preds = %3
%8 = tail call i8* @realloc(i8* %0, i64 %2)
br label %9
9: ; preds = %7, %5
%10 = phi i8* [ %8, %7 ], [ %6, %5 ]
ret i8* %10
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
volatile uint32_t *mem_get_reg32(uint32_t addr) {
  return (volatile uint32_t *)addr;
}


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

x86 assembly (clang, -O2):
<mem_get_reg32>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64* @mem_get_reg32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i64*
ret i64* %4
}

LLVM IR (-O2):
define i64* @mem_get_reg32(i64 %0) {
%2 = inttoptr i64 %0 to i64*
ret i64* %2
}
/* Variables and functions */
int /*<<< orphan*/ mergesortRange(int *, int /*<<< orphan*/, int);
void mergesort(int size, int values[]) { mergesortRange(values, 0, size); }


x86 assembly (clang, -O0):
<mergesort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <mergesortRange@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergesort>:
mov    %edi,%edx
mov    %rsi,%rdi
xor    %esi,%esi
jmp    1030 <mergesortRange@plt>

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

LLVM IR (-O2):
define void @mergesort(i32 %0, i32* %1) {
%3 = tail call i32 @mergesortRange(i32* %1, i32 0, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x53() {
  Assert_real((iscntrl(83) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              420, ("iscntrl should be 0 for S"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x53>:
push   %rax
mov    $0x53,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1a4,%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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for S\00"
define void @t_iscntrl_0x53() {
%1 = call i64 @iscntrl(i32 83)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 420, 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for S\00"
define void @t_iscntrl_0x53() {
%1 = tail call i64 @iscntrl(i32 83)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 420, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double const snaf(double const);
double strans(double const x) {
  double const snafx = snaf(x);
  return snafx / (snafx + snaf(1 - x));
}


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

x86 assembly (clang, -O2):
<strans>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <snaf@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0xed3(%rip),%xmm0
subsd  0x8(%rsp),%xmm0
call   1030 <snaf@plt>
movsd  0x10(%rsp),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @strans(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @snaf(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = load double, double* %2
%9 = fsub double 1.000000e+00, %8
%10 = call double @snaf(double %9)
%11 = fadd double %7, %10
%12 = fdiv double %6, %11
ret double %12
}

LLVM IR (-O2):
define double @strans(double %0) {
%2 = tail call double @snaf(double %0)
%3 = fsub double 1.000000e+00, %0
%4 = tail call double @snaf(double %3)
%5 = fadd double %2, %4
%6 = fdiv double %2, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ glColor3ub(unsigned char, unsigned char, unsigned char);
void Color3ub(unsigned char r, unsigned char g, unsigned char b) {
  glColor3ub(r, g, b);
}


x86 assembly (clang, -O0):
<Color3ub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x2(%rbp),%al
movzbl %cl,%edi
movzbl %al,%esi
movzbl -0x3(%rbp),%edx
call   1030 <glColor3ub@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Color3ub>:
jmp    1030 <glColor3ub@plt>

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

LLVM IR (-O2):
define void @Color3ub(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = tail call i32 @glColor3ub(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2)
ret void
}
void pcp_print_filesystem_stats(struct activity *a, int curr) {}


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

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

LLVM IR (-O0):
%struct.activity = type opaque
define void @pcp_print_filesystem_stats(%struct.activity* %0, i32 %1) {
%3 = alloca %struct.activity*
%4 = alloca i32
store %struct.activity* %0, %struct.activity** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_print_filesystem_stats(%struct.activity* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, ...);
void main() {
  printf("Press Enter");
  printf("getchar() != EOF = %d\n", getchar() != EOF);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eab(%rip),%rcx
xor    %esi,%esi
cmp    (%rcx),%rax
setne  %sil
lea    0xebf(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Press Enter\00"
@.str.1 = [23 x i8] c"getchar() != EOF = %d\0A\00"
@EOF = global i64 0
define void @main() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i64 (...) @getchar()
%3 = load i64, i64* @EOF
%4 = icmp ne i64 %2, %3
%5 = zext i1 %4 to i32
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Press Enter\00"
@.str.1 = [23 x i8] c"getchar() != EOF = %d\0A\00"
@EOF = global i64 0
define void @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i64 (...) @getchar()
%3 = load i64, i64* @EOF
%4 = icmp ne i64 %2, %3
%5 = zext i1 %4 to i32
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}
void gtk_entry_completion_complete() {}


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

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

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

LLVM IR (-O2):
define void @gtk_entry_completion_complete() {
ret void
}
/* Variables and functions */
float InvSqrt(float);
float RKMath_Sqrt(float x) { return x * InvSqrt(x); }


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

x86 assembly (clang, -O2):
<RKMath_Sqrt>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <InvSqrt@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @RKMath_Sqrt(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = call float @InvSqrt(float %4)
%6 = fmul float %3, %5
ret float %6
}

LLVM IR (-O2):
define float @RKMath_Sqrt(float %0) {
%2 = tail call float @InvSqrt(float %0)
%3 = fmul float %2, %0
ret float %3
}
void I2SIntRegister(unsigned long ulBase, void (*pfnHandler)(void)) {
  DEBUG_ASSERT(ulBase == 0x40054000);
  DEBUG_ASSERT(pfnHandler);
  IntRegister(68, pfnHandler);
  IntEnable(68);
}


x86 assembly (clang, -O0):
<I2SIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x40054000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1050 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rsi
mov    $0x44,%edi
mov    $0x0,%al
call   1040 <IntRegister@plt>
mov    $0x44,%edi
mov    $0x0,%al
call   1030 <IntEnable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2SIntRegister>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
cmp    $0x40054000,%rdi
sete   %al
mov    %eax,%edi
xor    %eax,%eax
call   1050 <DEBUG_ASSERT@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <DEBUG_ASSERT@plt>
mov    $0x44,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <IntRegister@plt>
mov    $0x44,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @I2SIntRegister(i64 %0, void ()* %1) {
%3 = alloca i64
%4 = alloca void ()*
store i64 %0, i64* %3
store void ()* %1, void ()** %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1074085888
%7 = zext i1 %6 to i32
%8 = call i32 (i32, ...) bitcast (i32 (...)* @DEBUG_ASSERT to i32 (i32, ...)*)(i32 %7)
%9 = load void ()*, void ()** %4
%10 = call i32 (void ()*, ...) bitcast (i32 (...)* @DEBUG_ASSERT to i32 (void ()*, ...)*)(void ()* %9)
%11 = load void ()*, void ()** %4
%12 = call i32 (i32, void ()*, ...) bitcast (i32 (...)* @IntRegister to i32 (i32, void ()*, ...)*)(i32 68, void ()* %11)
%13 = call i32 (i32, ...) bitcast (i32 (...)* @IntEnable to i32 (i32, ...)*)(i32 68)
ret void
}

LLVM IR (-O2):
define void @I2SIntRegister(i64 %0, void ()* %1) {
%3 = icmp eq i64 %0, 1074085888
%4 = zext i1 %3 to i32
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @DEBUG_ASSERT to i32 (i32, ...)*)(i32 %4)
%6 = tail call i32 (void ()*, ...) bitcast (i32 (...)* @DEBUG_ASSERT to i32 (void ()*, ...)*)(void ()* %1)
%7 = tail call i32 (i32, void ()*, ...) bitcast (i32 (...)* @IntRegister to i32 (i32, void ()*, ...)*)(i32 68, void ()* %1)
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @IntEnable to i32 (i32, ...)*)(i32 68)
ret void
}