xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ partab_init();
int parityb(unsigned char x) {
  extern unsigned char Partab[256];
  extern int Parity_initialized;
  if (!Parity_initialized) {
    partab_init();
  }
  return Partab[x];
}


x86 assembly (clang, -O0):
<parityb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    0x2eab(%rip),%rax
cmpl   $0x0,(%rax)
jne    1135 <parityb+0x25>
mov    $0x0,%al
call   1030 <partab_init@plt>
movzbl -0x1(%rbp),%eax
mov    %eax,%ecx
mov    0x2e9e(%rip),%rax
movzbl (%rax,%rcx,1),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parityb>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
cmpl   $0x0,(%rax)
jne    1126 <parityb+0x16>
xor    %eax,%eax
call   1030 <partab_init@plt>
movzbl %bl,%eax
mov    0x2eb0(%rip),%rcx
movzbl (%rcx,%rax,1),%eax
pop    %rbx
ret

LLVM IR (-O0):
@Parity_initialized = external global i32
@Partab = external global [256 x i8]
define i32 @parityb(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i32, i32* @Parity_initialized
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 (...) @partab_init()
br label %7
7: ; preds = %5, %1
%8 = load i8, i8* %2
%9 = zext i8 %8 to i64
%10 = getelementptr inbounds [256 x i8], [256 x i8]* @Partab, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@Parity_initialized = external global i32
@Partab = external global [256 x i8]
define i32 @parityb(i8 zeroext %0) {
%2 = load i32, i32* @Parity_initialized
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @partab_init()
br label %6
6: ; preds = %4, %1
%7 = zext i8 %0 to i64
%8 = getelementptr inbounds [256 x i8], [256 x i8]* @Partab, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void *memcat(void *s1, size_t n1, void *s2, size_t n2) {
  void *target = (uint8_t *)s1 + n1;
  memcpy(target, s2, n2);
  return s1;
}


x86 assembly (clang, -O0):
<memcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcat>:
push   %rbx
mov    %rdi,%rbx
lea    (%rdi,%rsi,4),%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @memcat(i8* returned %0, i64 %1, i8* %2, i64 %3) {
%5 = bitcast i8* %0 to i32*
%6 = getelementptr inbounds i32, i32* %5, i64 %1
%7 = bitcast i32* %6 to i8*
%8 = tail call i32 @memcpy(i8* %7, i8* %2, i64 %3)
ret i8* %0
}
/* Variables and functions */
int factorial(char);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char c;
  scanf(" %c", &c);
  printf("%d", factorial(c));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x1(%rbp),%edi
call   1030 <factorial@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c" %c\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = call i32 @factorial(i8 signext %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c" %c\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = call i32 @factorial(i8 signext %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
double calculate_angle(int, int);
int test_positive_angle() { return 80.0 == calculate_angle(1, 20); }


x86 assembly (clang, -O0):
<test_positive_angle>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x14,%esi
call   1030 <calculate_angle@plt>
movaps %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_positive_angle>:
push   %rax
mov    $0x1,%edi
mov    $0x14,%esi
call   1030 <calculate_angle@plt>
cmpeqsd 0xed7(%rip),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_positive_angle() {
%1 = call double @calculate_angle(i32 1, i32 20)
%2 = fcmp oeq double 8.000000e+01, %1
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @test_positive_angle() {
%1 = tail call double @calculate_angle(i32 1, i32 20)
%2 = fcmp oeq double %1, 8.000000e+01
%3 = zext i1 %2 to i32
ret i32 %3
}
void bnxt_unlock_poll(struct bnxt_napi *bnapi) {}


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

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

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

LLVM IR (-O2):
%struct.bnxt_napi = type opaque
define void @bnxt_unlock_poll(%struct.bnxt_napi* nocapture %0) {
ret void
}
void Sys_InitDynvars(void) {}


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

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

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

LLVM IR (-O2):
define void @Sys_InitDynvars() {
ret void
}
void ubi_dbg_dump_ec_hdr(const struct ubi_ec_hdr *ec_hdr) { return; }


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

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

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

LLVM IR (-O2):
%struct.ubi_ec_hdr = type opaque
define void @ubi_dbg_dump_ec_hdr(%struct.ubi_ec_hdr* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int main(void) {
  int A[1024];
  int i;
  for (i = 0; A[i] != 0; i++) {
  }
  __VERIFIER_assert(i <= 1024);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1020,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1014(%rbp)
movslq -0x1014(%rbp),%rax
cmpl   $0x0,-0x1010(%rbp,%rax,4)
je     115a <main+0x4a>
jmp    1146 <main+0x36>
mov    -0x1014(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1014(%rbp)
jmp    112c <main+0x1c>
cmpl   $0x400,-0x1014(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x1020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x1008,%rsp
mov    $0xffffffff,%eax
mov    %rsp,%rcx
nop
add    $0x1,%eax
cmpl   $0x0,(%rcx)
lea    0x4(%rcx),%rcx
jne    1120 <main+0x10>
xor    %edi,%edi
cmp    $0x401,%eax
setb   %dil
call   1030 <__VERIFIER_assert@plt>
xor    %eax,%eax
add    $0x1008,%rsp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [1024 x i32]
%2 = bitcast [1024 x i32]* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = phi i64 [ %8, %3 ], [ 0, %0 ]
%5 = getelementptr inbounds [1024 x i32], [1024 x i32]* %1, i64 0, i64 %4
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
%11 = icmp ult i32 %10, 1025
%12 = zext i1 %11 to i32
%13 = tail call i32 @__VERIFIER_assert(i32 %12)
ret i32 0
}
/* Variables and functions */
int **make_ptr();
int /*<<< orphan*/ set_ptr(int **, int);
int /*<<< orphan*/ validptr(int **);
void main() {
  int **t;
  int *t1;
  int t2;
  t = make_ptr();
  t1 = *t;
  set_ptr(t, 10);
  validptr(t);
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <make_ptr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <set_ptr@plt>
mov    -0x8(%rbp),%rdi
call   1050 <validptr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <make_ptr@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0xa,%esi
call   1030 <set_ptr@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <validptr@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32**
%2 = alloca i32*
%3 = alloca i32
%4 = call i32** (...) @make_ptr()
store i32** %4, i32*** %1
%5 = load i32**, i32*** %1
%6 = load i32*, i32** %5
store i32* %6, i32** %2
%7 = load i32**, i32*** %1
%8 = call i32 @set_ptr(i32** %7, i32 10)
%9 = load i32**, i32*** %1
%10 = call i32 @validptr(i32** %9)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32** (...) @make_ptr()
%2 = tail call i32 @set_ptr(i32** %1, i32 10)
%3 = tail call i32 @validptr(i32** %1)
ret void
}
/* Variables and functions */
int get_global_id(int);
int get_global_size(int);
int getElement() {
  return get_global_id(0) + get_global_id(1) * get_global_size(0) +
         get_global_id(2) * get_global_size(0) * get_global_size(1);
}


x86 assembly (clang, -O0):
<getElement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %edi,%edi
call   1040 <get_global_id@plt>
mov    %eax,-0x10(%rbp)
mov    $0x1,%edi
call   1040 <get_global_id@plt>
mov    %eax,-0x14(%rbp)
xor    %edi,%edi
call   1030 <get_global_size@plt>
mov    -0x14(%rbp),%ecx
mov    %eax,%edx
mov    -0x10(%rbp),%eax
imul   %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    $0x2,%edi
call   1040 <get_global_id@plt>
mov    %eax,-0xc(%rbp)
xor    %edi,%edi
call   1030 <get_global_size@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <get_global_size@plt>
mov    -0x8(%rbp),%ecx
mov    %eax,%edx
mov    -0x4(%rbp),%eax
imul   %edx,%ecx
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getElement>:
push   %rbp
push   %r14
push   %rbx
xor    %edi,%edi
call   1040 <get_global_id@plt>
mov    %eax,%r14d
mov    $0x1,%edi
call   1040 <get_global_id@plt>
mov    %eax,%ebp
xor    %edi,%edi
call   1030 <get_global_size@plt>
mov    %eax,%ebx
imul   %ebp,%ebx
add    %r14d,%ebx
mov    $0x2,%edi
call   1040 <get_global_id@plt>
mov    %eax,%r14d
xor    %edi,%edi
call   1030 <get_global_size@plt>
mov    %eax,%ebp
imul   %r14d,%ebp
mov    $0x1,%edi
call   1030 <get_global_size@plt>
imul   %ebp,%eax
add    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getElement() {
%1 = call i32 @get_global_id(i32 0)
%2 = call i32 @get_global_id(i32 1)
%3 = call i32 @get_global_size(i32 0)
%4 = mul nsw i32 %2, %3
%5 = add nsw i32 %1, %4
%6 = call i32 @get_global_id(i32 2)
%7 = call i32 @get_global_size(i32 0)
%8 = mul nsw i32 %6, %7
%9 = call i32 @get_global_size(i32 1)
%10 = mul nsw i32 %8, %9
%11 = add nsw i32 %5, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @getElement() {
%1 = tail call i32 @get_global_id(i32 0)
%2 = tail call i32 @get_global_id(i32 1)
%3 = tail call i32 @get_global_size(i32 0)
%4 = mul nsw i32 %3, %2
%5 = add nsw i32 %4, %1
%6 = tail call i32 @get_global_id(i32 2)
%7 = tail call i32 @get_global_size(i32 0)
%8 = mul nsw i32 %7, %6
%9 = tail call i32 @get_global_size(i32 1)
%10 = mul nsw i32 %8, %9
%11 = add nsw i32 %5, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ say(char *, int);
void talk(void) { say("Someone must live nearby.", 1); }


x86 assembly (clang, -O0):
<talk>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <say@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<talk>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <say@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Someone must live nearby.\00"
define void @talk() {
%1 = call i32 @say(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Someone must live nearby.\00"
define void @talk() {
%1 = tail call i32 @say(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ retire();
void nero_end() {
  printf("Your heavy handed performance smacks of Nero and Ivan IV.\n");
  printf("The people (remaining) find you an unpleasant ruler, and,\n");
  printf("frankly, hate your guts!\n");
  retire();
}


x86 assembly (clang, -O0):
<nero_end>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xf04(%rip),%rdi
call   1040 <printf@plt>
lea    0xf33(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <retire@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nero_end>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf06(%rip),%rdi
call   1030 <puts@plt>
lea    0xf34(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <retire@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"Your heavy handed performance smacks of Nero and Ivan IV.\0A\00"
@.str.1 = [59 x i8] c"The people (remaining) find you an unpleasant ruler, and,\0A\00"
@.str.2 = [26 x i8] c"frankly, hate your guts!\0A\00"
define void @nero_end() {
%1 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 (...) @retire()
ret void
}

LLVM IR (-O2):
@str = [58 x i8] c"Your heavy handed performance smacks of Nero and Ivan IV.\00"
@str.3 = [58 x i8] c"The people (remaining) find you an unpleasant ruler, and,\00"
@str.4 = [25 x i8] c"frankly, hate your guts!\00"
define void @nero_end() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 (...) @retire()
ret void
}
signed char explicit_signed_char_to_signed_char(signed char src) {
  return (signed char)src;
}


x86 assembly (clang, -O0):
<explicit_signed_char_to_signed_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @explicit_signed_char_to_signed_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
ret i8 %3
}

LLVM IR (-O2):
define signext i8 @explicit_signed_char_to_signed_char(i8 returned signext %0) {
ret i8 %0
}
void RSA_private_decrypt(void) {}


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

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

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

LLVM IR (-O2):
define void @RSA_private_decrypt() {
ret void
}
void strength_test1(int *data) {
  int i = 0;
  do {
    data[data[2]] = 2;
    i = i + 1;
  } while (i * 21 < data[1]);
}


x86 assembly (clang, -O0):
<strength_test1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq 0x8(%rcx),%rcx
movl   $0x2,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
imul   $0x15,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0x4(%rcx),%eax
jl     110f <strength_test1+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strength_test1>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq 0x8(%rdi),%rcx
movl   $0x2,(%rdi,%rcx,4)
add    $0x15,%eax
cmp    0x4(%rdi),%eax
jl     1110 <strength_test1+0x10>
ret

LLVM IR (-O0):
define void @strength_test1(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** %2
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 2
%8 = load i32, i32* %7
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %5, i64 %9
store i32 2, i32* %10
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %13
13: ; preds = %4
%14 = load i32, i32* %3
%15 = mul nsw i32 %14, 21
%16 = load i32*, i32** %2
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = load i32, i32* %17
%19 = icmp slt i32 %15, %18
br i1 %19, label %4, label %20
20: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @strength_test1(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = getelementptr inbounds i32, i32* %0, i64 1
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ 0, %1 ], [ %9, %4 ]
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 2, i32* %8
%9 = add nuw nsw i32 %5, 1
%10 = mul nsw i32 %9, 21
%11 = load i32, i32* %3
%12 = icmp slt i32 %10, %11
br i1 %12, label %4, label %13
13: ; preds = %4
ret void
}
int byteNot(int x, int n) {
  int mask = 0xff << (n << 3);
  return x ^ mask;
}


x86 assembly (clang, -O0):
<byteNot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
shl    $0x3,%ecx
mov    $0xff,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byteNot>:
lea    0x0(,%rsi,8),%ecx
mov    $0xff,%eax
shl    %cl,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @byteNot(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = shl i32 %6, 3
%8 = shl i32 255, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = xor i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @byteNot(i32 %0, i32 %1) {
%3 = shl i32 %1, 3
%4 = shl i32 255, %3
%5 = xor i32 %4, %0
ret i32 %5
}
/* Type definitions */
typedef int u32Reg;

/* Variables and functions */
unsigned short RIU_READ_2BYTE(int);
unsigned short SC_R2BYTE(unsigned int u32Reg) {
  return RIU_READ_2BYTE((0x130000 + ((u32Reg)&0xFFFF)) << 1);
}


x86 assembly (clang, -O0):
<SC_R2BYTE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xffff,%edi
add    $0x130000,%edi
shl    $0x1,%edi
call   1030 <RIU_READ_2BYTE@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SC_R2BYTE>:
movzwl %di,%eax
lea    (%rax,%rax,1),%edi
add    $0x260000,%edi
jmp    1030 <RIU_READ_2BYTE@plt>

LLVM IR (-O0):
define zeroext i16 @SC_R2BYTE(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = add i32 1245184, %4
%6 = shl i32 %5, 1
%7 = call zeroext i16 @RIU_READ_2BYTE(i32 %6)
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @SC_R2BYTE(i32 %0) {
%2 = shl i32 %0, 1
%3 = and i32 %2, 131070
%4 = or i32 %3, 2490368
%5 = tail call zeroext i16 @RIU_READ_2BYTE(i32 %4)
ret i16 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void *printHello(void *arg) {
  int *intptr = (int *)arg;
  int val = *intptr;
  printf("Hello World! arg = %d\n", val);
  return NULL;
}


x86 assembly (clang, -O0):
<printHello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHello>:
push   %rax
mov    (%rdi),%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Hello World! arg = %d\0A\00"
define i8* @printHello(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i8* null
}

LLVM IR (-O2):
@.str = [23 x i8] c"Hello World! arg = %d\0A\00"
define noalias i8* @printHello(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ spiWriteRegister(int, int);
void rfmSetReadyMode(void) { spiWriteRegister(0x07, 0x01); }


x86 assembly (clang, -O0):
<rfmSetReadyMode>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
mov    $0x1,%esi
call   1030 <spiWriteRegister@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfmSetReadyMode>:
mov    $0x7,%edi
mov    $0x1,%esi
jmp    1030 <spiWriteRegister@plt>

LLVM IR (-O0):
define void @rfmSetReadyMode() {
%1 = call i32 @spiWriteRegister(i32 7, i32 1)
ret void
}

LLVM IR (-O2):
define void @rfmSetReadyMode() {
%1 = tail call i32 @spiWriteRegister(i32 7, i32 1)
ret void
}
__attribute__((no, noclone)) unsigned short foo16(unsigned short arg) {
  unsigned short ret = 1;
  if (arg + 1 < ((!1) ? -(1 << (sizeof(char) * 8 - 1)) : 0) ||
      arg + 1 > ((!1) ? ((1 << (sizeof(char) * 8 - 1)) - 1)
                      : ((1 << (sizeof(char) * 8)) - 1)))
    return ret;
  arg = arg + 1;
  ret = (char)arg;
  return arg;
}


x86 assembly (clang, -O0):
<foo16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x0,%eax
jl     1133 <foo16+0x33>
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0xff,%eax
jle    1140 <foo16+0x40>
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    115e <foo16+0x5e>
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
movsbl %al,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo16>:
lea    0x1(%rdi),%ecx
cmp    $0xff,%edi
mov    $0x1,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @foo16(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 1, i16* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = add nsw i32 %6, 1
%8 = icmp slt i32 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %1
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = add nsw i32 %11, 1
%13 = icmp sgt i32 %12, 255
br i1 %13, label %14, label %16
14: ; preds = %9, %1
%15 = load i16, i16* %4
store i16 %15, i16* %2
br label %25
16: ; preds = %9
%17 = load i16, i16* %3
%18 = zext i16 %17 to i32
%19 = add nsw i32 %18, 1
%20 = trunc i32 %19 to i16
store i16 %20, i16* %3
%21 = load i16, i16* %3
%22 = trunc i16 %21 to i8
%23 = sext i8 %22 to i16
store i16 %23, i16* %4
%24 = load i16, i16* %3
store i16 %24, i16* %2
br label %25
25: ; preds = %16, %14
%26 = load i16, i16* %2
ret i16 %26
}

LLVM IR (-O2):
define zeroext i16 @foo16(i16 zeroext %0) {
%2 = add i16 %0, 1
%3 = icmp ugt i16 %0, 254
%4 = select i1 %3, i16 1, i16 %2
ret i16 %4
}
void task_semaphore_delete(void) {}


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

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

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

LLVM IR (-O2):
define void @task_semaphore_delete() {
ret void
}
/* Variables and functions */
int pow(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 2;
  int foo = pow(2, 3);
  printf("hello, %d\n", foo);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <pow@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <pow@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"hello, %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
%4 = call i32 @pow(i32 2, i32 3)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"hello, %d\0A\00"
define i32 @main() {
%1 = tail call i32 @pow(i32 2, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ opl_timer_over(int, int);
void opl_timer_callback11(void *p) { opl_timer_over(1, 1); }


x86 assembly (clang, -O0):
<opl_timer_callback11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <opl_timer_over@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opl_timer_callback11>:
mov    $0x1,%edi
mov    $0x1,%esi
jmp    1030 <opl_timer_over@plt>

LLVM IR (-O0):
define void @opl_timer_callback11(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @opl_timer_over(i32 1, i32 1)
ret void
}

LLVM IR (-O2):
define void @opl_timer_callback11(i8* nocapture readnone %0) {
%2 = tail call i32 @opl_timer_over(i32 1, i32 1)
ret void
}
void Draw_SetGrey(void) {}


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

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

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

LLVM IR (-O2):
define void @Draw_SetGrey() {
ret void
}
void EC_KEY_precompute_mult(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_KEY_precompute_mult() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void nn_bitset_set(unsigned numbits, unsigned *bits, unsigned idx) {
  assert(idx < numbits);
  bits[idx / 32] |= 1u << (31 - (idx % 32));
}


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

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

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

LLVM IR (-O2):
define void @nn_bitset_set(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp ult i32 %2, %0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = and i32 %2, 31
%8 = xor i32 %7, 31
%9 = shl nuw i32 1, %8
%10 = lshr i32 %2, 5
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %1, i64 %11
%13 = load i32, i32* %12
%14 = or i32 %13, %9
store i32 %14, i32* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ scanf(char *, int *, int *);
void test_scanf() {
  int n = 0, m = 0;
  scanf("%d %d", &n, &m);
  assert(n == 0);
  assert(m == 0);
}


x86 assembly (clang, -O0):
<test_scanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_scanf>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0xec9(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
xor    %edi,%edi
cmpl   $0x0,0x4(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x0,(%rsp)
sete   %dil
call   1030 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
define void @test_scanf() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define void @test_scanf() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret void
}
int test_imm_0Fint8_mem(signed char *val) {
  return ((*val) & (-0x0F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_0Fint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -15
%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_0Fint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -15
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int __month_to_secs(int month, int is_leap) {
  static const int secs_through_month[] = {
      0,           31 * 86400,  59 * 86400,  90 * 86400,
      120 * 86400, 151 * 86400, 181 * 86400, 212 * 86400,
      243 * 86400, 273 * 86400, 304 * 86400, 334 * 86400};
  int t = secs_through_month[month];
  if (is_leap && month >= 2)
    t += 86400;
  return t;
}


x86 assembly (clang, -O0):
<__month_to_secs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rcx
lea    0xeeb(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113a <__month_to_secs+0x3a>
cmpl   $0x2,-0x4(%rbp)
jl     113a <__month_to_secs+0x3a>
mov    -0xc(%rbp),%eax
add    $0x15180,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__month_to_secs>:
movslq %edi,%rcx
lea    0xef6(%rip),%rax
mov    (%rax,%rcx,4),%edx
lea    0x15180(%rdx),%eax
test   %esi,%esi
cmove  %edx,%eax
cmp    $0x2,%ecx
cmovl  %edx,%eax
ret

LLVM IR (-O0):
@__month_to_secs.secs_through_month = internal constant [12 x i32] [i32 0, i32 2678400, i32 5097600, i32 7776000, i32 10368000, i32 13046400, i32 15638400, i32 18316800, i32 20995200, i32 23587200, i32 26265600, i32 28857600]
define i32 @__month_to_secs(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [12 x i32], [12 x i32]* @__month_to_secs.secs_through_month, i64 0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 2
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 86400
store i32 %17, i32* %5
br label %18
18: ; preds = %15, %12, %2
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
@__month_to_secs.secs_through_month = internal unnamed_addr constant [12 x i32] [i32 0, i32 2678400, i32 5097600, i32 7776000, i32 10368000, i32 13046400, i32 15638400, i32 18316800, i32 20995200, i32 23587200, i32 26265600, i32 28857600]
define i32 @__month_to_secs(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds [12 x i32], [12 x i32]* @__month_to_secs.secs_through_month, i64 0, i64 %3
%5 = load i32, i32* %4
%6 = icmp ne i32 %1, 0
%7 = icmp sgt i32 %0, 1
%8 = and i1 %7, %6
%9 = add nsw i32 %5, 86400
%10 = select i1 %8, i32 %9, i32 %5
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void test_value(int test) {
  if (!test)
    die("IO function failed\n");
}


x86 assembly (clang, -O0):
<test_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1131 <test_value+0x21>
lea    0xed4(%rip),%rdi
call   1030 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_value>:
test   %edi,%edi
je     1115 <test_value+0x5>
ret
lea    0xee4(%rip),%rdi
jmp    1030 <die@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"IO function failed\0A\00"
define void @test_value(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 @die(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"IO function failed\0A\00"
define void @test_value(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @die(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
int test_imm_95int16_mem(short *val) {
  return ((*val) & (0x95 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_95int16_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, 149
%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_95int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 149
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
void check(int ret, char *mesg) {
  if (ret) {
    fprintf(stderr, mesg);
    errno = ret;
    perror("");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     117d <check+0x4d>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%ecx
mov    0x2e73(%rip),%rax
mov    %ecx,(%rax)
lea    0xe92(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
test   %edi,%edi
jne    1135 <check+0x5>
ret
push   %rbx
mov    %edi,%ebx
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    %ebx,(%rax)
lea    0xeaa(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@errno = global i32 0
@.str = [1 x i8] zeroinitializer
define void @check(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %4
%10 = call i32 @fprintf(i32 %8, i8* %9)
%11 = load i32, i32* %3
store i32 %11, i32* @errno
%12 = call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@errno = global i32 0
@.str = [1 x i8] zeroinitializer
define void @check(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* %1)
store i32 %0, i32* @errno
%7 = tail call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret void
}
void X509_REQ_verify(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_REQ_verify() {
ret void
}
struct s3c24x0_usb_device *s3c24x0_get_base_usb_device(void) {
  return (struct s3c24x0_usb_device *)0x52000140;
}


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

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

LLVM IR (-O0):
%struct.s3c24x0_usb_device = type opaque
define %struct.s3c24x0_usb_device* @s3c24x0_get_base_usb_device() {
ret %struct.s3c24x0_usb_device* inttoptr (i64 1375732032 to %struct.s3c24x0_usb_device*)
}

LLVM IR (-O2):
%struct.s3c24x0_usb_device = type opaque
define %struct.s3c24x0_usb_device* @s3c24x0_get_base_usb_device() {
ret %struct.s3c24x0_usb_device* inttoptr (i64 1375732032 to %struct.s3c24x0_usb_device*)
}
/* Type definitions */
struct MemoryPage {
  int dummy;
};

/* Variables and functions */
unsigned long MAGetMemoryTotalSize(struct MemoryPage *);
unsigned long MAGetMemoryUsedTotalSize(struct MemoryPage *);
unsigned long MAGetMemoryUnusedTotalSize(struct MemoryPage *p_mempage) {
  return MAGetMemoryTotalSize(p_mempage) - MAGetMemoryUsedTotalSize(p_mempage);
}


x86 assembly (clang, -O0):
<MAGetMemoryUnusedTotalSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <MAGetMemoryTotalSize@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <MAGetMemoryUsedTotalSize@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAGetMemoryUnusedTotalSize>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <MAGetMemoryTotalSize@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <MAGetMemoryUsedTotalSize@plt>
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.MemoryPage = type { i32 }
define i64 @MAGetMemoryUnusedTotalSize(%struct.MemoryPage* %0) {
%2 = alloca %struct.MemoryPage*
store %struct.MemoryPage* %0, %struct.MemoryPage** %2
%3 = load %struct.MemoryPage*, %struct.MemoryPage** %2
%4 = call i64 @MAGetMemoryTotalSize(%struct.MemoryPage* %3)
%5 = load %struct.MemoryPage*, %struct.MemoryPage** %2
%6 = call i64 @MAGetMemoryUsedTotalSize(%struct.MemoryPage* %5)
%7 = sub i64 %4, %6
ret i64 %7
}

LLVM IR (-O2):
%struct.MemoryPage = type { i32 }
define i64 @MAGetMemoryUnusedTotalSize(%struct.MemoryPage* %0) {
%2 = tail call i64 @MAGetMemoryTotalSize(%struct.MemoryPage* %0)
%3 = tail call i64 @MAGetMemoryUsedTotalSize(%struct.MemoryPage* %0)
%4 = sub i64 %2, %3
ret i64 %4
}
const char *hs_version_string(void) { return "0.9.0"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"0.9.0\00"
define i8* @hs_version_string() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
int numberofBitsSetToOne(int value) {
  int bitsSet = 0;
  int shiftedValue = value;
  while (shiftedValue > 0) {
    if ((shiftedValue & 1) != 0) {
      bitsSet++;
    }
    shiftedValue >>= 1;
  }
  return bitsSet;
}


x86 assembly (clang, -O0):
<numberofBitsSetToOne>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1144 <numberofBitsSetToOne+0x44>
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1136 <numberofBitsSetToOne+0x36>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <numberofBitsSetToOne+0x14>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numberofBitsSetToOne>:
xor    %eax,%eax
test   %edi,%edi
jle    1120 <numberofBitsSetToOne+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <numberofBitsSetToOne+0x10>
ret

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

LLVM IR (-O2):
define i32 @numberofBitsSetToOne(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = and i32 %4, 1
%7 = add nuw nsw i32 %6, %5
%8 = lshr i32 %4, 1
%9 = icmp ult i32 %4, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint_least16_t;

/* Variables and functions */
void SHAREMIND_MAP_KEY_FREE_uint_least16_t(uint_least16_t *const dest) {
  (void)dest;
}


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

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

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

LLVM IR (-O2):
define void @SHAREMIND_MAP_KEY_FREE_uint_least16_t(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void fini(void) { write(STDOUT_FILENO, "DSO fini\n", 9); }


x86 assembly (clang, -O0):
<fini>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x9,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fini>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
mov    $0x9,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [10 x i8] c"DSO fini\0A\00"
define void @fini() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = call i32 @write(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [10 x i8] c"DSO fini\0A\00"
define void @fini() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9)
ret void
}