xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned char const,
                           unsigned char const, unsigned char const,
                           unsigned char const);
const char *n2ip(const unsigned char *c) {
  static char b[sizeof("255.255.255.255")];
  sprintf(b, "%u.%u.%u.%u", c[0], c[1], c[2], c[3]);
  return b;
}


x86 assembly (clang, -O0):
<n2ip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%dl
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%r8b
mov    -0x8(%rbp),%rax
lea    0x2f04(%rip),%rdi
lea    0xebd(%rip),%rsi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl %r8b,%r8d
movzbl 0x3(%rax),%r9d
call   1030 <sprintf@plt>
lea    0x2ee2(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n2ip>:
push   %rbx
movzbl (%rdi),%edx
movzbl 0x1(%rdi),%ecx
movzbl 0x2(%rdi),%r8d
movzbl 0x3(%rdi),%r9d
lea    0x2f17(%rip),%rbx
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@n2ip.b = internal global [16 x i8] zeroinitializer
@.str = [12 x i8] c"%u.%u.%u.%u\00"
define i8* @n2ip(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = load i8, i8* %10
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 3
%14 = load i8, i8* %13
%15 = call i32 @sprintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @n2ip.b, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 zeroext %5, i8 zeroext %8, i8 zeroext %11, i8 zeroext %14)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @n2ip.b, i64 0, i64 0)
}

LLVM IR (-O2):
@n2ip.b = internal global [16 x i8] zeroinitializer
@.str = [12 x i8] c"%u.%u.%u.%u\00"
define i8* @n2ip(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 3
%8 = load i8, i8* %7
%9 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @n2ip.b, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 zeroext %2, i8 zeroext %4, i8 zeroext %6, i8 zeroext %8)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @n2ip.b, i64 0, i64 0)
}
long core___core__Int___Object__hash(long self) {
  long var;
  var = self;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


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

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

LLVM IR (-O0):
define i64 @core___core__Int___Object__hash(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
store i64 %4, i64* %3
br label %5
5: ; preds = %1
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @core___core__Int___Object__hash(i64 returned %0) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void fild_preg32_dword(int reg32) {
  put8(0xDB);
  put8(reg32);
}


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

x86 assembly (clang, -O2):
<fild_preg32_dword>:
push   %rbx
mov    %edi,%ebx
mov    $0xdb,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @fild_preg32_dword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 219)
%4 = load i32, i32* %2
%5 = call i32 @put8(i32 %4)
ret void
}

LLVM IR (-O2):
define void @fild_preg32_dword(i32 %0) {
%2 = tail call i32 @put8(i32 219)
%3 = tail call i32 @put8(i32 %0)
ret void
}
void decode(p, fetch, size) struct h8_opcode *p;
int fetch;
int size;
{
  if (fetch) {
    lval(p);
  }
}


x86 assembly (clang, -O0):
<decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1137 <decode+0x27>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <lval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode>:
test   %esi,%esi
je     111b <decode+0xb>
xor    %eax,%eax
jmp    1030 <lval@plt>
ret

LLVM IR (-O0):
%struct.h8_opcode = type opaque
define void @decode(%struct.h8_opcode* %0, i32 %1, i32 %2) {
%4 = alloca %struct.h8_opcode*
%5 = alloca i32
%6 = alloca i32
store %struct.h8_opcode* %0, %struct.h8_opcode** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load %struct.h8_opcode*, %struct.h8_opcode** %4
%11 = call i32 (%struct.h8_opcode*, ...) bitcast (i32 (...)* @lval to i32 (%struct.h8_opcode*, ...)*)(%struct.h8_opcode* %10)
br label %12
12: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
%struct.h8_opcode = type opaque
define void @decode(%struct.h8_opcode* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 (%struct.h8_opcode*, ...) bitcast (i32 (...)* @lval to i32 (%struct.h8_opcode*, ...)*)(%struct.h8_opcode* %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
struct rb3_tree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rb3_get_root(struct rb3_tree *);
int /*<<< orphan*/ visit_inorder_helper(int /*<<< orphan*/, int /*<<< orphan*/);
void visit_inorder(struct rb3_tree *tree) {
  visit_inorder_helper(rb3_get_root(tree), 0);
  printf("\n");
}


x86 assembly (clang, -O0):
<visit_inorder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <rb3_get_root@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1050 <visit_inorder_helper@plt>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<visit_inorder>:
push   %rax
call   1040 <rb3_get_root@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1050 <visit_inorder_helper@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
%struct.rb3_tree = type { i32 }
@.str = [2 x i8] c"\0A\00"
define void @visit_inorder(%struct.rb3_tree* %0) {
%2 = alloca %struct.rb3_tree*
store %struct.rb3_tree* %0, %struct.rb3_tree** %2
%3 = load %struct.rb3_tree*, %struct.rb3_tree** %2
%4 = call i32 @rb3_get_root(%struct.rb3_tree* %3)
%5 = call i32 @visit_inorder_helper(i32 %4, i32 0)
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.rb3_tree = type { i32 }
define void @visit_inorder(%struct.rb3_tree* %0) {
%2 = tail call i32 @rb3_get_root(%struct.rb3_tree* %0)
%3 = tail call i32 @visit_inorder_helper(i32 %2, i32 0)
%4 = tail call i32 @putchar(i32 10)
ret void
}
int terminator_bits(const int version) {
  if (version < 100) {
    return 4;
  }
  if (version < 200) {
    return 3;
  }
  return 3 + (version - 200) * 2;
}


x86 assembly (clang, -O0):
<terminator_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    111d <terminator_bits+0x1d>
movl   $0x4,-0x4(%rbp)
jmp    1147 <terminator_bits+0x47>
cmpl   $0xc8,-0x8(%rbp)
jge    1136 <terminator_bits+0x36>
movl   $0x3,-0x4(%rbp)
jmp    1147 <terminator_bits+0x47>
mov    -0x8(%rbp),%eax
sub    $0xc8,%eax
shl    $0x1,%eax
add    $0x3,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminator_bits>:
mov    $0x4,%eax
cmp    $0x64,%edi
jl     111f <terminator_bits+0x1f>
mov    $0x3,%eax
cmp    $0xc8,%edi
jb     111f <terminator_bits+0x1f>
lea    (%rdi,%rdi,1),%eax
add    $0xfffffe73,%eax
ret

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

LLVM IR (-O2):
define i32 @terminator_bits(i32 %0) {
%2 = icmp slt i32 %0, 100
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 200
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = shl nuw i32 %0, 1
%7 = add i32 %6, -397
br label %8
8: ; preds = %3, %1, %5
%9 = phi i32 [ %7, %5 ], [ 4, %1 ], [ 3, %3 ]
ret i32 %9
}
void debug(void) {}


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

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

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

LLVM IR (-O2):
define void @debug() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t fib32(uint32_t lfsr) {
  uint32_t bit = ((lfsr >> 0) ^ (lfsr >> 1) ^ (lfsr >> 3) ^ (lfsr >> 31) ^ 1);
  return (lfsr >> 1) | (bit << 31);
}


x86 assembly (clang, -O0):
<fib32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x3,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x1f,%ecx
xor    %ecx,%eax
xor    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    -0x8(%rbp),%ecx
shl    $0x1f,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib32>:
mov    %edi,%ecx
sar    %ecx
mov    %edi,%eax
shr    $0x3,%eax
mov    %ecx,%edx
xor    %edi,%edx
shr    $0x1f,%edi
xor    %edi,%eax
xor    %edx,%eax
not    %eax
shl    $0x1f,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fib32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 0
%6 = load i32, i32* %2
%7 = ashr i32 %6, 1
%8 = xor i32 %5, %7
%9 = load i32, i32* %2
%10 = ashr i32 %9, 3
%11 = xor i32 %8, %10
%12 = load i32, i32* %2
%13 = ashr i32 %12, 31
%14 = xor i32 %11, %13
%15 = xor i32 %14, 1
store i32 %15, i32* %3
%16 = load i32, i32* %2
%17 = ashr i32 %16, 1
%18 = load i32, i32* %3
%19 = shl i32 %18, 31
%20 = or i32 %17, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @fib32(i32 %0) {
%2 = ashr i32 %0, 1
%3 = lshr i32 %0, 3
%4 = lshr i32 %0, 31
%5 = xor i32 %2, %0
%6 = xor i32 %5, %3
%7 = xor i32 %6, %4
%8 = xor i32 %7, -1
%9 = shl i32 %8, 31
%10 = or i32 %9, %2
ret i32 %10
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int refine_root(int n, int *m, double *c) {
  int *a, fail;
  int b[2];
  b[0] = n;
  b[1] = *m;
  fail = _ada_use_c2phc(149, a, b, c);
  *m = b[1];
  return fail;
}


x86 assembly (clang, -O0):
<refine_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%rsi
lea    -0x2c(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x95,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x24(%rbp)
mov    -0x28(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<refine_root>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rcx
mov    %rsi,%rbx
mov    %edi,0x8(%rsp)
mov    (%rsi),%eax
mov    %eax,0xc(%rsp)
lea    0x8(%rsp),%rdx
mov    $0x95,%edi
call   1030 <_ada_use_c2phc@plt>
mov    0xc(%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @refine_root(i32 %0, i32* %1, double* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca double*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca [2 x i32]
store i32 %0, i32* %4
store i32* %1, i32** %5
store double* %2, double** %6
%10 = load i32, i32* %4
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
store i32 %10, i32* %11
%12 = load i32*, i32** %5
%13 = load i32, i32* %12
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
store i32 %13, i32* %14
%15 = load i32*, i32** %7
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%17 = load double*, double** %6
%18 = call i32 @_ada_use_c2phc(i32 149, i32* %15, i32* %16, double* %17)
store i32 %18, i32* %8
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%20 = load i32, i32* %19
%21 = load i32*, i32** %5
store i32 %20, i32* %21
%22 = load i32, i32* %8
ret i32 %22
}

LLVM IR (-O2):
define i32 @refine_root(i32 %0, i32* nocapture %1, double* %2) {
%4 = alloca [2 x i32]
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 %0, i32* %6
%7 = load i32, i32* %1
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 %7, i32* %8
%9 = call i32 @_ada_use_c2phc(i32 149, i32* undef, i32* %6, double* %2)
%10 = load i32, i32* %8
store i32 %10, i32* %1
ret i32 %9
}
int test_imm_0Dint16_mem(short *val) {
  return ((*val) & (-0x0D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_0Dint16_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, -13
%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_0Dint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -13
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int partition(int *, int, int);
void randomized_quick_sort(int data[], int p, int r) {
  if (p < r) {
    int q = partition(data, p, r);
    randomized_quick_sort(data, p, q - 1);
    randomized_quick_sort(data, q + 1, r);
  }
}


x86 assembly (clang, -O0):
<randomized_quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <randomized_quick_sort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <randomized_quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <randomized_quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomized_quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <randomized_quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <randomized_quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <randomized_quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @randomized_quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @randomized_quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
long pentium_cyclecount(void) {
  long count;
  __asm__ volatile("rdtsc" : "=A"(count));
  return (count);
}


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

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

LLVM IR (-O0):
define i64 @pentium_cyclecount() {
%1 = alloca i64
%2 = call i64 asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @pentium_cyclecount() {
%1 = tail call i64 asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_BROADCAST;
int __sapi_sock_set_optint(int, int /*<<< orphan*/, int /*<<< orphan*/);
int sapi_sock_set_broadcast(int sock) {
  return __sapi_sock_set_optint(sock, SOL_SOCKET, SO_BROADCAST);
}


x86 assembly (clang, -O0):
<sapi_sock_set_broadcast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
call   1030 <__sapi_sock_set_optint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sapi_sock_set_broadcast>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
mov    0x2ec0(%rip),%rax
mov    (%rax),%edx
jmp    1030 <__sapi_sock_set_optint@plt>

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
define i32 @sapi_sock_set_broadcast(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_BROADCAST
%6 = call i32 @__sapi_sock_set_optint(i32 %3, i32 %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
define i32 @sapi_sock_set_broadcast(i32 %0) {
%2 = load i32, i32* @SOL_SOCKET
%3 = load i32, i32* @SO_BROADCAST
%4 = tail call i32 @__sapi_sock_set_optint(i32 %0, i32 %2, i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ version;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int, int /*<<< orphan*/);
const char *ulib_version() {
  static char version[256] = {0};
  snprintf(version, sizeof(version),
           "ULIB %d.%d\n"
           "Copyright (C) 2009-2012 Zilong Tan (eric.zltan@gmail.com)\n",
           2, 0);
  return version;
}


x86 assembly (clang, -O0):
<ulib_version>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
mov    $0x100,%esi
lea    0xed9(%rip),%rdx
mov    $0x2,%ecx
xor    %r8d,%r8d
call   1030 <snprintf@plt>
lea    0x2f05(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ulib_version>:
push   %rbx
lea    0x2f28(%rip),%rbx
lea    0xee1(%rip),%rdx
mov    %rbx,%rdi
mov    $0x100,%esi
mov    $0x2,%ecx
xor    %r8d,%r8d
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ulib_version.version = internal global [256 x i8] zeroinitializer
@.str = [70 x i8] c"ULIB %d.%d\0ACopyright (C) 2009-2012 Zilong Tan (eric.zltan@gmail.com)\0A\00"
define i8* @ulib_version() {
%1 = call i32 @snprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @ulib_version.version, i64 0, i64 0), i32 256, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i32 2, i32 0)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @ulib_version.version, i64 0, i64 0)
}

LLVM IR (-O2):
@ulib_version.version = internal global [256 x i8] zeroinitializer
@.str = [70 x i8] c"ULIB %d.%d\0ACopyright (C) 2009-2012 Zilong Tan (eric.zltan@gmail.com)\0A\00"
define i8* @ulib_version() {
%1 = tail call i32 @snprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @ulib_version.version, i64 0, i64 0), i32 256, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i32 2, i32 0)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @ulib_version.version, i64 0, i64 0)
}
/* Variables and functions */
float i2f(int);
float vect_ldexpf(float x, int n) {
  n = (n + 0x7f) << 23;
  return x * i2f(n);
}


x86 assembly (clang, -O0):
<vect_ldexpf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x7f,%eax
shl    $0x17,%eax
mov    %eax,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <i2f@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vect_ldexpf>:
push   %rax
movss  %xmm0,0x4(%rsp)
shl    $0x17,%edi
add    $0x3f800000,%edi
call   1030 <i2f@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @vect_ldexpf(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 127
%7 = shl i32 %6, 23
store i32 %7, i32* %4
%8 = load float, float* %3
%9 = load i32, i32* %4
%10 = call float @i2f(i32 %9)
%11 = fmul float %8, %10
ret float %11
}

LLVM IR (-O2):
define float @vect_ldexpf(float %0, i32 %1) {
%3 = shl i32 %1, 23
%4 = add i32 %3, 1065353216
%5 = tail call float @i2f(i32 %4)
%6 = fmul float %5, %0
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
void stub1();
int main(void) {
  char *shellcode = "\x31\xf6\x48\xbb\x2f\x62\x69\x6e\x2f\x2f\x73\x68\x56\x53"
                    "\x54\x5f\x6a\x3b\x58\x31\xd2\x0f\x05";
  printf("strlen(shellcode)=%d\n", strlen(shellcode));
  ((void (*)(void))shellcode)();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
call   *-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <strlen@plt>
lea    0xee4(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
call   2000 <_fini+0xebc>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"1\F6H\BB/bin//shVST_j;X1\D2\0F\05\00"
@.str.1 = [22 x i8] c"strlen(shellcode)=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to void ()*
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"1\F6H\BB/bin//shVST_j;X1\D2\0F\05\00"
@.str.1 = [22 x i8] c"strlen(shellcode)=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %1)
tail call void bitcast ([24 x i8]* @.str to void ()*)()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char, int);
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void match(FILE *in, char expected) {
  int c = getc(in);
  if (expected != c) {
    fprintf(stderr, "[!] Expected '%c', got '%c'\n", expected, c);
    exit(2);
  }
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <getc@plt>
mov    %eax,-0x10(%rbp)
movsbl -0x9(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     1183 <match+0x53>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    -0x9(%rbp),%al
mov    -0x10(%rbp),%ecx
lea    0xe8f(%rip),%rsi
movsbl %al,%edx
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
push   %rbx
mov    %esi,%ebx
call   1050 <getc@plt>
cmp    %ebx,%eax
jne    113e <match+0xe>
pop    %rbx
ret
mov    0x2e9b(%rip),%rcx
mov    (%rcx),%edi
movsbl %bl,%edx
lea    0xeaf(%rip),%rsi
mov    %eax,%ecx
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"[!] Expected '%c', got '%c'\0A\00"
define void @match(i32* %0, i8 signext %1) {
%3 = alloca i32*
%4 = alloca i8
%5 = alloca i32
store i32* %0, i32** %3
store i8 %1, i8* %4
%6 = load i32*, i32** %3
%7 = call i32 @getc(i32* %6)
store i32 %7, i32* %5
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = load i32, i32* %5
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = load i8, i8* %4
%15 = load i32, i32* %5
%16 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8 signext %14, i32 %15)
%17 = call i32 @exit(i32 2)
unreachable
18: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"[!] Expected '%c', got '%c'\0A\00"
define void @match(i32* nocapture %0, i8 signext %1) {
%3 = tail call i32 @getc(i32* %0)
%4 = sext i8 %1 to i32
%5 = icmp eq i32 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8 signext %1, i32 %3)
%9 = tail call i32 @exit(i32 2)
unreachable
10: ; preds = %2
ret void
}
int main(void) {
  int a[] = {0};
  return a[0];
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [1 x i32]
store i32 0, i32* %1
%3 = bitcast [1 x i32]* %2 to i8*
%4 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%5 = load i32, i32* %4
ret i32 %5
}

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

/* Variables and functions */
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
void Ungetc(int c, FILE *f, int *linep) {
  if (c == '\n')
    --(*linep);
  ungetc(c, f);
}


x86 assembly (clang, -O0):
<Ungetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    1138 <Ungetc+0x28>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <ungetc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ungetc>:
cmp    $0xa,%edi
jne    1118 <Ungetc+0x8>
addl   $0xffffffff,(%rdx)
jmp    1030 <ungetc@plt>

LLVM IR (-O0):
define void @Ungetc(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* %4
%8 = icmp eq i32 %7, 10
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = add nsw i32 %11, -1
store i32 %12, i32* %10
br label %13
13: ; preds = %9, %3
%14 = load i32, i32* %4
%15 = load i32*, i32** %5
%16 = call i32 @ungetc(i32 %14, i32* %15)
ret void
}

LLVM IR (-O2):
define void @Ungetc(i32 %0, i32* nocapture %1, i32* nocapture %2) {
%4 = icmp eq i32 %0, 10
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = load i32, i32* %2
%7 = add nsw i32 %6, -1
store i32 %7, i32* %2
br label %8
8: ; preds = %5, %3
%9 = tail call i32 @ungetc(i32 %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy_e(char *, char const *);
char *strcpy(char *dest, const char *src) {
  strcpy_e(dest, src);
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
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 <strcpy_e@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strcpy_e@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned %0, i8* %1) {
%3 = tail call i32 @strcpy_e(i8* %0, i8* %1)
ret i8* %0
}
/* Variables and functions */
int EOF;
int getchar();
void cleaninput() {
  int c;
  while ((c = getchar()) != '\n' && c != EOF)
    ;
}


x86 assembly (clang, -O0):
<cleaninput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x5(%rbp)
je     1144 <cleaninput+0x34>
mov    -0x4(%rbp),%eax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1154 <cleaninput+0x44>
jmp    1159 <cleaninput+0x49>
jmp    1118 <cleaninput+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleaninput>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1130 <cleaninput+0x20>
cmp    (%rbx),%eax
jne    1120 <cleaninput+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @cleaninput() {
%1 = alloca i32
br label %2
2: ; preds = %11, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* %1
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br label %9
9: ; preds = %5, %2
%10 = phi i1 [ false, %2 ], [ %8, %5 ]
br i1 %10, label %11, label %12
11: ; preds = %9
br label %2
12: ; preds = %9
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @cleaninput() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = icmp ne i32 %2, 10
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %2, %4
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %1, label %7
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ executeApplescript(char *, char *);
void startiTunes() { executeApplescript("iTunes", "activate"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"iTunes\00"
@.str.1 = [9 x i8] c"activate\00"
define void @startiTunes() {
%1 = call i32 @executeApplescript(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"iTunes\00"
@.str.1 = [9 x i8] c"activate\00"
define void @startiTunes() {
%1 = tail call i32 @executeApplescript(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct evm_instance {
  int dummy;
};

/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int evm_set_option(struct evm_instance *evm, char const *name,
                   char const *value) {
  if (strcmp(name, "example-option") == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<evm_set_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    114a <evm_set_option+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <evm_set_option+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evm_set_option>:
push   %rax
mov    %rsi,%rdi
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.evm_instance = type { i32 }
@.str = [15 x i8] c"example-option\00"
define i32 @evm_set_option(%struct.evm_instance* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.evm_instance*
%6 = alloca i8*
%7 = alloca i8*
store %struct.evm_instance* %0, %struct.evm_instance** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = load i8*, i8** %6
%9 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 1, i32* %4
br label %13
12: ; preds = %3
store i32 0, i32* %4
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
%struct.evm_instance = type { i32 }
@.str = [15 x i8] c"example-option\00"
define i32 @evm_set_option(%struct.evm_instance* nocapture readnone %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xe0() {
  Assert_real((isbdigit(224) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              1125, ("isbdigit should be 0 for 0xe0"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xe0>:
push   %rax
mov    $0xe0,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x465,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xe0\00"
define void @t_isbdigit_0xe0() {
%1 = call i64 @isbdigit(i32 224)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1125, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xe0\00"
define void @t_isbdigit_0xe0() {
%1 = tail call i64 @isbdigit(i32 224)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1125, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t pcr_delta_u(const uint64_t a, const uint64_t b) {
  return a < b ? a + (0x200000000LL * 300LL) - b : a - b;
}


x86 assembly (clang, -O0):
<pcr_delta_u>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1135 <pcr_delta_u+0x35>
movabs $0x25800000000,%rax
add    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1141 <pcr_delta_u+0x41>
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcr_delta_u>:
movabs $0x25800000000,%rax
add    %rdi,%rax
cmp    %rsi,%rdi
cmovge %rdi,%rax
sub    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @pcr_delta_u(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i64, i64* %3
%10 = add nsw i64 %9, 2576980377600
%11 = load i64, i64* %4
%12 = sub nsw i64 %10, %11
br label %17
13: ; preds = %2
%14 = load i64, i64* %3
%15 = load i64, i64* %4
%16 = sub nsw i64 %14, %15
br label %17
17: ; preds = %13, %8
%18 = phi i64 [ %12, %8 ], [ %16, %13 ]
ret i64 %18
}

LLVM IR (-O2):
define i64 @pcr_delta_u(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = add nsw i64 %0, 2576980377600
%5 = select i1 %3, i64 %4, i64 %0
%6 = sub nsw i64 %5, %1
ret i64 %6
}
main() {
  struct {
    int a : 16;
    int b : 19;
    int c;
  } s;
  memset(&s, 0, sizeof s);
  s.a = 2;
  s.b = 3;
  s.c = 4;
  if (sizeof(s) != 3 * sizeof(int))
    return 4;
  if (0 [(int *)&s] != 2)
    return 1;
  if (1 [(int *)&s] != 3)
    return 2;
  if (2 [(int *)&s] != 4)
    return 3;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1030 <memset@plt>
movw   $0x2,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0xfff80000,%eax
or     $0x3,%eax
mov    %eax,-0xc(%rbp)
movl   $0x4,-0x8(%rbp)
cmpl   $0x2,-0x10(%rbp)
je     1160 <main+0x50>
movl   $0x1,-0x4(%rbp)
jmp    1193 <main+0x83>
cmpl   $0x3,-0xc(%rbp)
je     1176 <main+0x66>
movl   $0x2,-0x4(%rbp)
jmp    1193 <main+0x83>
cmpl   $0x4,-0x8(%rbp)
je     118c <main+0x7c>
movl   $0x3,-0x4(%rbp)
jmp    1193 <main+0x83>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i16, i24, i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.anon
store i32 0, i32* %1
%3 = bitcast %struct.anon* %2 to i8*
%4 = bitcast %struct.anon* %2 to i16*
store i16 2, i16* %4
%5 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
%6 = bitcast i24* %5 to i32*
%7 = load i32, i32* %6
%8 = and i32 %7, -524288
%9 = or i32 %8, 3
store i32 %9, i32* %6
%10 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 2
store i32 4, i32* %10
%11 = bitcast %struct.anon* %2 to i32*
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = icmp ne i32 %13, 2
br i1 %14, label %15, label %16
15: ; preds = %0
store i32 1, i32* %1
br label %29
16: ; preds = %0
%17 = bitcast %struct.anon* %2 to i32*
%18 = getelementptr inbounds i32, i32* %17, i64 1
%19 = load i32, i32* %18
%20 = icmp ne i32 %19, 3
br i1 %20, label %21, label %22
21: ; preds = %16
store i32 2, i32* %1
br label %29
22: ; preds = %16
%23 = bitcast %struct.anon* %2 to i32*
%24 = getelementptr inbounds i32, i32* %23, i64 2
%25 = load i32, i32* %24
%26 = icmp ne i32 %25, 4
br i1 %26, label %27, label %28
27: ; preds = %22
store i32 3, i32* %1
br label %29
28: ; preds = %22
store i32 0, i32* %1
br label %29
29: ; preds = %28, %27, %21, %15
%30 = load i32, i32* %1
ret i32 %30
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int quaddobl_deflate(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(250, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<quaddobl_deflate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xfa,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quaddobl_deflate>:
mov    $0xfa,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @quaddobl_deflate() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 250, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @quaddobl_deflate() {
%1 = tail call i32 @_ada_use_c2phc(i32 250, i32* undef, i32* undef, double* undef)
ret i32 %1
}
char memb_ref(struct memb_blocks *m, char *ptr) { return ++*(ptr - 1); }


x86 assembly (clang, -O0):
<memb_ref>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x1(%rcx),%al
add    $0x1,%al
mov    %al,-0x1(%rcx)
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memb_ref>:
mov    -0x1(%rsi),%al
add    $0x1,%al
mov    %al,-0x1(%rsi)
ret

LLVM IR (-O0):
%struct.memb_blocks = type opaque
define signext i8 @memb_ref(%struct.memb_blocks* %0, i8* %1) {
%3 = alloca %struct.memb_blocks*
%4 = alloca i8*
store %struct.memb_blocks* %0, %struct.memb_blocks** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 -1
%7 = load i8, i8* %6
%8 = add i8 %7, 1
store i8 %8, i8* %6
ret i8 %8
}

LLVM IR (-O2):
%struct.memb_blocks = type opaque
define signext i8 @memb_ref(%struct.memb_blocks* nocapture readnone %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 -1
%4 = load i8, i8* %3
%5 = add i8 %4, 1
store i8 %5, i8* %3
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ remove_me();
int main(void) {
  int a, b;
  int N = 100;
  a = 0;
  b = 0;
  while (a < N) {
    if (b >= 5 * N - 4)
      remove_me();
    a++;
    b += 5;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1170 <main+0x60>
mov    -0xc(%rbp),%eax
imul   $0x5,-0x10(%rbp),%ecx
sub    $0x4,%ecx
cmp    %ecx,%eax
jl     1159 <main+0x49>
mov    $0x0,%al
call   1030 <remove_me@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <main+0x24>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int ipkg_op(int, char **);
int main(int argc, char *argv[]) { return ipkg_op(argc, argv); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <ipkg_op@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <ipkg_op@plt>

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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @ipkg_op(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @ipkg_op(i32 %0, i8** %1)
ret i32 %3
}
int test_imm_4Auint8_mem(unsigned char *val) {
  return ((*val) & (-0x4A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_4Auint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -74
%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_4Auint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -74
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double pathcon_nm9_twice(double x) { return x + x; }


x86 assembly (clang, -O0):
<pathcon_nm9_twice>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathcon_nm9_twice>:
addsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @pathcon_nm9_twice(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fadd double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @pathcon_nm9_twice(double %0) {
%2 = fadd double %0, %0
ret double %2
}
const char *BitVector_Version(void) { return ("6.4"); }


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

x86 assembly (clang, -O2):
<BitVector_Version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"6.4\00"
define i8* @BitVector_Version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"6.4\00"
define i8* @BitVector_Version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
int func(void) {
  int n = 3;
  int m = 5;
  n << m;
  return 0;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @func() {
%1 = alloca i32
%2 = alloca i32
store i32 3, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = shl i32 %3, %4
ret i32 0
}

LLVM IR (-O2):
define i32 @func() {
ret i32 0
}