xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ alloc(unsigned short);
void *zalloc(unsigned short);
void *zalloc_align(unsigned short boundary, unsigned short size) {
  if ((int)alloc(0) % boundary)
    alloc(boundary - ((unsigned int)alloc(0) % boundary));
  return zalloc(size);
}


x86 assembly (clang, -O0):
<zalloc_align>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
xor    %edi,%edi
call   1030 <alloc@plt>
movzwl -0x2(%rbp),%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1170 <zalloc_align+0x50>
movzwl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
xor    %edi,%edi
call   1030 <alloc@plt>
movzwl -0x2(%rbp),%ecx
xor    %edx,%edx
div    %ecx
mov    -0x8(%rbp),%eax
sub    %edx,%eax
movzwl %ax,%edi
call   1030 <alloc@plt>
movzwl -0x4(%rbp),%edi
call   1040 <zalloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zalloc_align>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
call   1030 <alloc@plt>
cltd
idiv   %ebp
test   %edx,%edx
je     114a <zalloc_align+0x2a>
xor    %edi,%edi
call   1030 <alloc@plt>
xor    %edx,%edx
div    %ebp
sub    %edx,%ebp
movzwl %bp,%edi
call   1030 <alloc@plt>
movzwl %bx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <zalloc@plt>

LLVM IR (-O0):
define i8* @zalloc_align(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = call i64 @alloc(i16 zeroext 0)
%6 = trunc i64 %5 to i32
%7 = load i16, i16* %3
%8 = zext i16 %7 to i32
%9 = srem i32 %6, %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %22
11: ; preds = %2
%12 = load i16, i16* %3
%13 = zext i16 %12 to i32
%14 = call i64 @alloc(i16 zeroext 0)
%15 = trunc i64 %14 to i32
%16 = load i16, i16* %3
%17 = zext i16 %16 to i32
%18 = urem i32 %15, %17
%19 = sub i32 %13, %18
%20 = trunc i32 %19 to i16
%21 = call i64 @alloc(i16 zeroext %20)
br label %22
22: ; preds = %11, %2
%23 = load i16, i16* %4
%24 = call i8* @zalloc(i16 zeroext %23)
ret i8* %24
}

LLVM IR (-O2):
define i8* @zalloc_align(i16 zeroext %0, i16 zeroext %1) {
%3 = tail call i64 @alloc(i16 zeroext 0)
%4 = trunc i64 %3 to i32
%5 = zext i16 %0 to i32
%6 = srem i32 %4, %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %2
%9 = tail call i64 @alloc(i16 zeroext 0)
%10 = trunc i64 %9 to i32
%11 = urem i32 %10, %5
%12 = trunc i32 %11 to i16
%13 = sub i16 %0, %12
%14 = tail call i64 @alloc(i16 zeroext %13)
br label %15
15: ; preds = %8, %2
%16 = tail call i8* @zalloc(i16 zeroext %1)
ret i8* %16
}
main(argc, argv) char **argv;
{
  char c;
  for (;;) {
    if (read(0, &c, 1) != 1) {
      putchar('\n');
      return 1;
    }
    putchar(c);
    if (c == '\n')
      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)
xor    %edi,%edi
lea    -0x11(%rbp),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1040 <read@plt>
cmp    $0x1,%eax
je     1169 <main+0x49>
mov    $0xa,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
movl   $0x1,-0x4(%rbp)
jmp    1192 <main+0x72>
movsbl -0x11(%rbp),%edi
mov    $0x0,%al
call   1030 <putchar@plt>
movsbl -0x11(%rbp),%eax
cmp    $0xa,%eax
jne    118d <main+0x6d>
movl   $0x0,-0x4(%rbp)
jmp    1192 <main+0x72>
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0x7(%rsp),%rbx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <read@plt>
cmp    $0x1,%eax
jne    115b <main+0x3b>
movsbl 0x7(%rsp),%edi
xor    %eax,%eax
call   1030 <putchar@plt>
cmpb   $0xa,0x7(%rsp)
jne    1130 <main+0x10>
jmp    116c <main+0x4c>
mov    $0xa,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
br label %4
4: ; preds = %9, %2
%5 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @read to i32 (i32, i8*, i32, ...)*)(i32 0, i8* %3, i32 1)
%6 = icmp eq i32 %5, 1
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 10)
br label %15
9: ; preds = %4
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %11)
%13 = load i8, i8* %3
%14 = icmp eq i8 %13, 10
br i1 %14, label %15, label %4
15: ; preds = %9, %7
%16 = phi i32 [ 1, %7 ], [ 0, %9 ]
ret i32 %16
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned int avail_out;
};
typedef TYPE_1__ z_stream;

/* Variables and functions */
unsigned int streaming_commons_get_avail_out(z_stream *stream) {
  return stream->avail_out;
}


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

x86 assembly (clang, -O2):
<streaming_commons_get_avail_out>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32 @streaming_commons_get_avail_out(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @streaming_commons_get_avail_out(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int dll_ftrylockfile(int /*<<< orphan*/ *);
int __wrap_ftrylockfile(FILE *file) { return dll_ftrylockfile(file); }


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

x86 assembly (clang, -O2):
<__wrap_ftrylockfile>:
jmp    1030 <dll_ftrylockfile@plt>

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

LLVM IR (-O2):
define i32 @__wrap_ftrylockfile(i32* %0) {
%2 = tail call i32 @dll_ftrylockfile(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void halp(const char *prog) {
  printf("Usage:  %s [-hwf]\n  --help\tDisplay this help screen\n  -h "
         "<number>\tSpecify the height\n  -w <number>\tSpecify the width\n  -f "
         "<filename>\tThe file to save the map to\n",
         prog);
}


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

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

LLVM IR (-O0):
@.str = [162 x i8] c"Usage: %s [-hwf]\0A --help\09Display this help screen\0A -h <number>\09Specify the height\0A -w <number>\09Specify the width\0A -f <filename>\09The file to save the map to\0A\00"
define void @halp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"Usage: %s [-hwf]\0A --help\09Display this help screen\0A -h <number>\09Specify the height\0A -w <number>\09Specify the width\0A -f <filename>\09The file to save the map to\0A\00"
define void @halp(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int clamp(int, int, int);
int clampChange(int n, int b, int c) { return clamp(n, b - c, b + c); }


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

x86 assembly (clang, -O2):
<clampChange>:
mov    %esi,%eax
sub    %edx,%eax
add    %esi,%edx
mov    %eax,%esi
jmp    1030 <clamp@plt>

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

LLVM IR (-O2):
define i32 @clampChange(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %1, %2
%5 = add nsw i32 %2, %1
%6 = tail call i32 @clamp(i32 %0, i32 %4, i32 %5)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_add_epi32(int /*<<< orphan*/ const,
                                 int /*<<< orphan*/ const);
int /*<<< orphan*/ _mm_srai_epi32(int /*<<< orphan*/ const, int const);
__m128i mm_round_epi32_sse2(const __m128i *const src,
                            const __m128i *const half_depth, const int depth) {
  const __m128i nearest_src = _mm_add_epi32(*src, *half_depth);
  return _mm_srai_epi32(nearest_src, depth);
}


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

x86 assembly (clang, -O2):
<mm_round_epi32_sse2>:
push   %rbx
mov    %edx,%ebx
mov    (%rdi),%edi
mov    (%rsi),%esi
call   1030 <_mm_add_epi32@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <_mm_srai_epi32@plt>

LLVM IR (-O0):
define i32 @mm_round_epi32_sse2(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
%12 = call i32 @_mm_add_epi32(i32 %9, i32 %11)
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = load i32, i32* %6
%15 = call i32 @_mm_srai_epi32(i32 %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @mm_round_epi32_sse2(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = tail call i32 @_mm_add_epi32(i32 %4, i32 %5)
%7 = tail call i32 @_mm_srai_epi32(i32 %6, i32 %2)
ret i32 %7
}
/* Variables and functions */
int ACCESS(int *, int);
f(int i) {
  int a[4] = {0};
  return ACCESS(a, i);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <ACCESS@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sub    $0x18,%rsp
mov    %edi,%esi
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <ACCESS@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i32]
store i32 %0, i32* %2
%4 = bitcast [4 x i32]* %3 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @ACCESS(i32* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = alloca [4 x i32]
%3 = bitcast [4 x i32]* %2 to i8*
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%5 = call i32 @ACCESS(i32* %4, i32 %0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *, char *);
void slabheader(void) {
  printf("%-24s %6s %6s %6s %6s\n", "Cache", "Num", "Total", "Size", "Pages");
}


x86 assembly (clang, -O0):
<slabheader>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef5(%rip),%rsi
lea    0xef4(%rip),%rdx
lea    0xef1(%rip),%rcx
lea    0xef0(%rip),%r8
lea    0xeee(%rip),%r9
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<slabheader>:
lea    0xee9(%rip),%rdi
lea    0xef9(%rip),%rsi
lea    0xef8(%rip),%rdx
lea    0xef5(%rip),%rcx
lea    0xef4(%rip),%r8
lea    0xef2(%rip),%r9
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"%-24s %6s %6s %6s %6s\0A\00"
@.str.1 = [6 x i8] c"Cache\00"
@.str.2 = [4 x i8] c"Num\00"
@.str.3 = [6 x i8] c"Total\00"
@.str.4 = [5 x i8] c"Size\00"
@.str.5 = [6 x i8] c"Pages\00"
define void @slabheader() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"%-24s %6s %6s %6s %6s\0A\00"
@.str.1 = [6 x i8] c"Cache\00"
@.str.2 = [4 x i8] c"Num\00"
@.str.3 = [6 x i8] c"Total\00"
@.str.4 = [5 x i8] c"Size\00"
@.str.5 = [6 x i8] c"Pages\00"
define void @slabheader() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
int getline(char **, size_t *, int /*<<< orphan*/ *);
char *strip_newline(char *);
char *sem_read_line(FILE *in) {
  char *line = NULL;
  size_t len = 0;
  if (getline(&line, &len, in) != -1) {
    return strip_newline(line);
  } else {
    free(line);
    return NULL;
  }
}


x86 assembly (clang, -O0):
<sem_read_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <getline@plt>
cmp    $0xffffffff,%eax
je     1178 <sem_read_line+0x48>
mov    -0x18(%rbp),%rdi
call   1030 <strip_newline@plt>
mov    %rax,-0x8(%rbp)
jmp    1189 <sem_read_line+0x59>
mov    -0x18(%rbp),%rdi
call   1040 <free@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_read_line>:
sub    $0x18,%rsp
mov    %rdi,%rdx
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1050 <getline@plt>
mov    0x8(%rsp),%rdi
cmp    $0xffffffff,%eax
je     116c <sem_read_line+0x3c>
call   1030 <strip_newline@plt>
add    $0x18,%rsp
ret
call   1040 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i8* @sem_read_line(i32* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%5 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%6 = call i32 @getline(i8** %2, i64* %3, i32* %0)
%7 = icmp eq i32 %6, -1
%8 = load i8*, i8** %2
br i1 %7, label %11, label %9
9: ; preds = %1
%10 = call i8* @strip_newline(i8* %8)
br label %13
11: ; preds = %1
%12 = call i32 @free(i8* %8)
br label %13
13: ; preds = %11, %9
%14 = phi i8* [ %10, %9 ], [ null, %11 ]
ret i8* %14
}
long kernel__Int___42d(long self, long p0) {
  long var;
  long var1;
  var1 = self * p0;
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<kernel__Int___42d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel__Int___42d>:
mov    %rdi,%rax
imul   %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @kernel__Int___42d(i64 %0, i64 %1) {
%3 = mul nsw i64 %1, %0
ret i64 %3
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int raw_ctz(scalar_t__);
int ctz64(uint64_t n) { return n ? raw_ctz(n) : 64; }


x86 assembly (clang, -O0):
<ctz64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <ctz64+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <raw_ctz@plt>
mov    %eax,-0xc(%rbp)
jmp    1145 <ctz64+0x35>
mov    $0x40,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <ctz64+0x35>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctz64>:
test   %rdi,%rdi
je     111a <ctz64+0xa>
jmp    1030 <raw_ctz@plt>
mov    $0x40,%eax
ret

LLVM IR (-O0):
define i32 @ctz64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = call i32 @raw_ctz(i64 %6)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i32 [ %7, %5 ], [ 64, %8 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @ctz64(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @raw_ctz(i64 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 64, %1 ]
ret i32 %6
}
/* Variables and functions */
double trans(double *, int, double);
double f(double x) {
  double fp[5] = {+1.0, 0.7, -0.3, 0.0, 0.0};
  double y;
  y = trans(fp, 5, x);
  return y;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xeb6(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xea1(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
mov    $0x5,%esi
call   1030 <trans@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sub    $0x28,%rsp
xorps  %xmm1,%xmm1
movaps %xmm1,0x10(%rsp)
movq   $0x0,0x20(%rsp)
movaps 0xed4(%rip),%xmm1
movaps %xmm1,(%rsp)
movabs $0xbfd3333333333333,%rax
33 d3 bf
mov    %rax,0x10(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <trans@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
%3 = alloca [5 x double]
%4 = alloca double
store double %0, double* %2
%5 = bitcast [5 x double]* %3 to i8*
%6 = bitcast i8* %5 to [5 x double]*
%7 = getelementptr inbounds [5 x double], [5 x double]* %6, i32 0, i32 0
store double 1.000000e+00, double* %7
%8 = getelementptr inbounds [5 x double], [5 x double]* %6, i32 0, i32 1
store double 0x3FE6666666666666, double* %8
%9 = getelementptr inbounds [5 x double], [5 x double]* %6, i32 0, i32 2
store double -3.000000e-01, double* %9
%10 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 0
%11 = load double, double* %2
%12 = call double @trans(double* %10, i32 5, double %11)
store double %12, double* %4
%13 = load double, double* %4
ret double %13
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = alloca [5 x double]
%3 = bitcast [5 x double]* %2 to i8*
%4 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 2
%5 = bitcast double* %4 to i8*
%6 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 0
%7 = bitcast [5 x double]* %2 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 0x3FE6666666666666>, <2 x double>* %7
%8 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 2
store double -3.000000e-01, double* %8
%9 = call double @trans(double* %6, i32 5, double %0)
ret double %9
}
void timer_handler(int ino) {}


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

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

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

LLVM IR (-O2):
define void @timer_handler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void msg_help1() {
  printf("\n\n\tThis program is a Markov Babbler, which uses a pseudo Markov "
         "Model in order to predict which word coherently should come after "
         "the current word. This then creates sentences that very from "
         "gibberish to coherent and logical phrases. To make the model perform "
         "more logical sentences, insert more files. The more statistics the "
         "model develops, the better its speaking will be.\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [377 x i8] c"\0A\0A\09This program is a Markov Babbler, which uses a pseudo Markov Model in order to predict which word coherently should come after the current word. This then creates sentences that very from gibberish to coherent and logical phrases. To make the model perform more logical sentences, insert more files. The more statistics the model develops, the better its speaking will be.\0A\00"
define void @msg_help1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([377 x i8], [377 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [376 x i8] c"\0A\0A\09This program is a Markov Babbler, which uses a pseudo Markov Model in order to predict which word coherently should come after the current word. This then creates sentences that very from gibberish to coherent and logical phrases. To make the model perform more logical sentences, insert more files. The more statistics the model develops, the better its speaking will be.\00"
define void @msg_help1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([376 x i8], [376 x i8]* @str, i64 0, i64 0))
ret void
}
void EEPROM_Init(void) {}


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

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

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

LLVM IR (-O2):
define void @EEPROM_Init() {
ret void
}
void fa109(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    p02A:
      goto p02A;
      goto a;
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    a:
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa109>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa109+0x4>

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

LLVM IR (-O0):
define void @fa109() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; preds = %19
br label %19
20: ; No predecessors!
br label %21
21: ; preds = %21, %20
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
br label %24
24: ; preds = %24, %23
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

LLVM IR (-O2):
define void @fa109() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int, int);
int main(void) {
  int a, b;
  a = 10;
  b = 20;
  swap(a, b);
  printf("a = %d\t b = %d\n", a, b);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x14,%esi
call   1040 <swap@plt>
lea    0xec9(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"a = %d\09 b = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @swap(i32 10, i32 20)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 10, i32 20)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int searchForBytes(int const *, int /*<<< orphan*/, int *, int, int);
int isProbably3E(const uint8_t *image, uint32_t size) {
  uint8_t signature[] = {0x85, 0x3E, 0xA9, 0x00};
  return searchForBytes(image, size, signature, 4, 1);
}


x86 assembly (clang, -O0):
<isProbably3E>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x20(%rbp),%rdx
mov    $0x4,%ecx
mov    $0x1,%r8d
call   1030 <searchForBytes@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isProbably3E>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdx
mov    $0x4,%ecx
mov    $0x1,%r8d
call   1030 <searchForBytes@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.isProbably3E.signature = [4 x i32] [i32 133, i32 62, i32 169, i32 0]
define i32 @isProbably3E(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca [4 x i32]
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = bitcast [4 x i32]* %5 to i8*
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%10 = call i32 @searchForBytes(i32* %7, i32 %8, i32* %9, i32 4, i32 1)
ret i32 %10
}

LLVM IR (-O2):
@__const.isProbably3E.signature = [4 x i32] [i32 133, i32 62, i32 169, i32 0]
define i32 @isProbably3E(i32* %0, i32 %1) {
%3 = alloca [4 x i32]
%4 = bitcast [4 x i32]* %3 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%6 = call i32 @searchForBytes(i32* %0, i32 %1, i32* %5, i32 4, i32 1)
ret i32 %6
}
/* Variables and functions */
int CountLeadingZeroes(unsigned long);
scalar_t__ IsPowerOfTwo(unsigned long);
unsigned long DivInt(unsigned long numerator, unsigned long denominator) {
  if (IsPowerOfTwo(denominator))
    return numerator >> (31 - CountLeadingZeroes(denominator));
  else
    return numerator / denominator;
}


x86 assembly (clang, -O0):
<DivInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <IsPowerOfTwo@plt>
cmp    $0x0,%rax
je     116f <DivInt+0x4f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <CountLeadingZeroes@plt>
mov    %eax,%edx
mov    -0x20(%rbp),%rax
mov    $0x1f,%ecx
sub    %edx,%ecx
mov    %ecx,%ecx
shr    %cl,%rax
mov    %rax,-0x8(%rbp)
jmp    117f <DivInt+0x5f>
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DivInt>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <IsPowerOfTwo@plt>
test   %rax,%rax
je     1148 <DivInt+0x28>
mov    %rbx,%rdi
call   1040 <CountLeadingZeroes@plt>
mov    $0x1f,%cl
sub    %al,%cl
shr    %cl,%r14
jmp    116b <DivInt+0x4b>
mov    %r14,%rax
or     %rbx,%rax
shr    $0x20,%rax
je     1161 <DivInt+0x41>
mov    %r14,%rax
xor    %edx,%edx
div    %rbx
mov    %rax,%r14
jmp    116b <DivInt+0x4b>
mov    %r14d,%eax
xor    %edx,%edx
div    %ebx
mov    %eax,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @DivInt(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = call i64 @IsPowerOfTwo(i64 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %2
%10 = load i64, i64* %4
%11 = load i64, i64* %5
%12 = call i32 @CountLeadingZeroes(i64 %11)
%13 = sub nsw i32 31, %12
%14 = zext i32 %13 to i64
%15 = lshr i64 %10, %14
store i64 %15, i64* %3
br label %20
16: ; preds = %2
%17 = load i64, i64* %4
%18 = load i64, i64* %5
%19 = udiv i64 %17, %18
store i64 %19, i64* %3
br label %20
20: ; preds = %16, %9
%21 = load i64, i64* %3
ret i64 %21
}

LLVM IR (-O2):
define i64 @DivInt(i64 %0, i64 %1) {
%3 = tail call i64 @IsPowerOfTwo(i64 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i32 @CountLeadingZeroes(i64 %1)
%7 = sub nsw i32 31, %6
%8 = zext i32 %7 to i64
%9 = lshr i64 %0, %8
br label %12
10: ; preds = %2
%11 = udiv i64 %0, %1
br label %12
12: ; preds = %10, %5
%13 = phi i64 [ %9, %5 ], [ %11, %10 ]
ret i64 %13
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void UARTCharPut(uint32_t ui32Base, unsigned char ucData) {
  ;
  while ((*((volatile uint32_t *)(ui32Base + 0x00000018))) & 0x00000020) {
  }
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) = ucData;
}


x86 assembly (clang, -O0):
<UARTCharPut>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
add    $0x18,%eax
cltq
mov    (%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     1128 <UARTCharPut+0x28>
jmp    110d <UARTCharPut+0xd>
movzbl -0x5(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTCharPut>:
movslq %edi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
testl  $0x20,0x18(%rax)
jne    1110 <UARTCharPut+0x10>
movzbl %sil,%ecx
mov    %ecx,(%rax)
ret

LLVM IR (-O0):
define void @UARTCharPut(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
br label %5
5: ; preds = %13, %2
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 24
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = and i32 %10, 32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %5
br label %5
14: ; preds = %5
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 0
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
store volatile i32 %16, i32* %20
ret void
}

LLVM IR (-O2):
define void @UARTCharPut(i32 %0, i8 zeroext %1) {
%3 = add nsw i32 %0, 24
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
br label %6
6: ; preds = %6, %2
%7 = load volatile i32, i32* %5
%8 = and i32 %7, 32
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %6
10: ; preds = %6
%11 = zext i8 %1 to i32
%12 = sext i32 %0 to i64
%13 = inttoptr i64 %12 to i32*
store volatile i32 %11, i32* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int scanf(char *, double *, double *);
int /*<<< orphan*/ stderr;
void checkInput(double *A, double *B) {
  if ((scanf("%lf %lf", A, B)) != 2) {
    fprintf(stderr, "Wrong input values!");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<checkInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb1(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x2,%eax
je     1180 <checkInput+0x50>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkInput>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xec2(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    114a <checkInput+0x1a>
pop    %rax
ret
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%lf %lf\00"
@stderr = global i32 0
@.str.1 = [20 x i8] c"Wrong input values!\00"
@EXIT_FAILURE = global i32 0
define void @checkInput(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 i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %5, double* %6)
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%lf %lf\00"
@stderr = global i32 0
@.str.1 = [20 x i8] c"Wrong input values!\00"
@EXIT_FAILURE = global i32 0
define void @checkInput(double* %0, double* %1) {
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %0, double* %1)
%4 = icmp eq i32 %3, 2
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret void
}
/* Variables and functions */
char getch_(int);
char getche(void) { return getch_(1); }


x86 assembly (clang, -O0):
<getche>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <getch_@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getche>:
mov    $0x1,%edi
jmp    1030 <getch_@plt>

LLVM IR (-O0):
define signext i8 @getche() {
%1 = call signext i8 @getch_(i32 1)
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @getche() {
%1 = tail call signext i8 @getch_(i32 1)
ret i8 %1
}
/* Type definitions */
struct array {
  int dummy;
};

/* Variables and functions */
int array_add(struct array *, void const *);
int queue_push(struct array *q, const void *data) { return array_add(q, data); }


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

x86 assembly (clang, -O2):
<queue_push>:
jmp    1030 <array_add@plt>

LLVM IR (-O0):
%struct.array = type { i32 }
define i32 @queue_push(%struct.array* %0, i8* %1) {
%3 = alloca %struct.array*
%4 = alloca i8*
store %struct.array* %0, %struct.array** %3
store i8* %1, i8** %4
%5 = load %struct.array*, %struct.array** %3
%6 = load i8*, i8** %4
%7 = call i32 @array_add(%struct.array* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.array = type { i32 }
define i32 @queue_push(%struct.array* %0, i8* %1) {
%3 = tail call i32 @array_add(%struct.array* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(char);
int my_puts(char *s) {
  int i = 0;
  while (s[i] != '\0') {
    my_putchar(s[i]);
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<my_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <my_puts+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <my_putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <my_puts+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <my_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <my_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <my_puts+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

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


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

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

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

LLVM IR (-O2):
define void @_vRestoreScreen() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ oom_killer();
void *realloc(void *, size_t);
void *xrealloc(void *p, size_t s) {
  void *ptr = realloc(p, s);
  if (!ptr)
    oom_killer();
  return ptr;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <xrealloc+0x33>
mov    $0x0,%al
call   1030 <oom_killer@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xrealloc+0x15>
xor    %eax,%eax
call   1030 <oom_killer@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 (...) @oom_killer()
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @oom_killer()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
cbuf35(f, n) int f, n;
{ cbuf(f, n, 35); }


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

x86 assembly (clang, -O2):
<cbuf35>:
mov    $0x23,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf35(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 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %6, i32 %7, i32 35)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @cbuf35(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 35)
ret i32 undef
}
/* Variables and functions */
char **split_delimiter(char *, char *);
char **split(char *value) { return split_delimiter(value, "%"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"%\00"
define i8** @split(i8* %0) {
%2 = tail call i8** @split_delimiter(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8** %2
}
/* Variables and functions */
int /*<<< orphan*/ sfree(double *);
void frvec(double *v, int nl) {
  sfree((v + nl));
  v = NULL;
}


x86 assembly (clang, -O0):
<frvec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <sfree@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frvec>:
movslq %esi,%rax
lea    (%rdi,%rax,8),%rdi
jmp    1030 <sfree@plt>

LLVM IR (-O0):
define void @frvec(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds double, double* %5, i64 %7
%9 = call i32 @sfree(double* %8)
store double* null, double** %3
ret void
}

LLVM IR (-O2):
define void @frvec(double* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds double, double* %0, i64 %3
%5 = tail call i32 @sfree(double* %4)
ret void
}
/* Variables and functions */
double THRandom_uniform(double, double);
double Random_uniform(double low, double high) {
  return THRandom_uniform(low, high);
}


x86 assembly (clang, -O0):
<Random_uniform>:
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 <THRandom_uniform@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Random_uniform>:
jmp    1030 <THRandom_uniform@plt>

LLVM IR (-O0):
define double @Random_uniform(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 @THRandom_uniform(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @Random_uniform(double %0, double %1) {
%3 = tail call double @THRandom_uniform(double %0, double %1)
ret double %3
}
void put_user_byte(char val, char *addr) {
  __asm__("movb %0,%%fs:%1" : : "iq"(val), "m"(*addr));
}


x86 assembly (clang, -O0):
<put_user_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rcx
mov    %al,%fs:(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_user_byte>:
mov    %dil,%fs:(%rsi)
ret

LLVM IR (-O0):
define void @put_user_byte(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = load i8, i8* %3
%6 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
define void @put_user_byte(i8 signext %0, i8* %1) {
tail call void asm sideeffect "movb $0,%fs:$1", "iq,*m,~{dirflag},~{fpsr},~{flags}"(i8 %0, i8* elementtype(i8) %1)
ret void
}
int test_imm_B3int8_mem(signed char *val) {
  return ((*val) & (-0xB3 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_B3int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff4d,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B3int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -179
%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_B3int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -179
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}