xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ flu_system(char *);
void hlp_reset_tst(char flavour) {
  if (flavour == 't')
    flu_system("make -C .. clean-tst-time 2>&1 > /dev/null");
  else
    flu_system("make -C .. ctst 2>&1 > /dev/null");
}


x86 assembly (clang, -O0):
<hlp_reset_tst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x74,%eax
jne    113c <hlp_reset_tst+0x2c>
lea    0xece(%rip),%rdi
call   1030 <flu_system@plt>
jmp    1148 <hlp_reset_tst+0x38>
lea    0xee8(%rip),%rdi
call   1030 <flu_system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hlp_reset_tst>:
cmp    $0x74,%dil
lea    0xee5(%rip),%rax
lea    0xf09(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <flu_system@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"make -C .. clean-tst-time 2>&1 > /dev/null\00"
@.str.1 = [33 x i8] c"make -C .. ctst 2>&1 > /dev/null\00"
define void @hlp_reset_tst(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 116
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @flu_system(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 @flu_system(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"make -C .. clean-tst-time 2>&1 > /dev/null\00"
@.str.1 = [33 x i8] c"make -C .. ctst 2>&1 > /dev/null\00"
define void @hlp_reset_tst(i8 signext %0) {
%2 = icmp eq i8 %0, 116
%3 = select i1 %2, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @flu_system(i8* %3)
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ printf(char *, size_t);
void *Memory_malloc(size_t size) {
  void *ptr;
  ptr = malloc(size);
  if (ptr != ((void *)0)) {
    return ptr;
  }
  printf("[memory.c] Could not allocate %d bytes\n", size);
  return ((void *)0);
}


x86 assembly (clang, -O0):
<Memory_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1151 <Memory_malloc+0x31>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1169 <Memory_malloc+0x49>
mov    -0x10(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Memory_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <Memory_malloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [40 x i8] c"[memory.c] Could not allocate %d bytes\0A\00"
define i8* @Memory_malloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i8*, i8** %4
store i8* %10, i8** %2
br label %14
11: ; preds = %1
%12 = load i64, i64* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i64 %12)
store i8* null, i8** %2
br label %14
14: ; preds = %11, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
@.str = [40 x i8] c"[memory.c] Could not allocate %d bytes\0A\00"
define noalias i8* @Memory_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %1, %4
ret i8* %2
}
unsigned long TimerARRReloadGet(unsigned long ulBase) {

  ;
  return ((*((volatile unsigned long *)(ulBase + 0x0000002C))));
}


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

x86 assembly (clang, -O2):
<TimerARRReloadGet>:
mov    0x2c(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @TimerARRReloadGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 44
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @TimerARRReloadGet(i64 %0) {
%2 = add i64 %0, 44
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int memcmp(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *, int);
int eth_addr_compare_3way(const uint8_t a[6], const uint8_t b[6]) {
  return memcmp(a, b, 6);
}


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

x86 assembly (clang, -O2):
<eth_addr_compare_3way>:
mov    $0x6,%edx
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @eth_addr_compare_3way(i32* %0, i32* %1) {
%3 = tail call i32 @memcmp(i32* %0, i32* %1, i32 6)
ret i32 %3
}
void execute(void (*program)()) { return; }


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

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

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

LLVM IR (-O2):
define void @execute(void (...)* nocapture %0) {
ret void
}
/* Variables and functions */
int roadmap_locator_load_tile(int);
int roadmap_square_load(int square) {
  return roadmap_locator_load_tile(square);
}


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

x86 assembly (clang, -O2):
<roadmap_square_load>:
jmp    1030 <roadmap_locator_load_tile@plt>

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

LLVM IR (-O2):
define i32 @roadmap_square_load(i32 %0) {
%2 = tail call i32 @roadmap_locator_load_tile(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef size_t ptrdiff_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errx(int /*<<< orphan*/, char *);
void check_length(ptrdiff_t remaining, size_t needed) {
  if (remaining < needed)
    errx(EXIT_FAILURE, "command line too long");
}


x86 assembly (clang, -O0):
<check_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1143 <check_length+0x33>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
call   1030 <errx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_length>:
cmp    %rsi,%rdi
jae    112a <check_length+0x1a>
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
jmp    1030 <errx@plt>
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [22 x i8] c"command line too long\00"
define void @check_length(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @errx(i32 %9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [22 x i8] c"command line too long\00"
define void @check_length(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @errx(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %4, %2
ret void
}
void TestLength(void) {
  (void)0;
  (void)0;
  (void)0;
  (void)0;
}


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

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

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

LLVM IR (-O2):
define void @TestLength() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kdelay(int);
void kusleep(int time) {
  int kdelay_units = time / 140;
  while (kdelay_units > 0) {
    int nbunits = kdelay_units < 40 ? kdelay_units : 40;
    kdelay(nbunits);
    kdelay_units -= nbunits;
  }
}


x86 assembly (clang, -O0):
<kusleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1173 <kusleep+0x63>
cmpl   $0x28,-0x8(%rbp)
jge    1148 <kusleep+0x38>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1155 <kusleep+0x45>
mov    $0x28,%eax
mov    %eax,-0x10(%rbp)
jmp    1155 <kusleep+0x45>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <kdelay@plt>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <kusleep+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kusleep>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x8c,%edi
jl     1146 <kusleep+0x36>
shr    $0x2,%edi
imul   $0x3a83a83b,%rdi,%rbx
shr    $0x23,%rbx
nopl   0x0(%rax)
cmp    $0x28,%ebx
mov    $0x28,%ebp
cmovb  %ebx,%ebp
mov    %ebp,%edi
call   1030 <kdelay@plt>
sub    %ebp,%ebx
jg     1130 <kusleep+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @kusleep(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 140
store i32 %6, i32* %3
br label %7
7: ; preds = %16, %1
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %23
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 40
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = load i32, i32* %3
br label %16
15: ; preds = %10
br label %16
16: ; preds = %15, %13
%17 = phi i32 [ %14, %13 ], [ 40, %15 ]
store i32 %17, i32* %4
%18 = load i32, i32* %4
%19 = call i32 @kdelay(i32 %18)
%20 = load i32, i32* %4
%21 = load i32, i32* %3
%22 = sub nsw i32 %21, %20
store i32 %22, i32* %3
br label %7
23: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @kusleep(i32 %0) {
%2 = icmp sgt i32 %0, 139
br i1 %2, label %3, label %12
3: ; preds = %1
%4 = udiv i32 %0, 140
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %10, %5 ], [ %4, %3 ]
%7 = icmp ult i32 %6, 40
%8 = select i1 %7, i32 %6, i32 40
%9 = tail call i32 @kdelay(i32 %8)
%10 = sub nsw i32 %6, %8
%11 = icmp sgt i32 %10, 0
br i1 %11, label %5, label %12
12: ; preds = %5, %1
ret void
}
/* Variables and functions */
int matN_getIndex(int const, int const, int);
int mat3d_getIndex(const int row, const int col) {
  return matN_getIndex(row, col, 3);
}


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

x86 assembly (clang, -O2):
<mat3d_getIndex>:
mov    $0x3,%edx
jmp    1030 <matN_getIndex@plt>

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

LLVM IR (-O2):
define i32 @mat3d_getIndex(i32 %0, i32 %1) {
%3 = tail call i32 @matN_getIndex(i32 %0, i32 %1, i32 3)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ parse_expression(char *);
void run_bad_input_tests() {
  parse_expression("1 **/ 34 ");
  parse_expression("6.0 (6.0)");
}


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

x86 assembly (clang, -O2):
<run_bad_input_tests>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <parse_expression@plt>
lea    0xee6(%rip),%rdi
pop    %rax
jmp    1030 <parse_expression@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"1 **/ 34 \00"
@.str.1 = [10 x i8] c"6.0 (6.0)\00"
define void @run_bad_input_tests() {
%1 = call i32 @parse_expression(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @parse_expression(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"1 **/ 34 \00"
@.str.1 = [10 x i8] c"6.0 (6.0)\00"
define void @run_bad_input_tests() {
%1 = tail call i32 @parse_expression(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @parse_expression(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
extern void sleepf(int time_to_sleep) { sleep(time_to_sleep); }


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

x86 assembly (clang, -O2):
<sleepf>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define void @sleepf(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
FILE *file___new_NativeFile_io_open_write___impl(char *path) {
  return fopen(path, "w");
}


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define noalias i32* @file___new_NativeFile_io_open_write___impl(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32* %2
}
/* Variables and functions */
int O_ACCMODE;
int O_RDWR;
int O_WRONLY;
bool flags_is_writing(int flags) {
  int accmode = (flags & O_ACCMODE);
  return (accmode == O_WRONLY || accmode == O_RDWR);
}


x86 assembly (clang, -O0):
<flags_is_writing>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2edf(%rip),%rcx
and    (%rcx),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%al
mov    0x2ea6(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x9(%rbp)
je     113f <flags_is_writing+0x3f>
mov    -0x8(%rbp),%eax
mov    0x2ea9(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flags_is_writing>:
mov    0x2ee9(%rip),%rax
and    (%rax),%edi
mov    0x2eb8(%rip),%rax
cmp    (%rax),%edi
sete   %al
mov    0x2ec4(%rip),%rcx
cmp    (%rcx),%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
@O_ACCMODE = global i32 0
@O_WRONLY = global i32 0
@O_RDWR = global i32 0
define i32 @flags_is_writing(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @O_ACCMODE
%6 = and i32 %4, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* @O_WRONLY
%9 = icmp eq i32 %7, %8
br i1 %9, label %14, label %10
10: ; preds = %1
%11 = load i32, i32* %3
%12 = load i32, i32* @O_RDWR
%13 = icmp eq i32 %11, %12
br label %14
14: ; preds = %10, %1
%15 = phi i1 [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
@O_ACCMODE = global i32 0
@O_WRONLY = global i32 0
@O_RDWR = global i32 0
define i32 @flags_is_writing(i32 %0) {
%2 = load i32, i32* @O_ACCMODE
%3 = and i32 %2, %0
%4 = load i32, i32* @O_WRONLY
%5 = icmp eq i32 %3, %4
%6 = load i32, i32* @O_RDWR
%7 = icmp eq i32 %3, %6
%8 = select i1 %5, i1 true, i1 %7
%9 = zext i1 %8 to i32
ret i32 %9
}
double ms_dabs(double val) {
  if (val < 0.0)
    val *= -1.0;
  return val;
}


x86 assembly (clang, -O0):
<ms_dabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <ms_dabs+0x29>
movsd  0xee1(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms_dabs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ms_dabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fmul double %6, -1.000000e+00
store double %7, double* %2
br label %8
8: ; preds = %5, %1
%9 = load double, double* %2
ret double %9
}

LLVM IR (-O2):
define double @ms_dabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
int max(int a, int b) {
  if (a >= b)
    return a;
  else
    return b;
}


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

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

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
void glFenceSync(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glFenceSync() {
ret void
}
void sigfunc(int s) { (void)(s); }


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

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

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

LLVM IR (-O2):
define void @sigfunc(i32 %0) {
ret void
}
int do_774() { return 774; }


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

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

LLVM IR (-O0):
define i32 @do_774() {
ret i32 774
}

LLVM IR (-O2):
define i32 @do_774() {
ret i32 774
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef scalar_t__ uint32_t;
typedef scalar_t__ uint16_t;
typedef scalar_t__ l;
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t uint16_comparator(const void *l, const void *r) {
  return (uint16_t)(uint32_t)(uint64_t)(l) - (uint16_t)(uint32_t)(uint64_t)(r);
}


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

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

LLVM IR (-O0):
define i64 @uint16_comparator(i8* %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 = ptrtoint i8* %5 to i64
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = sub nsw i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @uint16_comparator(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub nsw i64 %3, %4
ret i64 %5
}
/* Variables and functions */
int strlen(char *);
char toupper(char);
void strupper(char *str) {
  int len = strlen(str);
  for (int i = 0; i < len; i++) {
    str[i] = toupper(str[i]);
  }
}


x86 assembly (clang, -O0):
<strupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1177 <strupper+0x57>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <strupper+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupper>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1040 <strlen@plt>
test   %eax,%eax
jle    1157 <strupper+0x37>
mov    %eax,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <strupper+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @strupper(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %7
6: ; preds = %7, %1
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call signext i8 @toupper(i8 signext %10)
store i8 %11, i8* %9
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
int main() {
  int a;
  int b;
  int i;
  a = 5;
  b = 3;
  i = 0;
  while (i < 10) {
    i = i + 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    1138 <main+0x38>
mov    -0x10(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <main+0x20>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ HiveX_motor_setMode(int);
int /*<<< orphan*/ HiveX_motor_setPeriod(int);
int /*<<< orphan*/ stopRobot();
void moveInit() {
  HiveX_motor_setMode(1);
  HiveX_motor_setPeriod(50);
  stopRobot();
}


x86 assembly (clang, -O0):
<moveInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <HiveX_motor_setMode@plt>
mov    $0x32,%edi
call   1050 <HiveX_motor_setPeriod@plt>
mov    $0x0,%al
call   1030 <stopRobot@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<moveInit>:
push   %rax
mov    $0x1,%edi
call   1040 <HiveX_motor_setMode@plt>
mov    $0x32,%edi
call   1050 <HiveX_motor_setPeriod@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <stopRobot@plt>

LLVM IR (-O0):
define void @moveInit() {
%1 = call i32 @HiveX_motor_setMode(i32 1)
%2 = call i32 @HiveX_motor_setPeriod(i32 50)
%3 = call i32 (...) @stopRobot()
ret void
}

LLVM IR (-O2):
define void @moveInit() {
%1 = tail call i32 @HiveX_motor_setMode(i32 1)
%2 = tail call i32 @HiveX_motor_setPeriod(i32 50)
%3 = tail call i32 (...) @stopRobot()
ret void
}
int(toascii)(int c) { return c & 0x7F; }


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

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

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

LLVM IR (-O2):
define i32 @toascii(i32 %0) {
%2 = and i32 %0, 127
ret i32 %2
}
/* Variables and functions */
bool falls(char c) { return c == 3 || c == 5 || c == 6 || c == 7 || c == 2; }


x86 assembly (clang, -O0):
<falls>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x3,%ecx
mov    %al,-0x2(%rbp)
je     115f <falls+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5,%ecx
mov    %al,-0x2(%rbp)
je     115f <falls+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x6,%ecx
mov    %al,-0x2(%rbp)
je     115f <falls+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7,%ecx
mov    %al,-0x2(%rbp)
je     115f <falls+0x5f>
movsbl -0x1(%rbp),%eax
cmp    $0x2,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<falls>:
lea    -0x3(%rdi),%eax
cmp    $0x5,%al
jae    1119 <falls+0x19>
movzbl %al,%ecx
mov    $0x1,%eax
mov    $0x1d,%edx
bt     %ecx,%edx
jb     1122 <falls+0x22>
xor    %eax,%eax
cmp    $0x2,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @falls(i8 signext %0) {
%2 = add i8 %0, -3
%3 = icmp ult i8 %2, 5
br i1 %3, label %7, label %4
4: ; preds = %7, %1
%5 = icmp eq i8 %0, 2
%6 = zext i1 %5 to i32
br label %11
7: ; preds = %1
%8 = lshr i8 29, %2
%9 = and i8 %8, 1
%10 = icmp eq i8 %9, 0
br i1 %10, label %4, label %11
11: ; preds = %7, %4
%12 = phi i32 [ %6, %4 ], [ 1, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ O_WRONLY;
int opendsp(char const *, int, int, int /*<<< orphan*/, size_t);
int opendsp_write(int channels, int samplerate, const char *path,
                  size_t fragsize) {
  return opendsp(path, channels, samplerate, O_WRONLY, fragsize);
}


x86 assembly (clang, -O0):
<opendsp_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    0x2ea1(%rip),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%r8
call   1030 <opendsp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opendsp_write>:
mov    %rcx,%r8
mov    %rdx,%rax
mov    %esi,%edx
mov    %edi,%esi
mov    0x2eb7(%rip),%rcx
mov    (%rcx),%ecx
mov    %rax,%rdi
jmp    1030 <opendsp@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
define i32 @opendsp_write(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %7
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* @O_WRONLY
%13 = load i64, i64* %8
%14 = call i32 @opendsp(i8* %9, i32 %10, i32 %11, i32 %12, i64 %13)
ret i32 %14
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
define i32 @opendsp_write(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = load i32, i32* @O_WRONLY
%6 = tail call i32 @opendsp(i8* %2, i32 %0, i32 %1, i32 %5, i64 %3)
ret i32 %6
}
int test_imm_E7int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xE7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E7int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0xe7,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_E7int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 231
%7 = icmp ne i64 %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_E7int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 992137445376
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct buf {
  int dummy;
};

/* Variables and functions */
size_t buf_capacity(struct buf *);
int buf_permit(struct buf *b, size_t n) { return buf_capacity(b) >= n; }


x86 assembly (clang, -O0):
<buf_permit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <buf_capacity@plt>
cmp    -0x10(%rbp),%rax
setae  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_permit>:
push   %rbx
mov    %rsi,%rbx
call   1030 <buf_capacity@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
setae  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.buf = type { i32 }
define i32 @buf_permit(%struct.buf* %0, i64 %1) {
%3 = alloca %struct.buf*
%4 = alloca i64
store %struct.buf* %0, %struct.buf** %3
store i64 %1, i64* %4
%5 = load %struct.buf*, %struct.buf** %3
%6 = call i64 @buf_capacity(%struct.buf* %5)
%7 = load i64, i64* %4
%8 = icmp uge i64 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.buf = type { i32 }
define i32 @buf_permit(%struct.buf* %0, i64 %1) {
%3 = tail call i64 @buf_capacity(%struct.buf* %0)
%4 = icmp uge i64 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int file_read_ulong(char *, char *);
long getdefaulthugesize(void) {
  return file_read_ulong("/proc/meminfo", "Hugepagesize:") * 1024;
}


x86 assembly (clang, -O0):
<getdefaulthugesize>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeec(%rip),%rsi
call   1030 <file_read_ulong@plt>
shl    $0xa,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<getdefaulthugesize>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xeef(%rip),%rsi
call   1030 <file_read_ulong@plt>
shl    $0xa,%eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"/proc/meminfo\00"
@.str.1 = [14 x i8] c"Hugepagesize:\00"
define i64 @getdefaulthugesize() {
%1 = call i32 @file_read_ulong(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%2 = mul nsw i32 %1, 1024
%3 = sext i32 %2 to i64
ret i64 %3
}

LLVM IR (-O2):
@.str = [14 x i8] c"/proc/meminfo\00"
@.str.1 = [14 x i8] c"Hugepagesize:\00"
define i64 @getdefaulthugesize() {
%1 = tail call i32 @file_read_ulong(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%2 = shl nsw i32 %1, 10
%3 = sext i32 %2 to i64
ret i64 %3
}
/* Type definitions */
struct tfshdr {
  int dummy;
};

/* Variables and functions */
struct tfshdr *_tfsstat(char *);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
struct tfshdr *mon_tfsstat(char *name) {
  struct tfshdr *ret;
  monLock();
  ret = _tfsstat(name);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_tfsstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <monLock@plt>
mov    -0x8(%rbp),%rdi
call   1030 <_tfsstat@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <monUnlock@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_tfsstat>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <monLock@plt>
mov    %rbx,%rdi
call   1030 <_tfsstat@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <monUnlock@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tfshdr = type { i32 }
define %struct.tfshdr* @mon_tfsstat(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.tfshdr*
store i8* %0, i8** %2
%4 = call i32 (...) @monLock()
%5 = load i8*, i8** %2
%6 = call %struct.tfshdr* @_tfsstat(i8* %5)
store %struct.tfshdr* %6, %struct.tfshdr** %3
%7 = call i32 (...) @monUnlock()
%8 = load %struct.tfshdr*, %struct.tfshdr** %3
ret %struct.tfshdr* %8
}

LLVM IR (-O2):
%struct.tfshdr = type { i32 }
define %struct.tfshdr* @mon_tfsstat(i8* %0) {
%2 = tail call i32 (...) @monLock()
%3 = tail call %struct.tfshdr* @_tfsstat(i8* %0)
%4 = tail call i32 (...) @monUnlock()
ret %struct.tfshdr* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int endmntent(FILE *fp) {
  fclose(fp);
  return 1;
}


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

x86 assembly (clang, -O2):
<endmntent>:
push   %rax
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @endmntent(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret i32 1
}
int fun(int arg) {
#pragma omp declare reduction(red:int : omp_out++)
  {
#pragma omp declare reduction(red:int : omp_out++)
#pragma omp declare reduction(red:int : omp_out++)
    {
#pragma omp declare reduction(red:int : omp_out++)
    }
  }
  return arg;
}


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

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

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

LLVM IR (-O2):
define i32 @fun(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int error = 0;
  if (error)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     114e <main+0x2e>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %2
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
int delete_list_item(void *data) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @delete_list_item(i8* nocapture readnone %0) {
ret i32 1
}
/* Type definitions */
struct gameState {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int drawCard(int, struct gameState *);
int checkDrawCard(int p, struct gameState *post) {
  int r;
  r = drawCard(p, post);
  assert(r == 0);
}


x86 assembly (clang, -O0):
<checkDrawCard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <drawCard@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkDrawCard>:
push   %rax
call   1040 <drawCard@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
%struct.gameState = type { i32 }
define i32 @checkDrawCard(i32 %0, %struct.gameState* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.gameState*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.gameState* %1, %struct.gameState** %5
%7 = load i32, i32* %4
%8 = load %struct.gameState*, %struct.gameState** %5
%9 = call i32 @drawCard(i32 %7, %struct.gameState* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
%struct.gameState = type { i32 }
define i32 @checkDrawCard(i32 %0, %struct.gameState* %1) {
%3 = tail call i32 @drawCard(i32 %0, %struct.gameState* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret i32 undef
}
void SNetDistribUnpack(void *dst, ...) {}


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

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

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

LLVM IR (-O2):
define void @SNetDistribUnpack(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
double dqage(double (*)(double), double, double, double, double, int, double *,
             int *, int *, int *);
double dqag(double f(double), double a, double b, double epsabs, double epsrel,
            int irule, double *abserr, int *neval, int *ier) {
  double result;
  int last;
  result = dqage(f, a, b, epsabs, epsrel, irule, abserr, neval, ier, &last);
  return result;
}


x86 assembly (clang, -O0):
<dqag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
mov    %esi,-0x2c(%rbp)
mov    %rdx,-0x38(%rbp)
mov    %rcx,-0x40(%rbp)
mov    %r8,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
mov    -0x2c(%rbp),%esi
mov    -0x38(%rbp),%rdx
mov    -0x40(%rbp),%rcx
mov    -0x48(%rbp),%r8
lea    -0x54(%rbp),%r9
call   1030 <dqage@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @dqag(double (double)* %0, double %1, double %2, double %3, double %4, i32 %5, double* %6, i32* %7, i32* %8) {
%10 = alloca double (double)*
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca i32
%16 = alloca double*
%17 = alloca i32*
%18 = alloca i32*
%19 = alloca double
%20 = alloca i32
store double (double)* %0, double (double)** %10
store double %1, double* %11
store double %2, double* %12
store double %3, double* %13
store double %4, double* %14
store i32 %5, i32* %15
store double* %6, double** %16
store i32* %7, i32** %17
store i32* %8, i32** %18
%21 = load double (double)*, double (double)** %10
%22 = load double, double* %11
%23 = load double, double* %12
%24 = load double, double* %13
%25 = load double, double* %14
%26 = load i32, i32* %15
%27 = load double*, double** %16
%28 = load i32*, i32** %17
%29 = load i32*, i32** %18
%30 = call double @dqage(double (double)* %21, double %22, double %23, double %24, double %25, i32 %26, double* %27, i32* %28, i32* %29, i32* %20)
store double %30, double* %19
%31 = load double, double* %19
ret double %31
}

LLVM IR (-O2):
define double @dqag(double (double)* %0, double %1, double %2, double %3, double %4, i32 %5, double* %6, i32* %7, i32* %8) {
%10 = alloca i32
%11 = bitcast i32* %10 to i8*
%12 = call double @dqage(double (double)* %0, double %1, double %2, double %3, double %4, i32 %5, double* %6, i32* %7, i32* %8, i32* %10)
ret double %12
}
/* Variables and functions */
double calc_fx(double);
int existence(double a, double b) {
  double fa = calc_fx(a);
  double fb = calc_fx(b);
  if (fa * fb < 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<existence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <calc_fx@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <calc_fx@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1163 <existence+0x53>
movl   $0x1,-0x4(%rbp)
jmp    116a <existence+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<existence>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
call   1030 <calc_fx@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <calc_fx@plt>
mulsd  0x8(%rsp),%xmm0
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @existence(double %0, double %1) {
%3 = tail call double @calc_fx(double %0)
%4 = tail call double @calc_fx(double %1)
%5 = fmul double %3, %4
%6 = fcmp olt double %5, 0.000000e+00
%7 = zext i1 %6 to i32
ret i32 %7
}
void RTLogRelPrintfV(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLogRelPrintfV() {
ret void
}
int test_imm_7Auint8_reg(unsigned char val) {
  return ((val) & (-0x7A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Auint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff86,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_7Auint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -122
%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_7Auint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -122
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int ENDSWAP_32(int);
void endswap_int_array(int *ptr, int len) {
  int temp;
  while (--len >= 0) {
    temp = ptr[len];
    ptr[len] = ENDSWAP_32(temp);
  };
}


x86 assembly (clang, -O0):
<endswap_int_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jl     1159 <endswap_int_array+0x49>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <ENDSWAP_32@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    111f <endswap_int_array+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endswap_int_array>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    114b <endswap_int_array+0x3b>
mov    %rdi,%r14
mov    %esi,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x2(%rbx),%r15d
mov    (%r14,%r15,4),%edi
call   1030 <ENDSWAP_32@plt>
mov    %eax,(%r14,%r15,4)
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1130 <endswap_int_array+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @endswap_int_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 @ENDSWAP_32(i32 %11)
store i32 %12, i32* %10
%13 = icmp ugt i64 %7, 1
br i1 %13, label %6, label %14
14: ; preds = %6, %2
ret void
}