xunge/DecIR huggingface dataset:
/* Type definitions */
struct DataFlag {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ DataFlag_set(struct DataFlag *, char *);
int DataFlag_waitAndSet(struct DataFlag *this, char *dataToWrite) {
  while (!DataFlag_set(this, dataToWrite)) {
  }
  return 1;
}


x86 assembly (clang, -O0):
<DataFlag_waitAndSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <DataFlag_set@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1142 <DataFlag_waitAndSet+0x32>
jmp    1147 <DataFlag_waitAndSet+0x37>
jmp    1120 <DataFlag_waitAndSet+0x10>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DataFlag_waitAndSet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <DataFlag_set@plt>
test   %eax,%eax
je     1120 <DataFlag_waitAndSet+0x10>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.DataFlag = type { i32 }
define i32 @DataFlag_waitAndSet(%struct.DataFlag* %0, i8* %1) {
%3 = alloca %struct.DataFlag*
%4 = alloca i8*
store %struct.DataFlag* %0, %struct.DataFlag** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %11, %2
%6 = load %struct.DataFlag*, %struct.DataFlag** %3
%7 = load i8*, i8** %4
%8 = call i32 @DataFlag_set(%struct.DataFlag* %6, i8* %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br i1 %10, label %11, label %12
11: ; preds = %5
br label %5
12: ; preds = %5
ret i32 1
}

LLVM IR (-O2):
%struct.DataFlag = type { i32 }
define i32 @DataFlag_waitAndSet(%struct.DataFlag* %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @DataFlag_set(%struct.DataFlag* %0, i8* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ mfs_get_fi(int);
int /*<<< orphan*/ mfs_pwrite_int(int /*<<< orphan*/, void const *, size_t,
                                  int /*<<< orphan*/);
ssize_t mfs_pwrite(int fildes, const void *buf, size_t nbyte, off_t offset) {
  return mfs_pwrite_int(mfs_get_fi(fildes), buf, nbyte, offset);
}


x86 assembly (clang, -O0):
<mfs_pwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <mfs_get_fi@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <mfs_pwrite_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mfs_pwrite>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %rsi,%rbp
call   1040 <mfs_get_fi@plt>
mov    %eax,%edi
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <mfs_pwrite_int@plt>

LLVM IR (-O0):
define i32 @mfs_pwrite(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = call i32 @mfs_get_fi(i32 %9)
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i32, i32* %8
%14 = call i32 @mfs_pwrite_int(i32 %10, i8* %11, i64 %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @mfs_pwrite(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @mfs_get_fi(i32 %0)
%6 = tail call i32 @mfs_pwrite_int(i32 %5, i8* %1, i64 %2, i32 %3)
ret i32 %6
}
/* Variables and functions */
int bit_num_leading_zeros(unsigned int);
int bit_nlz(unsigned int n) { return bit_num_leading_zeros(n); }


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

x86 assembly (clang, -O2):
<bit_nlz>:
jmp    1030 <bit_num_leading_zeros@plt>

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

LLVM IR (-O2):
define i32 @bit_nlz(i32 %0) {
%2 = tail call i32 @bit_num_leading_zeros(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void nn_bitset_clear(unsigned numbits, unsigned *bits, unsigned idx) {
  assert(idx < numbits);
  bits[idx / 32] &= ~(1u << (31 - (idx % 32)));
}


x86 assembly (clang, -O0):
<nn_bitset_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x14(%rbp),%eax
and    $0x1f,%eax
mov    $0x1f,%ecx
sub    %eax,%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shr    $0x5,%ecx
mov    %ecx,%ecx
and    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nn_bitset_clear>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
xor    %eax,%eax
cmp    %edi,%edx
setb   %al
mov    %eax,%edi
call   1030 <assert@plt>
mov    %ebx,%ecx
not    %cl
mov    $0xfffffffe,%eax
rol    %cl,%eax
shr    $0x5,%ebx
and    %eax,(%r14,%rbx,4)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @nn_bitset_clear(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = icmp ult i32 %7, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %6
%13 = urem i32 %12, 32
%14 = sub i32 31, %13
%15 = shl i32 1, %14
%16 = xor i32 %15, -1
%17 = load i32*, i32** %5
%18 = load i32, i32* %6
%19 = udiv i32 %18, 32
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %17, i64 %20
%22 = load i32, i32* %21
%23 = and i32 %22, %16
store i32 %23, i32* %21
ret void
}

LLVM IR (-O2):
define void @nn_bitset_clear(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp ult i32 %2, %0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = and i32 %2, 31
%8 = xor i32 %7, 31
%9 = shl nuw i32 1, %8
%10 = xor i32 %9, -1
%11 = lshr i32 %2, 5
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %1, i64 %12
%14 = load i32, i32* %13
%15 = and i32 %14, %10
store i32 %15, i32* %13
ret void
}
int getNumOctaves(int N) {
  int n;
  int octaves = 0;
  n = N;
  while (n > 1) {
    n >>= 1;
    octaves++;
  }
  return octaves;
}


x86 assembly (clang, -O0):
<getNumOctaves>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1135 <getNumOctaves+0x35>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <getNumOctaves+0x14>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNumOctaves>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     111c <getNumOctaves+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <getNumOctaves+0x10>
ret

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

LLVM IR (-O2):
define i32 @getNumOctaves(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ugt i32 %5, 3
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
int ubifs_add_dirt(struct ubifs_info *c, int lnum, int dirty) { return 0; }


x86 assembly (clang, -O0):
<ubifs_add_dirt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ubifs_info = type opaque
define i32 @ubifs_add_dirt(%struct.ubifs_info* %0, i32 %1, i32 %2) {
%4 = alloca %struct.ubifs_info*
%5 = alloca i32
%6 = alloca i32
store %struct.ubifs_info* %0, %struct.ubifs_info** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.ubifs_info = type opaque
define i32 @ubifs_add_dirt(%struct.ubifs_info* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
short strlen(int *);
void clean_array(int array[]) {
  short int i = 0;
  short int len = 0;
  len = strlen(array);
  for (i = 0; i < len; ++i) {
    array[i] = 0;
  };
}


x86 assembly (clang, -O0):
<clean_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movw   $0x0,-0xa(%rbp)
movw   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %ax,-0xc(%rbp)
movw   $0x0,-0xa(%rbp)
movswl -0xa(%rbp),%eax
movswl -0xc(%rbp),%ecx
cmp    %ecx,%eax
jge    116c <clean_array+0x5c>
mov    -0x8(%rbp),%rax
movswq -0xa(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xa(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xa(%rbp)
jmp    113b <clean_array+0x2b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_array>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %ax,%ax
jle    113f <clean_array+0x1f>
movzwl %ax,%edx
shl    $0x2,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @clean_array(i32* %0) {
%2 = tail call signext i16 @strlen(i32* %0)
%3 = icmp sgt i16 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = bitcast i32* %0 to i8*
%6 = zext i16 %2 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %1
ret void
}
void PS_NullCoordHMirror(void) {}


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

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

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

LLVM IR (-O2):
define void @PS_NullCoordHMirror() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ major_opcode;
};
typedef TYPE_1__ XExtCodes;

/* Variables and functions */
int get_XExtCodes_major_opcode(void *_p) {
  return (int)((XExtCodes *)_p)->major_opcode;
}


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

x86 assembly (clang, -O2):
<get_XExtCodes_major_opcode>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XExtCodes_major_opcode(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XExtCodes_major_opcode(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ DH;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ DHparams_it;
DH *d2i_DHparams(DH **a, const unsigned char **in, long len) {
  return (DH *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &DHparams_it);
}


x86 assembly (clang, -O0):
<d2i_DHparams>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2eb1(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_DHparams>:
mov    0x2ed1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@DHparams_it = global i32 0
define i32* @d2i_DHparams(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @DHparams_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@DHparams_it = global i32 0
define i32* @d2i_DHparams(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @DHparams_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
void disassemble() {}


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

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

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

LLVM IR (-O2):
define void @disassemble() {
ret void
}
/* Variables and functions */
int connectToIP(char const *);
char *grabDataWithURL(int, char *, char const *, size_t *);
char *captureSnapshot(const char *ip, size_t *len) {
  int sockfd = connectToIP(ip);
  if (sockfd >= 0) {
    return grabDataWithURL(
        sockfd, "/image?res=full&quality=20&x0=0&y0=0&x1=2048&y1=1536", ip,
        len);
  } else {
    return NULL;
  }
}


x86 assembly (clang, -O0):
<captureSnapshot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <connectToIP@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     1166 <captureSnapshot+0x46>
mov    -0x1c(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xea8(%rip),%rsi
call   1040 <grabDataWithURL@plt>
mov    %rax,-0x8(%rbp)
jmp    116e <captureSnapshot+0x4e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<captureSnapshot>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <connectToIP@plt>
test   %eax,%eax
js     114e <captureSnapshot+0x2e>
lea    0xec6(%rip),%rsi
mov    %eax,%edi
mov    %rbx,%rdx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <grabDataWithURL@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [53 x i8] c"/image?res=full&quality=20&x0=0&y0=0&x1=2048&y1=1536\00"
define i8* @captureSnapshot(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i32
store i8* %0, i8** %4
store i64* %1, i64** %5
%7 = load i8*, i8** %4
%8 = call i32 @connectToIP(i8* %7)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* %6
%13 = load i8*, i8** %4
%14 = load i64*, i64** %5
%15 = call i8* @grabDataWithURL(i32 %12, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %13, i64* %14)
store i8* %15, i8** %3
br label %17
16: ; preds = %2
store i8* null, i8** %3
br label %17
17: ; preds = %16, %11
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [53 x i8] c"/image?res=full&quality=20&x0=0&y0=0&x1=2048&y1=1536\00"
define i8* @captureSnapshot(i8* %0, i64* %1) {
%3 = tail call i32 @connectToIP(i8* %0)
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i8* @grabDataWithURL(i32 %3, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %0, i64* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ null, %2 ]
ret i8* %8
}
char chmin(char a, char b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<chmin>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jge    112c <chmin+0x2c>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <chmin+0x33>
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chmin>:
mov    %esi,%eax
cmp    %al,%dil
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define signext i8 @chmin(i8 signext %0, i8 signext %1) {
%3 = icmp slt i8 %0, %1
%4 = select i1 %3, i8 %0, i8 %1
ret i8 %4
}
/* Variables and functions */
bool test1() { return false; }


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

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

LLVM IR (-O0):
define i32 @test1() {
ret i32 0
}

LLVM IR (-O2):
define i32 @test1() {
ret i32 0
}
/* Type definitions */
typedef int int8_t;
typedef int /*<<< orphan*/ input;

/* Variables and functions */
int /*<<< orphan*/ test_rebase(int, int *, int, int /*<<< orphan*/, int *,
                               int /*<<< orphan*/);
void test_second_base_is_zero(void) {
  int8_t input[] = {7};
  int8_t expected[] = {0};
  test_rebase(10, input, (sizeof(input) / sizeof(input[0])), 0, expected, 0);
}


x86 assembly (clang, -O0):
<test_second_base_is_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%r8
mov    $0xa,%edi
mov    $0x1,%edx
xor    %r9d,%r9d
mov    %r9d,%ecx
call   1040 <test_rebase@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_second_base_is_zero>:
push   %rax
movl   $0x7,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%r8
mov    $0xa,%edi
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %r9d,%r9d
call   1030 <test_rebase@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.test_second_base_is_zero.input = [1 x i32] [i32 7]
define void @test_second_base_is_zero() {
%1 = alloca [1 x i32]
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %1 to i8*
%4 = bitcast [1 x i32]* %2 to i8*
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%7 = call i32 @test_rebase(i32 10, i32* %5, i32 1, i32 0, i32* %6, i32 0)
ret void
}

LLVM IR (-O2):
define void @test_second_base_is_zero() {
%1 = alloca [1 x i32]
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %1 to i8*
%4 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
store i32 7, i32* %4
%5 = bitcast [1 x i32]* %2 to i8*
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 0, i32* %6
%7 = call i32 @test_rebase(i32 10, i32* %4, i32 1, i32 0, i32* %6, i32 0)
ret void
}
int test_imm_06int16_mem(short *val) {
  return ((*val) & (-0x06 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_06int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xfffffffa,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_06int16_mem>:
movzwl (%rdi),%eax
test   $0xfffa,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_06int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -6
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned LZ4_64bits(void) { return sizeof(void *) == 8; }


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

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

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

LLVM IR (-O2):
define i32 @LZ4_64bits() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ C_HEAT_Control_Boiler();
int /*<<< orphan*/ C_HEAT_Get_Actual_Temperature();
int /*<<< orphan*/ C_HEAT_Get_Required_Temperature();
int /*<<< orphan*/ C_HEAT_Init();
void main(void) {
  C_HEAT_Init();
  while (1) {
    C_HEAT_Get_Required_Temperature();
    C_HEAT_Get_Actual_Temperature();
    C_HEAT_Control_Boiler();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <C_HEAT_Init@plt>
mov    $0x0,%al
call   1060 <C_HEAT_Get_Required_Temperature@plt>
mov    $0x0,%al
call   1050 <C_HEAT_Get_Actual_Temperature@plt>
mov    $0x0,%al
call   1040 <C_HEAT_Control_Boiler@plt>
jmp    114b <main+0xb>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <C_HEAT_Init@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <C_HEAT_Get_Required_Temperature@plt>
xor    %eax,%eax
call   1050 <C_HEAT_Get_Actual_Temperature@plt>
xor    %eax,%eax
call   1040 <C_HEAT_Control_Boiler@plt>
jmp    1150 <main+0x10>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @C_HEAT_Init()
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @C_HEAT_Get_Required_Temperature()
%4 = call i32 (...) @C_HEAT_Get_Actual_Temperature()
%5 = call i32 (...) @C_HEAT_Control_Boiler()
br label %2
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @C_HEAT_Init()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @C_HEAT_Get_Required_Temperature()
%4 = tail call i32 (...) @C_HEAT_Get_Actual_Temperature()
%5 = tail call i32 (...) @C_HEAT_Control_Boiler()
br label %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t djb_hash(char *p) {
  uint32_t h = 0;
  while (*p != 0) {
    h = 33 * h ^ (uint32_t)(*p);
    p++;
  };
  return h;
}


x86 assembly (clang, -O0):
<djb_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <djb_hash+0x40>
imul   $0x21,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <djb_hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<djb_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <djb_hash+0x28>
add    $0x1,%rdi
xor    %edx,%edx
mov    %edx,%eax
xchg   %ax,%ax
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1110 <djb_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @djb_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul nsw i32 %6, 33
%10 = xor i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
int s2e_is_symbolic(void *ptr) {
  int result;
  __s2e_touch_buffer(ptr, 1);
  __asm__ __volatile__(".byte 0x0f, 0x3f\n"
                       ".byte 0x00, 0x04, 0x00, 0x00\n"
                       ".byte 0x00, 0x00, 0x00, 0x00\n"
                       : "=a"(result)
                       : "a"(0), "c"(ptr));
  return result;
}


x86 assembly (clang, -O0):
<s2e_is_symbolic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <__s2e_touch_buffer@plt>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
(bad)
add    %al,(%rax,%rax,1)
add    %al,(%rax)
add    %al,(%rax)
add    %cl,0x458bf445(%rcx)
hlt
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2e_is_symbolic>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <__s2e_touch_buffer@plt>
xor    %eax,%eax
mov    %rbx,%rcx
(bad)
add    %al,(%rax,%rax,1)
add    %al,(%rax)
add    %al,(%rax)
add    %bl,-0x3d(%rbx)

LLVM IR (-O0):
define i32 @s2e_is_symbolic(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @__s2e_touch_buffer to i32 (i8*, i32, ...)*)(i8* %4, i32 1)
%6 = load i8*, i8** %2
%7 = call i32 asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0x04, 0x00, 0x00\0A.byte 0x00, 0x00, 0x00, 0x00\0A", "={ax},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i32 0, i8* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @s2e_is_symbolic(i8* %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @__s2e_touch_buffer to i32 (i8*, i32, ...)*)(i8* %0, i32 1)
%3 = tail call i32 asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0x04, 0x00, 0x00\0A.byte 0x00, 0x00, 0x00, 0x00\0A", "={ax},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i32 0, i8* %0)
ret i32 %3
}
int mvdu_vmode_for_in(int in) {
  switch (in) {
  case 1:
  case 2:
  case 6:
    return 0;
  default:
    return 1;
  }
}


x86 assembly (clang, -O0):
<mvdu_vmode_for_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffff,%eax
sub    $0x2,%eax
jb     112f <mvdu_vmode_for_in+0x2f>
jmp    111e <mvdu_vmode_for_in+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x6,%eax
jne    113b <mvdu_vmode_for_in+0x3b>
jmp    112f <mvdu_vmode_for_in+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1142 <mvdu_vmode_for_in+0x42>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mvdu_vmode_for_in>:
add    $0xffffffff,%edi
mov    $0x1,%eax
cmp    $0x5,%edi
ja     111a <mvdu_vmode_for_in+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.mvdu_vmode_for_in = [6 x i32] [i32 0, i32 0, i32 1, i32 1, i32 1, i32 0]
define i32 @mvdu_vmode_for_in(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 6
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.mvdu_vmode_for_in, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void __attribute__((unused)) write_stderr(const char *s) {
  write(2, s, strlen(s));
}


x86 assembly (clang, -O0):
<write_stderr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_stderr>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @write_stderr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x32_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x32_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x32_setup>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x32_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x32_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
int sqrCase(int a, int n) {
  if (n == 1) {
    return a;
  } else {
    a = sqrCase(a, n / 2) * sqrCase(a, n / 2);
  }
}


x86 assembly (clang, -O0):
<sqrCase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1133 <sqrCase+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116b <sqrCase+0x5b>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1030 <sqrCase@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1030 <sqrCase@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrCase>:
mov    %edi,%eax
cmp    $0x1,%esi
je     1121 <sqrCase+0x21>
mov    %esi,%ecx
nopl   0x0(%rax)
shr    $0x1f,%ecx
add    %esi,%ecx
sar    %ecx
and    $0xfffffffe,%esi
cmp    $0x2,%esi
mov    %ecx,%esi
jne    1110 <sqrCase+0x10>
ret

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

LLVM IR (-O2):
define i32 @sqrCase(i32 returned %0, i32 %1) {
%3 = icmp eq i32 %1, 1
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = sdiv i32 %5, 2
%7 = and i32 %5, -2
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret i32 %0
}
/* Variables and functions */
char *ls_xmemdup(char const *, scalar_t__);
scalar_t__ strlen(char const *);
__attribute__((unused)) char *ls_xstrdup(const char *s) {
  return ls_xmemdup(s, strlen(s) + 1);
}


x86 assembly (clang, -O0):
<ls_xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
call   1040 <ls_xmemdup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_xstrdup>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <ls_xmemdup@plt>

LLVM IR (-O0):
define i8* @ls_xstrdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @ls_xmemdup(i8* %3, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @ls_xstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @ls_xmemdup(i8* %0, i64 %3)
ret i8* %4
}
/* Variables and functions */
int Cyc_Tcutil_typecmp(void *, void *);
int Cyc_Unify_unify(void *, void *);
int Cyc_Evexp_unify_and_cmp(void *t1, void *t2) {
  int _T0;
  int _T1;
  _T0 = Cyc_Unify_unify(t1, t2);
  if (!_T0)
    goto _TLC6;
  return 0;
_TLC6:
  _T1 = Cyc_Tcutil_typecmp(t1, t2);
  return _T1;
}


x86 assembly (clang, -O0):
<Cyc_Evexp_unify_and_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <Cyc_Unify_unify@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    114f <Cyc_Evexp_unify_and_cmp+0x2f>
jmp    115b <Cyc_Evexp_unify_and_cmp+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    1171 <Cyc_Evexp_unify_and_cmp+0x51>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <Cyc_Tcutil_typecmp@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Evexp_unify_and_cmp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <Cyc_Unify_unify@plt>
test   %eax,%eax
je     113d <Cyc_Evexp_unify_and_cmp+0x1d>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <Cyc_Tcutil_typecmp@plt>

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

LLVM IR (-O2):
define i32 @Cyc_Evexp_unify_and_cmp(i8* %0, i8* %1) {
%3 = tail call i32 @Cyc_Unify_unify(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @Cyc_Tcutil_typecmp(i8* %0, i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ draw(int);
int /*<<< orphan*/ initN();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ write(int /*<<< orphan*/);
void test(int n) {
  printf("%d:\n", n);
  initN();
  draw(n);
  write(stdout);
  printf("\n\n");
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <initN@plt>
mov    -0x4(%rbp),%edi
call   1030 <draw@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1040 <write@plt>
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %edi,%ebx
lea    0xea6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   1070 <initN@plt>
mov    %ebx,%edi
call   1040 <draw@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <write@plt>
lea    0xe7d(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%d:\0A\00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"\0A\0A\00"
define void @test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @initN()
%6 = load i32, i32* %2
%7 = call i32 @draw(i32 %6)
%8 = load i32, i32* @stdout
%9 = call i32 @write(i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d:\0A\00"
@stdout = global i32 0
@str = [2 x i8] c"\0A\00"
define void @test(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (...) @initN()
%4 = tail call i32 @draw(i32 %0)
%5 = load i32, i32* @stdout
%6 = tail call i32 @write(i32 %5)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_bzero(void *, size_t);
scalar_t__ malloc(size_t);
void *ft_memalloc(size_t size) {
  void *memory;
  if (!(memory = (void *)malloc(size)))
    return (NULL);
  ft_bzero(memory, size);
  return (memory);
}


x86 assembly (clang, -O0):
<ft_memalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1150 <ft_memalloc+0x30>
movq   $0x0,-0x8(%rbp)
jmp    1165 <ft_memalloc+0x45>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <ft_bzero@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
test   %rax,%rax
je     1141 <ft_memalloc+0x21>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <ft_bzero@plt>
jmp    1143 <ft_memalloc+0x23>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @ft_memalloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = inttoptr i64 %2 to i8*
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @ft_bzero(i8* %3, i64 %0)
br label %7
7: ; preds = %1, %5
%8 = phi i8* [ %3, %5 ], [ null, %1 ]
ret i8* %8
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ gets(char *, int);
int geti() {
  char s[16];
  gets(s, 16);
  return atoi(s);
}


x86 assembly (clang, -O0):
<geti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
mov    $0x10,%esi
call   1030 <gets@plt>
lea    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geti>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1030 <gets@plt>
mov    %rbx,%rdi
call   1040 <atoi@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @geti() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2, i32 16)
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%5 = call i32 @atoi(i8* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @geti() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2, i32 16)
%4 = call i32 @atoi(i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ dxl_write_word(unsigned char, int, unsigned short);
void setGoalPosition(unsigned char id, unsigned short position) {
  dxl_write_word(id, (30), position);
}


x86 assembly (clang, -O0):
<setGoalPosition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%al
mov    $0x1e,%esi
movzbl %al,%edi
movzwl -0x4(%rbp),%edx
call   1030 <dxl_write_word@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setGoalPosition>:
mov    %esi,%edx
mov    $0x1e,%esi
jmp    1030 <dxl_write_word@plt>

LLVM IR (-O0):
define void @setGoalPosition(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
%6 = load i16, i16* %4
%7 = call i32 @dxl_write_word(i8 zeroext %5, i32 30, i16 zeroext %6)
ret void
}

LLVM IR (-O2):
define void @setGoalPosition(i8 zeroext %0, i16 zeroext %1) {
%3 = tail call i32 @dxl_write_word(i8 zeroext %0, i32 30, i16 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
void gen_swap(void) { output_line("exg d,x"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"exg d,x\00"
define void @gen_swap() {
%1 = call i32 @output_line(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"exg d,x\00"
define void @gen_swap() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
void CreateArray() {
  int x = sizeof(struct {});
  x = (x) + (sizeof(struct {}));
}


x86 assembly (clang, -O0):
<CreateArray>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movslq -0x4(%rbp),%rax
add    $0x0,%rax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @CreateArray() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = sext i32 %2 to i64
%4 = add i64 %3, 0
%5 = trunc i64 %4 to i32
store i32 %5, i32* %1
ret void
}

LLVM IR (-O2):
define void @CreateArray() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ACNtoLM(int, int, int);
int abs(int);
int ACN3DtoACN2D(int acn) {
  int l, m = 0;
  ACNtoLM(acn, l, m);
  if (l == abs(m)) {
    if (m < 0)
      return (2 * l - 1);
    else
      return 2 * l;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<ACN3DtoACN2D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <ACNtoLM@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jne    1184 <ACN3DtoACN2D+0x64>
cmpl   $0x0,-0x10(%rbp)
jge    1176 <ACN3DtoACN2D+0x56>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    118b <ACN3DtoACN2D+0x6b>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    118b <ACN3DtoACN2D+0x6b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ACN3DtoACN2D>:
push   %rax
xor    %edx,%edx
call   1030 <ACNtoLM@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ACN3DtoACN2D(i32 %0) {
%2 = tail call i32 @ACNtoLM(i32 %0, i32 undef, i32 0)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ test_from_str();
int /*<<< orphan*/ test_to_str();
int main(int argc, char **argv) {
  test_from_str();
  test_to_str();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_from_str()
%7 = call i32 (...) @test_to_str()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_from_str()
%4 = tail call i32 (...) @test_to_str()
ret i32 0
}
int func5(void) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @func5() {
ret i32 1
}