xunge/DecIR huggingface dataset:
void ksleeptick(int ticks) {
  int i;
  for (i = 0; i < ticks; i++) {
  }
}


x86 assembly (clang, -O0):
<ksleeptick>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <ksleeptick+0x2d>
jmp    111f <ksleeptick+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <ksleeptick+0xe>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ksleeptick(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
br label %9
9: ; preds = %8
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @ksleeptick(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
char *unicode_write_string_utf16_imp(int /*<<< orphan*/ *, size_t, size_t *,
                                     int, int);
char *unicode_write_string_utf16_without_bom(uint32_t *code_points,
                                             size_t code_points_length,
                                             size_t *string_length_ptr) {
  return unicode_write_string_utf16_imp(code_points, code_points_length,
                                        string_length_ptr, false, false);
}


x86 assembly (clang, -O0):
<unicode_write_string_utf16_without_bom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1030 <unicode_write_string_utf16_imp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unicode_write_string_utf16_without_bom>:
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <unicode_write_string_utf16_imp@plt>

LLVM IR (-O0):
define i8* @unicode_write_string_utf16_without_bom(i32* %0, i64 %1, i64* %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64*
store i32* %0, i32** %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%7 = load i32*, i32** %4
%8 = load i64, i64* %5
%9 = load i64*, i64** %6
%10 = call i8* @unicode_write_string_utf16_imp(i32* %7, i64 %8, i64* %9, i32 0, i32 0)
ret i8* %10
}

LLVM IR (-O2):
define i8* @unicode_write_string_utf16_without_bom(i32* %0, i64 %1, i64* %2) {
%4 = tail call i8* @unicode_write_string_utf16_imp(i32* %0, i64 %1, i64* %2, i32 0, i32 0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void foo(unsigned int param) { printf("foo %X\n", param); }


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

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"foo %X\0A\00"
define void @foo(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ die(char *);
void *xcalloc(size_t n, size_t size) {
  void *p = calloc(n, size);
  if (!p)
    die("out of memory");
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <xcalloc+0x38>
lea    0xead(%rip),%rdi
call   1040 <die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xcalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
long enum_pot2(int k) {
  if (k == 0)
    return 1;
  long n = 2 * enum_pot2(k - 1);
  printf("%ld ", n);
  return n;
}


x86 assembly (clang, -O0):
<enum_pot2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1142 <enum_pot2+0x22>
movq   $0x1,-0x8(%rbp)
jmp    116d <enum_pot2+0x4d>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1040 <enum_pot2@plt>
shl    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enum_pot2>:
push   %rbx
test   %edi,%edi
je     1144 <enum_pot2+0x24>
add    $0xffffffff,%edi
call   1040 <enum_pot2@plt>
mov    %rax,%rbx
add    %rax,%rbx
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1149 <enum_pot2+0x29>
mov    $0x1,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld \00"
define i64 @enum_pot2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i64 [ %8, %5 ], [ 1, %1 ]
ret i64 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i64 @enum_pot2(i32 %6)
%8 = shl nsw i64 %7, 1
%9 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %8)
br label %3
}
/* Variables and functions */
int realmain(int, char **);
int main(int argc, char *argv[]) { return realmain(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <realmain@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <realmain@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @realmain(i32 %0, i8** %1)
ret i32 %3
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISCHR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int fsop_path_ischr(const char *path) {
  struct stat st;
  if (stat(path, &st) < 0)
    return -1;
  return S_ISCHR(st.st_mode);
}


x86 assembly (clang, -O0):
<fsop_path_ischr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    114f <fsop_path_ischr+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <fsop_path_ischr+0x3a>
mov    -0x18(%rbp),%edi
call   1040 <S_ISCHR@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsop_path_ischr>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
js     1138 <fsop_path_ischr+0x18>
mov    (%rsp),%edi
call   1040 <S_ISCHR@plt>
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fsop_path_ischr(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @S_ISCHR(i32 %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fsop_path_ischr(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISCHR(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ -1, %1 ]
ret i32 %11
}
double pow2(double x) { return (x * x); }


x86 assembly (clang, -O0):
<pow2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow2>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @pow2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @pow2(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
size_t const page_size();
size_t optimal_size(const size_t stride) { return (stride * page_size()); }


x86 assembly (clang, -O0):
<optimal_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <page_size@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
imul   %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<optimal_size>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <page_size@plt>
imul   %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @optimal_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 (...) @page_size()
%5 = mul i64 %3, %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @optimal_size(i64 %0) {
%2 = tail call i64 (...) @page_size()
%3 = mul i64 %2, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hardwaremarkovcurry() { printf("hardwaremarkovcurry\n"); }


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"hardwaremarkovcurry\00"
define void @hardwaremarkovcurry() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char get_char(int /*<<< orphan*/ *);
char GetChar(void) { return get_char(NULL); }


x86 assembly (clang, -O0):
<GetChar>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <get_char@plt>
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @GetChar() {
%1 = call signext i8 @get_char(i32* null)
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @GetChar() {
%1 = tail call signext i8 @get_char(i32* null)
ret i8 %1
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int c;
  int size = 0;
  while ((c = getchar()) != EOF)
    size++;
  printf("%d\n", size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     115d <main+0x3d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffff,%ebx
mov    0x2eb8(%rip),%r14
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%ebx
cmp    (%r14),%eax
jne    1130 <main+0x10>
lea    0xeba(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %8, %0
%5 = call i32 (...) @getchar()
store i32 %5, i32* %2
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %4
11: ; preds = %4
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
%6 = add nuw nsw i32 %2, 1
br i1 %5, label %7, label %1
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putnbr(double);
void ft_putdouble(double d) {
  int i;
  i = 0;
  ft_putnbr((int)d);
  ft_putchar('.');
  d -= (int)d;
  while (i++ < 6)
    d *= 10;
  ft_putnbr(d);
}


x86 assembly (clang, -O0):
<ft_putdouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cvttsd2si -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
call   1040 <ft_putnbr@plt>
mov    $0x2e,%edi
call   1030 <ft_putchar@plt>
cvttsd2si -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  -0x8(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x6,%eax
jge    118e <ft_putdouble+0x6e>
movsd  0xe81(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1163 <ft_putdouble+0x43>
movsd  -0x8(%rbp),%xmm0
call   1040 <ft_putnbr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putdouble>:
sub    $0x28,%rsp
movapd %xmm0,0x10(%rsp)
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm0
movaps %xmm0,(%rsp)
call   1040 <ft_putnbr@plt>
mov    $0x2e,%edi
call   1030 <ft_putchar@plt>
movapd 0x10(%rsp),%xmm0
subsd  (%rsp),%xmm0
movsd  0xea8(%rip),%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
add    $0x28,%rsp
jmp    1040 <ft_putnbr@plt>

LLVM IR (-O0):
define void @ft_putdouble(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
store i32 0, i32* %3
%4 = load double, double* %2
%5 = fptosi double %4 to i32
%6 = sitofp i32 %5 to double
%7 = call i32 @ft_putnbr(double %6)
%8 = call i32 @ft_putchar(i8 signext 46)
%9 = load double, double* %2
%10 = fptosi double %9 to i32
%11 = sitofp i32 %10 to double
%12 = load double, double* %2
%13 = fsub double %12, %11
store double %13, double* %2
br label %14
14: ; preds = %18, %1
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
%17 = icmp slt i32 %15, 6
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load double, double* %2
%20 = fmul double %19, 1.000000e+01
store double %20, double* %2
br label %14
21: ; preds = %14
%22 = load double, double* %2
%23 = call i32 @ft_putnbr(double %22)
ret void
}

LLVM IR (-O2):
define void @ft_putdouble(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
%4 = tail call i32 @ft_putnbr(double %3)
%5 = tail call i32 @ft_putchar(i8 signext 46)
%6 = fsub double %0, %3
%7 = fmul double %6, 1.000000e+01
%8 = fmul double %7, 1.000000e+01
%9 = fmul double %8, 1.000000e+01
%10 = fmul double %9, 1.000000e+01
%11 = fmul double %10, 1.000000e+01
%12 = fmul double %11, 1.000000e+01
%13 = tail call i32 @ft_putnbr(double %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_BID128(int *);
void __bid128_div(void) {
  int res;
  get_BID128(&res);
}


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

x86 assembly (clang, -O2):
<__bid128_div>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <get_BID128@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @__bid128_div() {
%1 = alloca i32
%2 = call i32 @get_BID128(i32* %1)
ret void
}

LLVM IR (-O2):
define void @__bid128_div() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @get_BID128(i32* %1)
ret void
}
int isdigit(int c) {
  switch (c) {
  case '0':
  case '1':
  case '2':
  case '3':
  case '4':
  case '5':
  case '6':
  case '7':
  case '8':
  case '9':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffd0,%eax
sub    $0x9,%eax
ja     1127 <isdigit+0x27>
jmp    111b <isdigit+0x1b>
movl   $0x1,-0x4(%rbp)
jmp    112e <isdigit+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 48, label %5
i32 49, label %5
i32 50, label %5
i32 51, label %5
i32 52, label %5
i32 53, label %5
i32 54, label %5
i32 55, label %5
i32 56, label %5
i32 57, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void sqlite3_free(void *x) { return; }


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

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

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

LLVM IR (-O2):
define void @sqlite3_free(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex32(unsigned int);
void print_warning_hex32(unsigned int value) { __console_tx_hex32(value); }


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

x86 assembly (clang, -O2):
<print_warning_hex32>:
jmp    1030 <__console_tx_hex32@plt>

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

LLVM IR (-O2):
define void @print_warning_hex32(i32 %0) {
%2 = tail call i32 @__console_tx_hex32(i32 %0)
ret void
}
void debugpins_isr_toggle() {}


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

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

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

LLVM IR (-O2):
define void @debugpins_isr_toggle() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setegid(int);
int /*<<< orphan*/ setgid(int);
int setresgid(int rgid, int egid, int sgid) {
  if (rgid != -1)
    setgid(rgid);
  if (egid != -1)
    setegid(egid);
  return 0;
}


x86 assembly (clang, -O0):
<setresgid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     1143 <setresgid+0x23>
mov    -0x4(%rbp),%edi
call   1030 <setgid@plt>
cmpl   $0xffffffff,-0x8(%rbp)
je     1155 <setresgid+0x35>
mov    -0x8(%rbp),%edi
call   1040 <setegid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setresgid>:
push   %rbx
mov    %esi,%ebx
cmp    $0xffffffff,%edi
je     112d <setresgid+0xd>
call   1030 <setgid@plt>
cmp    $0xffffffff,%ebx
je     1139 <setresgid+0x19>
mov    %ebx,%edi
call   1040 <setegid@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @setresgid(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, -1
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @setgid(i32 %0)
br label %7
7: ; preds = %5, %3
%8 = icmp eq i32 %1, -1
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call i32 @setegid(i32 %1)
br label %11
11: ; preds = %9, %7
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ stringToUpper(char *);
int main() { stringToUpper("All your BASE are Belong to US!"); }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"All your BASE are Belong to US!\00"
define i32 @main() {
%1 = call i32 @stringToUpper(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"All your BASE are Belong to US!\00"
define i32 @main() {
%1 = tail call i32 @stringToUpper(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int detect();
int /*<<< orphan*/ printf(char *);
void get_subarchitecture(void) {
  int d = detect();
  switch (d) {
  case 2:
    printf("ARMV7");
    break;
  case 1:
    printf("ARMV6");
    break;
  default:
    printf("UNKNOWN");
    break;
  }
}


x86 assembly (clang, -O0):
<get_subarchitecture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <detect@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x1,%eax
je     1168 <get_subarchitecture+0x48>
jmp    1146 <get_subarchitecture+0x26>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
jne    1179 <get_subarchitecture+0x59>
jmp    1157 <get_subarchitecture+0x37>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
jmp    1185 <get_subarchitecture+0x65>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
jmp    1185 <get_subarchitecture+0x65>
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_subarchitecture>:
push   %rax
xor    %eax,%eax
call   1040 <detect@plt>
cmp    $0x1,%eax
lea    0xed4(%rip),%rcx
lea    0xed3(%rip),%rdx
cmove  %rcx,%rdx
cmp    $0x2,%eax
lea    0xeb9(%rip),%rdi
cmovne %rdx,%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ARMV7\00"
@.str.1 = [6 x i8] c"ARMV6\00"
@.str.2 = [8 x i8] c"UNKNOWN\00"
define void @get_subarchitecture() {
%1 = alloca i32
%2 = call i32 (...) @detect()
store i32 %2, i32* %1
%3 = load i32, i32* %1
switch i32 %3, label %8 [
i32 2, label %4
i32 1, label %6
]
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %10
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6, %4
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ARMV7\00"
@.str.1 = [6 x i8] c"ARMV6\00"
@.str.2 = [8 x i8] c"UNKNOWN\00"
define void @get_subarchitecture() {
%1 = tail call i32 (...) @detect()
%2 = icmp eq i32 %1, 1
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %1, 2
%5 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3
%6 = tail call i32 @printf(i8* dereferenceable(1) %5)
ret void
}
/* Type definitions */
typedef scalar_t__ val;
typedef int __u32;

/* Variables and functions */
__u32 ___swahb32(__u32 val) {
  return ((__u32)((((__u32)(val) & (__u32)0x00ff00ffUL) << 8) |
                  (((__u32)(val) & (__u32)0xff00ff00UL) >> 8)));
}


x86 assembly (clang, -O0):
<___swahb32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ff,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00ff00,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<___swahb32>:
mov    %edi,%eax
shl    $0x8,%eax
and    $0xff00ff00,%eax
sar    $0x8,%edi
and    $0xffff00ff,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @___swahb32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 16711935
%5 = shl i32 %4, 8
%6 = load i32, i32* %2
%7 = and i32 %6, -16711936
%8 = ashr i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @___swahb32(i32 %0) {
%2 = shl i32 %0, 8
%3 = and i32 %2, -16711936
%4 = ashr i32 %0, 8
%5 = and i32 %4, -65281
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ sprintf(char *, char *, double);
void dtos(char **output, double value) {
  *output = calloc(1, 50);
  sprintf(*output, "%.2f", value);
}


x86 assembly (clang, -O0):
<dtos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    $0x1,%edi
mov    $0x32,%esi
call   1030 <calloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
movsd  -0x10(%rbp),%xmm0
lea    0xea3(%rip),%rsi
call   1040 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtos>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%rbx
mov    $0x1,%edi
mov    $0x32,%esi
call   1030 <calloc@plt>
mov    %rax,(%rbx)
lea    0xeb9(%rip),%rsi
mov    %rax,%rdi
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
jmp    1040 <sprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%.2f\00"
define void @dtos(i8** %0, double %1) {
%3 = alloca i8**
%4 = alloca double
store i8** %0, i8*** %3
store double %1, double* %4
%5 = call i8* @calloc(i32 1, i32 50)
%6 = load i8**, i8*** %3
store i8* %5, i8** %6
%7 = load i8**, i8*** %3
%8 = load i8*, i8** %7
%9 = load double, double* %4
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %9)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.2f\00"
define void @dtos(i8** nocapture writeonly %0, double %1) {
%3 = tail call dereferenceable_or_null(50) i8* @calloc(i32 1, i32 50)
store i8* %3, i8** %0
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %1)
ret void
}
void foo643(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo643(i32 %0) {
ret void
}
char *copyright_notice(void) { return ("(c)1986 Philip Zimmermann"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"(c)1986 Philip Zimmermann\00"
define i8* @copyright_notice() {
ret i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [26 x i8] c"(c)1986 Philip Zimmermann\00"
define i8* @copyright_notice() {
ret i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0)
}
int Aig_Base10Log(unsigned n) {
  int r;
  if (n < 2)
    return n;
  for (r = 0, n--; n; n /= 10, r++)
    ;
  return r;
}


x86 assembly (clang, -O0):
<Aig_Base10Log>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jae    111c <Aig_Base10Log+0x1c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <Aig_Base10Log+0x5e>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1158 <Aig_Base10Log+0x58>
jmp    113b <Aig_Base10Log+0x3b>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <Aig_Base10Log+0x2c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Aig_Base10Log>:
mov    %edi,%eax
cmp    $0x2,%edi
jb     1134 <Aig_Base10Log+0x34>
mov    %eax,%ecx
add    $0xffffffff,%ecx
xor    %eax,%eax
mov    $0xcccccccd,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ecx,%esi
imul   %rdx,%rsi
shr    $0x23,%rsi
add    $0x1,%eax
cmp    $0x9,%ecx
mov    %esi,%ecx
ja     1120 <Aig_Base10Log+0x20>
ret

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

LLVM IR (-O2):
define i32 @Aig_Base10Log(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = add i32 %0, -1
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ 0, %3 ]
%7 = phi i32 [ %8, %5 ], [ %4, %3 ]
%8 = udiv i32 %7, 10
%9 = add nuw nsw i32 %6, 1
%10 = icmp ult i32 %7, 10
br i1 %10, label %11, label %5
11: ; preds = %5, %1
%12 = phi i32 [ %0, %1 ], [ %9, %5 ]
ret i32 %12
}
/* Variables and functions */
float log(float);
float uniform();
float expdev() {
  float dum;
  do
    dum = uniform();
  while (dum == 0.0);
  return -log(dum);
}


x86 assembly (clang, -O0):
<expdev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <uniform@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1155 <expdev+0x35>
jp     1155 <expdev+0x35>
jmp    1128 <expdev+0x8>
movss  -0x4(%rbp),%xmm0
call   1040 <log@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expdev>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <uniform@plt>
ucomiss 0xed2(%rip),%xmm0
jne    1142 <expdev+0x22>
jnp    1130 <expdev+0x10>
call   1040 <log@plt>
xorps  0xeb2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @expdev() {
%1 = alloca float
br label %2
2: ; preds = %4, %0
%3 = call float (...) @uniform()
store float %3, float* %1
br label %4
4: ; preds = %2
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = fcmp oeq double %6, 0.000000e+00
br i1 %7, label %2, label %8
8: ; preds = %4
%9 = load float, float* %1
%10 = call float @log(float %9)
%11 = fneg float %10
ret float %11
}

LLVM IR (-O2):
define float @expdev() {
br label %1
1: ; preds = %1, %0
%2 = tail call float (...) @uniform()
%3 = fcmp oeq float %2, 0.000000e+00
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = tail call float @log(float %2)
%6 = fneg float %5
ret float %6
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateLowBatSet(uint32_t ui32LowBatFlags) {

  ;
  (*((volatile unsigned long *)(0x400FC010))) =
      (ui32LowBatFlags | ((*((volatile unsigned long *)(0x400FC010))) &
                          ~(0x00006000 | 0x000000A0)));
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateLowBatSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400fc010,%eax
mov    (%rax),%rax
and    $0xffffffffffff9f5f,%rax
or     %rax,%rcx
mov    $0x400fc010,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateLowBatSet>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    $0xffffffffffff9f5f,%rcx
and    0x400fc010,%rcx
40
or     %rax,%rcx
mov    %rcx,0x400fc010
40
xor    %eax,%eax
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateLowBatSet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%5 = and i64 %4, -24737
%6 = or i64 %3, %5
store volatile i64 %6, i64* inttoptr (i64 1074774032 to i64*)
%7 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateLowBatSet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%5 = and i64 %4, -24737
%6 = or i64 %5, %3
store volatile i64 %6, i64* inttoptr (i64 1074774032 to i64*)
%7 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
int test_12a(void) {
  int i;
  return i;
}


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

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

LLVM IR (-O0):
define i32 @test_12a() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @test_12a() {
ret i32 undef
}
/* Variables and functions */
unsigned int echo_int_2_marshal_outputs__camkes_ret_fn_412(unsigned int, int *);
unsigned int echo_int_2_marshal_outputs(int *_camkes_return_416) {
  unsigned int _camkes_length_417 = 0;
  _camkes_length_417 = echo_int_2_marshal_outputs__camkes_ret_fn_412(
      _camkes_length_417, _camkes_return_416);
  if (_camkes_length_417 == 0xffffffffU) {
    return 0xffffffffU;
  }
  (void)0;
  return _camkes_length_417;
}


x86 assembly (clang, -O0):
<echo_int_2_marshal_outputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <echo_int_2_marshal_outputs__camkes_ret_fn_412@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1148 <echo_int_2_marshal_outputs+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <echo_int_2_marshal_outputs+0x3e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echo_int_2_marshal_outputs>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <echo_int_2_marshal_outputs__camkes_ret_fn_412@plt>

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

LLVM IR (-O2):
define i32 @echo_int_2_marshal_outputs(i32* %0) {
%2 = tail call i32 @echo_int_2_marshal_outputs__camkes_ret_fn_412(i32 0, i32* %0)
ret i32 %2
}
/* Variables and functions */
int commandmain(int, char **);
int main(int argc, char *argv[]) { return commandmain(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <commandmain@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <commandmain@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @commandmain(i32 %0, i8** %1)
ret i32 %3
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  {
    state[0UL] = input[0UL] + 0xffffffffff660b45UL;
    local1 = 0UL;
    while (local1 < 1UL) {
      state[local1] += state[local1];
      local1 += 2UL;
    }
    output[0UL] = state[0UL] + 809088178UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0xffffffffff660b45,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x1,-0x20(%rbp)
jae    1158 <RandomFunc+0x58>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp,%rax,8),%rcx
mov    -0x20(%rbp),%rax
add    -0x18(%rbp,%rax,8),%rcx
mov    %rcx,-0x18(%rbp,%rax,8)
mov    -0x20(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x20(%rbp)
jmp    1125 <RandomFunc+0x25>
mov    -0x18(%rbp),%rcx
add    $0x3039b4b2,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%rax
add    %rax,%rax
add    $0x2f05cb3c,%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = add i64 %9, -10089659
%11 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %10, i64* %11
store i64 0, i64* %6
br label %12
12: ; preds = %15, %2
%13 = load i64, i64* %6
%14 = icmp ult i64 %13, 1
br i1 %14, label %15, label %25
15: ; preds = %12
%16 = load i64, i64* %6
%17 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 %16
%18 = load i64, i64* %17
%19 = load i64, i64* %6
%20 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 %19
%21 = load i64, i64* %20
%22 = add i64 %21, %18
store i64 %22, i64* %20
%23 = load i64, i64* %6
%24 = add i64 %23, 2
store i64 %24, i64* %6
br label %12
25: ; preds = %12
%26 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%27 = load i64, i64* %26
%28 = add i64 %27, 809088178
%29 = load i64*, i64** %4
%30 = getelementptr inbounds i64, i64* %29, i64 0
store i64 %28, i64* %30
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = shl i64 %3, 1
%5 = add i64 %4, 788908860
store i64 %5, i64* %1
ret void
}
/* Variables and functions */
int rand();
int my_rand() {
  int a = 0;
  a = (a << 8) + (rand() & 0xff);
  a = (a << 8) + (rand() & 0xff);
  a = (a << 8) + (rand() & 0xff);
  a = (a << 8) + (rand() & 0xff);
  return a;
}


x86 assembly (clang, -O0):
<my_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_rand>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
shl    $0x18,%ebx
movzbl %bpl,%ecx
shl    $0x10,%ecx
or     %ebx,%ecx
shl    $0x8,%eax
movzwl %ax,%ebx
or     %ecx,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
movzbl %al,%eax
or     %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @my_rand() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = shl i32 %2, 8
%4 = call i32 (...) @rand()
%5 = and i32 %4, 255
%6 = add nsw i32 %3, %5
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = shl i32 %7, 8
%9 = call i32 (...) @rand()
%10 = and i32 %9, 255
%11 = add nsw i32 %8, %10
store i32 %11, i32* %1
%12 = load i32, i32* %1
%13 = shl i32 %12, 8
%14 = call i32 (...) @rand()
%15 = and i32 %14, 255
%16 = add nsw i32 %13, %15
store i32 %16, i32* %1
%17 = load i32, i32* %1
%18 = shl i32 %17, 8
%19 = call i32 (...) @rand()
%20 = and i32 %19, 255
%21 = add nsw i32 %18, %20
store i32 %21, i32* %1
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
define i32 @my_rand() {
%1 = tail call i32 (...) @rand()
%2 = tail call i32 (...) @rand()
%3 = tail call i32 (...) @rand()
%4 = shl i32 %1, 24
%5 = shl i32 %2, 16
%6 = and i32 %5, 16711680
%7 = or i32 %6, %4
%8 = shl i32 %3, 8
%9 = and i32 %8, 65280
%10 = or i32 %7, %9
%11 = tail call i32 (...) @rand()
%12 = and i32 %11, 255
%13 = or i32 %10, %12
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ I2CSlaveBaseValid(unsigned long);
void I2CSlaveIntEnableEx(unsigned long ulBase, unsigned long ulIntFlags) {
  DEBUG_ASSERT(I2CSlaveBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x0000000C))) |= ulIntFlags;
}


x86 assembly (clang, -O0):
<I2CSlaveIntEnableEx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <I2CSlaveBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0xc(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveIntEnableEx>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <I2CSlaveBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
or     %r14,0xc(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @I2CSlaveIntEnableEx(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i32 @I2CSlaveBaseValid(i64 %5)
%7 = call i32 @DEBUG_ASSERT(i32 %6)
%8 = load i64, i64* %4
%9 = load i64, i64* %3
%10 = add i64 %9, 12
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = or i64 %12, %8
store volatile i64 %13, i64* %11
ret void
}

LLVM IR (-O2):
define void @I2CSlaveIntEnableEx(i64 %0, i64 %1) {
%3 = tail call i32 @I2CSlaveBaseValid(i64 %0)
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = add i64 %0, 12
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = or i64 %7, %1
store volatile i64 %8, i64* %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int BUFSIZ;
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void my_flush_stdin() {
  char buf[BUFSIZ];
  fgets(buf, sizeof(buf), stdin);
}


x86 assembly (clang, -O0):
<my_flush_stdin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x10(%rbp)
mov    %eax,%esi
mov    0x2e9f(%rip),%rax
mov    (%rax),%edx
call   1030 <fgets@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_flush_stdin>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdi
mov    %rsi,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
call   1030 <fgets@plt>
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
@BUFSIZ = global i32 0
@stdin = global i32 0
define void @my_flush_stdin() {
%1 = alloca i8*
%2 = alloca i64
%3 = load i32, i32* @BUFSIZ
%4 = zext i32 %3 to i64
%5 = call i8* @llvm.stacksave()
store i8* %5, i8** %1
%6 = alloca i8, i64 %4
store i64 %4, i64* %2
%7 = trunc i64 %4 to i32
%8 = load i32, i32* @stdin
%9 = call i32 @fgets(i8* %6, i32 %7, i32 %8)
%10 = load i8*, i8** %1
ret void
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
@stdin = global i32 0
define void @my_flush_stdin() {
%1 = load i32, i32* @BUFSIZ
%2 = zext i32 %1 to i64
%3 = alloca i8, i64 %2
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 %1, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpngt_ps(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 test_mm_cmpngt_ps(__m128 __a, __m128 __b) {
  return _mm_cmpngt_ps(__a, __b);
}


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

x86 assembly (clang, -O2):
<test_mm_cmpngt_ps>:
jmp    1030 <_mm_cmpngt_ps@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cmpngt_ps(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpngt_ps(i32 %0, i32 %1)
ret i32 %3
}