xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ sendingbyte();
void wait_xmitr(void) {
  while (sendingbyte()) {
  }
}


x86 assembly (clang, -O0):
<wait_xmitr>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <wait_xmitr+0x9>
mov    $0x0,%al
call   1030 <sendingbyte@plt>
cmp    $0x0,%rax
je     112f <wait_xmitr+0x1f>
jmp    1119 <wait_xmitr+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_xmitr>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <sendingbyte@plt>
test   %rax,%rax
jne    1120 <wait_xmitr+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @wait_xmitr() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @sendingbyte()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @wait_xmitr() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @sendingbyte()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
float tilt_get_x(void) { return 0.0f; }


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

x86 assembly (clang, -O2):
<tilt_get_x>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @tilt_get_x() {
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @tilt_get_x() {
ret float 0.000000e+00
}
void SPUupdate(void) {}


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

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

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

LLVM IR (-O2):
define void @SPUupdate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DirectIndexedXE0(int);
int /*<<< orphan*/ ROL16(int /*<<< orphan*/, int);
void Op36E0M0(void) { ROL16(DirectIndexedXE0(3), 0xFFFF); }


x86 assembly (clang, -O0):
<Op36E0M0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <DirectIndexedXE0@plt>
mov    %eax,%edi
mov    $0xffff,%esi
call   1040 <ROL16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op36E0M0>:
push   %rax
mov    $0x3,%edi
call   1030 <DirectIndexedXE0@plt>
mov    %eax,%edi
mov    $0xffff,%esi
pop    %rax
jmp    1040 <ROL16@plt>

LLVM IR (-O0):
define void @Op36E0M0() {
%1 = call i32 @DirectIndexedXE0(i32 3)
%2 = call i32 @ROL16(i32 %1, i32 65535)
ret void
}

LLVM IR (-O2):
define void @Op36E0M0() {
%1 = tail call i32 @DirectIndexedXE0(i32 3)
%2 = tail call i32 @ROL16(i32 %1, i32 65535)
ret void
}
/* Variables and functions */
int strncmp(char const *, char const *, size_t);
int d_strncmp(const char *s1, const char *s2, size_t n) {
  return strncmp(s1, s2, n);
}


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

x86 assembly (clang, -O2):
<d_strncmp>:
jmp    1030 <strncmp@plt>

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

LLVM IR (-O2):
define i32 @d_strncmp(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
scalar_t__ strncmp(int /*<<< orphan*/, char *, int);
int dir_filter_tty_colon(const struct dirent *d) {
  return strncmp(d->d_name, "tty:", 4) == 0;
}


x86 assembly (clang, -O0):
<dir_filter_tty_colon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dir_filter_tty_colon>:
push   %rax
mov    (%rdi),%edi
lea    0xee6(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
@.str = [5 x i8] c"tty:\00"
define i32 @dir_filter_tty_colon(%struct.dirent* %0) {
%2 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %2
%3 = load %struct.dirent*, %struct.dirent** %2
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i64 @strncmp(i32 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@.str = [5 x i8] c"tty:\00"
define i32 @dir_filter_tty_colon(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i64 @strncmp(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int func(int);
int /*<<< orphan*/ printf(char *, int);
main() {
  int i;
  for (i = 0; i <= 1000; i++) {
    if (func(i) == 1)
      printf("%d\n", i);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jg     1176 <main+0x56>
mov    -0x8(%rbp),%edi
call   1040 <func@plt>
cmp    $0x1,%eax
jne    1163 <main+0x43>
mov    -0x8(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
jmp    1168 <main+0x48>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
jmp    113b <main+0x1b>
nop
add    $0x1,%ebx
cmp    $0x3e9,%ebx
je     1153 <main+0x33>
mov    %ebx,%edi
call   1040 <func@plt>
cmp    $0x1,%eax
jne    1130 <main+0x10>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %7
%2 = phi i32 [ 0, %0 ], [ %8, %7 ]
%3 = tail call i32 @func(i32 %2)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %7
7: ; preds = %1, %5
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 1001
br i1 %9, label %10, label %1
10: ; preds = %7
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(char *);
char *unicode_is_valid_code_point(int /*<<< orphan*/);
int unicode_write_utf16_with_endianness(int /*<<< orphan*/, char *, int);
int unicode_write_utf16(uint32_t code_point, char *string) {
  assert(unicode_is_valid_code_point(code_point));
  assert(string);
  return unicode_write_utf16_with_endianness(code_point, string, true);
}


x86 assembly (clang, -O0):
<unicode_write_utf16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <unicode_is_valid_code_point@plt>
mov    %rax,%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1040 <unicode_write_utf16_with_endianness@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unicode_write_utf16>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1050 <unicode_is_valid_code_point@plt>
mov    %rax,%rdi
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1030 <assert@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <unicode_write_utf16_with_endianness@plt>

LLVM IR (-O0):
define i32 @unicode_write_utf16(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i8* @unicode_is_valid_code_point(i32 %5)
%7 = call i32 @assert(i8* %6)
%8 = load i8*, i8** %4
%9 = call i32 @assert(i8* %8)
%10 = load i32, i32* %3
%11 = load i8*, i8** %4
%12 = call i32 @unicode_write_utf16_with_endianness(i32 %10, i8* %11, i32 1)
ret i32 %12
}

LLVM IR (-O2):
define i32 @unicode_write_utf16(i32 %0, i8* %1) {
%3 = tail call i8* @unicode_is_valid_code_point(i32 %0)
%4 = tail call i32 @assert(i8* %3)
%5 = tail call i32 @assert(i8* %1)
%6 = tail call i32 @unicode_write_utf16_with_endianness(i32 %0, i8* %1, i32 1)
ret i32 %6
}
/* Variables and functions */
float M_LN2;
float logf(float);
float log2f(float x) { return (logf(x) / M_LN2); }


x86 assembly (clang, -O0):
<log2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <logf@plt>
mov    0x2eb2(%rip),%rax
divss  (%rax),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2f>:
push   %rax
call   1030 <logf@plt>
mov    0x2ec3(%rip),%rax
divss  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_LN2 = global float 0.000000e+00
define float @log2f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @logf(float %3)
%5 = load float, float* @M_LN2
%6 = fdiv float %4, %5
ret float %6
}

LLVM IR (-O2):
@M_LN2 = global float 0.000000e+00
define float @log2f(float %0) {
%2 = tail call float @logf(float %0)
%3 = load float, float* @M_LN2
%4 = fdiv float %2, %3
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ posix_spawn_file_actions_t;
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int posix_spawn_file_actions_addopen(posix_spawn_file_actions_t *file_actions,
                                     int fildes, const char *path, int oflag,
                                     mode_t mode) {
  ;
  errno = ENOSYS;
  return -1;
  ;
}


x86 assembly (clang, -O0):
<posix_spawn_file_actions_addopen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    0x2ecb(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb2(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @posix_spawn_file_actions_addopen(i32* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* @ENOSYS
store i32 %11, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @posix_spawn_file_actions_addopen(i32* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3, i32 %4) {
%6 = load i32, i32* @ENOSYS
store i32 %6, i32* @errno
ret i32 -1
}
int sum(int *pa, int *pb) { return *pa + *pb; }


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
add    (%rcx),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sum(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = add nsw i32 %4, %3
ret i32 %5
}
void foo385() {}


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

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

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

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

/* Variables and functions */
uint64_t bswap64(uint64_t v) {
  return ((v & ((uint64_t)0xff << (7 * 8))) >> (7 * 8)) |
         ((v & ((uint64_t)0xff << (6 * 8))) >> (5 * 8)) |
         ((v & ((uint64_t)0xff << (5 * 8))) >> (3 * 8)) |
         ((v & ((uint64_t)0xff << (4 * 8))) >> (1 * 8)) |
         ((v & ((uint64_t)0xff << (3 * 8))) << (1 * 8)) |
         ((v & ((uint64_t)0xff << (2 * 8))) << (3 * 8)) |
         ((v & ((uint64_t)0xff << (1 * 8))) << (5 * 8)) |
         ((v & ((uint64_t)0xff << (0 * 8))) << (7 * 8));
}


x86 assembly (clang, -O0):
<bswap64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
and    -0x4(%rbp),%eax
mov    $0x38,%ecx
sar    %cl,%eax
and    -0x4(%rbp),%edx
mov    $0x28,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
and    -0x4(%rbp),%ecx
sar    $0x18,%ecx
or     %ecx,%eax
and    -0x4(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%edx
and    $0xff00,%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%edx
and    $0xff,%edx
mov    $0x38,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bswap64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, poison
%5 = ashr i32 %4, 56
%6 = load i32, i32* %2
%7 = and i32 %6, poison
%8 = ashr i32 %7, 40
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, poison
%12 = ashr i32 %11, 24
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, poison
%16 = ashr i32 %15, 8
%17 = or i32 %13, %16
%18 = load i32, i32* %2
%19 = and i32 %18, -16777216
%20 = shl i32 %19, 8
%21 = or i32 %17, %20
%22 = load i32, i32* %2
%23 = and i32 %22, 16711680
%24 = shl i32 %23, 24
%25 = or i32 %21, %24
%26 = load i32, i32* %2
%27 = and i32 %26, 65280
%28 = shl i32 %27, 40
%29 = or i32 %25, %28
%30 = load i32, i32* %2
%31 = and i32 %30, 255
%32 = shl i32 %31, 56
%33 = or i32 %29, %32
ret i32 %33
}

LLVM IR (-O2):
define i32 @bswap64(i32 %0) {
ret i32 poison
}
/* Type definitions */
struct wm8350 {
  int dummy;
};

/* Variables and functions */
int wm8350_read_auxadc(struct wm8350 *, int, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int wm8350_read_temp(struct wm8350 *wm8350) {
  return wm8350_read_auxadc(wm8350, 7, 0, 0);
}


x86 assembly (clang, -O0):
<wm8350_read_temp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x7,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <wm8350_read_auxadc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wm8350_read_temp>:
mov    $0x7,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <wm8350_read_auxadc@plt>

LLVM IR (-O0):
%struct.wm8350 = type { i32 }
define i32 @wm8350_read_temp(%struct.wm8350* %0) {
%2 = alloca %struct.wm8350*
store %struct.wm8350* %0, %struct.wm8350** %2
%3 = load %struct.wm8350*, %struct.wm8350** %2
%4 = call i32 @wm8350_read_auxadc(%struct.wm8350* %3, i32 7, i32 0, i32 0)
ret i32 %4
}

LLVM IR (-O2):
%struct.wm8350 = type { i32 }
define i32 @wm8350_read_temp(%struct.wm8350* %0) {
%2 = tail call i32 @wm8350_read_auxadc(%struct.wm8350* %0, i32 7, i32 0, i32 0)
ret i32 %2
}
/* Type definitions */
typedef int int64_t;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ __CRAB_assume(int);
int nd();
int32_t compute1(int32_t *t) {
  int64_t res = t[0] + t[2];
  int idx = nd();
  __CRAB_assume(idx >= 0);
  __CRAB_assume(idx <= 3);
  t[idx] = 30;
  return res;
}


x86 assembly (clang, -O0):
<compute1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
add    0x8(%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <nd@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__CRAB_assume@plt>
cmpl   $0x3,-0x10(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__CRAB_assume@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x1e,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute1>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    0x8(%rdi),%ebp
add    (%rdi),%ebp
xor    %eax,%eax
call   1030 <nd@plt>
mov    %eax,%ebx
mov    %eax,%edi
not    %edi
shr    $0x1f,%edi
call   1040 <__CRAB_assume@plt>
xor    %edi,%edi
cmp    $0x4,%ebx
setl   %dil
call   1040 <__CRAB_assume@plt>
movslq %ebx,%rax
movl   $0x1e,(%r14,%rax,4)
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @compute1(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 2
%10 = load i32, i32* %9
%11 = add nsw i32 %7, %10
store i32 %11, i32* %3
%12 = call i32 (...) @nd()
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = icmp sge i32 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @__CRAB_assume(i32 %15)
%17 = load i32, i32* %4
%18 = icmp sle i32 %17, 3
%19 = zext i1 %18 to i32
%20 = call i32 @__CRAB_assume(i32 %19)
%21 = load i32*, i32** %2
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
store i32 30, i32* %24
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @compute1(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 2
%4 = load i32, i32* %3
%5 = add nsw i32 %4, %2
%6 = tail call i32 (...) @nd()
%7 = xor i32 %6, -1
%8 = lshr i32 %7, 31
%9 = tail call i32 @__CRAB_assume(i32 %8)
%10 = icmp slt i32 %6, 4
%11 = zext i1 %10 to i32
%12 = tail call i32 @__CRAB_assume(i32 %11)
%13 = sext i32 %6 to i64
%14 = getelementptr inbounds i32, i32* %0, i64 %13
store i32 30, i32* %14
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t clamp(int n) {
  n = n > 255 ? 255 : n;
  return n < 0 ? 0 : n;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jle    1121 <clamp+0x21>
mov    $0xff,%eax
mov    %eax,-0x8(%rbp)
jmp    1127 <clamp+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1141 <clamp+0x41>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <clamp+0x47>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
cmp    $0xff,%edi
mov    $0xff,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define i32 @clamp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 255
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = load i32, i32* %2
br label %8
8: ; preds = %6, %5
%9 = phi i32 [ 255, %5 ], [ %7, %6 ]
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
br label %15
13: ; preds = %8
%14 = load i32, i32* %2
br label %15
15: ; preds = %13, %12
%16 = phi i32 [ 0, %12 ], [ %14, %13 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @clamp(i32 %0) {
%2 = icmp slt i32 %0, 255
%3 = select i1 %2, i32 %0, i32 255
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ semctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int sem_destroy(int semid) { semctl(semid, 0, IPC_RMID); }


x86 assembly (clang, -O0):
<sem_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <semctl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_destroy>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <semctl@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
define i32 @sem_destroy(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @IPC_RMID
%6 = call i32 @semctl(i32 %4, i32 0, i32 %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
define i32 @sem_destroy(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i32 @semctl(i32 %0, i32 0, i32 %2)
ret i32 undef
}
void NoSoundDrv_CD_Shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @NoSoundDrv_CD_Shutdown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void caught(void) { printf("Core 3 says caught\n"); }


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

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

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

LLVM IR (-O2):
@str = [19 x i8] c"Core 3 says caught\00"
define void @caught() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(char *);
int main() { f("foo"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
define i32 @main() {
%1 = call i32 @f(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define i32 @main() {
%1 = tail call i32 @f(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void programHeader3(int assignmentNumber, char *studentInfo) {
  printf("Student Assignment Number %d\n"
         "Student: %s\n\n",
         assignmentNumber, studentInfo);
}


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"Student Assignment Number %d\0AStudent: %s\0A\0A\00"
define void @programHeader3(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"Student Assignment Number %d\0AStudent: %s\0A\0A\00"
define void @programHeader3(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret void
}
unsigned short read2Target(unsigned char *ptr) {
  if (1) {
    return ((unsigned short)(((int)(*ptr) << 8) + (int)(*(ptr + 1))));
  } else {
    return ((*((unsigned short *)ptr)));
  }
}


x86 assembly (clang, -O0):
<read2Target>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read2Target>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @read2Target(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = shl i32 %5, 8
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = add nsw i32 %6, %10
%12 = trunc i32 %11 to i16
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @read2Target(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = shl nuw i16 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = or i16 %4, %7
ret i16 %8
}
int test_imm_B2int32_mem(int *val) {
  return ((*val) & (0xB2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B2int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 178
%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_B2int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 178
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void vcopy(const float v1[3], float v2[3]) {
  register int i;
  for (i = 0; i < 3; i++)
    v2[i] = v1[i];
}


x86 assembly (clang, -O0):
<vcopy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    1145 <vcopy+0x45>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <vcopy+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vcopy>:
movss  (%rdi),%xmm0
movss  %xmm0,(%rsi)
movss  0x4(%rdi),%xmm0
movss  %xmm0,0x4(%rsi)
movss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rsi)
ret

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

LLVM IR (-O2):
define void @vcopy(float* nocapture %0, float* nocapture writeonly %1) {
%3 = load float, float* %0
store float %3, float* %1
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %1, i64 1
store float %5, float* %6
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 2
store float %8, float* %9
ret void
}
int ccic_register_switch_device(int mode) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ccic_register_switch_device(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
int main(void) {
  int i;
  unsigned long r = 1;
  for (i = 1; i < 20; i++)
    r *= (20 + i) / i;
  printf("%lu\n", r);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    115b <main+0x4b>
mov    -0x8(%rbp),%eax
add    $0x14,%eax
cltd
idivl  -0x8(%rbp)
cltq
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <main+0x1e>
mov    -0x10(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 8047226880)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ writeCharacter(char);
void writeCharacters(char character, size_t count) {
  while (count > 0) {
    writeCharacter(character);
    count -= 1;
  }
}


x86 assembly (clang, -O0):
<writeCharacters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    1147 <writeCharacters+0x37>
movsbl -0x1(%rbp),%edi
call   1030 <writeCharacter@plt>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1122 <writeCharacters+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeCharacters>:
push   %rbp
push   %rbx
push   %rax
test   %rsi,%rsi
je     112d <writeCharacters+0x1d>
mov    %rsi,%rbx
movsbl %dil,%ebp
nop
mov    %ebp,%edi
call   1030 <writeCharacter@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <writeCharacters+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @writeCharacters(i8 signext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
br label %5
5: ; preds = %8, %2
%6 = load i64, i64* %4
%7 = icmp ugt i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i8, i8* %3
%10 = call i32 @writeCharacter(i8 signext %9)
%11 = load i64, i64* %4
%12 = sub i64 %11, 1
store i64 %12, i64* %4
br label %5
13: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @writeCharacters(i8 signext %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %1, %2 ]
%6 = tail call i32 @writeCharacter(i8 signext %0)
%7 = add i64 %5, -1
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
void g4(void) { sizeof(__typeof__(int(*)[f3()])); }


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

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

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

LLVM IR (-O2):
define void @g4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fn(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  fn(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <fn@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <fn@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @fn(i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PrintFormated(char *);
void printHelloWorld() { PrintFormated("Hello World!\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
define void @printHelloWorld() {
%1 = call i32 @PrintFormated(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World!\0A\00"
define void @printHelloWorld() {
%1 = tail call i32 @PrintFormated(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
int __attribute__((stack_protect)) main() {
  int i;
  char foo[255];
  for (i = 0; i <= 400; i++)
    foo[i] = 42;
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x190,-0x8(%rbp)
jg     1140 <main+0x40>
movslq -0x8(%rbp),%rax
movb   $0x2a,-0x110(%rbp,%rax,1)
2a
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
mov    $0x1,%eax
add    $0x90,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [255 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 400
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 %9
store i8 42, i8* %10
br label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %4
14: ; preds = %4
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
void ff_hevc_put_hevc_bi_w_epel_v24_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_v24_10_sse4() {
ret void
}
/* Variables and functions */
scalar_t__ sqrt(int);
int tri(int);
int invtri(int T) {
  int n = -1 + (int)sqrt(1 + (8 * T));
  n /= 2;
  if (tri(n) == T) {
    return n;
  }
  return 0;
}


x86 assembly (clang, -O0):
<invtri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
shl    $0x3,%edi
add    $0x1,%edi
call   1030 <sqrt@plt>
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <tri@plt>
cmp    -0x8(%rbp),%eax
jne    116b <invtri+0x4b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1172 <invtri+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invtri>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x1(,%rbx,8),%edi
call   1030 <sqrt@plt>
mov    %eax,%ecx
add    $0xffffffff,%ecx
shr    $0x1f,%ecx
lea    (%rax,%rcx,1),%ebp
add    $0xffffffff,%ebp
sar    %ebp
mov    %ebp,%edi
call   1040 <tri@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
cmove  %ebp,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @invtri(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = mul nsw i32 8, %5
%7 = add nsw i32 1, %6
%8 = call i64 @sqrt(i32 %7)
%9 = trunc i64 %8 to i32
%10 = add nsw i32 -1, %9
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = sdiv i32 %11, 2
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = call i32 @tri(i32 %13)
%15 = load i32, i32* %3
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %1
%18 = load i32, i32* %4
store i32 %18, i32* %2
br label %20
19: ; preds = %1
store i32 0, i32* %2
br label %20
20: ; preds = %19, %17
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @invtri(i32 %0) {
%2 = shl nsw i32 %0, 3
%3 = or i32 %2, 1
%4 = tail call i64 @sqrt(i32 %3)
%5 = trunc i64 %4 to i32
%6 = add nsw i32 %5, -1
%7 = sdiv i32 %6, 2
%8 = tail call i32 @tri(i32 %7)
%9 = icmp eq i32 %8, %0
%10 = select i1 %9, i32 %7, i32 0
ret i32 %10
}
/* Variables and functions */
int getch();
int /*<<< orphan*/ kbhit();
char waitForAnyKey(void) {
  int pressed;
  while (!kbhit())
    ;
  pressed = getch();
  return ((char)pressed);
}


x86 assembly (clang, -O0):
<waitForAnyKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <kbhit@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1144 <waitForAnyKey+0x24>
jmp    1149 <waitForAnyKey+0x29>
jmp    1128 <waitForAnyKey+0x8>
mov    $0x0,%al
call   1040 <getch@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitForAnyKey>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <kbhit@plt>
test   %eax,%eax
je     1130 <waitForAnyKey+0x10>
xor    %eax,%eax
call   1040 <getch@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @waitForAnyKey() {
%1 = alloca i32
br label %2
2: ; preds = %6, %0
%3 = call i32 (...) @kbhit()
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = call i32 (...) @getch()
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @waitForAnyKey() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @kbhit()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = tail call i32 (...) @getch()
%6 = trunc i32 %5 to i8
ret i8 %6
}
__attribute__((stdcall)) int STDCallfunc(int a, int b) { return a + b; }


x86 assembly (clang, -O0):
<STDCallfunc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<STDCallfunc>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @STDCallfunc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @STDCallfunc(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint8_t swapType(uint64_t v) { return v & (0x1F); }


x86 assembly (clang, -O0):
<swapType>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapType>:
mov    %edi,%eax
and    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @swapType(i32 %0) {
%2 = and i32 %0, 31
ret i32 %2
}
int fun174() { return 174; }


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

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

LLVM IR (-O0):
define i32 @fun174() {
ret i32 174
}

LLVM IR (-O2):
define i32 @fun174() {
ret i32 174
}
/* Type definitions */
struct obstack {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _obstack_newchunk(struct obstack *, int);
__attribute__((__weak__, __always___)) void
softboundcets__obstack_newchunk(struct obstack *obj, int b) {
  _obstack_newchunk(obj, b);
}


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

x86 assembly (clang, -O2):
<softboundcets__obstack_newchunk>:
jmp    1030 <_obstack_newchunk@plt>

LLVM IR (-O0):
%struct.obstack = type { i32 }
define weak void @softboundcets__obstack_newchunk(%struct.obstack* %0, i32 %1) {
%3 = alloca %struct.obstack*
%4 = alloca i32
store %struct.obstack* %0, %struct.obstack** %3
store i32 %1, i32* %4
%5 = load %struct.obstack*, %struct.obstack** %3
%6 = load i32, i32* %4
%7 = call i32 @_obstack_newchunk(%struct.obstack* %5, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.obstack = type { i32 }
define weak void @softboundcets__obstack_newchunk(%struct.obstack* %0, i32 %1) {
%3 = tail call i32 @_obstack_newchunk(%struct.obstack* %0, i32 %1)
ret void
}
char *test_column_append() { return 0; }


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

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

LLVM IR (-O0):
define i8* @test_column_append() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @test_column_append() {
ret i8* null
}
int *event_queue_max_size() {
  static int n = 10000;
  return &n;
}


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

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

LLVM IR (-O0):
@event_queue_max_size.n = internal global i32 10000
define i32* @event_queue_max_size() {
ret i32* @event_queue_max_size.n
}

LLVM IR (-O2):
@event_queue_max_size.n = internal global i32 10000
define i32* @event_queue_max_size() {
ret i32* @event_queue_max_size.n
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void om_text_print_footer(FILE *fp) { (void)fp; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ m68k_read_memory_16(int /*<<< orphan*/);
void m68k_read_to_16(uint32_t address, uint16_t *dest) {
  *dest = m68k_read_memory_16(address);
}


x86 assembly (clang, -O0):
<m68k_read_to_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <m68k_read_memory_16@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_read_to_16>:
push   %rbx
mov    %rsi,%rbx
call   1030 <m68k_read_memory_16@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @m68k_read_to_16(i32 %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @m68k_read_memory_16(i32 %0)
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sigill(int s) { printf("sigill caught\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"sigill caught\00"
define void @sigill(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
int SIGN(int a) { return (1 | (a >> 31)); }


x86 assembly (clang, -O0):
<SIGN>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
or     $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIGN>:
mov    %edi,%eax
sar    $0x1f,%eax
or     $0x1,%eax
ret

LLVM IR (-O0):
define i32 @SIGN(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 31
%5 = or i32 1, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @SIGN(i32 %0) {
%2 = ashr i32 %0, 31
%3 = or i32 %2, 1
ret i32 %3
}
void cmovi_(x, y, z) int *x, *y, *z;
{ cmov((float)*x, (float)*y, (float)*z); }


x86 assembly (clang, -O0):
<cmovi_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
cvtsi2ssl (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x18(%rbp),%rax
cvtsi2ssl (%rax),%xmm2
cvtss2sd %xmm2,%xmm2
mov    $0x3,%al
call   1030 <cmov@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmovi_>:
cvtsi2ssl (%rdi),%xmm0
cvtsi2ssl (%rsi),%xmm1
cvtsi2ssl (%rdx),%xmm2
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm2,%xmm2
mov    $0x3,%al
jmp    1030 <cmov@plt>

LLVM IR (-O0):
define void @cmovi_(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* %7
%9 = sitofp i32 %8 to float
%10 = fpext float %9 to double
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = sitofp i32 %12 to float
%14 = fpext float %13 to double
%15 = load i32*, i32** %6
%16 = load i32, i32* %15
%17 = sitofp i32 %16 to float
%18 = fpext float %17 to double
%19 = call i32 (double, double, double, ...) bitcast (i32 (...)* @cmov to i32 (double, double, double, ...)*)(double %10, double %14, double %18)
ret void
}

LLVM IR (-O2):
define void @cmovi_(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = sitofp i32 %4 to float
%6 = fpext float %5 to double
%7 = load i32, i32* %1
%8 = sitofp i32 %7 to float
%9 = fpext float %8 to double
%10 = load i32, i32* %2
%11 = sitofp i32 %10 to float
%12 = fpext float %11 to double
%13 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @cmov to i32 (double, double, double, ...)*)(double %6, double %9, double %12)
ret void
}