xunge/DecIR huggingface dataset:
int x_noop(c)
int c;
{ return 0; }


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

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

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

LLVM IR (-O2):
define i32 @x_noop(i32 %0) {
ret i32 0
}
unsigned char saturate(signed short val) {
  if (val > 255)
    return 255;
  else if (val < 0)
    return 0;
  else
    return val;
}


x86 assembly (clang, -O0):
<saturate>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movswl -0x4(%rbp),%eax
cmp    $0xff,%eax
jle    1123 <saturate+0x23>
movb   $0xff,-0x1(%rbp)
jmp    1140 <saturate+0x40>
movswl -0x4(%rbp),%eax
cmp    $0x0,%eax
jge    1139 <saturate+0x39>
movb   $0x0,-0x1(%rbp)
jmp    1140 <saturate+0x40>
mov    -0x4(%rbp),%ax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<saturate>:
xor    %ecx,%ecx
test   %di,%di
cmovns %edi,%ecx
movzwl %cx,%eax
cmp    $0xff,%eax
mov    $0xff,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @saturate(i16 signext %0) {
%2 = icmp sgt i16 %0, 0
%3 = select i1 %2, i16 %0, i16 0
%4 = icmp ult i16 %3, 255
%5 = select i1 %4, i16 %3, i16 255
%6 = trunc i16 %5 to i8
ret i8 %6
}
/* Variables and functions */
int rand();
int get_rand_data_length(void) {
  int max_mask = (1 << ((rand() % (20 - 8)) + 8)) - 1;
  return rand() & max_mask;
}


x86 assembly (clang, -O0):
<get_rand_data_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xc,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
add    $0x8,%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rand_data_length>:
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rcx
imul   $0x2aaaaaab,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x21,%rax
add    %edx,%eax
shl    $0x2,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%ecx
add    $0x8,%cl
mov    $0xffffffff,%ebx
shl    %cl,%ebx
not    %ebx
xor    %eax,%eax
call   1030 <rand@plt>
and    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_rand_data_length() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 12
%4 = add nsw i32 %3, 8
%5 = shl i32 1, %4
%6 = sub nsw i32 %5, 1
store i32 %6, i32* %1
%7 = call i32 (...) @rand()
%8 = load i32, i32* %1
%9 = and i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @get_rand_data_length() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 12
%3 = add nsw i32 %2, 8
%4 = shl nsw i32 -1, %3
%5 = xor i32 %4, -1
%6 = tail call i32 (...) @rand()
%7 = and i32 %6, %5
ret i32 %7
}
void test10(void) {
  __asm__("int3");
  __builtin_unreachable();
}


x86 assembly (clang, -O0):
<test10>:
push   %rbp
mov    %rsp,%rbp
int3

x86 assembly (clang, -O2):
<test10>:
int3

LLVM IR (-O0):
define void @test10() {
unreachable
}

LLVM IR (-O2):
define void @test10() {
tail call void asm sideeffect "int3", "~{dirflag},~{fpsr},~{flags}"()
unreachable
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int is_userspace(uint64_t ip) { return ip < 0xffffffff80000000; }


x86 assembly (clang, -O0):
<is_userspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
cmp    $0xffffffff80000000,%rax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_userspace>:
mov    %edi,%eax
not    %eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @is_userspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = icmp ult i64 %4, -2147483648
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_userspace(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
ret i32 %3
}
int get_motors_speed() { return 111; }


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

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

LLVM IR (-O0):
define i32 @get_motors_speed() {
ret i32 111
}

LLVM IR (-O2):
define i32 @get_motors_speed() {
ret i32 111
}
/* Variables and functions */
int XCurses_get_rows();
int PDC_get_rows() { return (XCurses_get_rows()); }


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

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

LLVM IR (-O0):
define i32 @PDC_get_rows() {
%1 = call i32 (...) @XCurses_get_rows()
ret i32 %1
}

LLVM IR (-O2):
define i32 @PDC_get_rows() {
%1 = tail call i32 (...) @XCurses_get_rows()
ret i32 %1
}
void _unlock(unsigned int *lock) {
  __asm__ __volatile__("" ::: "memory");
  *lock = 0;
}


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

x86 assembly (clang, -O2):
<_unlock>:
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @_unlock(i32* nocapture writeonly %0) {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
store i32 0, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int scanf(char *, int *);
int /*<<< orphan*/ stderr;
void checkInput(int *A) {
  if ((scanf("%d", A)) != 1) {
    fprintf(stderr, "Wrong input values!");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<checkInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     1178 <checkInput+0x48>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkInput>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1147 <checkInput+0x17>
pop    %rax
ret
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@stderr = global i32 0
@.str.1 = [20 x i8] c"Wrong input values!\00"
@EXIT_FAILURE = global i32 0
define void @checkInput(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@stderr = global i32 0
@.str.1 = [20 x i8] c"Wrong input values!\00"
@EXIT_FAILURE = global i32 0
define void @checkInput(i32* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}
void g1(int x[]) {
  int i;
  for (i = 0; i <= 2; i++) {
    x[i] = i;
  }
}


x86 assembly (clang, -O0):
<g1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jg     1135 <g1+0x35>
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <g1+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<g1>:
movabs $0x100000000,%rax
mov    %rax,(%rdi)
movl   $0x2,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @g1(i32* nocapture writeonly %0) {
store i32 0, i32* %0
%2 = getelementptr inbounds i32, i32* %0, i64 1
store i32 1, i32* %2
%3 = getelementptr inbounds i32, i32* %0, i64 2
store i32 2, i32* %3
ret void
}
int CachedWireContinuation_cache_cmp(unsigned *k0,
                                     struct CachedWireContinuation *wcont0,
                                     unsigned *k1,
                                     struct CachedWireContinuation *wcont1) {
  return *k0 == *k1;
}


x86 assembly (clang, -O0):
<CachedWireContinuation_cache_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CachedWireContinuation_cache_cmp>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rdx),%ecx
sete   %al
ret

LLVM IR (-O0):
%struct.CachedWireContinuation = type opaque
define i32 @CachedWireContinuation_cache_cmp(i32* %0, %struct.CachedWireContinuation* %1, i32* %2, %struct.CachedWireContinuation* %3) {
%5 = alloca i32*
%6 = alloca %struct.CachedWireContinuation*
%7 = alloca i32*
%8 = alloca %struct.CachedWireContinuation*
store i32* %0, i32** %5
store %struct.CachedWireContinuation* %1, %struct.CachedWireContinuation** %6
store i32* %2, i32** %7
store %struct.CachedWireContinuation* %3, %struct.CachedWireContinuation** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i32*, i32** %7
%12 = load i32, i32* %11
%13 = icmp eq i32 %10, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
%struct.CachedWireContinuation = type opaque
define i32 @CachedWireContinuation_cache_cmp(i32* nocapture %0, %struct.CachedWireContinuation* nocapture readnone %1, i32* nocapture %2, %struct.CachedWireContinuation* nocapture readnone %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %2
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ put8(unsigned char);
void xor_al_imm8(unsigned char imm8) {
  put8(0x34);
  put8(imm8);
}


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

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

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

LLVM IR (-O2):
define void @xor_al_imm8(i8 zeroext %0) {
%2 = tail call i32 @put8(i8 zeroext 52)
%3 = tail call i32 @put8(i8 zeroext %0)
ret void
}
long long llabs(long long x) { return x >= 0 ? x : -x; }


x86 assembly (clang, -O0):
<llabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jl     1120 <llabs+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <llabs+0x2a>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @llabs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sge i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i64, i64* %2
br label %10
7: ; preds = %1
%8 = load i64, i64* %2
%9 = sub nsw i64 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i64 [ %6, %5 ], [ %9, %7 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @llabs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void fill_random(int *array, int length) {
  int i;
  srand(time(NULL));
  for (i = 0; i < length; i++) {
    array[i] = rand();
  }
}


x86 assembly (clang, -O0):
<fill_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1184 <fill_random+0x54>
mov    $0x0,%al
call   1050 <rand@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1156 <fill_random+0x26>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_random>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
test   %ebp,%ebp
jle    1164 <fill_random+0x34>
mov    %ebp,%ebp
xor    %ebx,%ebx
nop
xor    %eax,%eax
call   1050 <rand@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1150 <fill_random+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @fill_random(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %14
6: ; preds = %2
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %12, %8 ]
%10 = tail call i32 (...) @rand()
%11 = getelementptr inbounds i32, i32* %0, i64 %9
store i32 %10, i32* %11
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %7
br i1 %13, label %14, label %8
14: ; preds = %8, %2
ret void
}
int execute_msgget() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_msgget() {
ret i32 0
}
int division(int x, int y) {
  int res = 0;
  while (x > y) {
    x -= y;
    ++res;
  }
  return res;
}


x86 assembly (clang, -O0):
<division>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1136 <division+0x36>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <division+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<division>:
xor    %eax,%eax
cmp    %esi,%edi
jle    1119 <division+0x19>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
sub    %esi,%edi
add    $0x1,%eax
cmp    %esi,%edi
jg     1110 <division+0x10>
ret

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

LLVM IR (-O2):
define i32 @division(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ 0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = sub nsw i32 %6, %1
%8 = add nuw nsw i32 %5, 1
%9 = icmp sgt i32 %7, %1
br i1 %9, label %4, label %10
10: ; preds = %4, %2
%11 = phi i32 [ 0, %2 ], [ %8, %4 ]
ret i32 %11
}
int lsm_proc_mount(struct lxc_conf *lxc_conf) { return 0; }


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

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

LLVM IR (-O0):
%struct.lxc_conf = type opaque
define i32 @lsm_proc_mount(%struct.lxc_conf* %0) {
%2 = alloca %struct.lxc_conf*
store %struct.lxc_conf* %0, %struct.lxc_conf** %2
ret i32 0
}

LLVM IR (-O2):
%struct.lxc_conf = type opaque
define i32 @lsm_proc_mount(%struct.lxc_conf* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
unsigned int get_urandom();
double get_urandomu(void) {
  unsigned u = get_urandom();
  double numer = (double)u;
  double denom = 4294967296.0;
  return (double)(numer / denom);
}


x86 assembly (clang, -O0):
<get_urandomu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
call   1030 <get_urandom@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_urandomu>:
push   %rax
xor    %eax,%eax
call   1030 <get_urandom@plt>
mov    %eax,%eax
cvtsi2sd %rax,%xmm0
mulsd  0xed9(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @get_urandomu() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = call i32 (...) @get_urandom()
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = uitofp i32 %5 to double
store double %6, double* %2
store double 0x41F0000000000000, double* %3
%7 = load double, double* %2
%8 = load double, double* %3
%9 = fdiv double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @get_urandomu() {
%1 = tail call i32 (...) @get_urandom()
%2 = uitofp i32 %1 to double
%3 = fmul double %2, 0x3DF0000000000000
ret double %3
}
unsigned int RGBtoYUV_32(unsigned int c) {
  register unsigned char r, g, b;
  b = c & 0x0000FF;
  g = (c & 0x00FF00) >> 8;
  r = c >> 16;
  return ((r + g + b) << 14) + ((r - b + 512) << 4) + ((2 * g - r - b) >> 3) +
         128;
}


x86 assembly (clang, -O0):
<RGBtoYUV_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x7(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
shr    $0x8,%eax
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
movzbl -0x6(%rbp),%ecx
add    %ecx,%eax
movzbl -0x7(%rbp),%ecx
add    %ecx,%eax
shl    $0xe,%eax
movzbl -0x5(%rbp),%ecx
movzbl -0x7(%rbp),%edx
sub    %edx,%ecx
add    $0x200,%ecx
shl    $0x4,%ecx
add    %ecx,%eax
movzbl -0x6(%rbp),%ecx
shl    $0x1,%ecx
movzbl -0x5(%rbp),%edx
sub    %edx,%ecx
movzbl -0x7(%rbp),%edx
sub    %edx,%ecx
sar    $0x3,%ecx
add    %ecx,%eax
add    $0x80,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RGBtoYUV_32>:
mov    %edi,%ecx
movzbl %ch,%eax
movzbl %cl,%edx
shr    $0x10,%ecx
movzbl %cl,%ecx
lea    (%rcx,%rdx,1),%esi
lea    (%rsi,%rax,1),%edi
shl    $0xe,%edi
sub    %edx,%ecx
shl    $0x4,%ecx
add    %edi,%ecx
add    %eax,%eax
sub    %esi,%eax
sar    $0x3,%eax
add    %ecx,%eax
add    $0x2080,%eax
ret

LLVM IR (-O0):
define i32 @RGBtoYUV_32(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
store i8 %8, i8* %5
%9 = load i32, i32* %2
%10 = and i32 %9, 65280
%11 = lshr i32 %10, 8
%12 = trunc i32 %11 to i8
store i8 %12, i8* %4
%13 = load i32, i32* %2
%14 = lshr i32 %13, 16
%15 = trunc i32 %14 to i8
store i8 %15, i8* %3
%16 = load i8, i8* %3
%17 = zext i8 %16 to i32
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = add nsw i32 %17, %19
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = add nsw i32 %20, %22
%24 = shl i32 %23, 14
%25 = load i8, i8* %3
%26 = zext i8 %25 to i32
%27 = load i8, i8* %5
%28 = zext i8 %27 to i32
%29 = sub nsw i32 %26, %28
%30 = add nsw i32 %29, 512
%31 = shl i32 %30, 4
%32 = add nsw i32 %24, %31
%33 = load i8, i8* %4
%34 = zext i8 %33 to i32
%35 = mul nsw i32 2, %34
%36 = load i8, i8* %3
%37 = zext i8 %36 to i32
%38 = sub nsw i32 %35, %37
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = sub nsw i32 %38, %40
%42 = ashr i32 %41, 3
%43 = add nsw i32 %32, %42
%44 = add nsw i32 %43, 128
ret i32 %44
}

LLVM IR (-O2):
define i32 @RGBtoYUV_32(i32 %0) {
%2 = lshr i32 %0, 8
%3 = lshr i32 %0, 16
%4 = and i32 %3, 255
%5 = and i32 %2, 255
%6 = and i32 %0, 255
%7 = add nuw nsw i32 %4, %6
%8 = add nuw nsw i32 %7, %5
%9 = shl nuw nsw i32 %8, 14
%10 = sub nsw i32 %4, %6
%11 = shl nsw i32 %10, 4
%12 = shl nuw nsw i32 %5, 1
%13 = sub nsw i32 %12, %7
%14 = ashr i32 %13, 3
%15 = add nsw i32 %11, 8320
%16 = add nsw i32 %15, %9
%17 = add nsw i32 %16, %14
ret i32 %17
}
int aps_startup(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @aps_startup() {
ret i32 0
}
void nbrStart2NAMED_BACKREFERENCE() {}


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

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

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

LLVM IR (-O2):
define void @nbrStart2NAMED_BACKREFERENCE() {
ret void
}
__attribute__((always_)) int pci_enable_ats(struct pci_dev *dev, int ps) {
  return -19;
}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define i32 @pci_enable_ats(%struct.pci_dev* nocapture readnone %0, i32 %1) {
ret i32 -19
}
unsigned char gf16_is_nonzero(unsigned char a) {
  unsigned a4 = a & 0xf;
  unsigned r = ((unsigned)0) - a4;
  r >>= 8;
  return r & 1;
}


x86 assembly (clang, -O0):
<gf16_is_nonzero>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf16_is_nonzero>:
mov    %edi,%eax
and    $0xf,%eax
neg    %eax
shr    $0x8,%eax
and    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @gf16_is_nonzero(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = and i32 %6, 15
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = sub i32 0, %8
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = lshr i32 %10, 8
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = and i32 %12, 1
%14 = trunc i32 %13 to i8
ret i8 %14
}

LLVM IR (-O2):
define zeroext i8 @gf16_is_nonzero(i8 zeroext %0) {
%2 = and i8 %0, 15
%3 = zext i8 %2 to i32
%4 = sub nsw i32 0, %3
%5 = lshr i32 %4, 8
%6 = trunc i32 %5 to i8
%7 = and i8 %6, 1
ret i8 %7
}
void I_NoAppServicesDestroyLobbyJoinListener(void) {}


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

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

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

LLVM IR (-O2):
define void @I_NoAppServicesDestroyLobbyJoinListener() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void showbyte(void *addr, int bytes) {
  while (bytes-- > 0) {
    printf("%02x ", *(unsigned char *)addr++);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<showbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    1158 <showbyte+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    111f <showbyte+0xf>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showbyte>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1159 <showbyte+0x39>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
lea    0xec9(%rip),%r14
nopw   0x0(%rax,%rax,1)
movzbl (%rbx),%esi
add    $0x1,%rbx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1140 <showbyte+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%02x \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @showbyte(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = icmp sgt i32 %6, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
%12 = load i8, i8* %10
%13 = zext i8 %12 to i32
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %5
15: ; preds = %5
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%02x \00"
define void @showbyte(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = icmp ugt i32 %5, 1
br i1 %12, label %4, label %13
13: ; preds = %4, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hmac_sha1_vector(unsigned char *, unsigned int, int,
                                    unsigned char **, unsigned int *,
                                    unsigned char *, int);
void hmac_sha1(unsigned char *key, unsigned int key_len, unsigned char *data,
               unsigned int data_len, unsigned char *mac, int usecached) {
  hmac_sha1_vector(key, key_len, 1, &data, &data_len, mac, usecached);
}


x86 assembly (clang, -O0):
<hmac_sha1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x28(%rbp),%r9
mov    -0x2c(%rbp),%eax
mov    $0x1,%edx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
mov    %eax,(%rsp)
call   1030 <hmac_sha1_vector@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hmac_sha1>:
sub    $0x18,%rsp
mov    %r8,%rax
mov    %rdx,0x10(%rsp)
mov    %ecx,0xc(%rsp)
mov    %r9d,(%rsp)
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    $0x1,%edx
mov    %rax,%r9
call   1030 <hmac_sha1_vector@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @hmac_sha1(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
store i8* %0, i8** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i8*, i8** %11
%16 = load i32, i32* %12
%17 = call i32 @hmac_sha1_vector(i8* %13, i32 %14, i32 1, i8** %9, i32* %10, i8* %15, i32 %16)
ret void
}

LLVM IR (-O2):
define void @hmac_sha1(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i32
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = call i32 @hmac_sha1_vector(i8* %0, i32 %1, i32 1, i8** %7, i32* %8, i8* %4, i32 %5)
ret void
}
unsigned char inb(int port) {
  unsigned char value;
  __asm__ __volatile__("in"
                       "b"
                       " %w1, %"
                       "b"
                       "0"
                       : "=a"(value)
                       : "Nd"(port));
  return value;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8 asm sideeffect "inb ${1:w}, ${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i32 %0) {
%2 = tail call i8 asm sideeffect "inb ${1:w}, ${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ mknod(char *, int, int /*<<< orphan*/);
int main() {
  mknod("Fifo.txt", 0666, 0);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1b6,%esi
xor    %edx,%edx
call   1030 <mknod@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Fifo.txt\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @mknod(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 438, i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"Fifo.txt\00"
define i32 @main() {
%1 = tail call i32 @mknod(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 438, i32 0)
ret i32 0
}
void dirvote_free_all(void) {}


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

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

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

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

/* Variables and functions */
bool rtp2435r_check_last(uint8_t *header) { return !!(header[2] & 0x2); }


x86 assembly (clang, -O0):
<rtp2435r_check_last>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp2435r_check_last>:
mov    0x8(%rdi),%eax
shr    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @rtp2435r_check_last(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = and i32 %5, 2
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @rtp2435r_check_last(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 1
%5 = and i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void error(const char *p) {
  fprintf(stderr, "%s\n", p);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int rand();
int get_random_between(int inf, int sup) { return rand() % (sup - inf) + inf; }


x86 assembly (clang, -O0):
<get_random_between>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random_between>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_random_between(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = srem i32 %5, %8
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @get_random_between(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub nsw i32 %1, %0
%5 = srem i32 %3, %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_STC();
void do0x37() { _I8080_STC(); }


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

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

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

LLVM IR (-O2):
define void @do0x37() {
%1 = tail call i32 (...) @_I8080_STC()
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ window;
};
struct TYPE_4__ {
  TYPE_1__ xcirculaterequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xcirculaterequest_window(void *_p) {
  return (unsigned long)((XEvent *)_p)->xcirculaterequest.window;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XEvent_xcirculaterequest_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
void cloog_initialize(void) {}


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

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

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

LLVM IR (-O2):
define void @cloog_initialize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *realloc(void *, size_t);
void *my_realloc(void *ptr, size_t size) {
  ptr = realloc(ptr, size);
  assert(ptr != NULL);
  return (ptr);
}


x86 assembly (clang, -O0):
<my_realloc>:
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   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_realloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @my_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define noalias i8* @my_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret i8* %3
}
void ft_swap(char *a, char *b) {
  char c;
  c = *a;
  *a = *b;
  *b = c;
}


x86 assembly (clang, -O0):
<ft_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_swap>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @ft_swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @ft_swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
notin(sh, lg) register char *sh, *lg;
{
  while (*lg != '\0') {
    if (wprefix(sh, lg))
      return 0;
    else
      lg++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<notin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1165 <notin+0x55>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <wprefix@plt>
cmp    $0x0,%eax
je     1154 <notin+0x44>
movl   $0x0,-0x4(%rbp)
jmp    116c <notin+0x5c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1120 <notin+0x10>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<notin>:
push   %rbp
push   %r14
push   %rbx
cmpb   $0x0,(%rsi)
je     114b <notin+0x3b>
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <wprefix@plt>
test   %eax,%eax
jne    1150 <notin+0x40>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1130 <notin+0x20>
mov    $0x1,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @notin(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %20, %2
%7 = load i8*, i8** %5
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %6
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @wprefix to i32 (i8*, i8*, ...)*)(i8* %12, i8* %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %11
store i32 0, i32* %3
br label %22
17: ; preds = %11
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %5
br label %20
20: ; preds = %17
br label %6
21: ; preds = %6
store i32 1, i32* %3
br label %22
22: ; preds = %21, %16
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @notin(i8* %0, i8* %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %8
5: ; preds = %8
%6 = load i8, i8* %12
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %2, %5
%9 = phi i8* [ %12, %5 ], [ %1, %2 ]
%10 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @wprefix to i32 (i8*, i8*, ...)*)(i8* %0, i8* %9)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %5, label %13
13: ; preds = %8, %5, %2
%14 = phi i32 [ 1, %2 ], [ 1, %5 ], [ 0, %8 ]
ret i32 %14
}
/* Variables and functions */
scalar_t__ islower(int);
char toupper(int);
void upcase(char *argument) {
  int c;
  while ((c = *argument) != 0) {
    if (islower(c)) {
      *argument = toupper(c);
    }
    argument++;
  }
}


x86 assembly (clang, -O0):
<upcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1172 <upcase+0x52>
mov    -0xc(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     1161 <upcase+0x41>
mov    -0xc(%rbp),%edi
call   1040 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <upcase+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upcase>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1166 <upcase+0x46>
mov    %rdi,%rbx
add    $0x1,%rbx
jmp    114b <upcase+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1166 <upcase+0x46>
movsbl %al,%ebp
mov    %ebp,%edi
call   1030 <islower@plt>
test   %rax,%rax
je     1140 <upcase+0x20>
mov    %ebp,%edi
call   1040 <toupper@plt>
mov    %al,-0x1(%rbx)
jmp    1140 <upcase+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @upcase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %14, %12 ], [ %2, %1 ]
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i64 @islower(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = tail call signext i8 @toupper(i32 %7)
store i8 %11, i8* %6
br label %12
12: ; preds = %10, %4
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %1
ret void
}
/* Type definitions */
struct ISzAlloc {
  int dummy;
};
struct CMatchFinder {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ LzInWindow_Free(struct CMatchFinder *, struct ISzAlloc *);
int /*<<< orphan*/ MatchFinder_FreeThisClassMemory(struct CMatchFinder *,
                                                   struct ISzAlloc *);
void MatchFinder_Free(struct CMatchFinder *p, struct ISzAlloc *alloc) {
  MatchFinder_FreeThisClassMemory(p, alloc);
  LzInWindow_Free(p, alloc);
}


x86 assembly (clang, -O0):
<MatchFinder_Free>:
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   1040 <MatchFinder_FreeThisClassMemory@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <LzInWindow_Free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MatchFinder_Free>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <MatchFinder_FreeThisClassMemory@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <LzInWindow_Free@plt>

LLVM IR (-O0):
%struct.CMatchFinder = type { i32 }
%struct.ISzAlloc = type { i32 }
define void @MatchFinder_Free(%struct.CMatchFinder* %0, %struct.ISzAlloc* %1) {
%3 = alloca %struct.CMatchFinder*
%4 = alloca %struct.ISzAlloc*
store %struct.CMatchFinder* %0, %struct.CMatchFinder** %3
store %struct.ISzAlloc* %1, %struct.ISzAlloc** %4
%5 = load %struct.CMatchFinder*, %struct.CMatchFinder** %3
%6 = load %struct.ISzAlloc*, %struct.ISzAlloc** %4
%7 = call i32 @MatchFinder_FreeThisClassMemory(%struct.CMatchFinder* %5, %struct.ISzAlloc* %6)
%8 = load %struct.CMatchFinder*, %struct.CMatchFinder** %3
%9 = load %struct.ISzAlloc*, %struct.ISzAlloc** %4
%10 = call i32 @LzInWindow_Free(%struct.CMatchFinder* %8, %struct.ISzAlloc* %9)
ret void
}

LLVM IR (-O2):
%struct.CMatchFinder = type { i32 }
%struct.ISzAlloc = type { i32 }
define void @MatchFinder_Free(%struct.CMatchFinder* %0, %struct.ISzAlloc* %1) {
%3 = tail call i32 @MatchFinder_FreeThisClassMemory(%struct.CMatchFinder* %0, %struct.ISzAlloc* %1)
%4 = tail call i32 @LzInWindow_Free(%struct.CMatchFinder* %0, %struct.ISzAlloc* %1)
ret void
}