xunge/DecIR huggingface dataset:
int hash_void_ptr(void *ptr) {
  int hash;
  int i;
  hash = 0;
  for (i = 0; i < sizeof(ptr) * 8 / 8; i++) {
    hash ^= (long)ptr >> i * 8;
    hash += i * 17;
    hash &= ((1 << 8) - 1);
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash_void_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movslq -0x10(%rbp),%rax
cmp    $0x8,%rax
jae    1163 <hash_void_ptr+0x63>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
shl    $0x3,%ecx
mov    %ecx,%ecx
sar    %cl,%rax
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
xor    %rcx,%rax
mov    %eax,-0xc(%rbp)
imul   $0x11,-0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <hash_void_ptr+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_void_ptr>:
mov    %edi,%eax
shr    $0x8,%eax
xor    %edi,%eax
add    $0x11,%eax
mov    %edi,%ecx
shr    $0x10,%ecx
xor    %eax,%ecx
add    $0x22,%ecx
mov    %edi,%eax
shr    $0x18,%eax
xor    %ecx,%eax
add    $0x33,%eax
mov    %rdi,%rcx
shr    $0x20,%rcx
xor    %eax,%ecx
add    $0x44,%ecx
mov    %rdi,%rax
shr    $0x28,%rax
xor    %ecx,%eax
add    $0x55,%eax
mov    %rdi,%rcx
shr    $0x30,%rcx
xor    %eax,%ecx
add    $0x66,%ecx
shr    $0x38,%rdi
xor    %ecx,%edi
add    $0x77,%edi
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_void_ptr(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = trunc i64 %2 to i32
%5 = lshr i32 %4, 8
%6 = xor i32 %5, %3
%7 = add i32 %6, 17
%8 = trunc i64 %2 to i32
%9 = lshr i32 %8, 16
%10 = xor i32 %7, %9
%11 = add i32 %10, 34
%12 = trunc i64 %2 to i32
%13 = lshr i32 %12, 24
%14 = xor i32 %11, %13
%15 = add i32 %14, 51
%16 = lshr i64 %2, 32
%17 = trunc i64 %16 to i32
%18 = xor i32 %15, %17
%19 = add i32 %18, 68
%20 = lshr i64 %2, 40
%21 = trunc i64 %20 to i32
%22 = xor i32 %19, %21
%23 = add i32 %22, 85
%24 = lshr i64 %2, 48
%25 = trunc i64 %24 to i32
%26 = xor i32 %23, %25
%27 = add i32 %26, 102
%28 = lshr i64 %2, 56
%29 = trunc i64 %28 to i32
%30 = xor i32 %27, %29
%31 = add i32 %30, 119
%32 = and i32 %31, 255
ret i32 %32
}
/* Variables and functions */
unsigned long CountOnes(unsigned long);
unsigned long CountZeroes(unsigned long x) { return CountOnes(~x); }


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

x86 assembly (clang, -O2):
<CountZeroes>:
not    %rdi
jmp    1030 <CountOnes@plt>

LLVM IR (-O0):
define i64 @CountZeroes(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = xor i64 %3, -1
%5 = call i64 @CountOnes(i64 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @CountZeroes(i64 %0) {
%2 = xor i64 %0, -1
%3 = tail call i64 @CountOnes(i64 %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void RotateLeft() { printf("Action: Rotating 90° Left\n"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"Action: Rotating 90\C2\B0 Left\0A\00"
define void @RotateLeft() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"Action: Rotating 90\C2\B0 Left\00"
define void @RotateLeft() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ calloc(size_t, int);
double ***init(int m, int n) {
  int i;
  double ***w;
  w = (double ***)calloc((size_t)m, sizeof(double **));
  w[0] = (double **)calloc((size_t)n, sizeof(double *));
  return w;
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rdi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
movslq -0x8(%rbp),%rdi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
movslq %edi,%rdi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
movslq %ebp,%rdi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double*** @init(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double***
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = call i64 @calloc(i64 %8, i32 8)
%10 = inttoptr i64 %9 to double***
store double*** %10, double**** %6
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = call i64 @calloc(i64 %12, i32 8)
%14 = inttoptr i64 %13 to double**
%15 = load double***, double**** %6
%16 = getelementptr inbounds double**, double*** %15, i64 0
store double** %14, double*** %16
%17 = load double***, double**** %6
ret double*** %17
}

LLVM IR (-O2):
define double*** @init(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = tail call i64 @calloc(i64 %3, i32 8)
%5 = inttoptr i64 %4 to double***
%6 = sext i32 %1 to i64
%7 = tail call i64 @calloc(i64 %6, i32 8)
%8 = inttoptr i64 %7 to double**
store double** %8, double*** %5
ret double*** %5
}
unsigned char getBit(void *stream, unsigned long byte, char bit) {
  char *lstream = stream;
  unsigned char ret = 0;
  ret = lstream[byte] && (1 << bit);
  return ret;
}


x86 assembly (clang, -O0):
<getBit>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movb   $0x0,-0x21(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x22(%rbp)
je     114b <getBit+0x4b>
movsbl -0x11(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x22(%rbp)
mov    -0x22(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x21(%rbp)
movzbl -0x21(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBit>:
cmpb   $0x0,(%rdi,%rsi,1)
setne  %al
ret

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

LLVM IR (-O2):
define zeroext i8 @getBit(i8* nocapture %0, i64 %1, i8 signext %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 %1
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
%7 = zext i1 %6 to i8
ret i8 %7
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ nrerror(char *);
float *vector(long nl, long nh) {
  float *v;
  v = (float *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(float)));
  if (!v)
    nrerror("allocation failure in vector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <vector+0x44>
lea    0xea1(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x4,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x8(,%rsi,4),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <vector+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <nrerror@plt>
shl    $0x2,%r14
sub    %r14,%rbx
add    $0x4,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [31 x i8] c"allocation failure in vector()\00"
define float* @vector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca float*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 4
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to float*
store float* %13, float** %5
%14 = load float*, float** %5
%15 = icmp ne float* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @nrerror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load float*, float** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds float, float* %19, i64 %21
%23 = getelementptr inbounds float, float* %22, i64 1
ret float* %23
}

LLVM IR (-O2):
@.str = [31 x i8] c"allocation failure in vector()\00"
define float* @vector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 2
%5 = add i64 %4, 8
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nrerror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to float*
%12 = sub i64 0, %0
%13 = getelementptr inbounds float, float* %11, i64 %12
%14 = getelementptr inbounds float, float* %13, i64 1
ret float* %14
}
int f(int x, int y) { return x + y; }


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

x86 assembly (clang, -O2):
<f>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @f(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void _makevar_isfname(isfname) char *isfname;
{ (void)strcat(isfname, ".var"); }


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

x86 assembly (clang, -O2):
<_makevar_isfname>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
movl   $0x7261762e,(%rbx,%rax,1)
movb   $0x0,0x4(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c".var\00"
define void @_makevar_isfname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strcat(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c".var\00"
define void @_makevar_isfname(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = getelementptr i8, i8* %0, i64 %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %3, i8* align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 5, i1 false)
ret void
}
unsigned xma_le16(unsigned n) {
  static const int endianess = 1;
  if (*(char *)&endianess)
    return (n);
  n = (((n & 0xff00) >> 8) | ((n & 0x00ff) << 8));
  return (n);
}


x86 assembly (clang, -O0):
<xma_le16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpb   $0x0,0xef2(%rip)
je     111f <xma_le16+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <xma_le16+0x41>
mov    -0x8(%rbp),%eax
and    $0xff00,%eax
shr    $0x8,%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@xma_le16.endianess = internal constant i32 1
define i32 @xma_le16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i8, i8* bitcast (i32* @xma_le16.endianess to i8*)
%5 = icmp ne i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %17
8: ; preds = %1
%9 = load i32, i32* %3
%10 = and i32 %9, 65280
%11 = lshr i32 %10, 8
%12 = load i32, i32* %3
%13 = and i32 %12, 255
%14 = shl i32 %13, 8
%15 = or i32 %11, %14
store i32 %15, i32* %3
%16 = load i32, i32* %3
store i32 %16, i32* %2
br label %17
17: ; preds = %8, %6
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @xma_le16(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef scalar_t__ const wchar_t;

/* Variables and functions */
wchar_t *wcsrchr(wchar_t const *s, wchar_t c) {
  wchar_t const *found = NULL;
  do {
    if (*s == c)
      found = s;
  } while (*s++);
  return (wchar_t *)found;
}


x86 assembly (clang, -O0):
<wcsrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
jne    112d <wcsrchr+0x2d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1132 <wcsrchr+0x32>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
cmpq   $0x0,(%rax)
jne    1114 <wcsrchr+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsrchr>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rdi),%rcx
cmp    %rsi,%rcx
cmove  %rdi,%rax
add    $0x8,%rdi
test   %rcx,%rcx
jne    1110 <wcsrchr+0x10>
ret

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

LLVM IR (-O2):
define i64* @wcsrchr(i64* %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64* [ %0, %2 ], [ %9, %3 ]
%5 = phi i64* [ null, %2 ], [ %8, %3 ]
%6 = load i64, i64* %4
%7 = icmp eq i64 %6, %1
%8 = select i1 %7, i64* %4, i64* %5
%9 = getelementptr inbounds i64, i64* %4, i64 1
%10 = icmp eq i64 %6, 0
br i1 %10, label %11, label %3
11: ; preds = %3
ret i64* %8
}
/* Variables and functions */
scalar_t__ LINES;
int /*<<< orphan*/ clrtoeol();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ move(scalar_t__, int);
int /*<<< orphan*/ mvaddstr(scalar_t__, int, char *);
int /*<<< orphan*/ raw();
int /*<<< orphan*/ refresh();
void Continue2(void) {
  move(LINES - 1, 1);
  clrtoeol();
  mvaddstr(LINES - 2, 1, " Press any key to continue");
  refresh();
  raw();
  getch();
}


x86 assembly (clang, -O0):
<Continue2>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e7d(%rip),%rax
mov    (%rax),%rdi
sub    $0x1,%rdi
mov    $0x1,%esi
call   1080 <move@plt>
mov    $0x0,%al
call   1060 <clrtoeol@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%rdi
sub    $0x2,%rdi
mov    $0x1,%esi
lea    0xe63(%rip),%rdx
call   1070 <mvaddstr@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
mov    $0x0,%al
call   1030 <raw@plt>
mov    $0x0,%al
call   1050 <getch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Continue2>:
push   %rbx
mov    0x2e80(%rip),%rbx
mov    (%rbx),%rdi
add    $0xffffffffffffffff,%rdi
mov    $0x1,%esi
call   1080 <move@plt>
xor    %eax,%eax
call   1060 <clrtoeol@plt>
mov    (%rbx),%rdi
add    $0xfffffffffffffffe,%rdi
lea    0xe72(%rip),%rdx
mov    $0x1,%esi
call   1070 <mvaddstr@plt>
xor    %eax,%eax
call   1040 <refresh@plt>
xor    %eax,%eax
call   1030 <raw@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <getch@plt>

LLVM IR (-O0):
@LINES = global i64 0
@.str = [27 x i8] c" Press any key to continue\00"
define void @Continue2() {
%1 = load i64, i64* @LINES
%2 = sub nsw i64 %1, 1
%3 = call i32 @move(i64 %2, i32 1)
%4 = call i32 (...) @clrtoeol()
%5 = load i64, i64* @LINES
%6 = sub nsw i64 %5, 2
%7 = call i32 @mvaddstr(i64 %6, i32 1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @refresh()
%9 = call i32 (...) @raw()
%10 = call i32 (...) @getch()
ret void
}

LLVM IR (-O2):
@LINES = global i64 0
@.str = [27 x i8] c" Press any key to continue\00"
define void @Continue2() {
%1 = load i64, i64* @LINES
%2 = add nsw i64 %1, -1
%3 = tail call i32 @move(i64 %2, i32 1)
%4 = tail call i32 (...) @clrtoeol()
%5 = load i64, i64* @LINES
%6 = add nsw i64 %5, -2
%7 = tail call i32 @mvaddstr(i64 %6, i32 1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @refresh()
%9 = tail call i32 (...) @raw()
%10 = tail call i32 (...) @getch()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lol2();
void lol(void) { lol2(); }


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

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

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

LLVM IR (-O2):
define void @lol() {
%1 = tail call i32 (...) @lol2()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M232_f(char *s) {
  debug("M232_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M232_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M232_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M232_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M232_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M232_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M232_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int get_length(FILE *fd) {
  int c = 0;
  int i = 0;
  while ((c = fgetc(fd)) != '\n') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<get_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xa,%eax
je     114d <get_length+0x3d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <get_length+0x1a>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_length>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0xffffffff,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <fgetc@plt>
add    $0x1,%ebx
cmp    $0xa,%eax
jne    1120 <get_length+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @get_length(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %6, %2 ]
%4 = tail call i32 @fgetc(i32* %0)
%5 = icmp eq i32 %4, 10
%6 = add nuw nsw i32 %3, 1
br i1 %5, label %7, label %2
7: ; preds = %2
ret i32 %3
}
int roundup_powerof2(int n) {
  int result = 1;
  while (n > 0) {
    n /= 2;
    result *= 2;
  }
  return result;
}


x86 assembly (clang, -O0):
<roundup_powerof2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1134 <roundup_powerof2+0x34>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <roundup_powerof2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundup_powerof2>:
mov    $0x1,%eax
test   %edi,%edi
jle    111b <roundup_powerof2+0x1b>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    %eax,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <roundup_powerof2+0x10>
ret

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

LLVM IR (-O2):
define i32 @roundup_powerof2(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = shl nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %10
}
void CFGMR3AreChildrenValid(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3AreChildrenValid() {
ret void
}
unsigned int getRoundingPrecision(const unsigned int opcode) {
  unsigned int nRc;
  switch (opcode & 0x00080080) {
  case 0x00000000:
    nRc = 1;
    break;
  case 0x00000080:
    nRc = 2;
    break;
  case 0x00080000:
    nRc = 3;
    break;
  default:
    nRc = 0;
  }
  return (nRc);
}


x86 assembly (clang, -O0):
<getRoundingPrecision>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80080,%eax
mov    %eax,-0xc(%rbp)
je     1143 <getRoundingPrecision+0x43>
jmp    111d <getRoundingPrecision+0x1d>
mov    -0xc(%rbp),%eax
sub    $0x80,%eax
je     114f <getRoundingPrecision+0x4f>
jmp    1130 <getRoundingPrecision+0x30>
mov    -0xc(%rbp),%eax
sub    $0x80000,%eax
je     115b <getRoundingPrecision+0x5b>
jmp    1167 <getRoundingPrecision+0x67>
movl   $0x1,-0x8(%rbp)
jmp    116e <getRoundingPrecision+0x6e>
movl   $0x2,-0x8(%rbp)
jmp    116e <getRoundingPrecision+0x6e>
movl   $0x3,-0x8(%rbp)
jmp    116e <getRoundingPrecision+0x6e>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRoundingPrecision>:
and    $0x80080,%edi
je     111e <getRoundingPrecision+0x1e>
cmp    $0x80000,%edi
je     1124 <getRoundingPrecision+0x24>
cmp    $0x80,%edi
jne    112a <getRoundingPrecision+0x2a>
mov    $0x2,%eax
ret
mov    $0x1,%eax
ret
mov    $0x3,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @getRoundingPrecision(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 524416
switch i32 %5, label %9 [
i32 0, label %6
i32 128, label %7
i32 524288, label %8
]
6: ; preds = %1
store i32 1, i32* %3
br label %10
7: ; preds = %1
store i32 2, i32* %3
br label %10
8: ; preds = %1
store i32 3, i32* %3
br label %10
9: ; preds = %1
store i32 0, i32* %3
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @getRoundingPrecision(i32 %0) {
%2 = and i32 %0, 524416
switch i32 %2, label %5 [
i32 0, label %6
i32 128, label %3
i32 524288, label %4
]
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3
%7 = phi i32 [ 0, %5 ], [ 3, %4 ], [ 2, %3 ], [ 1, %1 ]
ret i32 %7
}
/* Variables and functions */
int exp(int);
double beta_h(const double V) { return 1. / (1. + exp((55. - V) / 10.)); }


x86 assembly (clang, -O0):
<beta_h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  0xeb5(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xea9(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beta_h>:
push   %rax
movsd  0xee7(%rip),%xmm1
subsd  %xmm0,%xmm1
divsd  0xee3(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1030 <exp@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xed3(%rip),%xmm0
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @beta_h(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 5.500000e+01, %3
%5 = fdiv double %4, 1.000000e+01
%6 = fptosi double %5 to i32
%7 = call i32 @exp(i32 %6)
%8 = sitofp i32 %7 to double
%9 = fadd double 1.000000e+00, %8
%10 = fdiv double 1.000000e+00, %9
ret double %10
}

LLVM IR (-O2):
define double @beta_h(double %0) {
%2 = fsub double 5.500000e+01, %0
%3 = fdiv double %2, 1.000000e+01
%4 = fptosi double %3 to i32
%5 = tail call i32 @exp(i32 %4)
%6 = sitofp i32 %5 to double
%7 = fadd double %6, 1.000000e+00
%8 = fdiv double 1.000000e+00, %7
ret double %8
}
/* Variables and functions */
char getc();
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ solve(int, int);
int main(void) {
  int n, j;
  while (getc() != '\n')
    ;
  scanf("%d", &n);
  scanf("%d", &j);
  puts("Case #1:");
  solve(n, j);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <getc@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1167 <main+0x27>
jmp    114f <main+0xf>
lea    0xe92(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe82(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe75(%rip),%rdi
call   1040 <puts@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <solve@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1060 <getc@plt>
cmp    $0xa,%al
jne    1150 <main+0x10>
lea    0xe9e(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe80(%rip),%rdi
call   1040 <puts@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1030 <solve@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [9 x i8] c"Case:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %8, %0
%5 = call signext i8 (...) @getc()
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%12 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i32 @solve(i32 %13, i32 %14)
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [9 x i8] c"Case:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %5, %0
%6 = tail call signext i8 (...) @getc()
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %5
8: ; preds = %5
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = call i32 @solve(i32 %12, i32 %13)
ret i32 0
}
/* Variables and functions */
float sin(float);
float g(float x) { return sin(x); }


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

x86 assembly (clang, -O2):
<g>:
jmp    1030 <sin@plt>

LLVM IR (-O0):
define float @g(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sin(float %3)
ret float %4
}

LLVM IR (-O2):
define float @g(float %0) {
%2 = tail call float @sin(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char *strpbrk(char *, char *);
int main(int argc, char **argv) {
  char *r;
  char s2[] = "ab";
  char s1[] = {'c', 'a'};
  char s3 = 0;
  r = strpbrk(s1, s2);
  assert(r == s1 + 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%ax
mov    %ax,-0x1b(%rbp)
mov    0xebb(%rip),%al
mov    %al,-0x19(%rbp)
mov    0xeb2(%rip),%ax
mov    %ax,-0x1d(%rbp)
movb   $0x0,-0x1e(%rbp)
lea    -0x1d(%rbp),%rdi
lea    -0x1b(%rbp),%rsi
call   1040 <strpbrk@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
lea    -0x1d(%rbp),%rcx
add    $0x1,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x6163,0x6(%rsp)
lea    0xed1(%rip),%rsi
lea    0x6(%rsp),%rdi
call   1040 <strpbrk@plt>
lea    0x7(%rsp),%rcx
xor    %edi,%edi
cmp    %rcx,%rax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.s2 = [3 x i8] c"ab\00"
@__const.main.s1 = [2 x i8] c"ca"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca [3 x i8]
%8 = alloca [2 x i8]
%9 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = bitcast [3 x i8]* %7 to i8*
%11 = bitcast [2 x i8]* %8 to i8*
store i8 0, i8* %9
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%13 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
%14 = call i8* @strpbrk(i8* %12, i8* %13)
store i8* %14, i8** %6
%15 = load i8*, i8** %6
%16 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = icmp eq i8* %15, %17
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s2 = [3 x i8] c"ab\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i16
%4 = bitcast i16* %3 to i8*
store i16 24931, i16* %3
%5 = call i8* @strpbrk(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__const.main.s2, i64 0, i64 0))
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret i32 0
}
int dns_v_api(void) { return 0x20100416; }


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

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

LLVM IR (-O0):
define i32 @dns_v_api() {
ret i32 537920534
}

LLVM IR (-O2):
define i32 @dns_v_api() {
ret i32 537920534
}
/* Variables and functions */
int /*<<< orphan*/ check_intInput(int *);
void fill_array(int str[], int size) {
  int i;
  for (i = 0; i < size; i++) {
    check_intInput(&str[i]);
  }
}


x86 assembly (clang, -O0):
<fill_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1154 <fill_array+0x44>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <check_intInput@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <fill_array+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_array>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1132 <fill_array+0x22>
mov    %rdi,%rbx
mov    %esi,%r14d
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <check_intInput@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r14
jne    1120 <fill_array+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @fill_array(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = tail call i32 @check_intInput(i32* %8)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void fooA(int *iptr) {
  printf("the value of the integer pointed to by iptr is: %d\n", *iptr);
  printf("the address pointed to by iptr is: %p\n", iptr);
  printf("the address of iptr itself is: %p\n", &iptr);
}


x86 assembly (clang, -O0):
<fooA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf12(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fooA>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rdi,0x8(%rsp)
mov    (%rdi),%esi
lea    0xeda(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf16(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"the value of the integer pointed to by iptr is: %d\0A\00"
@.str.1 = [39 x i8] c"the address pointed to by iptr is: %p\0A\00"
@.str.2 = [35 x i8] c"the address of iptr itself is: %p\0A\00"
define void @fooA(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32*, i32** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32** %2)
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"the value of the integer pointed to by iptr is: %d\0A\00"
@.str.1 = [39 x i8] c"the address pointed to by iptr is: %p\0A\00"
@.str.2 = [35 x i8] c"the address of iptr itself is: %p\0A\00"
define void @fooA(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32* %0)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32** %2)
ret void
}
void wtf() {
  int a[10], i;
  for (i = 0; i <= 10; i++) {
    a[i] = 0;
  }
}


x86 assembly (clang, -O0):
<wtf>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jg     112f <wtf+0x2f>
movslq -0x34(%rbp),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    110b <wtf+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @wtf() {
%1 = alloca [10 x i32]
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 10
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %8
store i32 0, i32* %9
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @wtf() {
ret void
}
int hash_block_size() { return 1; }


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

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

LLVM IR (-O0):
define i32 @hash_block_size() {
ret i32 1
}

LLVM IR (-O2):
define i32 @hash_block_size() {
ret i32 1
}
/* Variables and functions */
scalar_t__ cosh(double);
float coshf(float x) { return (float)cosh((double)x); }


x86 assembly (clang, -O0):
<coshf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <cosh@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coshf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <cosh@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @coshf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @cosh(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @coshf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @cosh(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void delete_int(void *val) {
  if (val) {
    int *tmp = (int *)val;
    free(tmp);
  }
}


x86 assembly (clang, -O0):
<delete_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <delete_int+0x28>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_int>:
test   %rdi,%rdi
je     111a <delete_int+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @delete_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %3
%9 = load i32*, i32** %3
%10 = call i32 @free(i32* %9)
br label %11
11: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @delete_int(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @free(i32* %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void memcpy3() {
  char src[] = {1, 2, 3, 4};
  char dst[3];
  memcpy(dst + 1, src + 2, 2);
}


x86 assembly (clang, -O0):
<memcpy3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x7(%rbp),%rdi
add    $0x1,%rdi
lea    -0x4(%rbp),%rsi
add    $0x2,%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy3>:
push   %rax
movl   $0x4030201,(%rsp)
lea    0x6(%rsp),%rdi
lea    0x2(%rsp),%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.memcpy3.src = [4 x i8] c"\01\02\03\04"
define void @memcpy3() {
%1 = alloca [4 x i8]
%2 = alloca [3 x i8]
%3 = bitcast [4 x i8]* %1 to i8*
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds i8, i8* %6, i64 2
%8 = call i32 @memcpy(i8* %5, i8* %7, i32 2)
ret void
}

LLVM IR (-O2):
define void @memcpy3() {
%1 = alloca i32
%2 = alloca [3 x i8]
%3 = bitcast i32* %1 to i8*
store i32 67305985, i32* %1
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
%6 = getelementptr inbounds i8, i8* %3, i64 2
%7 = call i32 @memcpy(i8* %5, i8* %6, i32 2)
ret void
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/parse_tab.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/parse_tab.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/parse_tab.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
/* Variables and functions */
int mus_file_close(int);
int mus_sound_close_input(int fd) { return (mus_file_close(fd)); }


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

x86 assembly (clang, -O2):
<mus_sound_close_input>:
jmp    1030 <mus_file_close@plt>

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

LLVM IR (-O2):
define i32 @mus_sound_close_input(i32 %0) {
%2 = tail call i32 @mus_file_close(i32 %0)
ret i32 %2
}
int test_imm_44int8_reg(signed char val) {
  return ((val) & (0x44 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_44int8_reg>:
test   $0x44,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_44int8_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, 68
%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_44int8_reg(i8 signext %0) {
%2 = and i8 %0, 68
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}