xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t make_pow2(size_t);
scalar_t__ malloc(int);
void **alloc_data(size_t size, size_t *allocated_size) {
  size = make_pow2(size);
  if (allocated_size != 0)
    *allocated_size = size;
  if (size == ((size_t)0xffffffff))
    return 0;
  else
    return (void **)malloc(sizeof(void *) * size);
}


x86 assembly (clang, -O0):
<alloc_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <make_pow2@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1153 <alloc_data+0x33>
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    $0xffffffff,%eax
cmp    %rax,-0x10(%rbp)
jne    116f <alloc_data+0x4f>
movq   $0x0,-0x8(%rbp)
jmp    1182 <alloc_data+0x62>
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_data>:
push   %rbx
mov    %rsi,%rbx
call   1030 <make_pow2@plt>
test   %rbx,%rbx
je     1131 <alloc_data+0x11>
mov    %rax,(%rbx)
mov    $0xffffffff,%ecx
cmp    %rcx,%rax
jne    113f <alloc_data+0x1f>
xor    %eax,%eax
pop    %rbx
ret
lea    0x0(,%rax,8),%edi
call   1040 <malloc@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define i8** @alloc_data(i64 %0, i64* writeonly %1) {
%3 = tail call i64 @make_pow2(i64 %0)
%4 = icmp eq i64* %1, null
br i1 %4, label %6, label %5
5: ; preds = %2
store i64 %3, i64* %1
br label %6
6: ; preds = %5, %2
%7 = icmp eq i64 %3, 4294967295
br i1 %7, label %13, label %8
8: ; preds = %6
%9 = trunc i64 %3 to i32
%10 = shl i32 %9, 3
%11 = tail call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i8**
br label %13
13: ; preds = %6, %8
%14 = phi i8** [ %12, %8 ], [ null, %6 ]
ret i8** %14
}
void test24(void) {
  int a;
  int b;
  int c;
  c = ++a - b--;
  c = a++;
  b++;
  --a;
}


x86 assembly (clang, -O0):
<test24>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%ecx
mov    %ecx,%edx
add    $0xffffffff,%edx
mov    %edx,-0x8(%rbp)
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test24() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = load i32, i32* %2
%7 = add nsw i32 %6, -1
store i32 %7, i32* %2
%8 = sub nsw i32 %5, %6
store i32 %8, i32* %3
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
store i32 %9, i32* %3
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
%13 = load i32, i32* %1
%14 = add nsw i32 %13, -1
store i32 %14, i32* %1
ret void
}

LLVM IR (-O2):
define void @test24() {
ret void
}
/* Type definitions */
struct string_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ string_buffer_append_chars(struct string_buffer *, char *,
                                              int);
void string_buffer_append_char(struct string_buffer *buffer, char c) {
  char cc = c;
  string_buffer_append_chars(buffer, &cc, 1);
}


x86 assembly (clang, -O0):
<string_buffer_append_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xa(%rbp),%rsi
mov    $0x1,%edx
call   1030 <string_buffer_append_chars@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_buffer_append_char>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <string_buffer_append_chars@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.string_buffer = type { i32 }
define void @string_buffer_append_char(%struct.string_buffer* %0, i8 signext %1) {
%3 = alloca %struct.string_buffer*
%4 = alloca i8
%5 = alloca i8
store %struct.string_buffer* %0, %struct.string_buffer** %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
store i8 %6, i8* %5
%7 = load %struct.string_buffer*, %struct.string_buffer** %3
%8 = call i32 @string_buffer_append_chars(%struct.string_buffer* %7, i8* %5, i32 1)
ret void
}

LLVM IR (-O2):
%struct.string_buffer = type { i32 }
define void @string_buffer_append_char(%struct.string_buffer* %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @string_buffer_append_chars(%struct.string_buffer* %0, i8* %3, i32 1)
ret void
}
int ft_isupper(unsigned char c) {
  if (c >= 'A' && c <= 'Z')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1130 <ft_isupper+0x30>
movzbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1130 <ft_isupper+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <ft_isupper+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isupper>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isupper(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @ft_isupper(i8 zeroext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void tautologyLT(unsigned a) {
  char *b = malloc(1);
  if (a < 0)
    return;
  free(b);
}


x86 assembly (clang, -O0):
<tautologyLT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jae    1148 <tautologyLT+0x28>
jmp    1151 <tautologyLT+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tautologyLT>:
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @tautologyLT(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* @malloc(i32 1)
store i8* %4, i8** %3
%5 = load i32, i32* %2
%6 = icmp ult i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
br label %11
11: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @tautologyLT(i32 %0) {
%2 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%3 = tail call i32 @free(i8* %2)
ret void
}
char *Diss_char(char *pString, const char ch) {
  pString[0] = ch;
  ++pString;
  return pString;
}


x86 assembly (clang, -O0):
<Diss_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Diss_char>:
mov    %sil,(%rdi)
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @Diss_char(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 %5, i8* %7
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %3
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define i8* @Diss_char(i8* writeonly %0, i8 signext %1) {
store i8 %1, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
ret i8* %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int disable_save_ints();
int /*<<< orphan*/ restore_ints(int);
int /*<<< orphan*/ serial_tx();
void serial_start_tx() {
  uint32_t cpsr_store;
  cpsr_store = disable_save_ints();
  *((volatile uint32_t *)((0x3f000000 + 0x201000) + 0x38)) |= (1 << 5);
  (void)serial_tx();
  restore_ints(cpsr_store);
}


x86 assembly (clang, -O0):
<serial_start_tx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <disable_save_ints@plt>
mov    %eax,-0x4(%rbp)
mov    $0x3f201038,%eax
mov    (%rax),%ecx
or     $0x20,%ecx
mov    $0x3f201038,%eax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1050 <serial_tx@plt>
mov    -0x4(%rbp),%edi
call   1040 <restore_ints@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_start_tx>:
push   %rbx
xor    %eax,%eax
call   1030 <disable_save_ints@plt>
mov    %eax,%ebx
orl    $0x20,0x3f201038
20
xor    %eax,%eax
call   1050 <serial_tx@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <restore_ints@plt>

LLVM IR (-O0):
define void @serial_start_tx() {
%1 = alloca i32
%2 = call i32 (...) @disable_save_ints()
store i32 %2, i32* %1
%3 = load volatile i32, i32* inttoptr (i64 1059065912 to i32*)
%4 = or i32 %3, 32
store volatile i32 %4, i32* inttoptr (i64 1059065912 to i32*)
%5 = call i32 (...) @serial_tx()
%6 = load i32, i32* %1
%7 = call i32 @restore_ints(i32 %6)
ret void
}

LLVM IR (-O2):
define void @serial_start_tx() {
%1 = tail call i32 (...) @disable_save_ints()
%2 = load volatile i32, i32* inttoptr (i64 1059065912 to i32*)
%3 = or i32 %2, 32
store volatile i32 %3, i32* inttoptr (i64 1059065912 to i32*)
%4 = tail call i32 (...) @serial_tx()
%5 = tail call i32 @restore_ints(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(unsigned char, int /*<<< orphan*/ *);
void writebyte(unsigned char c, FILE *fp) { fputc(c, fp); }


x86 assembly (clang, -O0):
<writebyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
movzbl %al,%edi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writebyte>:
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
define void @writebyte(i8 zeroext %0, i32* nocapture %1) {
%3 = tail call i32 @fputc(i8 zeroext %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check(int *);
int *getPointer();
void testInitCheck() {
  int *a = getPointer();
  check(a);
  *a = 1;
}


x86 assembly (clang, -O0):
<testInitCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getPointer@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <check@plt>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testInitCheck>:
push   %rbx
xor    %eax,%eax
call   1040 <getPointer@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <check@plt>
movl   $0x1,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @testInitCheck() {
%1 = alloca i32*
%2 = call i32* (...) @getPointer()
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @check(i32* %3)
%5 = load i32*, i32** %1
store i32 1, i32* %5
ret void
}

LLVM IR (-O2):
define void @testInitCheck() {
%1 = tail call i32* (...) @getPointer()
%2 = tail call i32 @check(i32* %1)
store i32 1, i32* %1
ret void
}
/* Variables and functions */
float absf(float const);
int iszerof(const float x) { return (absf(x) < (float)1.19209290e-5f); }


x86 assembly (clang, -O0):
<iszerof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <absf@plt>
movaps %xmm0,%xmm1
movss  0xece(%rip),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iszerof>:
push   %rax
call   1030 <absf@plt>
movss  0xee2(%rip),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @iszerof(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @absf(float %3)
%5 = fcmp olt float %4, 0x3EE9000000000000
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @iszerof(float %0) {
%2 = tail call float @absf(float %0)
%3 = fcmp olt float %2, 0x3EE9000000000000
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_69int16_reg(short val) {
  return ((val) & (0x69 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_69int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x69,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_69int16_reg(i16 signext %0) {
%2 = and i16 %0, 105
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int gen_argv(char *, long, char **);
int main(int, char **);
int _start(char *arg_string, long len) {
  int rc;
  int argc;
  char *argv[10];
  argc = gen_argv(arg_string, len, argv);
  rc = main(argc, argv);
  return rc;
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x70(%rbp),%rdx
call   1030 <gen_argv@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
lea    -0x70(%rbp),%rsi
call   1040 <main@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_start>:
push   %rbx
sub    $0x50,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdx
call   1030 <gen_argv@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <main@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_start(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca [10 x i8*]
store i8* %0, i8** %3
store i64 %1, i64* %4
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = getelementptr inbounds [10 x i8*], [10 x i8*]* %7, i64 0, i64 0
%11 = call i32 @gen_argv(i8* %8, i64 %9, i8** %10)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = getelementptr inbounds [10 x i8*], [10 x i8*]* %7, i64 0, i64 0
%14 = call i32 @main(i32 %12, i8** %13)
store i32 %14, i32* %5
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @_start(i8* %0, i64 %1) {
%3 = alloca [10 x i8*]
%4 = bitcast [10 x i8*]* %3 to i8*
%5 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 0
%6 = call i32 @gen_argv(i8* %0, i64 %1, i8** %5)
%7 = call i32 @main(i32 %6, i8** %5)
ret i32 %7
}
int main() {
  int a[11];
  scanf("%d", a), read(a), sort(a), write(a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rsi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1050 <read@plt>
lea    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1040 <sort@plt>
lea    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1030 <write@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xeb4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <read@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sort@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <write@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [11 x i32]
%2 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%5 = call i32 (i32*, ...) bitcast (i32 (...)* @read to i32 (i32*, ...)*)(i32* %4)
%6 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @sort to i32 (i32*, ...)*)(i32* %6)
%8 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%9 = call i32 (i32*, ...) bitcast (i32 (...)* @write to i32 (i32*, ...)*)(i32* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [11 x i32]
%2 = bitcast [11 x i32]* %1 to i8*
%3 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = call i32 (i32*, ...) bitcast (i32 (...)* @read to i32 (i32*, ...)*)(i32* %3)
%6 = call i32 (i32*, ...) bitcast (i32 (...)* @sort to i32 (i32*, ...)*)(i32* %3)
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @write to i32 (i32*, ...)*)(i32* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ B(double);
int cos(double);
double sin(int /*<<< orphan*/);
double sqrt(int);
double Fst(double phi, double k) {
  double Fst = k * sin(B(phi)) * (sqrt(20 + 16 * cos(phi)) - sqrt(20));
  return Fst;
}


x86 assembly (clang, -O0):
<Fst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <B@plt>
mov    %eax,%edi
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <cos@plt>
mov    %eax,%edi
shl    $0x4,%edi
add    $0x14,%edi
call   1060 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
mov    $0x14,%edi
call   1060 <sqrt@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fst>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1030 <B@plt>
mov    %eax,%edi
call   1040 <sin@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <cos@plt>
shl    $0x4,%eax
lea    0x14(%rax),%edi
call   1060 <sqrt@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x14,%edi
call   1060 <sqrt@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x10(%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @Fst(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = call i32 @B(double %7)
%9 = call double @sin(i32 %8)
%10 = fmul double %6, %9
%11 = load double, double* %3
%12 = call i32 @cos(double %11)
%13 = mul nsw i32 16, %12
%14 = add nsw i32 20, %13
%15 = call double @sqrt(i32 %14)
%16 = call double @sqrt(i32 20)
%17 = fsub double %15, %16
%18 = fmul double %10, %17
store double %18, double* %5
%19 = load double, double* %5
ret double %19
}

LLVM IR (-O2):
define double @Fst(double %0, double %1) {
%3 = tail call i32 @B(double %0)
%4 = tail call double @sin(i32 %3)
%5 = fmul double %4, %1
%6 = tail call i32 @cos(double %0)
%7 = shl nsw i32 %6, 4
%8 = add nsw i32 %7, 20
%9 = tail call double @sqrt(i32 %8)
%10 = tail call double @sqrt(i32 20)
%11 = fsub double %9, %10
%12 = fmul double %5, %11
ret double %12
}
void option2optionStart_option_set_option_unset_group_optionEnd() {}


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

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

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

LLVM IR (-O2):
define void @option2optionStart_option_set_option_unset_group_optionEnd() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void write_uint32(unsigned char *buffer, uint32_t value) {
  buffer[0] = value & 0xff;
  buffer[1] = (value >> 8) & 0xff;
  buffer[2] = (value >> 16) & 0xff;
  buffer[3] = (value >> 24) & 0xff;
}


x86 assembly (clang, -O0):
<write_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_uint32>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @write_uint32(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mpfr_t;
typedef int /*<<< orphan*/ mpfr_prec_t;

/* Variables and functions */
int /*<<< orphan*/ m_init2(int /*<<< orphan*/, int /*<<< orphan*/);
void arr_fill(const size_t x, mpfr_t array[x], mpfr_prec_t precision) {
  for (size_t i = 0; i < x; i++) {
    m_init2(array[i], precision);
  }
}


x86 assembly (clang, -O0):
<arr_fill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    115d <arr_fill+0x4d>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x14(%rbp),%esi
call   1030 <m_init2@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112b <arr_fill+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arr_fill>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1145 <arr_fill+0x35>
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%edi
mov    %r14d,%esi
call   1030 <m_init2@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <arr_fill+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @arr_fill(i64 %0, i32* nocapture %1, i32 %2) {
%4 = icmp eq i64 %0, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i64 [ %11, %6 ], [ 0, %3 ]
%8 = getelementptr inbounds i32, i32* %1, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @m_init2(i32 %9, i32 %2)
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %0
br i1 %12, label %5, label %6
}
void f174(void) {
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
a:
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  goto a;
  0;
}


x86 assembly (clang, -O0):
<f174>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
jmp    1119 <f174+0x19>

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

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

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

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ mill_msleep(int, char *);
int now();
int main() {
  uint64_t ms = now();
  mill_msleep((100), "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                     "outputs/2022-01-22/02-19-57/repos/acornejo/libmill/refs/"
                     "heads/master/tests/sleep.c"
                     ":"
                     "41");
  ms = now() - ms;
  assert(ms > 90 && ms < 110);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <now@plt>
mov    %eax,-0x8(%rbp)
mov    $0x64,%edi
lea    0xeab(%rip),%rsi
call   1040 <mill_msleep@plt>
mov    $0x0,%al
call   1050 <now@plt>
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x5a,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jle    1180 <main+0x50>
cmpl   $0x6e,-0x8(%rbp)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <now@plt>
mov    %eax,%ebx
lea    0xebf(%rip),%rsi
mov    $0x64,%edi
call   1040 <mill_msleep@plt>
xor    %eax,%eax
call   1050 <now@plt>
sub    %ebx,%eax
add    $0xffffffa5,%eax
xor    %edi,%edi
cmp    $0x13,%eax
setb   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [142 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/acornejo/libmill/refs/heads/master/tests/sleep.c:41\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @now()
store i32 %3, i32* %2
%4 = call i32 @mill_msleep(i32 100, i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @now()
%6 = load i32, i32* %2
%7 = sub nsw i32 %5, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 90
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 110
br label %13
13: ; preds = %10, %0
%14 = phi i1 [ false, %0 ], [ %12, %10 ]
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [142 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/acornejo/libmill/refs/heads/master/tests/sleep.c:41\00"
define i32 @main() {
%1 = tail call i32 (...) @now()
%2 = tail call i32 @mill_msleep(i32 100, i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @now()
%4 = sub i32 -91, %1
%5 = add i32 %4, %3
%6 = icmp ult i32 %5, 19
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret i32 0
}
/* Variables and functions */
long long l_dnnt(double *);
long long intr_wrap_398(double p1) { return l_dnnt(&p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_398>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <l_dnnt@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i64 @intr_wrap_398(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i64 @l_dnnt(double* %2)
ret i64 %3
}

LLVM IR (-O2):
define i64 @intr_wrap_398(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i64 @l_dnnt(double* %2)
ret i64 %3
}
/* Variables and functions */
int instructions_million();
int main(int argc, char **argv) {
  int i;
  int result;
  for (i = 0; i < 100000; i++) {
    result = instructions_million();
  }
  (void)result;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x186a0,-0x14(%rbp)
jge    1152 <main+0x42>
mov    $0x0,%al
call   1030 <instructions_million@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x186a0,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <instructions_million@plt>
add    $0xffffffff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %6, %3 ]
%5 = tail call i32 (...) @instructions_million()
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 100000
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 0
}
/* Variables and functions */
int aeron_idle_strategy_init_null(void **state, const char *env_var,
                                  const char *init_args) {
  *state = NULL;
  return 0;
}


x86 assembly (clang, -O0):
<aeron_idle_strategy_init_null>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_idle_strategy_init_null>:
movq   $0x0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @aeron_idle_strategy_init_null(i8** nocapture writeonly %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
store i8* null, i8** %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test(char *);
int main(int argc, char *argv[]) {
  test("Tester");
  return 0;
}


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)
lea    0xed3(%rip),%rdi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"Tester\00"
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 = call i32 @test(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"Tester\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ nand_reset();
void nand_init(void) {
  (*(volatile unsigned long *)(0x70200000 + 0x00)) =
      (((0x0) << 30) | ((0x0) << 25) | ((0x0) << 23) | ((0x2) << 12) |
       ((0xf) << 8) | ((0x7) << 4));
  (*(volatile unsigned long *)(0x70200000 + 0x04)) |= (0x3 << 0);
  nand_reset();
}


x86 assembly (clang, -O0):
<nand_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x70200000,%eax
movq   $0x2f70,(%rax)
mov    $0x70200004,%eax
mov    (%rax),%rcx
or     $0x3,%rcx
mov    $0x70200004,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <nand_reset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_init>:
movq   $0x2f70,0x70200000
orq    $0x3,0x70200004
70 03
xor    %eax,%eax
jmp    1030 <nand_reset@plt>

LLVM IR (-O0):
define void @nand_init() {
store volatile i64 12144, i64* inttoptr (i64 1881145344 to i64*)
%1 = load volatile i64, i64* inttoptr (i64 1881145348 to i64*)
%2 = or i64 %1, 3
store volatile i64 %2, i64* inttoptr (i64 1881145348 to i64*)
%3 = call i32 (...) @nand_reset()
ret void
}

LLVM IR (-O2):
define void @nand_init() {
store volatile i64 12144, i64* inttoptr (i64 1881145344 to i64*)
%1 = load volatile i64, i64* inttoptr (i64 1881145348 to i64*)
%2 = or i64 %1, 3
store volatile i64 %2, i64* inttoptr (i64 1881145348 to i64*)
%3 = tail call i32 (...) @nand_reset()
ret void
}
float Div(float a, float b) { return (a / b); }


x86 assembly (clang, -O0):
<Div>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Div>:
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @Div(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fdiv float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @Div(float %0, float %1) {
%3 = fdiv float %0, %1
ret float %3
}
/* Variables and functions */
char getc();
int /*<<< orphan*/ vga_putchar(char);
int /*<<< orphan*/ vga_updatepos();
void getline(char *line) {
  char c;
  while (1) {
    c = getc();
    vga_putchar(c);
    vga_updatepos();
    *line = c;
    line++;
    if (c == '\n')
      break;
  }
}


x86 assembly (clang, -O0):
<getline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getc@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edi
call   1030 <vga_putchar@plt>
mov    $0x0,%al
call   1040 <vga_updatepos@plt>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
jne    117d <getline+0x4d>
jmp    1182 <getline+0x52>
jmp    113c <getline+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getline>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getc@plt>
movsbl %al,%ebp
mov    %ebp,%edi
call   1030 <vga_putchar@plt>
xor    %eax,%eax
call   1040 <vga_updatepos@plt>
mov    %bpl,(%rbx)
add    $0x1,%rbx
cmp    $0xa,%bpl
jne    1140 <getline+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @getline(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
br label %4
4: ; preds = %1, %17
%5 = call signext i8 (...) @getc()
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = call i32 @vga_putchar(i8 signext %6)
%8 = call i32 (...) @vga_updatepos()
%9 = load i8, i8* %3
%10 = load i8*, i8** %2
store i8 %9, i8* %10
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 10
br i1 %15, label %16, label %17
16: ; preds = %4
br label %18
17: ; preds = %4
br label %4
18: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @getline(i8* nocapture writeonly %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = tail call signext i8 (...) @getc()
%5 = tail call i32 @vga_putchar(i8 signext %4)
%6 = tail call i32 (...) @vga_updatepos()
store i8 %4, i8* %3
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = icmp eq i8 %4, 10
br i1 %8, label %9, label %2
9: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_cvolume_valid() {
  printf("NOT IMPLEMENTED:"
         "pa_cvolume_valid"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"NOT IMPLEMENTED:pa_cvolume_valid\0A\00"
define i32 @pa_cvolume_valid() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_cvolume_valid\00"
define i32 @pa_cvolume_valid() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int caam_algapi_hash_init(struct device *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define i32 @caam_algapi_hash_init(%struct.device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int randomBet(int, int);
unsigned char ranSpace() {
  int i;
  unsigned char num;
  i = randomBet(1, 5);
  switch (i) {
  case 1:
    num = 32;
    break;
  case 2:
    num = 126;
    break;
  case 3:
    num = 46;
    break;
  case 4:
    num = 45;
    break;
  case 5:
    num = 95;
    break;
  }
  return num;
}


x86 assembly (clang, -O0):
<ranSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x5,%esi
call   1030 <randomBet@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     117b <ranSpace+0x6b>
mov    -0x10(%rbp),%rax
lea    0xeb6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x20,-0x5(%rbp)
jmp    117b <ranSpace+0x6b>
movb   $0x7e,-0x5(%rbp)
jmp    117b <ranSpace+0x6b>
movb   $0x2e,-0x5(%rbp)
jmp    117b <ranSpace+0x6b>
movb   $0x2d,-0x5(%rbp)
jmp    117b <ranSpace+0x6b>
movb   $0x5f,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ranSpace>:
push   %rax
mov    $0x1,%edi
mov    $0x5,%esi
call   1030 <randomBet@plt>
lea    -0x10(,%rax,8),%ecx
add    $0xfffffffe,%eax
mov    $0x5f2d2e7e,%edx
shr    %cl,%edx
cmp    $0x4,%eax
mov    $0x20,%eax
cmovb  %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @ranSpace() {
%1 = alloca i32
%2 = alloca i8
%3 = call i32 @randomBet(i32 1, i32 5)
store i32 %3, i32* %1
%4 = load i32, i32* %1
switch i32 %4, label %10 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
i32 4, label %8
i32 5, label %9
]
5: ; preds = %0
store i8 32, i8* %2
br label %10
6: ; preds = %0
store i8 126, i8* %2
br label %10
7: ; preds = %0
store i8 46, i8* %2
br label %10
8: ; preds = %0
store i8 45, i8* %2
br label %10
9: ; preds = %0
store i8 95, i8* %2
br label %10
10: ; preds = %0, %9, %8, %7, %6, %5
%11 = load i8, i8* %2
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @ranSpace() {
%1 = tail call i32 @randomBet(i32 1, i32 5)
%2 = add i32 %1, -2
%3 = icmp ult i32 %2, 4
%4 = shl i32 %2, 3
%5 = lshr i32 1596796542, %4
%6 = trunc i32 %5 to i8
%7 = select i1 %3, i8 %6, i8 32
ret i8 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ write(int, void const *, size_t);
ssize_t networkWrite(int fd, const void *buf, size_t len) {
  return write(fd, buf, len);
}


x86 assembly (clang, -O0):
<networkWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<networkWrite>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @networkWrite(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
int start(int x) {
  int count = 0;
  for (int i = 0; i < x; i++) {
    for (int j = 0; j <= i; j++) {
      count += 1;
    }
  }
  return count - x + 1;
}


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115e <start+0x5e>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     114b <start+0x4b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <start+0x28>
jmp    1150 <start+0x50>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <start+0x15>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<start>:
test   %edi,%edi
jle    1119 <start+0x19>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,2),%eax
add    $0xffffffff,%eax
jmp    111b <start+0x1b>
xor    %eax,%eax
sub    %edi,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @start(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %14
3: ; preds = %1
%4 = shl nuw i32 %0, 1
%5 = add nsw i32 %0, -1
%6 = zext i32 %5 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %4, %11
%13 = add i32 %12, -1
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
%16 = sub i32 1, %0
%17 = add i32 %16, %15
ret i32 %17
}
void invalid_TSS() {
  __asm__ __volatile__("cli");
  SetTextColor(0x04 | 0x08, 0x00);
  kprintf("\nERROR: invalid_TSS\n");
  do {
    __asm__ __volatile__("cli  \n\t"
                         "hlt");
  } while (1 == 1);
}


x86 assembly (clang, -O0):
<invalid_TSS>:
push   %rbp
mov    %rsp,%rbp
cli
mov    $0xc,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <SetTextColor@plt>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1040 <kprintf@plt>
cli
hlt
mov    $0x1,%al
test   $0x1,%al
jne    1141 <invalid_TSS+0x21>
jmp    1152 <invalid_TSS+0x32>
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalid_TSS>:
push   %rax
cli
mov    $0xc,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <SetTextColor@plt>
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1040 <kprintf@plt>
xchg   %ax,%ax
cli
hlt
jmp    1140 <invalid_TSS+0x20>

LLVM IR (-O0):
@.str = [21 x i8] c"\0AERROR: invalid_TSS\0A\00"
define void @invalid_TSS() {
%1 = call i32 (i32, i32, ...) bitcast (i32 (...)* @SetTextColor to i32 (i32, i32, ...)*)(i32 12, i32 0)
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @kprintf to i32 (i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %4, %0
br label %4
4: ; preds = %3
br i1 true, label %3, label %5
5: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"\0AERROR: invalid_TSS\0A\00"
define void @invalid_TSS() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @SetTextColor to i32 (i32, i32, ...)*)(i32 12, i32 0)
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @kprintf to i32 (i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %3, %0
tail call void asm sideeffect "cli \0A\09hlt", "~{dirflag},~{fpsr},~{flags}"()
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f() { printf("This is a C code\n"); }


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

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

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

LLVM IR (-O2):
@str = [17 x i8] c"This is a C code\00"
define void @f() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}