xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ FatalErrnoError(int, int, char *);
int open(char const *, int, int);
int Eopen(char const *pathname, int flags, int mode) {
  int res = open(pathname, flags, mode);
  FatalErrnoError(res == -1, 1, "open()");
  return res;
}


x86 assembly (clang, -O0):
<Eopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x1,%esi
lea    0xea4(%rip),%rdx
call   1030 <FatalErrnoError@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Eopen>:
push   %rbx
call   1040 <open@plt>
mov    %eax,%ebx
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
lea    0xec8(%rip),%rdx
mov    $0x1,%esi
call   1030 <FatalErrnoError@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"open()\00"
define i32 @Eopen(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @open(i8* %8, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, -1
%14 = zext i1 %13 to i32
%15 = call i32 @FatalErrnoError(i32 %14, i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
@.str = [7 x i8] c"open()\00"
define i32 @Eopen(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
%5 = icmp eq i32 %4, -1
%6 = zext i1 %5 to i32
%7 = tail call i32 @FatalErrnoError(i32 %6, i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
int ExampleComparator(void *a, void *b) {
  if (*((int *)a) > *((int *)b))
    return 1;
  else if (*((int *)a) == *((int *)b))
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<ExampleComparator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    112a <ExampleComparator+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    114f <ExampleComparator+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    1148 <ExampleComparator+0x48>
movl   $0x0,-0x4(%rbp)
jmp    114f <ExampleComparator+0x4f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExampleComparator>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setne  %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @ExampleComparator(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void ignore_fprintf(FILE *f, char *s, ...) { ; }


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

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

LLVM IR (-O0):
define void @ignore_fprintf(i32* %0, i8* %1, ...) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @ignore_fprintf(i32* nocapture %0, i8* nocapture %1, ...) {
ret void
}
/* Type definitions */
struct iio_channel_info {
  int dummy;
};

/* Variables and functions */
int enable_se(char const *, struct iio_channel_info **, int *, char *, int);
int enable_accel_se(const char *device_dir, struct iio_channel_info **ci_array,
                    int *counter, int en) {
  return enable_se(device_dir, ci_array, counter, "accel", en);
}


x86 assembly (clang, -O0):
<enable_accel_se>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%r8d
lea    0xec2(%rip),%rcx
call   1030 <enable_se@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_accel_se>:
mov    %ecx,%r8d
lea    0xee6(%rip),%rcx
jmp    1030 <enable_se@plt>

LLVM IR (-O0):
%struct.iio_channel_info = type { i32 }
@.str = [6 x i8] c"accel\00"
define i32 @enable_accel_se(i8* %0, %struct.iio_channel_info** %1, i32* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca %struct.iio_channel_info**
%7 = alloca i32*
%8 = alloca i32
store i8* %0, i8** %5
store %struct.iio_channel_info** %1, %struct.iio_channel_info*** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load %struct.iio_channel_info**, %struct.iio_channel_info*** %6
%11 = load i32*, i32** %7
%12 = load i32, i32* %8
%13 = call i32 @enable_se(i8* %9, %struct.iio_channel_info** %10, i32* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.iio_channel_info = type { i32 }
@.str = [6 x i8] c"accel\00"
define i32 @enable_accel_se(i8* %0, %struct.iio_channel_info** %1, i32* %2, i32 %3) {
%5 = tail call i32 @enable_se(i8* %0, %struct.iio_channel_info** %1, i32* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %5
}
/* Variables and functions */
int alloc_vector_memory(char **, unsigned int *, unsigned int, unsigned int);
int vector_reserve(char **data, unsigned int *capacity, unsigned int data_size,
                   unsigned int new_capacity) {
  if (new_capacity > *capacity) {
    return alloc_vector_memory(data, capacity, data_size, new_capacity);
  }
  return 0;
}


x86 assembly (clang, -O0):
<vector_reserve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jbe    1150 <vector_reserve+0x40>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   1030 <alloc_vector_memory@plt>
mov    %eax,-0x4(%rbp)
jmp    1157 <vector_reserve+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_reserve>:
cmp    %ecx,(%rsi)
jae    1119 <vector_reserve+0x9>
jmp    1030 <alloc_vector_memory@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @vector_reserve(i8** %0, i32* %1, i32 %2, i32 %3) {
%5 = load i32, i32* %1
%6 = icmp ult i32 %5, %3
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @alloc_vector_memory(i8** %0, i32* %1, i32 %2, i32 %3)
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ %8, %7 ], [ 0, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void zfree(void *opaque, void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<zfree>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @zfree(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
int isEqual(int a, int b) { return !((a) & (~b)); }


x86 assembly (clang, -O0):
<isEqual>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEqual>:
not    %esi
xor    %eax,%eax
test   %edi,%esi
sete   %al
ret

LLVM IR (-O0):
define i32 @isEqual(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 = xor i32 %6, -1
%8 = and i32 %5, %7
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @isEqual(i32 %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = and i32 %3, %0
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int);
int /*<<< orphan*/ stderr;
int __va_error2(unsigned int size) {
  fprintf(stderr,
          "vacall: struct of size %u too large for pcc struct return.\n", size);
  abort();
}


x86 assembly (clang, -O0):
<__va_error2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<__va_error2>:
push   %rax
mov    %edi,%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [60 x i8] c"vacall: struct of size %u too large for pcc struct return.\0A\00"
define i32 @__va_error2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [60 x i8] c"vacall: struct of size %u too large for pcc struct return.\0A\00"
define i32 @__va_error2(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ w5100_write_byte(int, unsigned int);
void w5100_writeMR(unsigned data) { w5100_write_byte(0x0000, data); }


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

x86 assembly (clang, -O2):
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <w5100_write_byte@plt>

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

LLVM IR (-O2):
define void @w5100_writeMR(i32 %0) {
%2 = tail call i32 @w5100_write_byte(i32 0, i32 %0)
ret void
}
int plus(int a, int b) { return (a + b); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ free(struct fh_tokenizer *);
void fh_free_tokenizer(struct fh_tokenizer *t) { free(t); }


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

x86 assembly (clang, -O2):
<fh_free_tokenizer>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.fh_tokenizer = type { i32 }
define void @fh_free_tokenizer(%struct.fh_tokenizer* %0) {
%2 = alloca %struct.fh_tokenizer*
store %struct.fh_tokenizer* %0, %struct.fh_tokenizer** %2
%3 = load %struct.fh_tokenizer*, %struct.fh_tokenizer** %2
%4 = call i32 @free(%struct.fh_tokenizer* %3)
ret void
}

LLVM IR (-O2):
%struct.fh_tokenizer = type { i32 }
define void @fh_free_tokenizer(%struct.fh_tokenizer* nocapture %0) {
%2 = tail call i32 @free(%struct.fh_tokenizer* %0)
ret void
}
/* Variables and functions */
scalar_t__ isprint(unsigned char);
int /*<<< orphan*/ printf(char *, unsigned char, int, int);
void keyboard(unsigned char key, int x, int y) {
  if (isprint(key)) {
    printf("key: `%c' %d,%d\n", key, x, y);
  } else {
    printf("key: 0x%x %d,%d\n", key, x, y);
  }
}


x86 assembly (clang, -O0):
<keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%edi
call   1040 <isprint@plt>
cmp    $0x0,%rax
je     1164 <keyboard+0x44>
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xea9(%rip),%rdi
movzbl %al,%esi
call   1030 <printf@plt>
jmp    117c <keyboard+0x5c>
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe9d(%rip),%rdi
movzbl %al,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
call   1040 <isprint@plt>
test   %rax,%rax
lea    0xed7(%rip),%rax
lea    0xebf(%rip),%rdi
cmove  %rax,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"key: `%c' %d,%d\0A\00"
@.str.1 = [17 x i8] c"key: 0x%x %d,%d\0A\00"
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = call i64 @isprint(i8 zeroext %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i8, i8* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8 zeroext %11, i32 %12, i32 %13)
br label %20
15: ; preds = %3
%16 = load i8, i8* %4
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %16, i32 %17, i32 %18)
br label %20
20: ; preds = %15, %10
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"key: `%c' %d,%d\0A\00"
@.str.1 = [17 x i8] c"key: 0x%x %d,%d\0A\00"
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = tail call i64 @isprint(i8 zeroext %0)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
%7 = tail call i32 @printf(i8* %6, i8 zeroext %0, i32 %1, i32 %2)
ret void
}
void End(void) {}


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

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

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

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

/* Variables and functions */
scalar_t__ make_name(char *);
int push_front(struct List *, struct Link *);
int push_front_name(struct List *lst, char *n) {
  return push_front(lst, (struct Link *)make_name(n));
}


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

x86 assembly (clang, -O2):
<push_front_name>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <make_name@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <push_front@plt>

LLVM IR (-O0):
%struct.List = type { i32 }
%struct.Link = type { i32 }
define i32 @push_front_name(%struct.List* %0, i8* %1) {
%3 = alloca %struct.List*
%4 = alloca i8*
store %struct.List* %0, %struct.List** %3
store i8* %1, i8** %4
%5 = load %struct.List*, %struct.List** %3
%6 = load i8*, i8** %4
%7 = call i64 @make_name(i8* %6)
%8 = inttoptr i64 %7 to %struct.Link*
%9 = call i32 @push_front(%struct.List* %5, %struct.Link* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.List = type { i32 }
%struct.Link = type { i32 }
define i32 @push_front_name(%struct.List* %0, i8* %1) {
%3 = tail call i64 @make_name(i8* %1)
%4 = inttoptr i64 %3 to %struct.Link*
%5 = tail call i32 @push_front(%struct.List* %0, %struct.Link* %4)
ret i32 %5
}
/* Variables and functions */
int _add(int, int);
int _substract(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int a = 20, b = 10;
  printf("ASM: 20+10=%d", _add(a, b));
  printf("ASM: 20-10=%d", _substract(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x14,-0x14(%rbp)
movl   $0xa,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1040 <_add@plt>
mov    %eax,%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1050 <_substract@plt>
mov    %eax,%esi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"ASM: 20+10=%d\00"
@.str.1 = [14 x i8] c"ASM: 20-10=%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 20, i32* %6
store i32 10, i32* %7
%8 = load i32, i32* %6
%9 = load i32, i32* %7
%10 = call i32 @_add(i32 %8, i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = call i32 @_substract(i32 %12, i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"ASM: 20+10=%d\00"
@.str.1 = [14 x i8] c"ASM: 20-10=%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @_add(i32 20, i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @_substract(i32 20, i32 10)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
int setSMB347Charger(int usb_state) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @setSMB347Charger(i32 %0) {
ret i32 0
}
long int labs(long int j) { return (j < 0L) ? -j : j; }


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1122 <labs+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <labs+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<labs>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @labs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub nsw i64 0, %6
br label %10
8: ; preds = %1
%9 = load i64, i64* %2
br label %10
10: ; preds = %8, %5
%11 = phi i64 [ %7, %5 ], [ %9, %8 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
void nic_outw(unsigned char reg, unsigned short val) {
  (*((volatile unsigned char *)(0x20000000)) = (reg));
  (*((volatile unsigned char *)((0x20000000 + 4))) = ((unsigned char)val));
  (*((volatile unsigned char *)(0x20000000)) = (reg + 1));
  (*((volatile unsigned char *)((0x20000000 + 4))) =
       ((unsigned char)(val >> 8)));
}


x86 assembly (clang, -O0):
<nic_outw>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%cl
mov    $0x20000000,%eax
mov    %cl,(%rax)
mov    -0x4(%rbp),%ax
mov    %al,%cl
mov    $0x20000004,%eax
mov    %cl,(%rax)
movzbl -0x1(%rbp),%eax
add    $0x1,%eax
mov    %al,%cl
mov    $0x20000000,%eax
mov    %cl,(%rax)
movzwl -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    $0x20000004,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nic_outw>:
mov    %esi,%eax
mov    %dil,0x20000000
20
mov    %al,0x20000004
add    $0x1,%dil
mov    %dil,0x20000000
20
mov    %ah,0x20000004
ret

LLVM IR (-O0):
define void @nic_outw(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
store volatile i8 %5, i8* inttoptr (i64 536870912 to i8*)
%6 = load i16, i16* %4
%7 = trunc i16 %6 to i8
store volatile i8 %7, i8* inttoptr (i64 536870916 to i8*)
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = add nsw i32 %9, 1
%11 = trunc i32 %10 to i8
store volatile i8 %11, i8* inttoptr (i64 536870912 to i8*)
%12 = load i16, i16* %4
%13 = zext i16 %12 to i32
%14 = ashr i32 %13, 8
%15 = trunc i32 %14 to i8
store volatile i8 %15, i8* inttoptr (i64 536870916 to i8*)
ret void
}

LLVM IR (-O2):
define void @nic_outw(i8 zeroext %0, i16 zeroext %1) {
store volatile i8 %0, i8* inttoptr (i64 536870912 to i8*)
%3 = trunc i16 %1 to i8
store volatile i8 %3, i8* inttoptr (i64 536870916 to i8*)
%4 = add i8 %0, 1
store volatile i8 %4, i8* inttoptr (i64 536870912 to i8*)
%5 = lshr i16 %1, 8
%6 = trunc i16 %5 to i8
store volatile i8 %6, i8* inttoptr (i64 536870916 to i8*)
ret void
}
void afun() {}


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

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

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

LLVM IR (-O2):
define void @afun() {
ret void
}
/* Variables and functions */
int fixed_to_i_round(long, int);
int fixed_adjust_precision(long int val, int precision_old, int precision_new) {
  if (precision_old < precision_new) {
    return val << (precision_new - precision_old);
  } else {
    return fixed_to_i_round(val, precision_old - precision_new);
  }
}


x86 assembly (clang, -O0):
<fixed_adjust_precision>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1145 <fixed_adjust_precision+0x35>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
sub    -0x14(%rbp),%ecx
mov    %ecx,%ecx
shl    %cl,%rax
mov    %eax,-0x4(%rbp)
jmp    1157 <fixed_adjust_precision+0x47>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
sub    -0x18(%rbp),%esi
call   1030 <fixed_to_i_round@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixed_adjust_precision>:
mov    %esi,%eax
sub    %edx,%eax
jge    1120 <fixed_adjust_precision+0x10>
sub    %esi,%edx
mov    %edx,%ecx
shl    %cl,%rdi
mov    %edi,%eax
ret
mov    %eax,%esi
jmp    1030 <fixed_to_i_round@plt>

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

LLVM IR (-O2):
define i32 @fixed_adjust_precision(i64 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = sub nsw i32 %2, %1
%7 = zext i32 %6 to i64
%8 = shl i64 %0, %7
%9 = trunc i64 %8 to i32
br label %13
10: ; preds = %3
%11 = sub nsw i32 %1, %2
%12 = tail call i32 @fixed_to_i_round(i64 %0, i32 %11)
br label %13
13: ; preds = %10, %5
%14 = phi i32 [ %9, %5 ], [ %12, %10 ]
ret i32 %14
}
struct el **el_vector(nl, nh)
long nh, nl;
{
  struct el **v;
  v = (struct el **)calloc(nh - nl + 1 + 1, sizeof(struct el *));
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<el_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<el_vector>:
push   %rbx
mov    %rdi,%rbx
sub    %rdi,%rsi
lea    0x2(%rsi),%rdi
mov    $0x8,%esi
call   1030 <calloc@plt>
shl    $0x3,%rbx
neg    %rbx
add    %rbx,%rax
add    $0x8,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.el = type opaque
define %struct.el** @el_vector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca %struct.el**
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = call i8* @calloc(i64 %10, i64 8)
%12 = bitcast i8* %11 to %struct.el**
store %struct.el** %12, %struct.el*** %5
%13 = load %struct.el**, %struct.el*** %5
%14 = load i64, i64* %3
%15 = sub i64 0, %14
%16 = getelementptr inbounds %struct.el*, %struct.el** %13, i64 %15
%17 = getelementptr inbounds %struct.el*, %struct.el** %16, i64 1
ret %struct.el** %17
}

LLVM IR (-O2):
%struct.el = type opaque
define noalias %struct.el** @el_vector(i64 %0, i64 %1) {
%3 = sub i64 0, %0
%4 = sub i64 2, %0
%5 = add i64 %4, %1
%6 = tail call i8* @calloc(i64 %5, i64 8)
%7 = bitcast i8* %6 to %struct.el**
%8 = getelementptr inbounds %struct.el*, %struct.el** %7, i64 %3
%9 = getelementptr inbounds %struct.el*, %struct.el** %8, i64 1
ret %struct.el** %9
}
/* Variables and functions */
char *filesys_decompressor_for_file(char *);
int compressed_filename_p(char *filename) {
  char *decompressor;
  decompressor = filesys_decompressor_for_file(filename);
  if (decompressor)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compressed_filename_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <filesys_decompressor_for_file@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1140 <compressed_filename_p+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1147 <compressed_filename_p+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compressed_filename_p>:
push   %rax
call   1030 <filesys_decompressor_for_file@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @compressed_filename_p(i8* %0) {
%2 = tail call i8* @filesys_decompressor_for_file(i8* %0)
%3 = icmp ne i8* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
void RGBColorTableRow_C() {}


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

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

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

LLVM IR (-O2):
define void @RGBColorTableRow_C() {
ret void
}
int jac_chain_nm5_alloc(void **mem, const int *idata, const double *rdata) {
  if (mem)
    *mem = 0;
  (void)idata;
  (void)rdata;
  return 0;
}


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

x86 assembly (clang, -O2):
<jac_chain_nm5_alloc>:
test   %rdi,%rdi
je     110c <jac_chain_nm5_alloc+0xc>
movq   $0x0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @jac_chain_nm5_alloc(i8** writeonly %0, i32* nocapture readnone %1, double* nocapture readnone %2) {
%4 = icmp eq i8** %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
store i8* null, i8** %0
br label %6
6: ; preds = %5, %3
ret i32 0
}
/* Variables and functions */
unsigned int __t1mskc_u32(unsigned int);
unsigned int test__t1mskc_u32(unsigned int a) { return __t1mskc_u32(a); }


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

x86 assembly (clang, -O2):
<test__t1mskc_u32>:
jmp    1030 <__t1mskc_u32@plt>

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

LLVM IR (-O2):
define i32 @test__t1mskc_u32(i32 %0) {
%2 = tail call i32 @__t1mskc_u32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int /*<<< orphan*/);
void stop_timer() { alarm(0); }


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

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

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

LLVM IR (-O2):
define void @stop_timer() {
%1 = tail call i32 @alarm(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void time5_cb(int value) {
  if (value != -3) {
    printf("ERROR: test18\n");
    exit(1);
  }
  printf("PASS: test18\n");
  exit(0);
}


x86 assembly (clang, -O0):
<time5_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xfffffffd,-0x4(%rbp)
je     114b <time5_cb+0x2b>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<time5_cb>:
push   %rax
cmp    $0xfffffffd,%edi
jne    1139 <time5_cb+0x19>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"ERROR: test18\0A\00"
@.str.1 = [14 x i8] c"PASS: test18\0A\00"
define void @time5_cb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, -3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [13 x i8] c"PASS: test18\00"
@str.2 = [14 x i8] c"ERROR: test18\00"
define void @time5_cb(i32 %0) {
%2 = icmp eq i32 %0, -3
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.2, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double stub1();
double testClosureVrD(double (*closure)(void)) {
  return closure != NULL ? (*closure)() : (double)0;
}


x86 assembly (clang, -O0):
<testClosureVrD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1124 <testClosureVrD+0x24>
call   *-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
jmp    1131 <testClosureVrD+0x31>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1131 <testClosureVrD+0x31>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureVrD>:
test   %rdi,%rdi
je     1107 <testClosureVrD+0x7>
jmp    *%rdi
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @testClosureVrD(double ()* %0) {
%2 = alloca double ()*
store double ()* %0, double ()** %2
%3 = load double ()*, double ()** %2
%4 = icmp ne double ()* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double ()*, double ()** %2
%7 = call double %6()
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi double [ %7, %5 ], [ 0.000000e+00, %8 ]
ret double %10
}

LLVM IR (-O2):
define double @testClosureVrD(double ()* %0) {
%2 = icmp eq double ()* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call double %0()
br label %5
5: ; preds = %1, %3
%6 = phi double [ %4, %3 ], [ 0.000000e+00, %1 ]
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ runalltests_behaviour_flat_file();
int main(void) {
  runalltests_behaviour_flat_file();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <runalltests_behaviour_flat_file@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <runalltests_behaviour_flat_file@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @runalltests_behaviour_flat_file()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @runalltests_behaviour_flat_file()
ret i32 0
}
void SteamAPI_ISteamUtils_SetOverlayNotificationInset(void *self,
                                                      int nHorizontalInset,
                                                      int nVerticalInset) {
  xlogf("%s(self = %p, nHorizontalInset = %d, nVerticalInset = %d)\n", __func__,
        self, nHorizontalInset, nVerticalInset);
}


x86 assembly (clang, -O0):
<SteamAPI_ISteamUtils_SetOverlayNotificationInset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xecc(%rip),%rdi
lea    0xf00(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_ISteamUtils_SetOverlayNotificationInset>:
mov    %edx,%r8d
mov    %esi,%ecx
mov    %rdi,%rdx
lea    0xee1(%rip),%rdi
lea    0xf15(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"%s(self = %p, nHorizontalInset = %d, nVerticalInset = %d)\0A\00"
@__func__.SteamAPI_ISteamUtils_SetOverlayNotificationInset = [49 x i8] c"SteamAPI_ISteamUtils_SetOverlayNotificationInset\00"
define void @SteamAPI_ISteamUtils_SetOverlayNotificationInset(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 (i8*, i8*, i8*, i32, i32, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @__func__.SteamAPI_ISteamUtils_SetOverlayNotificationInset, i64 0, i64 0), i8* %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"%s(self = %p, nHorizontalInset = %d, nVerticalInset = %d)\0A\00"
@__func__.SteamAPI_ISteamUtils_SetOverlayNotificationInset = [49 x i8] c"SteamAPI_ISteamUtils_SetOverlayNotificationInset\00"
define void @SteamAPI_ISteamUtils_SetOverlayNotificationInset(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 (i8*, i8*, i8*, i32, i32, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @__func__.SteamAPI_ISteamUtils_SetOverlayNotificationInset, i64 0, i64 0), i8* %0, i32 %1, i32 %2)
ret void
}
void RTAssertShouldPanic(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAssertShouldPanic() {
ret void
}
int f_i14(int i0, int i1, int i2, int i3, int i4, int i5, int i6, int i7,
          int i8, int i9, int i10, int i11, int i12, int i13) {
  return i13;
}


x86 assembly (clang, -O0):
<f_i14>:
push   %rbp
mov    %rsp,%rbp
mov    0x48(%rbp),%eax
mov    0x40(%rbp),%eax
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    0x48(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_i14>:
mov    0x40(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @f_i14(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i32 %12, i32 returned %13) {
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ getpid();
pthread_t pthread_self(void) { return getpid(); }


x86 assembly (clang, -O0):
<pthread_self>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_self>:
xor    %eax,%eax
jmp    1030 <getpid@plt>

LLVM IR (-O0):
define i32 @pthread_self() {
%1 = call i32 (...) @getpid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @pthread_self() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}
/* Type definitions */
struct skin_element {
  int dummy;
};

/* Variables and functions */
struct skin_element *skin_parse_sublines_optional(char const **,
                                                  int /*<<< orphan*/);
struct skin_element *skin_parse_sublines(const char **document) {
  return skin_parse_sublines_optional(document, 0);
}


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

x86 assembly (clang, -O2):
<skin_parse_sublines>:
xor    %esi,%esi
jmp    1030 <skin_parse_sublines_optional@plt>

LLVM IR (-O0):
%struct.skin_element = type { i32 }
define %struct.skin_element* @skin_parse_sublines(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = call %struct.skin_element* @skin_parse_sublines_optional(i8** %3, i32 0)
ret %struct.skin_element* %4
}

LLVM IR (-O2):
%struct.skin_element = type { i32 }
define %struct.skin_element* @skin_parse_sublines(i8** %0) {
%2 = tail call %struct.skin_element* @skin_parse_sublines_optional(i8** %0, i32 0)
ret %struct.skin_element* %2
}
/* Variables and functions */
char getchar();
int clearBuffer() {
  if (getchar() != '\n')
    clearBuffer();
  return 0;
}


x86 assembly (clang, -O0):
<clearBuffer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     113c <clearBuffer+0x1c>
call   1030 <clearBuffer@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearBuffer>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <clearBuffer+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @clearBuffer() {
%1 = call signext i8 (...) @getchar()
%2 = sext i8 %1 to i32
%3 = icmp ne i32 %2, 10
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @clearBuffer()
br label %6
6: ; preds = %4, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @clearBuffer() {
%1 = tail call signext i8 (...) @getchar()
%2 = icmp eq i8 %1, 10
br i1 %2, label %6, label %3
3: ; preds = %0, %3
%4 = tail call signext i8 (...) @getchar()
%5 = icmp eq i8 %4, 10
br i1 %5, label %6, label %3
6: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stringassign(char *, char *, int);
char *heapalloc() {
  char *ss;
  ss = malloc(sizeof(char) * sizeof("Hello\0"));
  stringassign("Hello\0", ss, sizeof("Hello\0"));
  printf("In heapalloc():\n\tstring = [%s]\n", ss);
  return ss;
}


x86 assembly (clang, -O0):
<heapalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x7,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeaf(%rip),%rdi
mov    $0x7,%edx
call   1040 <stringassign@plt>
mov    -0x8(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heapalloc>:
push   %rbx
mov    $0x7,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rdi
mov    %rax,%rsi
mov    $0x7,%edx
call   1040 <stringassign@plt>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Hello\00\00"
@.str.1 = [32 x i8] c"In heapalloc():\0A\09string = [%s]\0A\00"
define i8* @heapalloc() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 7)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @stringassign(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3, i32 7)
%5 = load i8*, i8** %1
%6 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
@.str = [7 x i8] c"Hello\00\00"
@.str.1 = [32 x i8] c"In heapalloc():\0A\09string = [%s]\0A\00"
define i8* @heapalloc() {
%1 = tail call dereferenceable_or_null(7) i8* @malloc(i32 7)
%2 = tail call i32 @stringassign(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i32 7)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i8* %1
}
int compare_wrapper(const void *a, const void *b, void *arg) {
  return ((int (*)(const void *, const void *))arg)(a, b);
}


x86 assembly (clang, -O0):
<compare_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_wrapper>:
jmp    *%rdx

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

LLVM IR (-O2):
define i32 @compare_wrapper(i8* %0, i8* %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32 (i8*, i8*)*
%5 = tail call i32 %4(i8* %0, i8* %1)
ret i32 %5
}