xunge/DecIR huggingface dataset:
int test_imm_D9uint8_mem(unsigned char *val) {
  return ((*val) & (0xD9 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D9uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 217
%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_D9uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -39
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void lt_dladderror(void) {}


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

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

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

LLVM IR (-O2):
define void @lt_dladderror() {
ret void
}
void chkdiff(void) {
  int i;
  i = 0;
}


x86 assembly (clang, -O0):
<chkdiff>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @chkdiff() {
ret void
}
int getatt(int req, char *buf) {
  asm("int $0x80;" ::"a"(13), "b"(req), "c"(buf));
  ;
}


x86 assembly (clang, -O0):
<getatt>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%ebx
mov    -0x18(%rbp),%rcx
mov    $0xd,%eax
int    $0x80
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<getatt>:
push   %rbx
mov    %rsi,%rcx
mov    %edi,%ebx
mov    $0xd,%eax
int    $0x80
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @getatt(i32 %0, i8* %1) {
tail call void asm sideeffect "int $$0x80;", "{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 13, i32 %0, i8* %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ io_outportb(int, int);
void timer_phase() {
  int divisor = 1193180;
  io_outportb(0x43, 0x36);
  io_outportb(0x40, divisor & 0xFF);
  io_outportb(0x40, divisor >> 8);
}


x86 assembly (clang, -O0):
<timer_phase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1234dc,-0x4(%rbp)
mov    $0x43,%edi
mov    $0x36,%esi
call   1030 <io_outportb@plt>
mov    -0x4(%rbp),%esi
and    $0xff,%esi
mov    $0x40,%edi
call   1030 <io_outportb@plt>
mov    -0x4(%rbp),%esi
sar    $0x8,%esi
mov    $0x40,%edi
call   1030 <io_outportb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_phase>:
push   %rax
mov    $0x43,%edi
mov    $0x36,%esi
call   1030 <io_outportb@plt>
mov    $0x40,%edi
mov    $0xdc,%esi
call   1030 <io_outportb@plt>
mov    $0x40,%edi
mov    $0x1234,%esi
pop    %rax
jmp    1030 <io_outportb@plt>

LLVM IR (-O0):
define void @timer_phase() {
%1 = alloca i32
store i32 1193180, i32* %1
%2 = call i32 @io_outportb(i32 67, i32 54)
%3 = load i32, i32* %1
%4 = and i32 %3, 255
%5 = call i32 @io_outportb(i32 64, i32 %4)
%6 = load i32, i32* %1
%7 = ashr i32 %6, 8
%8 = call i32 @io_outportb(i32 64, i32 %7)
ret void
}

LLVM IR (-O2):
define void @timer_phase() {
%1 = tail call i32 @io_outportb(i32 67, i32 54)
%2 = tail call i32 @io_outportb(i32 64, i32 220)
%3 = tail call i32 @io_outportb(i32 64, i32 4660)
ret void
}
int fail(str)
char *str;
{ printf("FAIL: %s\n", str); }


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fail>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"FAIL: %s\0A\00"
define i32 @fail(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ ptrdiff_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, int /*<<< orphan*/ const);
bool cutils_cdar_DynamicArray_ptrdiff_t_format(const ptrdiff_t *i, char **b,
                                               size_t *s) {
  snprintf(*b, *s, "%td", *i);
  return true;
}


x86 assembly (clang, -O0):
<cutils_cdar_DynamicArray_ptrdiff_t_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
lea    0xec1(%rip),%rdx
call   1030 <snprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cdar_DynamicArray_ptrdiff_t_format>:
push   %rax
mov    (%rsi),%rax
mov    (%rdx),%rsi
mov    (%rdi),%ecx
lea    0xee0(%rip),%rdx
mov    %rax,%rdi
call   1030 <snprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%td\00"
define i32 @cutils_cdar_DynamicArray_ptrdiff_t_format(i32* %0, i8** %1, i64* %2) {
%4 = alloca i32*
%5 = alloca i8**
%6 = alloca i64*
store i32* %0, i32** %4
store i8** %1, i8*** %5
store i64* %2, i64** %6
%7 = load i8**, i8*** %5
%8 = load i8*, i8** %7
%9 = load i64*, i64** %6
%10 = load i64, i64* %9
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
%13 = call i32 @snprintf(i8* %8, i64 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 1
}

LLVM IR (-O2):
@.str = [4 x i8] c"%td\00"
define i32 @cutils_cdar_DynamicArray_ptrdiff_t_format(i32* nocapture %0, i8** nocapture %1, i64* nocapture %2) {
%4 = load i8*, i8** %1
%5 = load i64, i64* %2
%6 = load i32, i32* %0
%7 = tail call i32 @snprintf(i8* %4, i64 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 1
}
/* Variables and functions */
int pow(int, int);
int squareSum() {
  int i, t = 0;
  for (i = 1; i <= 100; i++) {
    t += i;
  }
  return pow(t, 2);
}


x86 assembly (clang, -O0):
<squareSum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jg     1147 <squareSum+0x37>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <squareSum+0x16>
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<squareSum>:
mov    $0x13ba,%edi
mov    $0x2,%esi
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define i32 @squareSum() {
%1 = tail call i32 @pow(i32 5050, i32 2)
ret i32 %1
}
void wakeup_source_gic_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @wakeup_source_gic_cleanup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char const *);
void usage(const char *s) {
  printf("%s\n"
         "usage: %s [OPTIONS]\n"
         "   -c ............. Output CSV format instead of OSM.\n"
         "   -f <format> .... Define output format. Available formats: csv, "
         "gpx, osm.\n"
         "   -h ............. This help.\n"
         "   -q ............. Quiet. No informational output.\n",
         "ARCHIVE.FSH decoder (c) 2013-2019 by Bernhard R. Fischer, "
         "4096R/8E24F29D <bf@abenteuerland.at>, License GPLv3",
         s);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xfcc(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [237 x i8] c"%s\0Ausage: %s [OPTIONS]\0A -c ............. Output CSV format instead of OSM.\0A -f <format> .... Define output format. Available formats: csv, gpx, osm.\0A -h ............. This help.\0A -q ............. Quiet. No informational output.\0A\00"
@.str.1 = [110 x i8] c"ARCHIVE.FSH decoder (c) 2013-2019 by Bernhard R. Fischer, 4096R/8E24F29D <bf@abenteuerland.at>, License GPLv3\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([237 x i8], [237 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [237 x i8] c"%s\0Ausage: %s [OPTIONS]\0A -c ............. Output CSV format instead of OSM.\0A -f <format> .... Define output format. Available formats: csv, gpx, osm.\0A -h ............. This help.\0A -q ............. Quiet. No informational output.\0A\00"
@.str.1 = [110 x i8] c"ARCHIVE.FSH decoder (c) 2013-2019 by Bernhard R. Fischer, 4096R/8E24F29D <bf@abenteuerland.at>, License GPLv3\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([237 x i8], [237 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int test_imm_99uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x99 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_99uint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0x99,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_99uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 153
%7 = icmp ne i64 %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_99uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 10027008
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int my_fibo_rec(int nb) {
  if (nb < 0)
    return (0);
  else if (nb < 2)
    return (nb);
  else
    return ((my_fibo_rec(nb - 1)) + (my_fibo_rec(nb - 2)));
}


x86 assembly (clang, -O0):
<my_fibo_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1131 <my_fibo_rec+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1169 <my_fibo_rec+0x59>
cmpl   $0x2,-0x8(%rbp)
jge    1146 <my_fibo_rec+0x36>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <my_fibo_rec+0x59>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <my_fibo_rec@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <my_fibo_rec@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_fibo_rec>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
js     1146 <my_fibo_rec+0x36>
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jb     1142 <my_fibo_rec+0x32>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <my_fibo_rec@plt>
add    $0xfffffffe,%ebx
add    %eax,%ebp
cmp    $0x1,%ebx
ja     1130 <my_fibo_rec+0x20>
add    %ebp,%ebx
jmp    1148 <my_fibo_rec+0x38>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @my_fibo_rec(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %17, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 2
br i1 %4, label %13, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %11, %5 ], [ 0, %3 ]
%7 = phi i32 [ %10, %5 ], [ %0, %3 ]
%8 = add nsw i32 %7, -1
%9 = tail call i32 @my_fibo_rec(i32 %8)
%10 = add nsw i32 %7, -2
%11 = add nsw i32 %9, %6
%12 = icmp ult i32 %10, 2
br i1 %12, label %13, label %5
13: ; preds = %5, %3
%14 = phi i32 [ %0, %3 ], [ %10, %5 ]
%15 = phi i32 [ 0, %3 ], [ %11, %5 ]
%16 = add nsw i32 %14, %15
br label %17
17: ; preds = %13, %1
%18 = phi i32 [ %16, %13 ], [ 0, %1 ]
ret i32 %18
}
void transfer_ARGB8888_to_ARGB8888(unsigned char *(*output),
                                   unsigned char *input) {
  (*output)[0] = input[0];
  (*output)[1] = input[1];
  (*output)[2] = input[2];
  (*output)[3] = input[3];
  (*output) += 4;
}


x86 assembly (clang, -O0):
<transfer_ARGB8888_to_ARGB8888>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<transfer_ARGB8888_to_ARGB8888>:
mov    (%rsi),%al
mov    (%rdi),%rcx
mov    %al,(%rcx)
mov    0x1(%rsi),%al
mov    (%rdi),%rcx
mov    %al,0x1(%rcx)
mov    0x2(%rsi),%al
mov    (%rdi),%rcx
mov    %al,0x2(%rcx)
mov    0x3(%rsi),%al
mov    (%rdi),%rcx
mov    %al,0x3(%rcx)
addq   $0x4,(%rdi)
ret

LLVM IR (-O0):
define void @transfer_ARGB8888_to_ARGB8888(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %7, i8* %10
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = load i8**, i8*** %3
%15 = load i8*, i8** %14
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %13, i8* %16
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i64 2
%19 = load i8, i8* %18
%20 = load i8**, i8*** %3
%21 = load i8*, i8** %20
%22 = getelementptr inbounds i8, i8* %21, i64 2
store i8 %19, i8* %22
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 3
%25 = load i8, i8* %24
%26 = load i8**, i8*** %3
%27 = load i8*, i8** %26
%28 = getelementptr inbounds i8, i8* %27, i64 3
store i8 %25, i8* %28
%29 = load i8**, i8*** %3
%30 = load i8*, i8** %29
%31 = getelementptr inbounds i8, i8* %30, i64 4
store i8* %31, i8** %29
ret void
}

LLVM IR (-O2):
define void @transfer_ARGB8888_to_ARGB8888(i8** nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = load i8*, i8** %0
store i8 %3, i8* %4
%5 = getelementptr inbounds i8, i8* %1, i64 1
%6 = load i8, i8* %5
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %8
%9 = getelementptr inbounds i8, i8* %1, i64 2
%10 = load i8, i8* %9
%11 = load i8*, i8** %0
%12 = getelementptr inbounds i8, i8* %11, i64 2
store i8 %10, i8* %12
%13 = getelementptr inbounds i8, i8* %1, i64 3
%14 = load i8, i8* %13
%15 = load i8*, i8** %0
%16 = getelementptr inbounds i8, i8* %15, i64 3
store i8 %14, i8* %16
%17 = load i8*, i8** %0
%18 = getelementptr inbounds i8, i8* %17, i64 4
store i8* %18, i8** %0
ret void
}
/* Variables and functions */
scalar_t__ pthread_self();
unsigned long __mp_threadid(void) { return (unsigned long)pthread_self(); }


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

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

LLVM IR (-O0):
define i64 @__mp_threadid() {
%1 = call i64 (...) @pthread_self()
ret i64 %1
}

LLVM IR (-O2):
define i64 @__mp_threadid() {
%1 = tail call i64 (...) @pthread_self()
ret i64 %1
}
void _clear_bit_le(int nr, unsigned long *p) { return; }


x86 assembly (clang, -O0):
<_clear_bit_le>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @_clear_bit_le(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
ret void
}

LLVM IR (-O2):
define void @_clear_bit_le(i32 %0, i64* nocapture %1) {
ret void
}
int HelpItem48(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem48() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void afficherIntroduction() {
  printf("Ce logiciel est un exemple pour le cours INF3135.\n\n");
  printf("Toute reproduction est permise\n\n\n");
}


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

x86 assembly (clang, -O2):
<afficherIntroduction>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0f(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"Ce logiciel est un exemple pour le cours INF3135.\0A\0A\00"
@.str.1 = [34 x i8] c"Toute reproduction est permise\0A\0A\0A\00"
define void @afficherIntroduction() {
%1 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [51 x i8] c"Ce logiciel est un exemple pour le cours INF3135.\0A\00"
@str.2 = [33 x i8] c"Toute reproduction est permise\0A\0A\00"
define void @afficherIntroduction() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.2, i64 0, i64 0))
ret void
}
double Tween_QuinticOutEasing(double k) {
  --k;
  return k * k * k * k * k + 1;
}


x86 assembly (clang, -O0):
<Tween_QuinticOutEasing>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec0(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tween_QuinticOutEasing>:
addsd  0xef8(%rip),%xmm0
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
addsd  0xee4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @Tween_QuinticOutEasing(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, -1.000000e+00
store double %4, double* %2
%5 = load double, double* %2
%6 = load double, double* %2
%7 = fmul double %5, %6
%8 = load double, double* %2
%9 = fmul double %7, %8
%10 = load double, double* %2
%11 = fmul double %9, %10
%12 = load double, double* %2
%13 = call double @llvm.fmuladd.f64(double %11, double %12, double 1.000000e+00)
ret double %13
}

LLVM IR (-O2):
define double @Tween_QuinticOutEasing(double %0) {
%2 = fadd double %0, -1.000000e+00
%3 = fmul double %2, %2
%4 = fmul double %2, %3
%5 = fmul double %2, %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double %2, double 1.000000e+00)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ __ESBMC_assume(int *);
int /*<<< orphan*/ free(int *);
int *malloc(int);
int main() {
  int *p = malloc(sizeof(int));
  __ESBMC_assume(p);
  int *q = p;
  int i;
  if (i == 4711)
    free(q);
  *p = 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <__ESBMC_assume@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x1267,-0x1c(%rbp)
jne    1174 <main+0x44>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <__ESBMC_assume@plt>
movl   $0x1,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32* @malloc(i32 4)
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = call i32 @__ESBMC_assume(i32* %6)
%8 = load i32*, i32** %2
store i32* %8, i32** %3
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 4711
br i1 %10, label %11, label %14
11: ; preds = %0
%12 = load i32*, i32** %3
%13 = call i32 @free(i32* %12)
br label %14
14: ; preds = %11, %0
%15 = load i32*, i32** %2
store i32 1, i32* %15
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
%2 = tail call i32 @__ESBMC_assume(i32* %1)
store i32 1, i32* %1
ret i32 0
}
/* Variables and functions */
scalar_t__ remove(char *);
int removeCsv(void) {
  char *filename = "booklist.csv";
  if (remove(filename) == 0) {
    return 0;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<removeCsv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <remove@plt>
cmp    $0x0,%rax
jne    1142 <removeCsv+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1149 <removeCsv+0x39>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeCsv>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <remove@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"booklist.csv\00"
define i32 @removeCsv() {
%1 = alloca i32
%2 = alloca i8*
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @remove(i8* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %1
br label %8
7: ; preds = %0
store i32 -1, i32* %1
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [13 x i8] c"booklist.csv\00"
define i32 @removeCsv() {
%1 = tail call i64 @remove(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
%3 = sext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int dbg_ctrl(unsigned char, unsigned char);
int dbg_set_chain(int);
int dbg_cpu0_write_ctrl(uint32_t adr, unsigned char data) {
  int err;
  if ((err = dbg_set_chain(1)))
    return err;
  if ((err = dbg_ctrl(data & 2, data & 1)))
    return err;
  return 0;
}


x86 assembly (clang, -O0):
<dbg_cpu0_write_ctrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    $0x1,%edi
call   1030 <dbg_set_chain@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1152 <dbg_cpu0_write_ctrl+0x32>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    118b <dbg_cpu0_write_ctrl+0x6b>
movzbl -0x9(%rbp),%eax
and    $0x2,%eax
mov    %al,%cl
movzbl -0x9(%rbp),%eax
and    $0x1,%eax
movzbl %cl,%edi
movzbl %al,%esi
call   1040 <dbg_ctrl@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1184 <dbg_cpu0_write_ctrl+0x64>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    118b <dbg_cpu0_write_ctrl+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbg_cpu0_write_ctrl>:
push   %rbx
mov    %esi,%ebx
mov    $0x1,%edi
call   1030 <dbg_set_chain@plt>
test   %eax,%eax
je     1133 <dbg_cpu0_write_ctrl+0x13>
pop    %rbx
ret
mov    %ebx,%eax
and    $0x2,%al
and    $0x1,%bl
movzbl %al,%edi
movzbl %bl,%esi
pop    %rbx
jmp    1040 <dbg_ctrl@plt>

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

LLVM IR (-O2):
define i32 @dbg_cpu0_write_ctrl(i32 %0, i8 zeroext %1) {
%3 = tail call i32 @dbg_set_chain(i32 1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = and i8 %1, 2
%7 = and i8 %1, 1
%8 = tail call i32 @dbg_ctrl(i8 zeroext %6, i8 zeroext %7)
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ %3, %2 ], [ %8, %5 ]
ret i32 %10
}
int main() { return '\x03'; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
void setup0() {}


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

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

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

LLVM IR (-O2):
define void @setup0() {
ret void
}
void ExecCfg(char *arg) {}


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

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

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

LLVM IR (-O2):
define void @ExecCfg(i8* nocapture %0) {
ret void
}
double lsx_bessel_I_0(double x) {
  double term = 1, sum = 1, last_sum, x2 = x / 2;
  int i = 1;
  do {
    double y = x2 / i++;
    last_sum = sum, sum += term *= y * y;
  } while (sum != last_sum);
  return sum;
}


x86 assembly (clang, -O0):
<lsx_bessel_I_0>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed0(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x1,-0x2c(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x2c(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x2c(%rbp)
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jne    1140 <lsx_bessel_I_0+0x40>
jp     1140 <lsx_bessel_I_0+0x40>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsx_bessel_I_0>:
mulsd  0xef8(%rip),%xmm0
mov    $0x1,%eax
movsd  0xef3(%rip),%xmm1
movapd %xmm1,%xmm2
nopl   0x0(%rax)
xorps  %xmm3,%xmm3
cvtsi2sd %eax,%xmm3
movapd %xmm1,%xmm4
add    $0x1,%eax
movapd %xmm0,%xmm5
divsd  %xmm3,%xmm5
mulsd  %xmm5,%xmm5
mulsd  %xmm5,%xmm2
addsd  %xmm2,%xmm1
ucomisd %xmm4,%xmm1
jne    1120 <lsx_bessel_I_0+0x20>
jp     1120 <lsx_bessel_I_0+0x20>
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @lsx_bessel_I_0(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca double
store double %0, double* %2
store double 1.000000e+00, double* %3
store double 1.000000e+00, double* %4
%9 = load double, double* %2
%10 = fdiv double %9, 2.000000e+00
store double %10, double* %6
store i32 1, i32* %7
br label %11
11: ; preds = %25, %1
%12 = load double, double* %6
%13 = load i32, i32* %7
%14 = add nsw i32 %13, 1
store i32 %14, i32* %7
%15 = sitofp i32 %13 to double
%16 = fdiv double %12, %15
store double %16, double* %8
%17 = load double, double* %4
store double %17, double* %5
%18 = load double, double* %8
%19 = load double, double* %8
%20 = fmul double %18, %19
%21 = load double, double* %3
%22 = fmul double %21, %20
store double %22, double* %3
%23 = load double, double* %4
%24 = fadd double %23, %22
store double %24, double* %4
br label %25
25: ; preds = %11
%26 = load double, double* %4
%27 = load double, double* %5
%28 = fcmp une double %26, %27
br i1 %28, label %11, label %29
29: ; preds = %25
%30 = load double, double* %4
ret double %30
}

LLVM IR (-O2):
define double @lsx_bessel_I_0(double %0) {
%2 = fmul double %0, 5.000000e-01
br label %3
3: ; preds = %3, %1
%4 = phi double [ 1.000000e+00, %1 ], [ %12, %3 ]
%5 = phi i32 [ 1, %1 ], [ %7, %3 ]
%6 = phi double [ 1.000000e+00, %1 ], [ %11, %3 ]
%7 = add nuw nsw i32 %5, 1
%8 = sitofp i32 %5 to double
%9 = fdiv double %2, %8
%10 = fmul double %9, %9
%11 = fmul double %6, %10
%12 = fadd double %4, %11
%13 = fcmp une double %12, %4
br i1 %13, label %3, label %14
14: ; preds = %3
ret double %12
}
int f(_Bool x) { return (x != 1); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x1,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    $0x1,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @f(i1 zeroext %0) {
%2 = alloca i8
%3 = zext i1 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = trunc i8 %4 to i1
%6 = zext i1 %5 to i32
%7 = icmp ne i32 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @f(i1 zeroext %0) {
%2 = xor i1 %0, true
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int mvprintw(int, int, char const *, int, int);
int ii_mvprintw(int y, int x, const char *fmt, int i, int j) {
  return (mvprintw(y, x, fmt, i, j));
}


x86 assembly (clang, -O0):
<ii_mvprintw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1030 <mvprintw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ii_mvprintw>:
jmp    1030 <mvprintw@plt>

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

LLVM IR (-O2):
define i32 @ii_mvprintw(i32 %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = tail call i32 @mvprintw(i32 %0, i32 %1, i8* %2, i32 %3, i32 %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ state_init_origin();
void state_init() { state_init_origin(); }


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

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

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

LLVM IR (-O2):
define void @state_init() {
%1 = tail call i32 (...) @state_init_origin()
ret void
}
/* Variables and functions */
float Square(float);
float RefractiveIndexToF0(float refractiveIndex) {
  return Square((refractiveIndex - 1.f) / (refractiveIndex + 1.f));
}


x86 assembly (clang, -O0):
<RefractiveIndexToF0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xed6(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xeca(%rip),%xmm1
addss  -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
call   1030 <Square@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RefractiveIndexToF0>:
movss  0xee8(%rip),%xmm1
addss  %xmm0,%xmm1
addss  0xee0(%rip),%xmm0
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
jmp    1030 <Square@plt>

LLVM IR (-O0):
define float @RefractiveIndexToF0(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float %3, 1.000000e+00
%5 = load float, float* %2
%6 = fadd float %5, 1.000000e+00
%7 = fdiv float %4, %6
%8 = call float @Square(float %7)
ret float %8
}

LLVM IR (-O2):
define float @RefractiveIndexToF0(float %0) {
%2 = fadd float %0, -1.000000e+00
%3 = fadd float %0, 1.000000e+00
%4 = fdiv float %2, %3
%5 = tail call float @Square(float %4)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void init_timer(int freq) {
  unsigned char cb = 0x80 | 0x06 | 0x30;
  outb(0x43, cb);
  outb(0x42, ((1193182 + (freq / 2)) / freq) % 256);
  outb(0x42, ((1193182 + (freq / 2)) / freq) / 256);
}


x86 assembly (clang, -O0):
<init_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movb   $0xb6,-0x5(%rbp)
movzbl -0x5(%rbp),%esi
mov    $0x43,%edi
call   1030 <outb@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1234de,%eax
cltd
idivl  -0x4(%rbp)
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    $0x42,%edi
call   1030 <outb@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1234de,%eax
cltd
idivl  -0x4(%rbp)
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    $0x42,%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_timer>:
push   %rbx
mov    %edi,%ebx
mov    $0x43,%edi
mov    $0xb6,%esi
call   1030 <outb@plt>
mov    %ebx,%eax
shr    $0x1f,%eax
add    %ebx,%eax
sar    %eax
add    $0x1234de,%eax
cltd
idiv   %ebx
lea    0xff(%rax),%ebx
test   %eax,%eax
cmovns %eax,%ebx
mov    %ebx,%ecx
and    $0xffffff00,%ecx
sub    %ecx,%eax
mov    $0x42,%edi
mov    %eax,%esi
call   1030 <outb@plt>
sar    $0x8,%ebx
mov    $0x42,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @init_timer(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
store i8 -74, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = call i32 @outb(i32 67, i32 %5)
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 2
%9 = add nsw i32 1193182, %8
%10 = load i32, i32* %2
%11 = sdiv i32 %9, %10
%12 = srem i32 %11, 256
%13 = call i32 @outb(i32 66, i32 %12)
%14 = load i32, i32* %2
%15 = sdiv i32 %14, 2
%16 = add nsw i32 1193182, %15
%17 = load i32, i32* %2
%18 = sdiv i32 %16, %17
%19 = sdiv i32 %18, 256
%20 = call i32 @outb(i32 66, i32 %19)
ret void
}

LLVM IR (-O2):
define void @init_timer(i32 %0) {
%2 = tail call i32 @outb(i32 67, i32 182)
%3 = sdiv i32 %0, 2
%4 = add nsw i32 %3, 1193182
%5 = sdiv i32 %4, %0
%6 = srem i32 %5, 256
%7 = tail call i32 @outb(i32 66, i32 %6)
%8 = sdiv i32 %5, 256
%9 = tail call i32 @outb(i32 66, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int som = 23 + 197 + (23 * 197);
  printf("de som is: %d", som);
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"de som is: %d\00"
define i32 @main() {
%1 = alloca i32
store i32 4751, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"de som is: %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 4751)
ret i32 0
}
int rtl930x_dma_if_rx_ring_cntr(int i) { return (0x7C8C) + ((i / 3) << 2); }


x86 assembly (clang, -O0):
<rtl930x_dma_if_rx_ring_cntr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
add    $0x7c8c,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtl930x_dma_if_rx_ring_cntr>:
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    0x7c8c(,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @rtl930x_dma_if_rx_ring_cntr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 3
%5 = shl i32 %4, 2
%6 = add nsw i32 31884, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @rtl930x_dma_if_rx_ring_cntr(i32 %0) {
%2 = sdiv i32 %0, 3
%3 = shl i32 %2, 2
%4 = add nsw i32 %3, 31884
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  printf("42.0 as an integer %d  \n", 42.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
movsd  0xed2(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"42.0 as an integer %d \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double 4.200000e+01)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"42.0 as an integer %d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double 4.200000e+01)
ret i32 0
}
void pv_remote_fini(void) {}


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

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

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

LLVM IR (-O2):
define void @pv_remote_fini() {
ret void
}
int pixel_get_g(unsigned int pixel) { return (pixel & 0xFF00) >> 8; }


x86 assembly (clang, -O0):
<pixel_get_g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
shr    $0x8,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pixel_get_g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65280
%5 = lshr i32 %4, 8
ret i32 %5
}

LLVM IR (-O2):
define i32 @pixel_get_g(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 255
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void err_msg(char *msg) {
  if (msg) {
    printf("Error: %s\n", msg);
  }
}


x86 assembly (clang, -O0):
<err_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1137 <err_msg+0x27>
mov    -0x8(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_msg>:
test   %rdi,%rdi
je     1124 <err_msg+0x14>
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Error: %s\0A\00"
define void @err_msg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Error: %s\0A\00"
define void @err_msg(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
void func2(void) {
  int func2_variable;
  printf("&func2_variable... %p\n", &func2_variable);
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [23 x i8] c"&func2_variable... %p\0A\00"
define void @func2() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32* %1)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"&func2_variable... %p\0A\00"
define void @func2() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_imm(int);
int /*<<< orphan*/ write_instr(int);
int f2_handler(char **save) {
  write_instr(0x00);
  write_imm(0x3B);
  write_instr(0x28);
  return 0;
}


x86 assembly (clang, -O0):
<f2_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x3b,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2_handler>:
push   %rax
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x3b,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f2_handler(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @write_instr(i32 0)
%4 = call i32 @write_imm(i32 59)
%5 = call i32 @write_instr(i32 40)
ret i32 0
}

LLVM IR (-O2):
define i32 @f2_handler(i8** nocapture readnone %0) {
%2 = tail call i32 @write_instr(i32 0)
%3 = tail call i32 @write_imm(i32 59)
%4 = tail call i32 @write_instr(i32 40)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void onezero_note_free(void *data) { free(data); }


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

x86 assembly (clang, -O2):
<onezero_note_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @onezero_note_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void strascii(p) register unsigned char *p;
{
  while (*p) {
    *p &= 0x7F;
    ++p;
  }
  return;
}


x86 assembly (clang, -O0):
<strascii>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <strascii+0x32>
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
and    $0x7f,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <strascii+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strascii>:
mov    (%rdi),%al
test   %al,%al
je     1120 <strascii+0x20>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
and    $0x7f,%al
mov    %al,-0x1(%rdi)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strascii+0x10>
ret

LLVM IR (-O0):
define void @strascii(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = and i32 %10, 127
%12 = trunc i32 %11 to i8
store i8 %12, i8* %8
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %2
br label %3
15: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @strascii(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = and i8 %5, 127
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main(void) { foo(10); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @foo(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 10)
ret i32 0
}
extern int ididid(x)
int x;
{ return idid(id(x)); }


x86 assembly (clang, -O0):
<ididid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <id@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1030 <idid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ididid>:
push   %rax
xor    %eax,%eax
call   1040 <id@plt>
mov    %eax,%edi
xor    %eax,%eax
pop    %rcx
jmp    1030 <idid@plt>

LLVM IR (-O0):
define i32 @ididid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @id to i32 (i32, ...)*)(i32 %3)
%5 = call i32 (i32, ...) bitcast (i32 (...)* @idid to i32 (i32, ...)*)(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @ididid(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @id to i32 (i32, ...)*)(i32 %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @idid to i32 (i32, ...)*)(i32 %2)
ret i32 %3
}