xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t signed_saturate_rshift(int32_t val, int bits, int rshift) {}


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

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

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

LLVM IR (-O2):
define i32 @signed_saturate_rshift(i32 %0, i32 %1, i32 %2) {
ret i32 undef
}
void s3c6400_default_sdhci0(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @s3c6400_default_sdhci0() {
ret void
}
/* Variables and functions */
int mkfifo(char const *, int);
int Mkfifo(const char *path, int mode) { return mkfifo(path, mode); }


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

x86 assembly (clang, -O2):
<Mkfifo>:
jmp    1030 <mkfifo@plt>

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

LLVM IR (-O2):
define i32 @Mkfifo(i8* %0, i32 %1) {
%3 = tail call i32 @mkfifo(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int cos(double);
double sec(double x) { return 1 / cos(x); }


x86 assembly (clang, -O0):
<sec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sec>:
push   %rax
call   1030 <cos@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sec(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @cos(double %3)
%5 = sdiv i32 1, %4
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
define double @sec(double %0) {
%2 = tail call i32 @cos(double %0)
%3 = add i32 %2, 1
%4 = icmp ult i32 %3, 3
%5 = select i1 %4, i32 %2, i32 0
%6 = sitofp i32 %5 to double
ret double %6
}
int ti_atan_start(double const *options) {
  (void)options;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ti_atan_start(double* nocapture readnone %0) {
ret i32 0
}
int test_imm_DDint64_midword_reg(long long val) {
  return ((val >> 16) & (0xDD << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_DDint64_midword_reg>:
test   $0xdd0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DDint64_midword_reg(i64 %0) {
%2 = and i64 %0, 14483456
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void gdk_x11_display_ungrab() {}


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

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

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

LLVM IR (-O2):
define void @gdk_x11_display_ungrab() {
ret void
}
/* Variables and functions */
unsigned int partition(unsigned int *, unsigned int);
void quicksort(unsigned int *a, unsigned int n) {
  if (n > 1) {
    unsigned int pivot_idx = partition(a, n);
    quicksort(a, pivot_idx);
    quicksort(a + pivot_idx + 1, n - pivot_idx - 1);
  }
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jbe    1174 <quicksort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <partition@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1040 <quicksort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%eax
shl    $0x2,%rax
add    %rax,%rdi
add    $0x4,%rdi
mov    -0xc(%rbp),%esi
sub    -0x10(%rbp),%esi
sub    $0x1,%esi
call   1040 <quicksort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jb     115c <quicksort+0x3c>
mov    %esi,%r14d
mov    %rdi,%rbx
nop
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <partition@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <quicksort@plt>
mov    %ebp,%eax
lea    (%rbx,%rax,4),%rbx
add    $0x4,%rbx
not    %ebp
add    %ebp,%r14d
cmp    $0x1,%r14d
ja     1130 <quicksort+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1) {
%3 = icmp ugt i32 %1, 1
br i1 %3, label %4, label %14
4: ; preds = %2, %4
%5 = phi i32 [ %12, %4 ], [ %1, %2 ]
%6 = phi i32* [ %10, %4 ], [ %0, %2 ]
%7 = tail call i32 @partition(i32* %6, i32 %5)
tail call void @quicksort(i32* %6, i32 %7)
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 1
%10 = getelementptr inbounds i32, i32* %9, i64 %8
%11 = xor i32 %7, -1
%12 = add i32 %5, %11
%13 = icmp ugt i32 %12, 1
br i1 %13, label %4, label %14
14: ; preds = %4, %2
ret void
}
/* Type definitions */
struct tinyrl {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int tinyrl_insert_text_len(struct tinyrl *, char const *, int /*<<< orphan*/);
bool tinyrl_insert_text(struct tinyrl *this, const char *text) {
  return tinyrl_insert_text_len(this, text, strlen(text));
}


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

x86 assembly (clang, -O2):
<tinyrl_insert_text>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <tinyrl_insert_text_len@plt>

LLVM IR (-O0):
%struct.tinyrl = type { i32 }
define i32 @tinyrl_insert_text(%struct.tinyrl* %0, i8* %1) {
%3 = alloca %struct.tinyrl*
%4 = alloca i8*
store %struct.tinyrl* %0, %struct.tinyrl** %3
store i8* %1, i8** %4
%5 = load %struct.tinyrl*, %struct.tinyrl** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @tinyrl_insert_text_len(%struct.tinyrl* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.tinyrl = type { i32 }
define i32 @tinyrl_insert_text(%struct.tinyrl* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @tinyrl_insert_text_len(%struct.tinyrl* %0, i8* %1, i32 %3)
ret i32 %4
}
void fo(int *y) {
  char x;
  asm(""
      : "=@cc"
        "o"(x));
  if (!x)
    *y = 0;
}


x86 assembly (clang, -O0):
<fo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
seto   %al
mov    %al,-0x9(%rbp)
cmpb   $0x0,-0x9(%rbp)
jne    1122 <fo+0x22>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fo>:
jno    1103 <fo+0x3>
ret
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @fo(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
%4 = call i8 asm "", "={@cco},~{dirflag},~{fpsr},~{flags}"()
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = icmp ne i8 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = load i32*, i32** %2
store i32 0, i32* %8
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @fo(i32* nocapture writeonly %0) {
%2 = tail call i8 asm "", "={@cco},~{dirflag},~{fpsr},~{flags}"()
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
store i32 0, i32* %0
br label %5
5: ; preds = %4, %1
ret void
}
int any_odd_is_one(unsigned val) { return (val & 0xaaaaaaaa) != 0; }


x86 assembly (clang, -O0):
<any_odd_is_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xaaaaaaaa,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<any_odd_is_one>:
xor    %eax,%eax
test   $0xaaaaaaaa,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @any_odd_is_one(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -1431655766
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @any_odd_is_one(i32 %0) {
%2 = and i32 %0, -1431655766
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int main() {
  char name[25];
  printf("Enter your name: ");
  fgets(name, 25, stdin);
  printf("Hello %s", name);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    $0x19,%esi
call   1040 <fgets@plt>
lea    -0x20(%rbp),%rsi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x19,%esi
call   1040 <fgets@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter your name: \00"
@stdin = global i32 0
@.str.1 = [9 x i8] c"Hello %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [25 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 25, i32 %5)
%7 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Enter your name: \00"
@stdin = global i32 0
@.str.1 = [9 x i8] c"Hello %s\00"
define i32 @main() {
%1 = alloca [25 x i8]
%2 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 25, i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fatalError(char *);
void timeoutHandler(int NotUsed) {
  (void)NotUsed;
  fatalError("timeout\n");
}


x86 assembly (clang, -O0):
<timeoutHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <fatalError@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"timeout\0A\00"
define void @timeoutHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @fatalError(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"timeout\0A\00"
define void @timeoutHandler(i32 %0) {
%2 = tail call i32 @fatalError(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned char *hmac_sha1(unsigned char *, unsigned char const *, size_t,
                         unsigned char const *, size_t);
unsigned char *mac_hmac_sha1(unsigned char *out, const unsigned char *key,
                             size_t key_len, const unsigned char *msg,
                             size_t msg_len) {
  return hmac_sha1(out, key, key_len, msg, msg_len);
}


x86 assembly (clang, -O0):
<mac_hmac_sha1>:
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    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <hmac_sha1@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mac_hmac_sha1>:
jmp    1030 <hmac_sha1@plt>

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

LLVM IR (-O2):
define i8* @mac_hmac_sha1(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i8* @hmac_sha1(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ release_page(int);
void release_page_range(unsigned int start_pageno, unsigned int end_pageno) {
  for (int i = start_pageno; i < end_pageno + 1; i++)
    release_page(i);
}


x86 assembly (clang, -O0):
<release_page_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jae    114b <release_page_range+0x3b>
mov    -0xc(%rbp),%edi
call   1030 <release_page@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <release_page_range+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<release_page_range>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
add    $0x1,%ebx
cmp    %edi,%ebx
jbe    112e <release_page_range+0x1e>
mov    %edi,%ebp
xchg   %ax,%ax
mov    %ebp,%edi
call   1030 <release_page@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <release_page_range+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @release_page_range(i32 %0, i32 %1) {
%3 = add i32 %1, 1
%4 = icmp ugt i32 %3, %0
br i1 %4, label %6, label %5
5: ; preds = %6, %2
ret void
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ %0, %2 ]
%8 = tail call i32 @release_page(i32 %7)
%9 = add i32 %7, 1
%10 = icmp eq i32 %7, %1
br i1 %10, label %5, label %6
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int getSQLResultInt(int /*<<< orphan*/ *, char *);
char *sqlite3_mprintf(char *, char *, char *);
int isUserAdmin(sqlite3 *db, char *username, char *password) {
  int result;
  char *sql = sqlite3_mprintf("Select IsAdmin From Database "
                              "Where Username = '%q' and Password = '%q';",
                              username, password);
  result = getSQLResultInt(db, sql);
  return result;
}


x86 assembly (clang, -O0):
<isUserAdmin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xebd(%rip),%rdi
call   1040 <sqlite3_mprintf@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <getSQLResultInt@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isUserAdmin>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <sqlite3_mprintf@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <getSQLResultInt@plt>

LLVM IR (-O0):
@.str = [72 x i8] c"Select IsAdmin From Database Where Username = '%q' and Password = '%q';\00"
define i32 @isUserAdmin(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i8* @sqlite3_mprintf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
store i8* %11, i8** %8
%12 = load i32*, i32** %4
%13 = load i8*, i8** %8
%14 = call i32 @getSQLResultInt(i32* %12, i8* %13)
store i32 %14, i32* %7
%15 = load i32, i32* %7
ret i32 %15
}

LLVM IR (-O2):
@.str = [72 x i8] c"Select IsAdmin From Database Where Username = '%q' and Password = '%q';\00"
define i32 @isUserAdmin(i32* %0, i8* %1, i8* %2) {
%4 = tail call i8* @sqlite3_mprintf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
%5 = tail call i32 @getSQLResultInt(i32* %0, i8* %4)
ret i32 %5
}
/* Variables and functions */
int rand();
int rand_for_y(int y, int y_end) { return y + rand() % (y_end - y); }


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

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

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

LLVM IR (-O2):
define i32 @rand_for_y(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub nsw i32 %1, %0
%5 = srem i32 %3, %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int /*<<< orphan*/ __get_unaligned_be32(int /*<<< orphan*/ const *);
u_int32_t get_unaligned_be32(const void *p) {
  return __get_unaligned_be32((const u_char *)p);
}


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

x86 assembly (clang, -O2):
<get_unaligned_be32>:
jmp    1030 <__get_unaligned_be32@plt>

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

LLVM IR (-O2):
define i32 @get_unaligned_be32(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @__get_unaligned_be32(i32* %2)
ret i32 %3
}
int wr_hashfun_uchar(const char *s) { return (unsigned char)(*s); }


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

x86 assembly (clang, -O2):
<wr_hashfun_uchar>:
movzbl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @wr_hashfun_uchar(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
ret i32 %5
}

LLVM IR (-O2):
define i32 @wr_hashfun_uchar(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
ret i32 %3
}
int sort_utils_double_cmp(const void *const a, const void *const b) {
  const double *const x = (const double *const)a;
  const double *const y = (const double *const)b;
  return (*x > *y) - (*x < *y);
}


x86 assembly (clang, -O0):
<sort_utils_double_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
ucomisd (%rax),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x18(%rbp),%rcx
movsd  (%rcx),%xmm1
mov    -0x20(%rbp),%rcx
movsd  (%rcx),%xmm0
ucomisd %xmm1,%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_utils_double_cmp>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sort_utils_double_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double*
%6 = alloca double*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to double*
store double* %8, double** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to double*
store double* %10, double** %6
%11 = load double*, double** %5
%12 = load double, double* %11
%13 = load double*, double** %6
%14 = load double, double* %13
%15 = fcmp ogt double %12, %14
%16 = zext i1 %15 to i32
%17 = load double*, double** %5
%18 = load double, double* %17
%19 = load double*, double** %6
%20 = load double, double* %19
%21 = fcmp olt double %18, %20
%22 = zext i1 %21 to i32
%23 = sub nsw i32 %16, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @sort_utils_double_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
%8 = zext i1 %7 to i32
%9 = fcmp olt double %5, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
void rcu_irq_exit_check_preempt(void) {}


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

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

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

LLVM IR (-O2):
define void @rcu_irq_exit_check_preempt() {
ret void
}
/* Variables and functions */
_Bool is_cygwin();
_Bool is_cygwin64() { return is_cygwin(); }


x86 assembly (clang, -O0):
<is_cygwin64>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <is_cygwin@plt>
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i1 @is_cygwin64() {
%1 = call zeroext i1 (...) @is_cygwin()
ret i1 %1
}

LLVM IR (-O2):
define zeroext i1 @is_cygwin64() {
%1 = tail call zeroext i1 (...) @is_cygwin()
ret i1 %1
}
/* Type definitions */
struct statfs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ statfs(char *, struct statfs *);
int main(void) {
  struct statfs stb;
  assert(statfs("/proc/self/status", &stb) == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <statfs@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <statfs@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.statfs = type { i32 }
@.str = [18 x i8] c"/proc/self/status\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.statfs
store i32 0, i32* %1
%3 = call i64 @statfs(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.statfs* %2)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret i32 0
}

LLVM IR (-O2):
%struct.statfs = type { i32 }
@.str = [18 x i8] c"/proc/self/status\00"
define i32 @main() {
%1 = alloca %struct.statfs
%2 = bitcast %struct.statfs* %1 to i8*
%3 = call i64 @statfs(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.statfs* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void shell() {
  printf("You got it\n");
  system("/bin/sh");
}


x86 assembly (clang, -O0):
<shell>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xed5(%rip),%rdi
call   1030 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<shell>:
push   %rax
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"You got it\0A\00"
@.str.1 = [8 x i8] c"/bin/sh\00"
define void @shell() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"/bin/sh\00"
@str = [11 x i8] c"You got it\00"
define void @shell() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int main() { return 120; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 120
}
int idptr_cmp(const void *x1, const void *x2) {
  int id1 = **(int *const *)x1;
  int id2 = **(int *const *)x2;
  return id1 - id2;
}


x86 assembly (clang, -O0):
<idptr_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<idptr_cmp>:
mov    (%rdi),%rax
mov    (%rax),%eax
mov    (%rsi),%rcx
sub    (%rcx),%eax
ret

LLVM IR (-O0):
define i32 @idptr_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32**
%9 = load i32*, i32** %8
%10 = load i32, i32* %9
store i32 %10, i32* %5
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32**
%13 = load i32*, i32** %12
%14 = load i32, i32* %13
store i32 %14, i32* %6
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = sub nsw i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @idptr_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32**
%4 = load i32*, i32** %3
%5 = load i32, i32* %4
%6 = bitcast i8* %1 to i32**
%7 = load i32*, i32** %6
%8 = load i32, i32* %7
%9 = sub nsw i32 %5, %8
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
void freelocale(locale_t locale) {}


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

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

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

LLVM IR (-O2):
define void @freelocale(i32 %0) {
ret void
}
int test_imm_90int64_lowword_reg(long long val) {
  return ((val) & (0x90 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_90int64_lowword_reg>:
test   $0x90,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_90int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 144
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int imx5_cpuidle_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @imx5_cpuidle_init() {
ret i32 0
}
/* Variables and functions */
int checkinscode();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int answer;
  answer = checkinscode();
  printf("%d\n", answer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <checkinscode@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @checkinscode()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ads8568_init_gpio();
int /*<<< orphan*/ ads8568_init_pinmux();
int /*<<< orphan*/ ads8568_reset();
int ads8568_init(void) {
  ads8568_init_pinmux();
  ads8568_init_gpio();
  ads8568_reset();
  return 0;
}


x86 assembly (clang, -O0):
<ads8568_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ads8568_init_pinmux@plt>
mov    $0x0,%al
call   1050 <ads8568_init_gpio@plt>
mov    $0x0,%al
call   1040 <ads8568_reset@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ads8568_init>:
push   %rax
xor    %eax,%eax
call   1030 <ads8568_init_pinmux@plt>
xor    %eax,%eax
call   1050 <ads8568_init_gpio@plt>
xor    %eax,%eax
call   1040 <ads8568_reset@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ads8568_init() {
%1 = call i32 (...) @ads8568_init_pinmux()
%2 = call i32 (...) @ads8568_init_gpio()
%3 = call i32 (...) @ads8568_reset()
ret i32 0
}

LLVM IR (-O2):
define i32 @ads8568_init() {
%1 = tail call i32 (...) @ads8568_init_pinmux()
%2 = tail call i32 (...) @ads8568_init_gpio()
%3 = tail call i32 (...) @ads8568_reset()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int usage(const char *argv0) {
  fprintf(stderr, "usage: %s filein.rat fileout.rat hW\n\n", argv0);
  fprintf(stderr, "\t hW \t half width of the search window \t [=1]\n");
  return 1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef2(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"usage: %s filein.rat fileout.rat hW\0A\0A\00"
@.str.1 = [47 x i8] c"\09 hW \09 half width of the search window \09 [=1]\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"usage: %s filein.rat fileout.rat hW\0A\0A\00"
@.str.1 = [47 x i8] c"\09 hW \09 half width of the search window \09 [=1]\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void USBHostPwrFaultEnable(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x40050000);
  (*((volatile uint16_t *)(ui32Base + 0x00000400))) |= 0x00000010;
}


x86 assembly (clang, -O0):
<USBHostPwrFaultEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x40050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x400,%eax
cltq
mov    (%rax),%ecx
or     $0x10,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostPwrFaultEnable>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x40050000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
orl    $0x10,0x400(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @USBHostPwrFaultEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1074069504
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1024
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = or i32 %11, 16
store volatile i32 %12, i32* %10
ret void
}

LLVM IR (-O2):
define void @USBHostPwrFaultEnable(i32 %0) {
%2 = icmp eq i32 %0, 1074069504
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 1024
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = or i32 %8, 16
store volatile i32 %9, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
unsigned Sys_MemFree(void *p) {
  free(p);
  return 0;
}


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

x86 assembly (clang, -O2):
<Sys_MemFree>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @Sys_MemFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int solve_by_quaddobl_homotopy_continuation(int number_of_tasks) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(246, &number_of_tasks, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solve_by_quaddobl_homotopy_continuation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xf6,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_by_quaddobl_homotopy_continuation>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0xf6,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @solve_by_quaddobl_homotopy_continuation(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 246, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Variables and functions */
int syscall(int, int, int);
int timerfd_create(int clockid, int flags) {
  return syscall(283, clockid, flags);
}


x86 assembly (clang, -O0):
<timerfd_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x11b,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timerfd_create>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x11b,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @timerfd_create(i32 %0, i32 %1) {
%3 = tail call i32 @syscall(i32 283, i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fwrite(char const *, int, size_t, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void put_message(const char *msg, size_t len) { fwrite(msg, 1, len, stdout); }


x86 assembly (clang, -O0):
<put_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    0x2eb1(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_message>:
mov    %rsi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @put_message(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = load i32, i32* @stdout
%8 = call i32 @fwrite(i8* %5, i32 1, i64 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @put_message(i8* %0, i64 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fwrite(i8* %0, i32 1, i64 %1, i32 %3)
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *raptor_basename(const char *name) {
  char *p;
  if ((p = strrchr(name, '/')))
    name = p + 1;
  else if ((p = strrchr(name, '\\')))
    name = p + 1;
  return name;
}


x86 assembly (clang, -O0):
<raptor_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1149 <raptor_basename+0x39>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1176 <raptor_basename+0x66>
mov    -0x8(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1171 <raptor_basename+0x61>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1176 <raptor_basename+0x66>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raptor_basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1129 <raptor_basename+0x19>
add    $0x1,%rax
pop    %rbx
ret
mov    %rbx,%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
mov    %rax,%rcx
add    $0x1,%rax
test   %rcx,%rcx
cmove  %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @raptor_basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 1
br label %11
6: ; preds = %1
%7 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 92)
%8 = icmp eq i8* %7, null
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = select i1 %8, i8* %0, i8* %9
br label %11
11: ; preds = %6, %4
%12 = phi i8* [ %5, %4 ], [ %10, %6 ]
ret i8* %12
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int microsecs() {
  struct timespec ts;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  return (ts.tv_sec * 1000000) + (ts.tv_nsec / 1000);
}


x86 assembly (clang, -O0):
<microsecs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<microsecs>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @microsecs() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @microsecs() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = add nsw i32 %10, %7
ret i32 %11
}
int fun1232() { return 1232; }


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

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

LLVM IR (-O0):
define i32 @fun1232() {
ret i32 1232
}

LLVM IR (-O2):
define i32 @fun1232() {
ret i32 1232
}