xunge/DecIR huggingface dataset:
int re_getlib(unsigned char *aa1, int n1, int maxt3, int loff, int cont,
              int term_code, long *loffset, long *l_off,
              struct lmf_str *m_file_p) {
  *loffset = 0;
  *l_off = 1;
  return n1;
}


x86 assembly (clang, -O0):
<re_getlib>:
push   %rbp
mov    %rsp,%rbp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    0x18(%rbp),%rax
movq   $0x1,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_getlib>:
mov    %esi,%eax
mov    0x10(%rsp),%rcx
mov    0x8(%rsp),%rdx
movq   $0x0,(%rdx)
movq   $0x1,(%rcx)
ret

LLVM IR (-O0):
%struct.lmf_str = type opaque
define i32 @re_getlib(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i64* %6, i64* %7, %struct.lmf_str* %8) {
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i64*
%17 = alloca i64*
%18 = alloca %struct.lmf_str*
store i8* %0, i8** %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i64* %6, i64** %16
store i64* %7, i64** %17
store %struct.lmf_str* %8, %struct.lmf_str** %18
%19 = load i64*, i64** %16
store i64 0, i64* %19
%20 = load i64*, i64** %17
store i64 1, i64* %20
%21 = load i32, i32* %11
ret i32 %21
}

LLVM IR (-O2):
%struct.lmf_str = type opaque
define i32 @re_getlib(i8* nocapture readnone %0, i32 returned %1, i32 %2, i32 %3, i32 %4, i32 %5, i64* nocapture writeonly %6, i64* nocapture writeonly %7, %struct.lmf_str* nocapture readnone %8) {
store i64 0, i64* %6
store i64 1, i64* %7
ret i32 %1
}
int max(int i, int j) { return (i > j) ? i : j; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @max(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void bar(void *v, int size) {
  int int_size = size >> 2;
  int *np = (int *)v;
  for (int i = 0; i < int_size; i++)
    np[i] = 0;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    114c <bar+0x4c>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1123 <bar+0x23>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
cmp    $0x4,%esi
jl     1126 <bar+0x16>
push   %rax
mov    %esi,%edx
and    $0xfffffffc,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @bar(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = ashr i32 %8, 2
store i32 %9, i32* %5
%10 = load i8*, i8** %3
%11 = bitcast i8* %10 to i32*
store i32* %11, i32** %6
store i32 0, i32* %7
br label %12
12: ; preds = %21, %2
%13 = load i32, i32* %7
%14 = load i32, i32* %5
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %24
16: ; preds = %12
%17 = load i32*, i32** %6
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
store i32 0, i32* %20
br label %21
21: ; preds = %16
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
store i32 %23, i32* %7
br label %12
24: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @bar(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 3
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = and i32 %1, -4
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ input_align_to_next_byte_thread(int /*<<< orphan*/);
void input_align_to_next_byte() { input_align_to_next_byte_thread(0); }


x86 assembly (clang, -O0):
<input_align_to_next_byte>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <input_align_to_next_byte_thread@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @input_align_to_next_byte() {
%1 = call i32 @input_align_to_next_byte_thread(i32 0)
ret void
}

LLVM IR (-O2):
define void @input_align_to_next_byte() {
%1 = tail call i32 @input_align_to_next_byte_thread(i32 0)
ret void
}
/* Variables and functions */
scalar_t__ strncmp(char const *, char const *, int);
int utf8_is_emdash(const char *p) {
  const char emdash[3] = {-30, -128, -108};
  if (strncmp(p, emdash, 3))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<utf8_is_emdash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    0xedd(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xed5(%rip),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x13(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1158 <utf8_is_emdash+0x48>
movl   $0x0,-0x4(%rbp)
jmp    115f <utf8_is_emdash+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_is_emdash>:
push   %rax
movb   $0x94,0x6(%rsp)
movw   $0x80e2,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.utf8_is_emdash.emdash = [3 x i8] c"\E2\80\94"
define i32 @utf8_is_emdash(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [3 x i8]
store i8* %0, i8** %3
%5 = bitcast [3 x i8]* %4 to i8*
%6 = load i8*, i8** %3
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%8 = call i64 @strncmp(i8* %6, i8* %7, i32 3)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %12
11: ; preds = %1
store i32 1, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@__const.utf8_is_emdash.emdash = [3 x i8] c"\E2\80\94"
define i32 @utf8_is_emdash(i8* %0) {
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%4 = call i64 @strncmp(i8* %0, i8* %3, i32 3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ SecureClearMem(char *, int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ munlock(char *, int);
void SecureDestroy(char *Mem, int Size) {
  if (!Mem)
    return;
  SecureClearMem(Mem, Size);
  munlock(Mem, Size);
  free(Mem);
}


x86 assembly (clang, -O0):
<SecureDestroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114f <SecureDestroy+0x1f>
jmp    1170 <SecureDestroy+0x40>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <SecureClearMem@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <munlock@plt>
mov    -0x8(%rbp),%rdi
call   1040 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SecureDestroy>:
test   %rdi,%rdi
je     115a <SecureDestroy+0x2a>
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1050 <SecureClearMem@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <munlock@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <free@plt>
ret

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

LLVM IR (-O2):
define void @SecureDestroy(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 @SecureClearMem(i8* %0, i32 %1)
%6 = tail call i32 @munlock(i8* %0, i32 %1)
%7 = tail call i32 @free(i8* %0)
br label %8
8: ; preds = %2, %4
ret void
}
int Operand_bt_encode(unsigned int *valp) {
  int error;
  error = (*valp & ~0xf) != 0;
  return error;
}


x86 assembly (clang, -O0):
<Operand_bt_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xfffffff0,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_bt_encode>:
xor    %eax,%eax
cmpl   $0x10,(%rdi)
setae  %al
ret

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

LLVM IR (-O2):
define i32 @Operand_bt_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ugt i32 %2, 15
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Delay(int);
scalar_t__ ds18b20Init();
int /*<<< orphan*/ ds18b20WriteByte(int);
unsigned char ds18b20ReadTemperature() {
  if (ds18b20Init())
    return 1;
  Delay(90);
  ds18b20WriteByte(0xCC);
  ds18b20WriteByte(0xBE);
  return 0;
}


x86 assembly (clang, -O0):
<ds18b20ReadTemperature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <ds18b20Init@plt>
cmp    $0x0,%rax
je     1152 <ds18b20ReadTemperature+0x22>
movb   $0x1,-0x1(%rbp)
jmp    1174 <ds18b20ReadTemperature+0x44>
mov    $0x5a,%edi
call   1030 <Delay@plt>
mov    $0xcc,%edi
call   1040 <ds18b20WriteByte@plt>
mov    $0xbe,%edi
call   1040 <ds18b20WriteByte@plt>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds18b20ReadTemperature>:
push   %rax
xor    %eax,%eax
call   1050 <ds18b20Init@plt>
mov    %rax,%rcx
mov    $0x1,%al
test   %rcx,%rcx
je     1144 <ds18b20ReadTemperature+0x14>
pop    %rcx
ret
mov    $0x5a,%edi
call   1030 <Delay@plt>
mov    $0xcc,%edi
call   1040 <ds18b20WriteByte@plt>
mov    $0xbe,%edi
call   1040 <ds18b20WriteByte@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @ds18b20ReadTemperature() {
%1 = alloca i8
%2 = call i64 (...) @ds18b20Init()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i8 1, i8* %1
br label %9
5: ; preds = %0
%6 = call i32 @Delay(i32 90)
%7 = call i32 @ds18b20WriteByte(i32 204)
%8 = call i32 @ds18b20WriteByte(i32 190)
store i8 0, i8* %1
br label %9
9: ; preds = %5, %4
%10 = load i8, i8* %1
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @ds18b20ReadTemperature() {
%1 = tail call i64 (...) @ds18b20Init()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @Delay(i32 90)
%5 = tail call i32 @ds18b20WriteByte(i32 204)
%6 = tail call i32 @ds18b20WriteByte(i32 190)
br label %7
7: ; preds = %0, %3
%8 = phi i8 [ 0, %3 ], [ 1, %0 ]
ret i8 %8
}
int test_imm_C9int16_mem(short *val) {
  return ((*val) & (-0xC9 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C9int16_mem>:
movzwl (%rdi),%eax
test   $0xff37,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C9int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -201
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned char high_byte(int word) { return (word >> 8); }


x86 assembly (clang, -O0):
<high_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<high_byte>:
mov    %edi,%eax
shr    $0x8,%eax
ret

LLVM IR (-O0):
define zeroext i8 @high_byte(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = trunc i32 %4 to i8
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @high_byte(i32 %0) {
%2 = lshr i32 %0, 8
%3 = trunc i32 %2 to i8
ret i8 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("%s\n", argv[1]);
  return EXIT_SUCCESS;
}


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    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rsi
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
unsigned int f60(unsigned int x, int y __attribute__((unused))) {
  return (x << 1) ^ (x >> (8 * sizeof(unsigned int) - 1));
}


x86 assembly (clang, -O0):
<f60>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1f,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f60(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 = shl i32 %5, 1
%7 = load i32, i32* %3
%8 = lshr i32 %7, 31
%9 = xor i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f60(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 1)
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
double clocksToSeconds(clock_t start, clock_t end) {
  return ((double)(end - start)) / CLOCKS_PER_SEC;
}


x86 assembly (clang, -O0):
<clocksToSeconds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2ec8(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clocksToSeconds>:
sub    %rdi,%rsi
cvtsi2sd %rsi,%xmm0
mov    0x2ed9(%rip),%rax
divsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @clocksToSeconds(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = sub nsw i64 %5, %6
%8 = sitofp i64 %7 to double
%9 = load double, double* @CLOCKS_PER_SEC
%10 = fdiv double %8, %9
ret double %10
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @clocksToSeconds(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = sitofp i64 %3 to double
%5 = load double, double* @CLOCKS_PER_SEC
%6 = fdiv double %4, %5
ret double %6
}
double calculate_sales_tax(double purchases) {
  double sales_tax = purchases * 0.05;
  return sales_tax;
}


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

x86 assembly (clang, -O2):
<calculate_sales_tax>:
mulsd  0xef8(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @calculate_sales_tax(double %0) {
%2 = fmul double %0, 5.000000e-02
ret double %2
}
/* Variables and functions */
char *s_let(char *, char *);
char *maceol(char *arg) { return (s_let("\n", arg)); }


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

x86 assembly (clang, -O2):
<maceol>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <s_let@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i8* @maceol(i8* %0) {
%2 = tail call i8* @s_let(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
/* Variables and functions */
char *go_hello();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("Hello from C lang and %s!!\n", go_hello());
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"Hello from C lang and %s!!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i8* (...) @go_hello()
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Hello from C lang and %s!!\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @go_hello()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void DelayMs(unsigned int t) { usleep(1000 * t); }


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

x86 assembly (clang, -O2):
<DelayMs>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @DelayMs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 1000, %3
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @DelayMs(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
short USBSTK5505_GPIO_init() { return 0; }


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

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

LLVM IR (-O0):
define signext i16 @USBSTK5505_GPIO_init() {
ret i16 0
}

LLVM IR (-O2):
define signext i16 @USBSTK5505_GPIO_init() {
ret i16 0
}
int fz_mini(int a, int b) { return (a < b ? a : b); }


x86 assembly (clang, -O0):
<fz_mini>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <fz_mini+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <fz_mini+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fz_mini>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @fz_mini(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @fz_mini(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int roi_set_motors(char *buff, int main_brush, int vacuum, int side_brush) {
  buff[0] = (138);
  buff[1] = 0;
  if (main_brush) {
    buff[1] |= 0x04;
  }
  if (vacuum) {
    buff[1] |= 0x02;
  }
  if (side_brush) {
    buff[1] |= 0x01;
  }
  return 2;
}


x86 assembly (clang, -O0):
<roi_set_motors>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x8a,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x1(%rax)
cmpl   $0x0,-0xc(%rbp)
je     1138 <roi_set_motors+0x38>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
or     $0x4,%ecx
mov    %cl,0x1(%rax)
cmpl   $0x0,-0x10(%rbp)
je     1150 <roi_set_motors+0x50>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
or     $0x2,%ecx
mov    %cl,0x1(%rax)
cmpl   $0x0,-0x14(%rbp)
je     1168 <roi_set_motors+0x68>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
or     $0x1,%ecx
mov    %cl,0x1(%rax)
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roi_set_motors>:
test   %esi,%esi
setne  %al
movb   $0x8a,(%rdi)
shl    $0x2,%al
lea    0x2(%rax),%esi
test   %edx,%edx
movzbl %al,%eax
movzbl %sil,%edx
cmove  %eax,%edx
test   %ecx,%ecx
setne  %al
or     %dl,%al
mov    %al,0x1(%rdi)
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @roi_set_motors(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 -118, i8* %10
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8 0, i8* %12
%13 = load i32, i32* %6
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %4
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = or i32 %19, 4
%21 = trunc i32 %20 to i8
store i8 %21, i8* %17
br label %22
22: ; preds = %15, %4
%23 = load i32, i32* %7
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = load i8*, i8** %5
%27 = getelementptr inbounds i8, i8* %26, i64 1
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = or i32 %29, 2
%31 = trunc i32 %30 to i8
store i8 %31, i8* %27
br label %32
32: ; preds = %25, %22
%33 = load i32, i32* %8
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %42
35: ; preds = %32
%36 = load i8*, i8** %5
%37 = getelementptr inbounds i8, i8* %36, i64 1
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = or i32 %39, 1
%41 = trunc i32 %40 to i8
store i8 %41, i8* %37
br label %42
42: ; preds = %35, %32
ret i32 2
}

LLVM IR (-O2):
define i32 @roi_set_motors(i8* nocapture %0, i32 %1, i32 %2, i32 %3) {
store i8 -118, i8* %0
%5 = icmp eq i32 %1, 0
%6 = select i1 %5, i8 0, i8 4
%7 = icmp eq i32 %2, 0
%8 = or i8 %6, 2
%9 = select i1 %7, i8 %6, i8 %8
%10 = icmp ne i32 %3, 0
%11 = zext i1 %10 to i8
%12 = or i8 %9, %11
%13 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %12, i8* %13
ret i32 2
}
__attribute__((always_)) void flush_cache_mm(struct mm_struct *mm) {}


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

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

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

LLVM IR (-O2):
%struct.mm_struct = type opaque
define void @flush_cache_mm(%struct.mm_struct* nocapture %0) {
ret void
}
unsigned long crb_reset_env(unsigned long id, char *buf, unsigned long length) {
  return 0xc000000000000000ul;
}


x86 assembly (clang, -O0):
<crb_reset_env>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movabs $0xc000000000000000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crb_reset_env>:
movabs $0xc000000000000000,%rax
ret

LLVM IR (-O0):
define i64 @crb_reset_env(i64 %0, i8* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i64 %0, i64* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i64 -4611686018427387904
}

LLVM IR (-O2):
define i64 @crb_reset_env(i64 %0, i8* nocapture readnone %1, i64 %2) {
ret i64 -4611686018427387904
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int symlink(const char *name1, const char *name2) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<symlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<symlink>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @symlink(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @symlink(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ type_range();
void chapter02() { type_range(); }


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

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

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

LLVM IR (-O2):
define void @chapter02() {
%1 = tail call i32 (...) @type_range()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
void *_DtCvStrPtr(const void *p1, int type, int count) {
  if (0 == type)
    return ((void *)(((char *)p1) + count));
  return ((void *)(((wchar_t *)p1) + count));
}


x86 assembly (clang, -O0):
<_DtCvStrPtr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x14(%rbp),%eax
jne    112d <_DtCvStrPtr+0x2d>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1140 <_DtCvStrPtr+0x40>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_DtCvStrPtr>:
movslq %edx,%rcx
lea    0x0(,%rcx,4),%rax
test   %esi,%esi
cmove  %rcx,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @_DtCvStrPtr(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %6
%9 = icmp eq i32 0, %8
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i8*, i8** %5
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8* %14, i8** %4
br label %22
15: ; preds = %3
%16 = load i8*, i8** %5
%17 = bitcast i8* %16 to i32*
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = bitcast i32* %20 to i8*
store i8* %21, i8** %4
br label %22
22: ; preds = %15, %10
%23 = load i8*, i8** %4
ret i8* %23
}

LLVM IR (-O2):
define i8* @_DtCvStrPtr(i8* readnone %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = bitcast i8* %0 to i32*
%8 = getelementptr inbounds i32, i32* %7, i64 %5
%9 = bitcast i32* %8 to i8*
%10 = select i1 %4, i8* %6, i8* %9
ret i8* %10
}
/* Variables and functions */
int S_IRWXG;
int S_IRWXO;
int S_IRWXU;
int mkdir(char *, int);
int idris2_createDir(char *dir) {
  return mkdir(dir, S_IRWXU | S_IRWXG | S_IRWXO);
}


x86 assembly (clang, -O0):
<idris2_createDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    0x2ea8(%rip),%rax
or     (%rax),%esi
mov    0x2eb7(%rip),%rax
or     (%rax),%esi
call   1030 <mkdir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idris2_createDir>:
mov    0x2ec9(%rip),%rax
mov    0x2eba(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2ec7(%rip),%rax
or     (%rax),%esi
jmp    1030 <mkdir@plt>

LLVM IR (-O0):
@S_IRWXU = global i32 0
@S_IRWXG = global i32 0
@S_IRWXO = global i32 0
define i32 @idris2_createDir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @S_IRWXU
%5 = load i32, i32* @S_IRWXG
%6 = or i32 %4, %5
%7 = load i32, i32* @S_IRWXO
%8 = or i32 %6, %7
%9 = call i32 @mkdir(i8* %3, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
@S_IRWXU = global i32 0
@S_IRWXG = global i32 0
@S_IRWXO = global i32 0
define i32 @idris2_createDir(i8* nocapture %0) {
%2 = load i32, i32* @S_IRWXU
%3 = load i32, i32* @S_IRWXG
%4 = or i32 %3, %2
%5 = load i32, i32* @S_IRWXO
%6 = or i32 %4, %5
%7 = tail call i32 @mkdir(i8* %0, i32 %6)
ret i32 %7
}
int my_unique_function_name(int arg) {
  int j = 0;
  if (arg == 50)
    j = 10;
  return j;
}


x86 assembly (clang, -O0):
<my_unique_function_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x32,-0x4(%rbp)
jne    111f <my_unique_function_name+0x1f>
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_unique_function_name>:
xor    %ecx,%ecx
cmp    $0x32,%edi
mov    $0xa,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @my_unique_function_name(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 50
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 10, i32* %3
br label %7
7: ; preds = %6, %1
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @my_unique_function_name(i32 %0) {
%2 = icmp eq i32 %0, 50
%3 = select i1 %2, i32 10, i32 0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ des_block;
typedef int /*<<< orphan*/ caddr_t;
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
int /*<<< orphan*/ xdr_opaque(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
bool_t xdr_des_block(XDR *xdrs, des_block *blkp) {
  return xdr_opaque(xdrs, (caddr_t)blkp, sizeof(des_block));
}


x86 assembly (clang, -O0):
<xdr_des_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %eax,%esi
mov    $0x4,%edx
call   1030 <xdr_opaque@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_des_block>:
mov    $0x4,%edx
jmp    1030 <xdr_opaque@plt>

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

LLVM IR (-O2):
define i32 @xdr_des_block(i32* %0, i32* %1) {
%3 = ptrtoint i32* %1 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @xdr_opaque(i32* %0, i32 %4, i32 4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ debug_critical(char *);
void signal_segv(int sig_value) {
  debug_critical(
      "[signal_segv] Received SIGSEGV [segmentation fault / access violation]");
}


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

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

LLVM IR (-O0):
@.str = [71 x i8] c"[signal_segv] Received SIGSEGV [segmentation fault / access violation]\00"
define void @signal_segv(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @debug_critical(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [71 x i8] c"[signal_segv] Received SIGSEGV [segmentation fault / access violation]\00"
define void @signal_segv(i32 %0) {
%2 = tail call i32 @debug_critical(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
ret void
}
double factorial(double number) {
  if (number == 0) {
    return 1;
  } else {
    return number * factorial(number - 1);
  }
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1147 <factorial+0x37>
jp     1147 <factorial+0x37>
movsd  0xec3(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1178 <factorial+0x68>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xea2(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <factorial@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
push   %rax
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    112b <factorial+0x1b>
jp     112b <factorial+0x1b>
movsd  0xed7(%rip),%xmm0
pop    %rax
ret
movsd  0xed5(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm1,(%rsp)
call   1030 <factorial@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @factorial(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.000000e+00, double* %2
br label %13
7: ; preds = %1
%8 = load double, double* %3
%9 = load double, double* %3
%10 = fsub double %9, 1.000000e+00
%11 = call double @factorial(double %10)
%12 = fmul double %8, %11
store double %12, double* %2
br label %13
13: ; preds = %7, %6
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
define double @factorial(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi double [ %8, %5 ], [ 1.000000e+00, %1 ]
ret double %4
5: ; preds = %1
%6 = fadd double %0, -1.000000e+00
%7 = tail call double @factorial(double %6)
%8 = fmul double %7, %0
br label %3
}
/* Variables and functions */
void uv_bios_init(void) {}


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

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

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

LLVM IR (-O2):
define void @uv_bios_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test();
int main(void) {
  test();
  test();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test@plt>
mov    $0x0,%al
call   1030 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test()
%2 = tail call i32 (...) @test()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ blinkdash();
int /*<<< orphan*/ blinkdot();
int /*<<< orphan*/ sleep(double);
int blinkG() {
  blinkdash();
  blinkdash();
  blinkdot();
  sleep(1.5);
  return 0;
}


x86 assembly (clang, -O0):
<blinkG>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <blinkdash@plt>
mov    $0x0,%al
call   1040 <blinkdash@plt>
mov    $0x0,%al
call   1030 <blinkdot@plt>
movsd  0xeaf(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blinkG>:
push   %rax
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
movsd  0xeb2(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @blinkG() {
%1 = call i32 (...) @blinkdash()
%2 = call i32 (...) @blinkdash()
%3 = call i32 (...) @blinkdot()
%4 = call i32 @sleep(double 1.500000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @blinkG() {
%1 = tail call i32 (...) @blinkdash()
%2 = tail call i32 (...) @blinkdash()
%3 = tail call i32 (...) @blinkdot()
%4 = tail call i32 @sleep(double 1.500000e+00)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void checkIntZero(int value, char *mess) {
  if (value <= 0) {
    printf(mess);
    printf("Try 'tiotest -h' for more information.\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<checkIntZero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1158 <checkIntZero+0x38>
mov    -0x10(%rbp),%rdi
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkIntZero>:
test   %edi,%edi
jle    1135 <checkIntZero+0x5>
ret
push   %rax
mov    %rsi,%rdi
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Try 'tiotest -h' for more information.\0A\00"
define void @checkIntZero(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @printf(i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@str = [39 x i8] c"Try 'tiotest -h' for more information.\00"
define void @checkIntZero(i32 %0, i8* nocapture %1) {
%3 = icmp slt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i32 @printf(i8* dereferenceable(1) %1)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
unsigned int f49(unsigned int x, unsigned int y) {
  return (x << ((-y) & (8 * 4 - 1))) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f49>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0x1f,%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f49>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f49(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 = sub i32 0, %6
%8 = and i32 %7, 31
%9 = shl i32 %5, %8
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = lshr i32 %10, %11
%13 = xor i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @f49(i32 %0, i32 %1) {
%3 = sub i32 0, %1
%4 = and i32 %3, 31
%5 = shl i32 %0, %4
%6 = lshr i32 %0, %1
%7 = xor i32 %5, %6
ret i32 %7
}
int compare_int(int a, int b) {
  if (a >= b)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<compare_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1122 <compare_int+0x22>
movl   $0x0,-0x4(%rbp)
jmp    1129 <compare_int+0x29>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_int>:
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
ret

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

LLVM IR (-O2):
define i32 @compare_int(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void output_tab0(FILE *outptr, int level) {
  int i;
  for (i = 0; i <= level; ++i)
    fprintf(outptr, "    ");
}


x86 assembly (clang, -O0):
<output_tab0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1150 <output_tab0+0x40>
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <output_tab0+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_tab0>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
js     114a <output_tab0+0x3a>
mov    %esi,%ebx
mov    %rdi,%r14
add    $0x1,%ebx
lea    0xed8(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %r14,%rcx
call   1030 <fwrite@plt>
add    $0xffffffff,%ebx
jne    1130 <output_tab0+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c" \00"
define void @output_tab0(i32* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 4, i64 1, i32* %0)
%7 = add nuw i32 %5, 1
%8 = icmp eq i32 %5, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
int PFCompDouble(const double *d1, const double *d2) {
  if (*d1 < *d2)
    return -1;
  else if (*d1 == *d2)
    return 0;
  else
    return +1;
}


x86 assembly (clang, -O0):
<PFCompDouble>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1132 <PFCompDouble+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1161 <PFCompDouble+0x61>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jne    115a <PFCompDouble+0x5a>
jp     115a <PFCompDouble+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    1161 <PFCompDouble+0x61>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PFCompDouble>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
movapd %xmm0,%xmm2
cmpneqsd %xmm1,%xmm2
movq   %xmm2,%rcx
and    $0x1,%ecx
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @PFCompDouble(double* %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
%6 = load double*, double** %4
%7 = load double, double* %6
%8 = load double*, double** %5
%9 = load double, double* %8
%10 = fcmp olt double %7, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %20
12: ; preds = %2
%13 = load double*, double** %4
%14 = load double, double* %13
%15 = load double*, double** %5
%16 = load double, double* %15
%17 = fcmp oeq double %14, %16
br i1 %17, label %18, label %19
18: ; preds = %12
store i32 0, i32* %3
br label %20
19: ; preds = %12
store i32 1, i32* %3
br label %20
20: ; preds = %19, %18, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @PFCompDouble(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp olt double %3, %4
%6 = fcmp une double %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
__attribute__((weak)) void fd_nrf8001_system_credit_change(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define weak void @fd_nrf8001_system_credit_change() {
ret void
}
/* Variables and functions */
double __nv_hypot(double, double);
double hypot(double __a, double __b) { return __nv_hypot(__a, __b); }


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

x86 assembly (clang, -O2):
<hypot>:
jmp    1030 <__nv_hypot@plt>

LLVM IR (-O0):
define double @hypot(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @__nv_hypot(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @hypot(double %0, double %1) {
%3 = tail call double @__nv_hypot(double %0, double %1)
ret double %3
}
void IN_NULL_PumpEvents() {}


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

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

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

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