xunge/DecIR huggingface dataset:
void UARTIntEnable(unsigned int baseAdd, unsigned int intFlags) {
  (*((volatile unsigned int *)(baseAdd + (0x4)))) |=
      (intFlags &
       ((0x00000008u) | (0x00000004u) | (0x00000002u) | (0x00000001u)));
}


x86 assembly (clang, -O0):
<UARTIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
and    $0xf,%edx
mov    -0x4(%rbp),%eax
add    $0x4,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTIntEnable>:
and    $0xf,%esi
add    $0x4,%edi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @UARTIntEnable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 15
%7 = load i32, i32* %3
%8 = add i32 %7, 4
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = or i32 %11, %6
store volatile i32 %12, i32* %10
ret void
}

LLVM IR (-O2):
define void @UARTIntEnable(i32 %0, i32 %1) {
%3 = and i32 %1, 15
%4 = add i32 %0, 4
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, %3
store volatile i32 %8, i32* %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *asctime(int /*<<< orphan*/);
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *obtenerTiempo() {
  time_t t;
  time(&t);
  return asctime(localtime(&t));
}


x86 assembly (clang, -O0):
<obtenerTiempo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1050 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1040 <asctime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<obtenerTiempo>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1040 <asctime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @obtenerTiempo() {
%1 = alloca i32
%2 = call i32 @time(i32* %1)
%3 = call i32 @localtime(i32* %1)
%4 = call i8* @asctime(i32 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @obtenerTiempo() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call i32 @localtime(i32* %1)
%5 = call i8* @asctime(i32 %4)
ret i8* %5
}
/* Type definitions */
struct BITSTREAM {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct BITSTREAM *);
void deleteBitstream(struct BITSTREAM *pBitstream) {
  if (pBitstream)
    free(pBitstream);
}


x86 assembly (clang, -O0):
<deleteBitstream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <deleteBitstream+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteBitstream>:
test   %rdi,%rdi
je     111a <deleteBitstream+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.BITSTREAM = type { i32 }
define void @deleteBitstream(%struct.BITSTREAM* %0) {
%2 = alloca %struct.BITSTREAM*
store %struct.BITSTREAM* %0, %struct.BITSTREAM** %2
%3 = load %struct.BITSTREAM*, %struct.BITSTREAM** %2
%4 = icmp ne %struct.BITSTREAM* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.BITSTREAM*, %struct.BITSTREAM** %2
%7 = call i32 @free(%struct.BITSTREAM* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.BITSTREAM = type { i32 }
define void @deleteBitstream(%struct.BITSTREAM* %0) {
%2 = icmp eq %struct.BITSTREAM* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.BITSTREAM* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *smt_get_buffer(size_t size) {
  void *x = malloc(size);
  return x;
}


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

x86 assembly (clang, -O2):
<smt_get_buffer>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @smt_get_buffer(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @smt_get_buffer(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
void OuputVarPool() {}


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

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

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

LLVM IR (-O2):
define void @OuputVarPool() {
ret void
}
/* Variables and functions */
const char *select_error_str(int existing_error,
                             const char *const existing_error_str,
                             int new_error, const char *const new_error_str) {
  const char *error_str =
      (char *)((~(intptr_t)existing_error & (intptr_t)new_error &
                (intptr_t)new_error_str) |
               ((intptr_t)existing_error & (intptr_t)existing_error_str));
  return (error_str);
}


x86 assembly (clang, -O0):
<select_error_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
movslq -0x4(%rbp),%rax
xor    $0xffffffffffffffff,%rax
movslq -0x14(%rbp),%rcx
and    %rcx,%rax
mov    -0x20(%rbp),%rcx
and    %rcx,%rax
movslq -0x4(%rbp),%rcx
mov    -0x10(%rbp),%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<select_error_str>:
movslq %edi,%rdi
and    %rdi,%rsi
not    %rdi
movslq %edx,%rax
and    %rcx,%rax
and    %rdi,%rax
or     %rsi,%rax
ret

LLVM IR (-O0):
define i8* @select_error_str(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = xor i64 %11, -1
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = and i64 %12, %14
%16 = load i8*, i8** %8
%17 = ptrtoint i8* %16 to i64
%18 = and i64 %15, %17
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = load i8*, i8** %6
%22 = ptrtoint i8* %21 to i64
%23 = and i64 %20, %22
%24 = or i64 %18, %23
%25 = inttoptr i64 %24 to i8*
store i8* %25, i8** %9
%26 = load i8*, i8** %9
ret i8* %26
}

LLVM IR (-O2):
define i8* @select_error_str(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = sext i32 %0 to i64
%6 = xor i64 %5, -1
%7 = sext i32 %2 to i64
%8 = and i64 %7, %6
%9 = ptrtoint i8* %3 to i64
%10 = and i64 %8, %9
%11 = ptrtoint i8* %1 to i64
%12 = and i64 %11, %5
%13 = or i64 %10, %12
%14 = inttoptr i64 %13 to i8*
ret i8* %14
}
/* Variables and functions */
scalar_t__ lock();
int /*<<< orphan*/ tzset_unlocked();
int /*<<< orphan*/ unlock();
void tzset(void) {
  if (lock() != 0)
    return;
  tzset_unlocked();
  unlock();
}


x86 assembly (clang, -O0):
<tzset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <lock@plt>
cmp    $0x0,%rax
je     114a <tzset+0x1a>
jmp    1158 <tzset+0x28>
mov    $0x0,%al
call   1030 <tzset_unlocked@plt>
mov    $0x0,%al
call   1040 <unlock@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tzset>:
push   %rax
xor    %eax,%eax
call   1050 <lock@plt>
test   %rax,%rax
je     113f <tzset+0xf>
pop    %rax
ret
xor    %eax,%eax
call   1030 <tzset_unlocked@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <unlock@plt>

LLVM IR (-O0):
define void @tzset() {
%1 = call i64 (...) @lock()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
br label %7
4: ; preds = %0
%5 = call i32 (...) @tzset_unlocked()
%6 = call i32 (...) @unlock()
br label %7
7: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
define void @tzset() {
%1 = tail call i64 (...) @lock()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 (...) @tzset_unlocked()
%5 = tail call i32 (...) @unlock()
br label %6
6: ; preds = %0, %3
ret void
}
/* Variables and functions */
int getNumber(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
int getUserSelection() {
  printf("Select a menu option (0-7): ");
  return getNumber(0, 7);
}


x86 assembly (clang, -O0):
<getUserSelection>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
mov    $0x7,%esi
call   1040 <getNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getUserSelection>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
mov    $0x7,%esi
pop    %rax
jmp    1040 <getNumber@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Select a menu option (0-7): \00"
define i32 @getUserSelection() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @getNumber(i32 0, i32 7)
ret i32 %2
}

LLVM IR (-O2):
@.str = [29 x i8] c"Select a menu option (0-7): \00"
define i32 @getUserSelection() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @getNumber(i32 0, i32 7)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ input;

/* Variables and functions */
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ stdin;
char *strdup(char *);
char *terminal_get_input(const char *prompt) {
  char input[256];
  printf("%s", prompt);
  if (fgets(input, sizeof(input), stdin)) {
    return strdup(input);
  } else
    return NULL;
}


x86 assembly (clang, -O0):
<terminal_get_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    -0x110(%rbp),%rdi
mov    0x2e8b(%rip),%rax
mov    (%rax),%edx
mov    $0x100,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     1188 <terminal_get_input+0x58>
lea    -0x110(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    1190 <terminal_get_input+0x60>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminal_get_input>:
sub    $0x108,%rsp
mov    %rdi,%rsi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rdi
mov    $0x100,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     1171 <terminal_get_input+0x41>
mov    %rsp,%rdi
call   1050 <strdup@plt>
add    $0x108,%rsp
ret
xor    %eax,%eax
add    $0x108,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@stdin = global i32 0
define i8* @terminal_get_input(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [256 x i8]
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%8 = load i32, i32* @stdin
%9 = call i64 @fgets(i8* %7, i32 256, i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%13 = call i8* @strdup(i8* %12)
store i8* %13, i8** %2
br label %15
14: ; preds = %1
store i8* null, i8** %2
br label %15
15: ; preds = %14, %11
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@stdin = global i32 0
define noalias i8* @terminal_get_input(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = load i32, i32* @stdin
%6 = call i64 @fgets(i8* %3, i32 256, i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i8* @strdup(i8* %3)
br label %10
10: ; preds = %1, %8
%11 = phi i8* [ %9, %8 ], [ null, %1 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("\n  Usage:\n"
         "    miso [-h]\n"
         "    miso [-v]\n"
         "    miso [-c] [-d] [-F field_separator] [-V value_separator]\n"
         "                   [-i initial_values] [-f values_path]\n"
         "                   [-l log_path ] [-s shell] [ FILE ]"
         "\n\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [211 x i8] c"\0A Usage:\0A miso [-h]\0A miso [-v]\0A miso [-c] [-d] [-F field_separator] [-V value_separator]\0A [-i initial_values] [-f values_path]\0A [-l log_path ] [-s shell] [ FILE ]\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([211 x i8], [211 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [210 x i8] c"\0A Usage:\0A miso [-h]\0A miso [-v]\0A miso [-c] [-d] [-F field_separator] [-V value_separator]\0A [-i initial_values] [-f values_path]\0A [-l log_path ] [-s shell] [ FILE ]\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([210 x i8], [210 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void pmu_adc_reset_setting() {
  mbus_remote_register_write(0x6, 0x3C,
                             ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) |
                              (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7) |
                              (1 << 8) | (1 << 9) | (1 << 10) | (0 << 11) |
                              (0 << 12) | (0 << 13) | (1 << 14) | (1 << 15) |
                              (1 << 16) | (1 << 17) | (1 << 18) | (1 << 19)));
  delay(100);
}


x86 assembly (clang, -O0):
<pmu_adc_reset_setting>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x3c,%esi
mov    $0xfc7ff,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_adc_reset_setting>:
push   %rax
mov    $0x6,%edi
mov    $0x3c,%esi
mov    $0xfc7ff,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @pmu_adc_reset_setting() {
%1 = call i32 @mbus_remote_register_write(i32 6, i32 60, i32 1034239)
%2 = call i32 @delay(i32 100)
ret void
}

LLVM IR (-O2):
define void @pmu_adc_reset_setting() {
%1 = tail call i32 @mbus_remote_register_write(i32 6, i32 60, i32 1034239)
%2 = tail call i32 @delay(i32 100)
ret void
}
/* Type definitions */
struct hashMap {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *getWord(int /*<<< orphan*/ *);
int /*<<< orphan*/ insertMap(struct hashMap *, char *, int /*<<< orphan*/);
void loadDictionary(FILE *file, struct hashMap *ht) {
  while (1) {
    char *word = getWord(file);
    if (word == NULL)
      break;
    else {
      insertMap(ht, word, 0);
      free(word);
      continue;
    }
  }
}


x86 assembly (clang, -O0):
<loadDictionary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <getWord@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115d <loadDictionary+0x2d>
jmp    117a <loadDictionary+0x4a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1040 <insertMap@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
jmp    1140 <loadDictionary+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loadDictionary>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1050 <getWord@plt>
test   %rax,%rax
je     1175 <loadDictionary+0x45>
mov    %rax,%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
call   1040 <insertMap@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1050 <getWord@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1150 <loadDictionary+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.hashMap = type { i32 }
define void @loadDictionary(i32* %0, %struct.hashMap* %1) {
%3 = alloca i32*
%4 = alloca %struct.hashMap*
%5 = alloca i8*
store i32* %0, i32** %3
store %struct.hashMap* %1, %struct.hashMap** %4
br label %6
6: ; preds = %2, %12
%7 = load i32*, i32** %3
%8 = call i8* @getWord(i32* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %6
br label %18
12: ; preds = %6
%13 = load %struct.hashMap*, %struct.hashMap** %4
%14 = load i8*, i8** %5
%15 = call i32 @insertMap(%struct.hashMap* %13, i8* %14, i32 0)
%16 = load i8*, i8** %5
%17 = call i32 @free(i8* %16)
br label %6
18: ; preds = %11
ret void
}

LLVM IR (-O2):
%struct.hashMap = type { i32 }
define void @loadDictionary(i32* %0, %struct.hashMap* %1) {
%3 = tail call i8* @getWord(i32* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %11, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %9, %5 ], [ %3, %2 ]
%7 = tail call i32 @insertMap(%struct.hashMap* %1, i8* %6, i32 0)
%8 = tail call i32 @free(i8* %6)
%9 = tail call i8* @getWord(i32* %0)
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %5
11: ; preds = %5, %2
ret void
}
double dbl_cmp_lt(double a, double b, double c, double d) {
  return (a < b) ? c : d;
}


x86 assembly (clang, -O0):
<dbl_cmp_lt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    113b <dbl_cmp_lt+0x3b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1145 <dbl_cmp_lt+0x45>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbl_cmp_lt>:
cmpltsd %xmm1,%xmm0
andpd  %xmm0,%xmm2
andnpd %xmm3,%xmm0
orpd   %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @dbl_cmp_lt(double %0, double %1, double %2, double %3) {
%5 = fcmp olt double %0, %1
%6 = select i1 %5, double %2, double %3
ret double %6
}
int fun719() { return 719; }


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

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

LLVM IR (-O0):
define i32 @fun719() {
ret i32 719
}

LLVM IR (-O2):
define i32 @fun719() {
ret i32 719
}
/* Variables and functions */
int /*<<< orphan*/ calcSpringEndEvents(unsigned int);
int /*<<< orphan*/ calcSpringLengthEvents(unsigned int);
int /*<<< orphan*/ printQueue();
void calcSpringEventTime(unsigned int i) {
  calcSpringLengthEvents(i);
  if ((1 == 0)) {
    printQueue();
  }
  calcSpringEndEvents(i);
  if ((1 == 0)) {
    printQueue();
  }
}


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

x86 assembly (clang, -O2):
<calcSpringEventTime>:
push   %rbx
mov    %edi,%ebx
call   1030 <calcSpringLengthEvents@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <calcSpringEndEvents@plt>

LLVM IR (-O0):
define void @calcSpringEventTime(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @calcSpringLengthEvents(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @calcSpringEndEvents(i32 %5)
ret void
}

LLVM IR (-O2):
define void @calcSpringEventTime(i32 %0) {
%2 = tail call i32 @calcSpringLengthEvents(i32 %0)
%3 = tail call i32 @calcSpringEndEvents(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ hash_add64(int /*<<< orphan*/ const,
                              int /*<<< orphan*/ const);
int /*<<< orphan*/ hash_finish(int /*<<< orphan*/, int);
uint32_t hash_uint64_basis(const uint64_t x, const uint32_t basis) {
  return hash_finish(hash_add64(basis, x), 8);
}


x86 assembly (clang, -O0):
<hash_uint64_basis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <hash_add64@plt>
mov    %eax,%edi
mov    $0x8,%esi
call   1040 <hash_finish@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_uint64_basis>:
push   %rax
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
call   1030 <hash_add64@plt>
mov    %eax,%edi
mov    $0x8,%esi
pop    %rax
jmp    1040 <hash_finish@plt>

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

LLVM IR (-O2):
define i32 @hash_uint64_basis(i32 %0, i32 %1) {
%3 = tail call i32 @hash_add64(i32 %1, i32 %0)
%4 = tail call i32 @hash_finish(i32 %3, i32 8)
ret i32 %4
}
unsigned int peak_transfer_detach(const char *x) {
  (void)x;
  return (1);
}


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

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

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

LLVM IR (-O2):
define i32 @peak_transfer_detach(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
void __stub() { putchar(0); }


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

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

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

LLVM IR (-O2):
define void @__stub() {
%1 = tail call i32 @putchar(i32 0)
ret void
}
int is_repair(card)
short card;
{ return card == 10 || card == 11 || card == 12 || card == -1; }


x86 assembly (clang, -O0):
<is_repair>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x3(%rbp)
je     114e <is_repair+0x4e>
movswl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0xb,%ecx
mov    %al,-0x3(%rbp)
je     114e <is_repair+0x4e>
movswl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0xc,%ecx
mov    %al,-0x3(%rbp)
je     114e <is_repair+0x4e>
movswl -0x2(%rbp),%eax
cmp    $0xffffffff,%eax
sete   %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_repair>:
mov    %edi,%eax
shl    $0x10,%eax
and    $0xfffe,%edi
cmp    $0xa,%edi
sete   %cl
cmp    $0xc0000,%eax
sete   %dl
or     %cl,%dl
cmp    $0xffff0000,%eax
sete   %al
or     %dl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @is_repair(i32 %0) {
%2 = shl i32 %0, 16
%3 = and i32 %0, 65534
%4 = icmp eq i32 %3, 10
%5 = icmp eq i32 %2, 786432
%6 = or i1 %4, %5
%7 = icmp eq i32 %2, -65536
%8 = or i1 %7, %6
%9 = zext i1 %8 to i32
ret i32 %9
}
const char *_Locale_t_fmt(struct _Locale_time *ltime
                          __attribute__((__unused__))) {
  return "%H:%M:%S";
}


x86 assembly (clang, -O0):
<_Locale_t_fmt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct._Locale_time = type opaque
@.str = [9 x i8] c"%H:%M:%S\00"
define i8* @_Locale_t_fmt(%struct._Locale_time* %0) {
%2 = alloca %struct._Locale_time*
store %struct._Locale_time* %0, %struct._Locale_time** %2
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct._Locale_time = type opaque
@.str = [9 x i8] c"%H:%M:%S\00"
define i8* @_Locale_t_fmt(%struct._Locale_time* nocapture readnone %0) {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
void led_task(void) {}


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

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

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

LLVM IR (-O2):
define void @led_task() {
ret void
}
int defaultOrderer(const void *a, const void *b) { return (int)(a - b); }


x86 assembly (clang, -O0):
<defaultOrderer>:
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):
<defaultOrderer>:
mov    %rdi,%rax
sub    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @defaultOrderer(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
int main() {
  char *foo;
  char *bar;
  foo = (char *)malloc(10);
  bar = (char *)malloc(10);
  free(foo);
  bar[4] = 'a';
  memcpy(foo, bar, 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
movb   $0x61,0x4(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1040 <memcpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <free@plt>
movb   $0x61,0x4(%rbx)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1040 <memcpy@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i64 @malloc(i32 10)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
%6 = call i64 @malloc(i32 10)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %3
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 4
store i8 97, i8* %11
%12 = load i8*, i8** %2
%13 = load i8*, i8** %3
%14 = call i32 @memcpy(i8* %12, i8* %13, i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 10)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i64 @malloc(i32 10)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @free(i8* %2)
%6 = getelementptr inbounds i8, i8* %4, i64 4
store i8 97, i8* %6
%7 = tail call i32 @memcpy(i8* %2, i8* %4, i32 10)
ret i32 0
}
int str_arrlen(char **arr) {
  int i = 0;
  while (arr[i]) {
    ++i;
  }
  return i;
}


x86 assembly (clang, -O0):
<str_arrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1130 <str_arrlen+0x30>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <str_arrlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_arrlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <str_arrlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @str_arrlen(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int next_utf8(char const *, int *);
int fn_ch_92(const char *text) {
  int pos = 0;
  if (next_utf8(text, &pos) == 92)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_ch_92>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <next_utf8@plt>
cmp    $0x5c,%eax
jne    1144 <fn_ch_92+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_ch_92+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_ch_92>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <next_utf8@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x5c,%ecx
jne    1133 <fn_ch_92+0x23>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fn_ch_92(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @next_utf8(i8* %0, i32* %2)
%5 = icmp eq i32 %4, 92
%6 = load i32, i32* %2
%7 = select i1 %5, i32 %6, i32 -1
ret i32 %7
}
void __outb(unsigned char value, unsigned short port) {
  __asm__ __volatile__("out"
                       "b"
                       " %"
                       "b"
                       "0,%"
                       "w"
                       "1"
                       :
                       : "a"(value), "d"(port));
}


x86 assembly (clang, -O0):
<__outb>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%al
mov    -0x4(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__outb>:
mov    %esi,%edx
mov    %edi,%eax
out    %al,(%dx)
ret

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

LLVM IR (-O2):
define void @__outb(i8 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outb ${0:b},${1:w}", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i8 %0, i16 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GuiSingleton_sdl_draw();
int /*<<< orphan*/ GuiSingleton_sdl_prepareForDirectDraw();
int /*<<< orphan*/ Mt3dSingleton_draw();
void render(double const inLag) {
  GuiSingleton_sdl_prepareForDirectDraw();
  Mt3dSingleton_draw();
  GuiSingleton_sdl_draw();
}


x86 assembly (clang, -O0):
<render>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <GuiSingleton_sdl_prepareForDirectDraw@plt>
mov    $0x0,%al
call   1030 <Mt3dSingleton_draw@plt>
mov    $0x0,%al
call   1050 <GuiSingleton_sdl_draw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<render>:
push   %rax
xor    %eax,%eax
call   1040 <GuiSingleton_sdl_prepareForDirectDraw@plt>
xor    %eax,%eax
call   1030 <Mt3dSingleton_draw@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <GuiSingleton_sdl_draw@plt>

LLVM IR (-O0):
define void @render(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 (...) @GuiSingleton_sdl_prepareForDirectDraw()
%4 = call i32 (...) @Mt3dSingleton_draw()
%5 = call i32 (...) @GuiSingleton_sdl_draw()
ret void
}

LLVM IR (-O2):
define void @render(double %0) {
%2 = tail call i32 (...) @GuiSingleton_sdl_prepareForDirectDraw()
%3 = tail call i32 (...) @Mt3dSingleton_draw()
%4 = tail call i32 (...) @GuiSingleton_sdl_draw()
ret void
}
long double zisnan(x)
long double x;
{
  long double y;
  int k;
  k = isnanl(x);
  y = k;
  return (y);
}


x86 assembly (clang, -O0):
<zisnan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
xor    %eax,%eax
call   1030 <isnanl@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
fildl  -0x28(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zisnan>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
xor    %eax,%eax
call   1030 <isnanl@plt>
mov    %eax,0x14(%rsp)
fildl  0x14(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @zisnan(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
%4 = alloca i32
store x86_fp80 %0, x86_fp80* %2
%5 = load x86_fp80, x86_fp80* %2
%6 = call i32 (x86_fp80, ...) bitcast (i32 (...)* @isnanl to i32 (x86_fp80, ...)*)(x86_fp80 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to x86_fp80
store x86_fp80 %8, x86_fp80* %3
%9 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %9
}

LLVM IR (-O2):
define x86_fp80 @zisnan(x86_fp80 %0) {
%2 = tail call i32 (x86_fp80, ...) bitcast (i32 (...)* @isnanl to i32 (x86_fp80, ...)*)(x86_fp80 %0)
%3 = sitofp i32 %2 to x86_fp80
ret x86_fp80 %3
}
int fun298() { return 298; }


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

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

LLVM IR (-O0):
define i32 @fun298() {
ret i32 298
}

LLVM IR (-O2):
define i32 @fun298() {
ret i32 298
}
/* Variables and functions */
bool full_impl(int top) { return top + 1 == 20; }


x86 assembly (clang, -O0):
<full_impl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x14,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<full_impl>:
xor    %eax,%eax
cmp    $0x13,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @full_impl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = icmp eq i32 %4, 20
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @full_impl(i32 %0) {
%2 = icmp eq i32 %0, 19
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int time(int /*<<< orphan*/);
int g_time1(void) { return time(0); }


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

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

LLVM IR (-O0):
define i32 @g_time1() {
%1 = call i32 @time(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @g_time1() {
%1 = tail call i32 @time(i32 0)
ret i32 %1
}
/* Variables and functions */
char *strdup(char const *);
char *strcopy(const char *str) {
  if (str == NULL)
    return NULL;
  return strdup(str);
}


x86 assembly (clang, -O0):
<strcopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <strcopy+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1141 <strcopy+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcopy>:
test   %rdi,%rdi
je     111a <strcopy+0xa>
jmp    1030 <strdup@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @strcopy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* null, i8** %2
br label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i8* @strdup(i8* %8)
store i8* %9, i8** %2
br label %10
10: ; preds = %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @strcopy(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *cmd) {
  fprintf(stderr, "usage: %s <iterations>\n", cmd);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"usage: %s <iterations>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"usage: %s <iterations>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int fastio_write(int, double *, int);
int fastio_write_doubles(int fd, double *val, int size) {
  return fastio_write(fd, val, sizeof(double) * size);
}


x86 assembly (clang, -O0):
<fastio_write_doubles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <fastio_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastio_write_doubles>:
shl    $0x3,%edx
jmp    1030 <fastio_write@plt>

LLVM IR (-O0):
define i32 @fastio_write_doubles(i32 %0, double* %1, i32 %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca i32
store i32 %0, i32* %4
store double* %1, double** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load double*, double** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 8, %10
%12 = trunc i64 %11 to i32
%13 = call i32 @fastio_write(i32 %7, double* %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @fastio_write_doubles(i32 %0, double* %1, i32 %2) {
%4 = shl i32 %2, 3
%5 = tail call i32 @fastio_write(i32 %0, double* %1, i32 %4)
ret i32 %5
}
int modulo(int nombre, int modulo) {
  if (modulo <= 0) {
    return -1;
  } else if (nombre >= 0) {
    return nombre % modulo;
  } else {
    return modulo - ((-nombre) % modulo);
  }
}


x86 assembly (clang, -O0):
<modulo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1120 <modulo+0x20>
movl   $0xffffffff,-0x4(%rbp)
jmp    1150 <modulo+0x50>
cmpl   $0x0,-0x8(%rbp)
jl     1139 <modulo+0x39>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x4(%rbp)
jmp    1150 <modulo+0x50>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulo>:
test   %esi,%esi
jle    1111 <modulo+0x11>
test   %edi,%edi
js     1117 <modulo+0x17>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret
mov    $0xffffffff,%eax
ret
neg    %edi
mov    %edi,%eax
xor    %edx,%edx
div    %esi
sub    %edx,%esi
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @modulo(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* %5
%7 = icmp sle i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 -1, i32* %3
br label %23
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = srem i32 %13, %14
store i32 %15, i32* %3
br label %23
16: ; preds = %9
%17 = load i32, i32* %5
%18 = load i32, i32* %4
%19 = sub nsw i32 0, %18
%20 = load i32, i32* %5
%21 = srem i32 %19, %20
%22 = sub nsw i32 %17, %21
store i32 %22, i32* %3
br label %23
23: ; preds = %16, %12, %8
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @modulo(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, -1
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = urem i32 %0, %1
br label %12
8: ; preds = %4
%9 = sub i32 0, %0
%10 = urem i32 %9, %1
%11 = sub i32 %1, %10
br label %12
12: ; preds = %2, %8, %6
%13 = phi i32 [ %7, %6 ], [ %11, %8 ], [ -1, %2 ]
ret i32 %13
}
int is_comp(char in) {
  if (in == 0x21 || in == 0x3D || in == 0x3C || in == 0x3E || in == 0x2B) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_comp>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x21,%eax
je     114b <is_comp+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x3d,%eax
je     114b <is_comp+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x3c,%eax
je     114b <is_comp+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x3e,%eax
je     114b <is_comp+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
jne    1157 <is_comp+0x57>
movl   $0x0,-0x4(%rbp)
jmp    115e <is_comp+0x5e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_comp>:
cmp    $0x3e,%dil
ja     111d <is_comp+0x1d>
xor    %eax,%eax
movzbl %dil,%ecx
movabs $0x7000080200000000,%rdx
bt     %rcx,%rdx
jae    111d <is_comp+0x1d>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_comp(i8 signext %0) {
switch i8 %0, label %2 [
i8 62, label %3
i8 61, label %3
i8 60, label %3
i8 43, label %3
i8 33, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 1, %2 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %4
}
void print_memory_stats(void) {}


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

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

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

LLVM IR (-O2):
define void @print_memory_stats() {
ret void
}
int combinatorial(int a, int b) { return a * b; }


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

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

LLVM IR (-O0):
define i32 @combinatorial(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 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @combinatorial(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
struct tree {
  int dummy;
};

/* Variables and functions */
struct tree *make_tree(int);
int /*<<< orphan*/ printf(char *, int);
int tree_compute_sum_facs(struct tree *);
int main() {
  struct tree *tree = make_tree(22);
  int sum = tree_compute_sum_facs(tree);
  printf("%i", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x16,%edi
call   1030 <make_tree@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <tree_compute_sum_facs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x16,%edi
call   1030 <make_tree@plt>
mov    %rax,%rdi
call   1050 <tree_compute_sum_facs@plt>
lea    0xeb6(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tree = type { i32 }
@.str = [3 x i8] c"%i\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.tree*
%3 = alloca i32
store i32 0, i32* %1
%4 = call %struct.tree* @make_tree(i32 22)
store %struct.tree* %4, %struct.tree** %2
%5 = load %struct.tree*, %struct.tree** %2
%6 = call i32 @tree_compute_sum_facs(%struct.tree* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
%struct.tree = type { i32 }
@.str = [3 x i8] c"%i\00"
define i32 @main() {
%1 = tail call %struct.tree* @make_tree(i32 22)
%2 = tail call i32 @tree_compute_sum_facs(%struct.tree* %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ install_malloc_hooks();
void *malloc(size_t);
int /*<<< orphan*/ restore_malloc_hooks();
void *libc_malloc(size_t size) {
  void *ptr;
  restore_malloc_hooks();
  ptr = malloc(size);
  install_malloc_hooks();
  return ptr;
}


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

x86 assembly (clang, -O2):
<libc_malloc>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <restore_malloc_hooks@plt>
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <install_malloc_hooks@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @libc_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = call i32 (...) @restore_malloc_hooks()
%5 = load i64, i64* %2
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %3
%7 = call i32 (...) @install_malloc_hooks()
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define noalias i8* @libc_malloc(i64 %0) {
%2 = tail call i32 (...) @restore_malloc_hooks()
%3 = tail call i8* @malloc(i64 %0)
%4 = tail call i32 (...) @install_malloc_hooks()
ret i8* %3
}