xunge/DecIR huggingface dataset:
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void *calloc(int num, int size) {
  void *p = malloc(num * size);
  if (!p)
    return 0;
  memset(p, 0, num * size);
  return p;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%edi
imul   -0x10(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1156 <calloc+0x36>
movq   $0x0,-0x8(%rbp)
jmp    1170 <calloc+0x50>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
imul   -0x10(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
imul   %esi,%ebx
mov    %ebx,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1144 <calloc+0x24>
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @calloc(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i32 0, i32 %3)
br label %8
8: ; preds = %2, %6
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ isalnum(int const);
scalar_t__ isprint(int const);
int /*<<< orphan*/ isspace(int const);
int ispunct(const int c) { return isprint(c) && !isspace(c) && !isalnum(c); }


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <isprint@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1180 <ispunct+0x50>
mov    -0x4(%rbp),%edi
call   1040 <isspace@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1180 <ispunct+0x50>
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1050 <isprint@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     115a <ispunct+0x2a>
mov    %ebp,%edi
call   1040 <isspace@plt>
test   %eax,%eax
jne    115a <ispunct+0x2a>
mov    %ebp,%edi
call   1030 <isalnum@plt>
xor    %ebx,%ebx
test   %eax,%eax
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ispunct(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isprint(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @isspace(i32 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i32 @isalnum(i32 %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br label %15
15: ; preds = %10, %6, %1
%16 = phi i1 [ false, %6 ], [ false, %1 ], [ %14, %10 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = tail call i64 @isprint(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i32 @isspace(i32 %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i32 @isalnum(i32 %0)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
void *malloc(int);
int main(void) {
  void *ptr = malloc(42);
  return (ptr != NULL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2a,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 42)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int listen(int, int);
int sock_listen(int *fd, int backlog) { return listen((*fd), backlog); }


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

x86 assembly (clang, -O2):
<sock_listen>:
mov    (%rdi),%edi
jmp    1030 <listen@plt>

LLVM IR (-O0):
define i32 @sock_listen(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* %5
%7 = load i32, i32* %4
%8 = call i32 @listen(i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @sock_listen(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @listen(i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ color_printf(char *);
int /*<<< orphan*/ vcode_dump_tab(int, int);
void vcode_dump_comment(int col) {
  vcode_dump_tab(col, 40);
  color_printf("$cyan$// ");
}


x86 assembly (clang, -O0):
<vcode_dump_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x28,%esi
call   1030 <vcode_dump_tab@plt>
lea    0xec1(%rip),%rdi
call   1040 <color_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vcode_dump_comment>:
push   %rax
mov    $0x28,%esi
call   1030 <vcode_dump_tab@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1040 <color_printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"$cyan$// \00"
define void @vcode_dump_comment(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @vcode_dump_tab(i32 %3, i32 40)
%5 = call i32 @color_printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"$cyan$// \00"
define void @vcode_dump_comment(i32 %0) {
%2 = tail call i32 @vcode_dump_tab(i32 %0, i32 40)
%3 = tail call i32 @color_printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  uint64_t n = 600851475143;
  int i = 2;
  while (i * i < n) {
    while (n % i == 0) {
      n = n / i;
    }
    i++;
  }
  printf("%lu", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xe589eac7,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    116f <main+0x5f>
jmp    1142 <main+0x32>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1161 <main+0x51>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1142 <main+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xe87(%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    $0xe589eac7,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lu\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 -443946297, i32* %2
store i32 2, i32* %3
br label %4
4: ; preds = %20, %0
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = mul nsw i32 %5, %6
%8 = load i32, i32* %2
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %23
10: ; preds = %4
br label %11
11: ; preds = %16, %10
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = srem i32 %12, %13
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %11
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = sdiv i32 %17, %18
store i32 %19, i32* %2
br label %11
20: ; preds = %11
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %4
23: ; preds = %4
%24 = load i32, i32* %2
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lu\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -443946297)
ret i32 0
}
__attribute__((always_)) void *phys_to_virt(unsigned long address) {
  return ((void *)((unsigned long)(address) + ((unsigned long)(0xC0000000UL))));
}


x86 assembly (clang, -O0):
<phys_to_virt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0xc0000000,%rax
add    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<phys_to_virt>:
mov    $0xc0000000,%eax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @phys_to_virt(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 3221225472
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @phys_to_virt(i64 %0) {
%2 = add i64 %0, 3221225472
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_emit_interfaces_added(void *bus, const char *path, const char *interface,
                             ...) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_emit_interfaces_added>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
neg    %eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_emit_interfaces_added>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_emit_interfaces_added(i8* %0, i8* %1, i8* %2, ...) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_emit_interfaces_added(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, ...) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
int f() {
  int *p;
  p = 0;
  return 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 0
}
/* Type definitions */
typedef unsigned int loff_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void read_nvram(loff_t *ppos) {
  unsigned int i;
  *ppos = i;
  assert(*ppos == i);
}


x86 assembly (clang, -O0):
<read_nvram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_nvram>:
xor    %edi,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @read_nvram(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32, i32* %3
%5 = load i32*, i32** %2
store i32 %4, i32* %5
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = load i32, i32* %3
%9 = icmp eq i32 %7, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret void
}

LLVM IR (-O2):
define void @read_nvram(i32* nocapture readnone %0) {
%2 = tail call i32 @assert(i32 0)
ret void
}
int __doewma(int oldv, int newv, int num, int den) {
  int retval;
  retval = ((oldv * (den - num)) + (newv * num)) / den;
  return retval;
}


x86 assembly (clang, -O0):
<__doewma>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    -0xc(%rbp),%ecx
imul   %ecx,%eax
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__doewma>:
mov    %ecx,%eax
sub    %edx,%eax
imul   %edi,%eax
imul   %edx,%esi
add    %esi,%eax
cltd
idiv   %ecx
ret

LLVM IR (-O0):
define i32 @__doewma(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i32, i32* %8
%12 = load i32, i32* %7
%13 = sub nsw i32 %11, %12
%14 = mul nsw i32 %10, %13
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = mul nsw i32 %15, %16
%18 = add nsw i32 %14, %17
%19 = load i32, i32* %8
%20 = sdiv i32 %18, %19
store i32 %20, i32* %9
%21 = load i32, i32* %9
ret i32 %21
}

LLVM IR (-O2):
define i32 @__doewma(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %3, %2
%6 = mul nsw i32 %5, %0
%7 = mul nsw i32 %2, %1
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %8, %3
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func1(void) { printf("hello from func1\n"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"hello from func1\0A\00"
define void @func1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"hello from func1\00"
define void @func1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ r;

/* Variables and functions */
int /*<<< orphan*/ memcpy(float *, void const *, int);
float S_LD_F(const void *a) {
  float r;
  memcpy(&r, a, sizeof(r));
  return r;
}


x86 assembly (clang, -O0):
<S_LD_F>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<S_LD_F>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @S_LD_F(i8* %0) {
%2 = alloca i8*
%3 = alloca float
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(float* %3, i8* %4, i32 4)
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @S_LD_F(i8* %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = call i32 @memcpy(float* %2, i8* %0, i32 4)
%5 = load float, float* %2
ret float %5
}
void sync(void) { return; }


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

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

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

LLVM IR (-O2):
define void @sync() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_IterateSyntaxMethodMustReturnBoolean(long p_position) {
  _Error(p_position, "Iterate syntax methods must return boolean or CBool");
}


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

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

LLVM IR (-O0):
@.str = [52 x i8] c"Iterate syntax methods must return boolean or CBool\00"
define void @Error_IterateSyntaxMethodMustReturnBoolean(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"Iterate syntax methods must return boolean or CBool\00"
define void @Error_IterateSyntaxMethodMustReturnBoolean(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}
void Timer3A_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<Timer3A_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Timer3A_Handler+0x9>
jmp    1109 <Timer3A_Handler+0x9>

x86 assembly (clang, -O2):
<Timer3A_Handler>:
jmp    1100 <Timer3A_Handler>

LLVM IR (-O0):
define void @Timer3A_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Timer3A_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
int /*<<< orphan*/ IntDisable(int);
int /*<<< orphan*/ IntUnregister(int);
int _QEIIntNumberGet(int);
void QEIIntUnregister(uint32_t ui32Base) {
  uint32_t ui32Int;
  ASSERT((ui32Base == 0x4002C000) || (ui32Base == 0x4002D000));
  ui32Int = _QEIIntNumberGet(ui32Base);
  ASSERT(ui32Int != 0);
  IntDisable(ui32Int);
  IntUnregister(ui32Int);
}


x86 assembly (clang, -O0):
<QEIIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x4002c000,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     116a <QEIIntUnregister+0x2a>
cmpl   $0x4002d000,-0x4(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <ASSERT@plt>
mov    -0x4(%rbp),%edi
call   1030 <_QEIIntNumberGet@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <ASSERT@plt>
mov    -0x8(%rbp),%edi
call   1040 <IntDisable@plt>
mov    -0x8(%rbp),%edi
call   1060 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIIntUnregister>:
push   %rbx
mov    %edi,%ebx
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x4002c000,%eax
sete   %dil
call   1050 <ASSERT@plt>
mov    %ebx,%edi
call   1030 <_QEIIntNumberGet@plt>
mov    %eax,%ebx
xor    %edi,%edi
test   %eax,%eax
setne  %dil
call   1050 <ASSERT@plt>
mov    %ebx,%edi
call   1040 <IntDisable@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1060 <IntUnregister@plt>

LLVM IR (-O0):
define void @QEIIntUnregister(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1073922048
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 1073926144
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ true, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
%12 = call i32 @ASSERT(i32 %11)
%13 = load i32, i32* %2
%14 = call i32 @_QEIIntNumberGet(i32 %13)
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i32
%18 = call i32 @ASSERT(i32 %17)
%19 = load i32, i32* %3
%20 = call i32 @IntDisable(i32 %19)
%21 = load i32, i32* %3
%22 = call i32 @IntUnregister(i32 %21)
ret void
}

LLVM IR (-O2):
define void @QEIIntUnregister(i32 %0) {
%2 = and i32 %0, -4097
%3 = icmp eq i32 %2, 1073922048
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = tail call i32 @_QEIIntNumberGet(i32 %0)
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @ASSERT(i32 %8)
%10 = tail call i32 @IntDisable(i32 %6)
%11 = tail call i32 @IntUnregister(i32 %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256d;

/* Variables and functions */
int /*<<< orphan*/ _mm256_extractf128_pd(int /*<<< orphan*/,
                                         int /*<<< orphan*/);
int sum_m128d(int /*<<< orphan*/);
int sum_m256d(__m256d vec) {
  return sum_m128d(_mm256_extractf128_pd(vec, 0)) +
         sum_m128d(_mm256_extractf128_pd(vec, 0));
}


x86 assembly (clang, -O0):
<sum_m256d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <_mm256_extractf128_pd@plt>
mov    %eax,%edi
call   1030 <sum_m128d@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <_mm256_extractf128_pd@plt>
mov    %eax,%edi
call   1030 <sum_m128d@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_m256d>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %esi,%esi
call   1040 <_mm256_extractf128_pd@plt>
mov    %eax,%edi
call   1030 <sum_m128d@plt>
mov    %eax,%ebp
mov    %ebx,%edi
xor    %esi,%esi
call   1040 <_mm256_extractf128_pd@plt>
mov    %eax,%edi
call   1030 <sum_m128d@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sum_m256d(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_mm256_extractf128_pd(i32 %3, i32 0)
%5 = call i32 @sum_m128d(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @_mm256_extractf128_pd(i32 %6, i32 0)
%8 = call i32 @sum_m128d(i32 %7)
%9 = add nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @sum_m256d(i32 %0) {
%2 = tail call i32 @_mm256_extractf128_pd(i32 %0, i32 0)
%3 = tail call i32 @sum_m128d(i32 %2)
%4 = tail call i32 @_mm256_extractf128_pd(i32 %0, i32 0)
%5 = tail call i32 @sum_m128d(i32 %4)
%6 = add nsw i32 %5, %3
ret i32 %6
}
void INT_Excep_SCI0_TXI0(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SCI0_TXI0() {
ret void
}
/* Variables and functions */
unsigned int sys_call(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/);
unsigned int timer_reset_irq() { return sys_call(0x04, 3, 0, 0, 0); }


x86 assembly (clang, -O0):
<timer_reset_irq>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0x3,%esi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <sys_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_reset_irq>:
mov    $0x4,%edi
mov    $0x3,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <sys_call@plt>

LLVM IR (-O0):
define i32 @timer_reset_irq() {
%1 = call i32 @sys_call(i32 4, i32 3, i32 0, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @timer_reset_irq() {
%1 = tail call i32 @sys_call(i32 4, i32 3, i32 0, i32 0, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ myputs(char *);
void irq_c_handler(void) {
  void (*handler)(void) = 0x0;
  myputs("in irq_c_handler\n");
  handler = (void (*)(void))(*(volatile unsigned int *)(0xF2000F00));
  if (handler) {
    handler();
  }
}


x86 assembly (clang, -O0):
<irq_c_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
lea    0xed9(%rip),%rdi
call   1030 <myputs@plt>
mov    $0xf2000f00,%eax
mov    (%rax),%eax
mov    %eax,%eax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1147 <irq_c_handler+0x37>
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_c_handler>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <myputs@plt>
mov    $0xf2000f00,%eax
mov    (%rax),%eax
test   %rax,%rax
je     112c <irq_c_handler+0x1c>
pop    %rcx
jmp    *%rax
pop    %rax
ret

LLVM IR (-O0):
@.str = [18 x i8] c"in irq_c_handler\0A\00"
define void @irq_c_handler() {
%1 = alloca void ()*
store void ()* null, void ()** %1
%2 = call i32 @myputs(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = load volatile i32, i32* inttoptr (i64 4060090112 to i32*)
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to void ()*
store void ()* %5, void ()** %1
%6 = load void ()*, void ()** %1
%7 = icmp ne void ()* %6, null
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = load void ()*, void ()** %1
br label %10
10: ; preds = %8, %0
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"in irq_c_handler\0A\00"
define void @irq_c_handler() {
%1 = tail call i32 @myputs(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = load volatile i32, i32* inttoptr (i64 4060090112 to i32*)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = zext i32 %2 to i64
%6 = inttoptr i64 %5 to void ()*
tail call void %6()
br label %7
7: ; preds = %4, %0
ret void
}
/* Variables and functions */
int bit_set(int /*<<< orphan*/, unsigned int);
bool is_bit_set(int n, unsigned int pos_zb) { return (n & bit_set(0, pos_zb)); }


x86 assembly (clang, -O0):
<is_bit_set>:
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    -0x8(%rbp),%esi
xor    %edi,%edi
call   1030 <bit_set@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_bit_set>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1030 <bit_set@plt>
and    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_bit_set(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 @bit_set(i32 0, i32 %6)
%8 = and i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_bit_set(i32 %0, i32 %1) {
%3 = tail call i32 @bit_set(i32 0, i32 %1)
%4 = and i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int const rand();
int random_integer(const int max) { return rand() % max; }


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

x86 assembly (clang, -O2):
<random_integer>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @random_integer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @random_integer(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char *);
FILE *open_hasm(const char *path) { return fopen(path, "r"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define noalias i32* @open_hasm(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32* %2
}
/* Variables and functions */
char *optarg;
int optind;
void _getopt_reset(int argc, char *argv[]) {
  optind = 1;
  optarg = argv[1];
}


x86 assembly (clang, -O0):
<_getopt_reset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ece(%rip),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    0x2ed1(%rip),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_getopt_reset>:
mov    0x2ed9(%rip),%rax
movl   $0x1,(%rax)
mov    0x8(%rsi),%rax
mov    0x2ee0(%rip),%rcx
mov    %rax,(%rcx)
ret

LLVM IR (-O0):
@optind = global i32 0
@optarg = global i8* null
define void @_getopt_reset(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 1, i32* @optind
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
store i8* %7, i8** @optarg
ret void
}

LLVM IR (-O2):
@optind = global i32 0
@optarg = global i8* null
define void @_getopt_reset(i32 %0, i8** nocapture %1) {
store i32 1, i32* @optind
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
store i8* %4, i8** @optarg
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eat();
int /*<<< orphan*/ put_forks(int);
int /*<<< orphan*/ take_forks(int);
int /*<<< orphan*/ think();
void philo(int i) {
  while (1) {
    think();
    take_forks(i);
    eat();
    put_forks(i);
  }
}


x86 assembly (clang, -O0):
<philo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <think@plt>
mov    -0x4(%rbp),%edi
call   1060 <take_forks@plt>
mov    $0x0,%al
call   1030 <eat@plt>
mov    -0x4(%rbp),%edi
call   1050 <put_forks@plt>
jmp    114b <philo+0xb>

x86 assembly (clang, -O2):
<philo>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1040 <think@plt>
mov    %ebx,%edi
call   1060 <take_forks@plt>
xor    %eax,%eax
call   1030 <eat@plt>
mov    %ebx,%edi
call   1050 <put_forks@plt>
jmp    1150 <philo+0x10>

LLVM IR (-O0):
define void @philo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %3
%4 = call i32 (...) @think()
%5 = load i32, i32* %2
%6 = call i32 @take_forks(i32 %5)
%7 = call i32 (...) @eat()
%8 = load i32, i32* %2
%9 = call i32 @put_forks(i32 %8)
br label %3
}

LLVM IR (-O2):
define void @philo(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 (...) @think()
%4 = tail call i32 @take_forks(i32 %0)
%5 = tail call i32 (...) @eat()
%6 = tail call i32 @put_forks(i32 %0)
br label %2
}
/* Variables and functions */
char *malloc(int);
char *chunkify(char *s, int low, int up) {
  char *str = malloc(sizeof(char *) * 100);
  int i;
  for (i = low; i < up; i++)
    str[i - low] = s[i];
  return str;
}


x86 assembly (clang, -O0):
<chunkify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x320,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    116b <chunkify+0x5b>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    -0xc(%rbp),%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1136 <chunkify+0x26>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chunkify>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %esi,%ebx
mov    %rdi,%r14
mov    $0x320,%edi
call   1040 <malloc@plt>
mov    %rax,%r15
cmp    %ebp,%ebx
jge    115b <chunkify+0x3b>
movslq %ebx,%rax
add    %rax,%r14
not    %ebx
add    %ebp,%ebx
add    $0x1,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @chunkify(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = call i8* @malloc(i32 800)
store i8* %9, i8** %7
%10 = load i32, i32* %5
store i32 %10, i32* %8
br label %11
11: ; preds = %27, %3
%12 = load i32, i32* %8
%13 = load i32, i32* %6
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %30
15: ; preds = %11
%16 = load i8*, i8** %4
%17 = load i32, i32* %8
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = load i8*, i8** %7
%22 = load i32, i32* %8
%23 = load i32, i32* %5
%24 = sub nsw i32 %22, %23
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %21, i64 %25
store i8 %20, i8* %26
br label %27
27: ; preds = %15
%28 = load i32, i32* %8
%29 = add nsw i32 %28, 1
store i32 %29, i32* %8
br label %11
30: ; preds = %11
%31 = load i8*, i8** %7
ret i8* %31
}

LLVM IR (-O2):
define noalias i8* @chunkify(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call dereferenceable_or_null(800) i8* @malloc(i32 800)
%5 = icmp slt i32 %1, %2
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = sext i32 %1 to i64
%8 = getelementptr i8, i8* %0, i64 %7
%9 = xor i32 %1, -1
%10 = add i32 %9, %2
%11 = zext i32 %10 to i64
%12 = add nuw nsw i64 %11, 1
br label %13
13: ; preds = %6, %3
ret i8* %4
}
int test_imm_F5uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xF5 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F5uint64_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, 245
%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_F5uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 16056320
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned int cstrlen(const char *s) {
  unsigned int i;
  for (i = 0; *s; ++i, ++s) {
  }
  return i;
}


x86 assembly (clang, -O0):
<cstrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113b <cstrlen+0x3b>
jmp    1121 <cstrlen+0x21>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <cstrlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cstrlen>:
cmpb   $0x0,(%rdi)
je     111c <cstrlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <cstrlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @cstrlen(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 i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add i32 %5, 1
%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
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
unsigned int REG_SPI_BASE(unsigned int);
__attribute__((always_)) __attribute__((flatten)) unsigned int
SPI_USER2(unsigned int i) {
  return (REG_SPI_BASE(i) + 0x24);
}


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

x86 assembly (clang, -O2):
<SPI_USER2>:
push   %rax
call   1030 <REG_SPI_BASE@plt>
add    $0x24,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @SPI_USER2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @REG_SPI_BASE(i32 %3)
%5 = add i32 %4, 36
ret i32 %5
}

LLVM IR (-O2):
define i32 @SPI_USER2(i32 %0) {
%2 = tail call i32 @REG_SPI_BASE(i32 %0)
%3 = add i32 %2, 36
ret i32 %3
}
unsigned _get_zero_arr_size_char(const char *orig_x, unsigned orig_offset) {
  {
    const char *_gres_x = (const char *)orig_x;
    unsigned _gres = 0;
    if (_gres_x != 0) {
      _gres = orig_offset;
      _gres_x += orig_offset - 1;
      while (*_gres_x != 0) {
        _gres_x++;
        _gres++;
      }
    }
    return _gres;
  }
}


x86 assembly (clang, -O0):
<_get_zero_arr_size_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116d <_get_zero_arr_size_char+0x6d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1168 <_get_zero_arr_size_char+0x68>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113e <_get_zero_arr_size_char+0x3e>
jmp    116d <_get_zero_arr_size_char+0x6d>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_zero_arr_size_char>:
test   %rdi,%rdi
je     112d <_get_zero_arr_size_char+0x2d>
mov    %esi,%eax
lea    -0x1(%rax),%ecx
cmpb   $0x0,(%rdi,%rcx,1)
je     112c <_get_zero_arr_size_char+0x2c>
add    %rdi,%rcx
add    $0x1,%rcx
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1120 <_get_zero_arr_size_char+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @_get_zero_arr_size_char(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
store i32 0, i32* %6
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %28
10: ; preds = %2
%11 = load i32, i32* %4
store i32 %11, i32* %6
%12 = load i32, i32* %4
%13 = sub i32 %12, 1
%14 = load i8*, i8** %5
%15 = zext i32 %13 to i64
%16 = getelementptr inbounds i8, i8* %14, i64 %15
store i8* %16, i8** %5
br label %17
17: ; preds = %22, %10
%18 = load i8*, i8** %5
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %17
%23 = load i8*, i8** %5
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %5
%25 = load i32, i32* %6
%26 = add i32 %25, 1
store i32 %26, i32* %6
br label %17
27: ; preds = %17
br label %28
28: ; preds = %27, %2
%29 = load i32, i32* %6
ret i32 %29
}

LLVM IR (-O2):
define i32 @_get_zero_arr_size_char(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = add i32 %1, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %17, label %10
10: ; preds = %4, %10
%11 = phi i32 [ %14, %10 ], [ %1, %4 ]
%12 = phi i8* [ %13, %10 ], [ %7, %4 ]
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = add i32 %11, 1
%15 = load i8, i8* %13
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %10
17: ; preds = %10, %4, %2
%18 = phi i32 [ 0, %2 ], [ %1, %4 ], [ %14, %10 ]
ret i32 %18
}
int isblank(int c) { return (c == 0x09 || c == 0x20); }


x86 assembly (clang, -O0):
<isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <isblank+0x20>
cmpl   $0x20,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isblank>:
cmp    $0x9,%edi
sete   %al
cmp    $0x20,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isblank(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 9
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 32
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isblank(i32 %0) {
%2 = icmp eq i32 %0, 9
%3 = icmp eq i32 %0, 32
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
int g() {
  int ret = 0;
  goto out;
  ret = 1;
out:
  return ret;
}


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

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

LLVM IR (-O0):
define i32 @g() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @g() {
ret i32 0
}
void foo208() {}


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

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

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

LLVM IR (-O2):
define void @foo208() {
ret void
}
void rop3_169_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T | S;
  stk1 = *D ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_169_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_169_0_1>:
mov    %edx,%eax
or     %sil,%al
mov    (%rdi),%r8b
xor    %r8b,%al
not    %al
mov    %edx,%ecx
not    %cl
or     %sil,%cl
and    %al,%cl
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_169_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = and i32 %27, %29
%31 = load i8, i8* %7
%32 = zext i8 %31 to i32
%33 = load i8, i8* %6
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = or i32 %30, %36
%38 = load i8, i8* %6
%39 = zext i8 %38 to i32
%40 = load i8, i8* %5
%41 = zext i8 %40 to i32
%42 = xor i32 %41, -1
%43 = and i32 %39, %42
%44 = load i8*, i8** %4
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = and i32 %43, %46
%48 = or i32 %37, %47
%49 = trunc i32 %48 to i8
%50 = load i8*, i8** %4
store i8 %49, i8* %50
ret void
}

LLVM IR (-O2):
define void @rop3_169_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = load i8, i8* %0
%6 = xor i8 %4, %5
%7 = xor i8 %6, -1
%8 = xor i8 %2, -1
%9 = or i8 %8, %1
%10 = and i8 %9, %7
%11 = xor i8 %1, -1
%12 = and i8 %11, %2
%13 = and i8 %12, %5
%14 = or i8 %10, %13
store i8 %14, i8* %0
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
size_t strlen(char *);
void strlen_malloc_2_Good_FP() {
  int a[5];
  char *s = (char *)malloc(sizeof(char) * 6);
  s[0] = 'h';
  s[1] = 'e';
  s[2] = '\0';
  s[3] = 'l';
  s[4] = 'o';
  s[5] = '\0';
  a[strlen(s)] = 0;
}


x86 assembly (clang, -O0):
<strlen_malloc_2_Good_FP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x6,%edi
call   1040 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movb   $0x68,(%rax)
mov    -0x28(%rbp),%rax
movb   $0x65,0x1(%rax)
mov    -0x28(%rbp),%rax
movb   $0x0,0x2(%rax)
mov    -0x28(%rbp),%rax
movb   $0x6c,0x3(%rax)
mov    -0x28(%rbp),%rax
movb   $0x6f,0x4(%rax)
mov    -0x28(%rbp),%rax
movb   $0x0,0x5(%rax)
mov    -0x28(%rbp),%rdi
call   1030 <strlen@plt>
movl   $0x0,-0x20(%rbp,%rax,4)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen_malloc_2_Good_FP>:
push   %rax
mov    $0x6,%edi
call   1030 <malloc@plt>
movl   $0x6c006568,(%rax)
movw   $0x6f,0x4(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @strlen_malloc_2_Good_FP() {
%1 = alloca [5 x i32]
%2 = alloca i8*
%3 = call i64 @malloc(i32 6)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 104, i8* %6
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 101, i8* %8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
store i8 0, i8* %10
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 3
store i8 108, i8* %12
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 4
store i8 111, i8* %14
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 5
store i8 0, i8* %16
%17 = load i8*, i8** %2
%18 = call i64 @strlen(i8* %17)
%19 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 %18
store i32 0, i32* %19
ret void
}

LLVM IR (-O2):
define void @strlen_malloc_2_Good_FP() {
%1 = tail call i64 @malloc(i32 6)
%2 = inttoptr i64 %1 to i8*
store i8 104, i8* %2
%3 = getelementptr inbounds i8, i8* %2, i64 1
store i8 101, i8* %3
%4 = getelementptr inbounds i8, i8* %2, i64 2
store i8 0, i8* %4
%5 = getelementptr inbounds i8, i8* %2, i64 3
store i8 108, i8* %5
%6 = getelementptr inbounds i8, i8* %2, i64 4
store i8 111, i8* %6
%7 = getelementptr inbounds i8, i8* %2, i64 5
store i8 0, i8* %7
ret void
}
/* Variables and functions */
double sinh(double);
double AUX1bp0a(double x) { return x / sinh(x); }


x86 assembly (clang, -O0):
<AUX1bp0a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sinh@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AUX1bp0a>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <sinh@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @AUX1bp0a(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @sinh(double %4)
%6 = fdiv double %3, %5
ret double %6
}

LLVM IR (-O2):
define double @AUX1bp0a(double %0) {
%2 = tail call double @sinh(double %0)
%3 = fdiv double %0, %2
ret double %3
}