xunge/DecIR huggingface dataset:
int main() {
  int a = 10;
  const int *aa = &a;
  int *aaa = aa;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void finalize_filesize() {}


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

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

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

LLVM IR (-O2):
define void @finalize_filesize() {
ret void
}
void VP8DspInitMIPSdspR2(void) {}


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

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

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

LLVM IR (-O2):
define void @VP8DspInitMIPSdspR2() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void write_uint8(FILE *f, unsigned char c) {
  if (fwrite(&c, 1, 1, f) < 1) {
    fprintf(stderr, "Error writing to opening book\n");
    fclose(f);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<write_uint8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0x9(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1060 <fwrite@plt>
cmp    $0x1,%eax
jge    1197 <write_uint8+0x57>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
lea    0xe81(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_uint8>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %sil,0xf(%rsp)
lea    0xf(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1060 <fwrite@plt>
test   %eax,%eax
jle    116e <write_uint8+0x2e>
add    $0x10,%rsp
pop    %rbx
ret
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
lea    0xe82(%rip),%rsi
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"Error writing to opening book\0A\00"
define void @write_uint8(i32* %0, i8 zeroext %1) {
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
store i8 %1, i8* %4
%5 = load i32*, i32** %3
%6 = call i32 @fwrite(i8* %4, i32 1, i32 1, i32* %5)
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%11 = load i32*, i32** %3
%12 = call i32 @fclose(i32* %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Error writing to opening book\0A\00"
define void @write_uint8(i32* nocapture %0, i8 zeroext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @fwrite(i8* %3, i32 1, i32 1, i32* %0)
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @fclose(i32* %0)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %2
ret void
}
void trace_exception(struct compilation_unit *cu, struct jit_stack_frame *frame,
                     unsigned char *native_ptr) {}


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

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

LLVM IR (-O0):
%struct.compilation_unit = type opaque
%struct.jit_stack_frame = type opaque
define void @trace_exception(%struct.compilation_unit* %0, %struct.jit_stack_frame* %1, i8* %2) {
%4 = alloca %struct.compilation_unit*
%5 = alloca %struct.jit_stack_frame*
%6 = alloca i8*
store %struct.compilation_unit* %0, %struct.compilation_unit** %4
store %struct.jit_stack_frame* %1, %struct.jit_stack_frame** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
%struct.compilation_unit = type opaque
%struct.jit_stack_frame = type opaque
define void @trace_exception(%struct.compilation_unit* nocapture %0, %struct.jit_stack_frame* nocapture %1, i8* nocapture %2) {
ret void
}
/* Type definitions */
struct tini_base {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ errx(int, char *, char const *);
scalar_t__ tini_parse(char const *, struct tini_base **);
void config_load(const char *config_file, struct tini_base **base) {
  if (tini_parse(config_file, base) < 0)
    errx(1, "can't load %s", config_file);
}


x86 assembly (clang, -O0):
<config_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <tini_parse@plt>
cmp    $0x0,%rax
jge    115c <config_load+0x3c>
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
lea    0xea9(%rip),%rsi
call   1030 <errx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_load>:
push   %rbx
mov    %rdi,%rbx
call   1040 <tini_parse@plt>
test   %rax,%rax
js     1130 <config_load+0x10>
pop    %rbx
ret
lea    0xec9(%rip),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <errx@plt>

LLVM IR (-O0):
%struct.tini_base = type { i32 }
@.str = [14 x i8] c"can't load %s\00"
define void @config_load(i8* %0, %struct.tini_base** %1) {
%3 = alloca i8*
%4 = alloca %struct.tini_base**
store i8* %0, i8** %3
store %struct.tini_base** %1, %struct.tini_base*** %4
%5 = load i8*, i8** %3
%6 = load %struct.tini_base**, %struct.tini_base*** %4
%7 = call i64 @tini_parse(i8* %5, %struct.tini_base** %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 @errx(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
%struct.tini_base = type { i32 }
@.str = [14 x i8] c"can't load %s\00"
define void @config_load(i8* %0, %struct.tini_base** %1) {
%3 = tail call i64 @tini_parse(i8* %0, %struct.tini_base** %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %2
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};
typedef int /*<<< orphan*/ gpio_path;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int stat(char *, struct stat *);
int gpio_is_exported(int gpio) {
  char gpio_path[256];
  struct stat buf;
  int ret;
  snprintf(gpio_path, sizeof(gpio_path) - 1,
           "/sys/class/gpio"
           "/gpio%d/direction",
           gpio);
  ret = stat(gpio_path, &buf);
  if (ret == -1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<gpio_is_exported>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %edi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%ecx
mov    $0xff,%esi
lea    0xebc(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x110(%rbp),%rdi
lea    -0x118(%rbp),%rsi
call   1040 <stat@plt>
mov    %eax,-0x11c(%rbp)
cmpl   $0xffffffff,-0x11c(%rbp)
jne    117b <gpio_is_exported+0x5b>
movl   $0x0,-0x4(%rbp)
jmp    1182 <gpio_is_exported+0x62>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_is_exported>:
push   %rbx
sub    $0x110,%rsp
mov    %edi,%ecx
lea    0xecf(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xff,%esi
call   1030 <snprintf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <stat@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
add    $0x110,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [33 x i8] c"/sys/class/gpio/gpio%d/direction\00"
define i32 @gpio_is_exported(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [256 x i8]
%5 = alloca %struct.stat
%6 = alloca i32
store i32 %0, i32* %3
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call i32 @snprintf(i8* %7, i32 255, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%11 = call i32 @stat(i8* %10, %struct.stat* %5)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %15
14: ; preds = %1
store i32 0, i32* %2
br label %16
15: ; preds = %1
store i32 1, i32* %2
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [33 x i8] c"/sys/class/gpio/gpio%d/direction\00"
define i32 @gpio_is_exported(i32 %0) {
%2 = alloca [256 x i8]
%3 = alloca %struct.stat
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = bitcast %struct.stat* %3 to i8*
%6 = call i32 @snprintf(i8* %4, i32 255, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = call i32 @stat(i8* %4, %struct.stat* %3)
%8 = icmp ne i32 %7, -1
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i, sum = 0;
  for (i = 0; i < 10; i++) {
    if (i % 2)
      continue;
    sum += i;
  }
  printf("%d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1167 <main+0x57>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1150 <main+0x40>
jmp    1159 <main+0x49>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 20)
ret i32 0
}
/* Variables and functions */
int rand();
unsigned long rand8x8(void) {
  unsigned long r = 0UL;
  unsigned int i;
  for (i = (rand() % 7) + 1; i > 0; --i)
    r = (r << 8) | rand() % 256;
  return r;
}


x86 assembly (clang, -O0):
<rand8x8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x7,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jbe    1176 <rand8x8+0x66>
mov    -0x8(%rbp),%rax
shl    $0x8,%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%rax
movslq %edx,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <rand8x8+0x25>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand8x8>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff92492493,%rax,%r14
shr    $0x20,%r14
add    %eax,%r14d
mov    %r14d,%ecx
shr    $0x1f,%ecx
sar    $0x2,%r14d
add    %ecx,%r14d
lea    0x0(,%r14,8),%ecx
sub    %ecx,%r14d
add    %eax,%r14d
inc    %r14d
je     1179 <rand8x8+0x69>
xor    %ebx,%ebx
nop
shl    $0x8,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
lea    0xff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffff00,%ecx
sub    %ecx,%eax
cltq
or     %rax,%rbx
add    $0xffffffff,%r14d
jne    1150 <rand8x8+0x40>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @rand8x8() {
%1 = alloca i64
%2 = alloca i32
store i64 0, i64* %1
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 7
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
br label %6
6: ; preds = %16, %0
%7 = load i32, i32* %2
%8 = icmp ugt i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i64, i64* %1
%11 = shl i64 %10, 8
%12 = call i32 (...) @rand()
%13 = srem i32 %12, 256
%14 = sext i32 %13 to i64
%15 = or i64 %11, %14
store i64 %15, i64* %1
br label %16
16: ; preds = %9
%17 = load i32, i32* %2
%18 = add i32 %17, -1
store i32 %18, i32* %2
br label %6
19: ; preds = %6
%20 = load i64, i64* %1
ret i64 %20
}

LLVM IR (-O2):
define i64 @rand8x8() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 7
%3 = add nsw i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %0, %5
%6 = phi i32 [ %13, %5 ], [ %3, %0 ]
%7 = phi i64 [ %12, %5 ], [ 0, %0 ]
%8 = shl i64 %7, 8
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, 256
%11 = sext i32 %10 to i64
%12 = or i64 %8, %11
%13 = add i32 %6, -1
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %0
%16 = phi i64 [ 0, %0 ], [ %12, %5 ]
ret i64 %16
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ refresh();
void window_resize(void) {
  endwin();
  refresh();
}


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

x86 assembly (clang, -O2):
<window_resize>:
push   %rax
xor    %eax,%eax
call   1040 <endwin@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <refresh@plt>

LLVM IR (-O0):
define void @window_resize() {
%1 = call i32 (...) @endwin()
%2 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
define void @window_resize() {
%1 = tail call i32 (...) @endwin()
%2 = tail call i32 (...) @refresh()
ret void
}
/* Variables and functions */
int getArray(double *, int);
int /*<<< orphan*/ getArrayRange(double *, int, int *, int *);
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, const char *argv[]) {
  double array[100];
  int len, min, max;
  len = getArray(array, 100);
  getArrayRange(array, len, &min, &max);
  printf("The range of values is %d-%d\n", min, max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x330(%rbp),%rdi
mov    $0x64,%esi
call   1050 <getArray@plt>
mov    %eax,-0x334(%rbp)
lea    -0x330(%rbp),%rdi
mov    -0x334(%rbp),%esi
lea    -0x338(%rbp),%rdx
lea    -0x33c(%rbp),%rcx
call   1040 <getArrayRange@plt>
mov    -0x338(%rbp),%esi
mov    -0x33c(%rbp),%edx
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x330,%rsp
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1050 <getArray@plt>
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <getArrayRange@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x330,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"The range of values is %d-%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x double]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = getelementptr inbounds [100 x double], [100 x double]* %6, i64 0, i64 0
%11 = call i32 @getArray(double* %10, i32 100)
store i32 %11, i32* %7
%12 = getelementptr inbounds [100 x double], [100 x double]* %6, i64 0, i64 0
%13 = load i32, i32* %7
%14 = call i32 @getArrayRange(double* %12, i32 %13, i32* %8, i32* %9)
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"The range of values is %d-%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x double]
%4 = alloca i32
%5 = alloca i32
%6 = bitcast [100 x double]* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = getelementptr inbounds [100 x double], [100 x double]* %3, i64 0, i64 0
%10 = call i32 @getArray(double* %9, i32 100)
%11 = call i32 @getArrayRange(double* %9, i32 %10, i32* %4, i32* %5)
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
double test_double(double x) {
  if (x == 0.)
    printf("param x is 0.\n");
  return -1;
}


x86 assembly (clang, -O0):
<test_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1141 <test_double+0x31>
jp     1141 <test_double+0x31>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
movsd  0xeb7(%rip),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_double>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1129 <test_double+0x19>
jp     1129 <test_double+0x19>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
movsd  0xecf(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"param x is 0.\0A\00"
define double @test_double(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oeq double %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret double -1.000000e+00
}

LLVM IR (-O2):
@str = [14 x i8] c"param x is 0.\00"
define double @test_double(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret double -1.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int getpid();
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
void prmaps() {
  char buf[100];
  sprintf(buf, "/bin/cat /proc/%d/maps", getpid());
  system(buf);
  exit(1);
}


x86 assembly (clang, -O0):
<prmaps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x70(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x78(%rbp),%rdi
mov    %eax,%edx
lea    0xe99(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x70(%rbp),%rdi
call   1040 <system@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<prmaps>:
push   %rbx
sub    $0x70,%rsp
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xead(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %eax,%edx
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"/bin/cat /proc/%d/maps\00"
define void @prmaps() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 (...) @getpid()
%4 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = call i32 @system(i8* %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [23 x i8] c"/bin/cat /proc/%d/maps\00"
define void @prmaps() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @getpid()
%4 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @system(i8* %2)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int32_t prv_gte_str_fn(const char *a, const char *b) {
  return strcmp(a, b) >= 0 ? -1 : 0;
}


x86 assembly (clang, -O0):
<prv_gte_str_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovge %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prv_gte_str_fn>:
push   %rax
call   1030 <strcmp@plt>
sar    $0x3f,%rax
not    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @prv_gte_str_fn(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 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp sge i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 -1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @prv_gte_str_fn(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = ashr i64 %3, 63
%5 = trunc i64 %4 to i32
%6 = xor i32 %5, -1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ getVect(int *, int *);
int /*<<< orphan*/ putVect(int *, int);
int main() {
  int vector[8];
  int numItms;
  getVect(vector, &numItms);
  putVect(vector, numItms);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x34(%rbp),%rsi
call   1040 <getVect@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <putVect@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0x10(%rsp),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <getVect@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <putVect@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%5 = call i32 @getVect(i32* %4, i32* %3)
%6 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i32 @putVect(i32* %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [8 x i32]
%2 = alloca i32
%3 = bitcast [8 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%6 = call i32 @getVect(i32* %5, i32* %2)
%7 = load i32, i32* %2
%8 = call i32 @putVect(i32* %5, i32 %7)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ read(int, void *, size_t);
ssize_t osl_read(int fd, void *buf, size_t count) {
  return read(fd, buf, count);
}


x86 assembly (clang, -O0):
<osl_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<osl_read>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @osl_read(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
int foo(int a) { return a - 4; }


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

x86 assembly (clang, -O2):
<foo>:
lea    -0x4(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, -4
ret i32 %2
}
double hl_date_get_time(int date) { return date * 1000.; }


x86 assembly (clang, -O0):
<hl_date_get_time>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hl_date_get_time>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @hl_date_get_time(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 1.000000e+03
ret double %5
}

LLVM IR (-O2):
define double @hl_date_get_time(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 1.000000e+03
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ bnc_setup_file();
void bnc_init() { bnc_setup_file(); }


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

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

LLVM IR (-O0):
define void @bnc_init() {
%1 = call i32 (...) @bnc_setup_file()
ret void
}

LLVM IR (-O2):
define void @bnc_init() {
%1 = tail call i32 (...) @bnc_setup_file()
ret void
}
void RTFileLock(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileLock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
int system(char *);
int software_installed(char *softwarename) {
  char commandstr[256];
  sprintf(commandstr, "[ $(which %s | wc -c) = 0 ]", softwarename);
  return system(commandstr);
}


x86 assembly (clang, -O0):
<software_installed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <system@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<software_installed>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"[ $(which %s | wc -c) = 0 ]\00"
define i32 @software_installed(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%8 = call i32 @system(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [28 x i8] c"[ $(which %s | wc -c) = 0 ]\00"
define i32 @software_installed(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @system(i8* %3)
ret i32 %5
}
/* Type definitions */
struct evbuffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ evbuffer_add(struct evbuffer *, void *, int);
void buffer_add_data_with_size(struct evbuffer *msg, void *data, int size) {
  evbuffer_add(msg, &size, sizeof(int));
  evbuffer_add(msg, data, size);
}


x86 assembly (clang, -O0):
<buffer_add_data_with_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
call   1030 <evbuffer_add@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <evbuffer_add@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_add_data_with_size>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <evbuffer_add@plt>
mov    0x4(%rsp),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <evbuffer_add@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.evbuffer = type { i32 }
define void @buffer_add_data_with_size(%struct.evbuffer* %0, i8* %1, i32 %2) {
%4 = alloca %struct.evbuffer*
%5 = alloca i8*
%6 = alloca i32
store %struct.evbuffer* %0, %struct.evbuffer** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.evbuffer*, %struct.evbuffer** %4
%8 = bitcast i32* %6 to i8*
%9 = call i32 @evbuffer_add(%struct.evbuffer* %7, i8* %8, i32 4)
%10 = load %struct.evbuffer*, %struct.evbuffer** %4
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @evbuffer_add(%struct.evbuffer* %10, i8* %11, i32 %12)
ret void
}

LLVM IR (-O2):
%struct.evbuffer = type { i32 }
define void @buffer_add_data_with_size(%struct.evbuffer* %0, i8* %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = bitcast i32* %4 to i8*
%6 = call i32 @evbuffer_add(%struct.evbuffer* %0, i8* %5, i32 4)
%7 = load i32, i32* %4
%8 = call i32 @evbuffer_add(%struct.evbuffer* %0, i8* %1, i32 %7)
ret void
}
void cli() { asm("cli"); }


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

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

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

LLVM IR (-O2):
define void @cli() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int myrand();
void generate_random_aes_key(char *key) {
  for (int i = 0; i < 128; ++i)
    key[i] = myrand() % 256;
}


x86 assembly (clang, -O0):
<generate_random_aes_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x80,-0xc(%rbp)
jge    1158 <generate_random_aes_key+0x48>
mov    $0x0,%al
call   1030 <myrand@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <generate_random_aes_key+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_random_aes_key>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <myrand@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    $0x80,%rbx
jne    1120 <generate_random_aes_key+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @generate_random_aes_key(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %15, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 128
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = call i32 (...) @myrand()
%9 = srem i32 %8, 256
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %2
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 %10, i8* %14
br label %15
15: ; preds = %7
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %4
18: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @generate_random_aes_key(i8* nocapture writeonly %0) {
br label %3
2: ; preds = %3
ret void
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %8, %3 ]
%5 = tail call i32 (...) @myrand()
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %7
%8 = add nuw nsw i64 %4, 1
%9 = icmp eq i64 %8, 128
br i1 %9, label %2, label %3
}
/* Variables and functions */
#define LOG_DEBUG 131
#define LOG_ERR 130
#define LOG_INFO 129
#define LOG_WARNING 128
char _level_code(int level) {
  switch (level) {
  case LOG_ERR:
    return 'E';
  case LOG_WARNING:
    return 'W';
  case LOG_INFO:
    return 'I';
  case LOG_DEBUG:
    return 'D';
  default:
    return 'U';
  }
}


x86 assembly (clang, -O0):
<_level_code>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     1154 <_level_code+0x54>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x45,-0x1(%rbp)
jmp    1158 <_level_code+0x58>
movb   $0x57,-0x1(%rbp)
jmp    1158 <_level_code+0x58>
movb   $0x49,-0x1(%rbp)
jmp    1158 <_level_code+0x58>
movb   $0x44,-0x1(%rbp)
jmp    1158 <_level_code+0x58>
movb   $0x55,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_level_code>:
lea    -0x400(,%rdi,8),%ecx
mov    %edi,%eax
add    $0xffffff80,%eax
mov    $0x44454957,%edx
shr    %cl,%edx
cmp    $0x4,%eax
mov    $0x55,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @_level_code(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 130, label %5
i32 128, label %6
i32 129, label %7
i32 131, label %8
]
5: ; preds = %1
store i8 69, i8* %2
br label %10
6: ; preds = %1
store i8 87, i8* %2
br label %10
7: ; preds = %1
store i8 73, i8* %2
br label %10
8: ; preds = %1
store i8 68, i8* %2
br label %10
9: ; preds = %1
store i8 85, i8* %2
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i8, i8* %2
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @_level_code(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, 4
%4 = shl i32 %2, 3
%5 = lshr i32 1145391447, %4
%6 = trunc i32 %5 to i8
%7 = select i1 %3, i8 %6, i8 85
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ eFree(char *);
int /*<<< orphan*/ getenv(char *);
char *popString();
int /*<<< orphan*/ pushStringCopy(int /*<<< orphan*/);
void basGetEnv() {
  char *varname;
  varname = popString();
  pushStringCopy(getenv(varname));
  eFree(varname);
}


x86 assembly (clang, -O0):
<basGetEnv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1060 <pushStringCopy@plt>
mov    -0x8(%rbp),%rdi
call   1040 <eFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basGetEnv>:
push   %rbx
xor    %eax,%eax
call   1050 <popString@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1060 <pushStringCopy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <eFree@plt>

LLVM IR (-O0):
define void @basGetEnv() {
%1 = alloca i8*
%2 = call i8* (...) @popString()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @getenv(i8* %3)
%5 = call i32 @pushStringCopy(i32 %4)
%6 = load i8*, i8** %1
%7 = call i32 @eFree(i8* %6)
ret void
}

LLVM IR (-O2):
define void @basGetEnv() {
%1 = tail call i8* (...) @popString()
%2 = tail call i32 @getenv(i8* %1)
%3 = tail call i32 @pushStringCopy(i32 %2)
%4 = tail call i32 @eFree(i8* %1)
ret void
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
float VoltSOCRawToFloat(uint16_t raw) { return ((float)raw) * 0.002f; }


x86 assembly (clang, -O0):
<VoltSOCRawToFloat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cvtsi2ssq -0x8(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<VoltSOCRawToFloat>:
cvtsi2ss %rdi,%xmm0
mulss  0xef3(%rip),%xmm0
ret

LLVM IR (-O0):
define float @VoltSOCRawToFloat(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to float
%5 = fmul float %4, 0x3F60624DE0000000
ret float %5
}

LLVM IR (-O2):
define float @VoltSOCRawToFloat(i64 %0) {
%2 = sitofp i64 %0 to float
%3 = fmul float %2, 0x3F60624DE0000000
ret float %3
}
OP(ed, c3) {}


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

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

LLVM IR (-O0):
define i32 @OP(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* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, q, w;
  scanf("%d", &a);
  q = a * a;
  w = a * a * a;
  printf("%d\n", q);
  printf("%d\n", w);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    %ebx,%esi
imul   %ebx,%esi
imul   %esi,%ebx
lea    0xebb(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* 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(bar);
  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    -0x18(%rbp),%rdi
call   1030 <free@plt>
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    %rax,%rdi
call   1030 <free@plt>
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** %3
%9 = call i32 @free(i8* %8)
%10 = load i8*, i8** %2
%11 = load i8*, i8** %3
%12 = call i32 @memcpy(i8* %10, i8* %11, 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* %4)
%6 = tail call i32 @memcpy(i8* %2, i8* %4, i32 10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ i;

/* Variables and functions */
int *malloc(int);
int *allocateInt(int i) {
  int *ret = malloc(sizeof(i));
  *ret = i;
  return ret;
}


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

x86 assembly (clang, -O2):
<allocateInt>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %ebx,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i32* @allocateInt(i32 %0) {
%2 = tail call i32* @malloc(i32 4)
store i32 %0, i32* %2
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ alarm(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
void sig_timeout(void) {
  signal(SIGALRM, SIG_IGN);
  alarm(0);
  syslog(LOG_ERR, "[pam_smtpauth] connection is timed out");
  exit(1);
}


x86 assembly (clang, -O0):
<sig_timeout>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
xor    %edi,%edi
call   1030 <alarm@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
lea    0xe8e(%rip),%rsi
call   1050 <syslog@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<sig_timeout>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
xor    %edi,%edi
call   1030 <alarm@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
lea    0xe91(%rip),%rsi
call   1050 <syslog@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@SIGALRM = global i32 0
@SIG_IGN = global i32 0
@LOG_ERR = global i32 0
@.str = [39 x i8] c"[pam_smtpauth] connection is timed out\00"
define void @sig_timeout() {
%1 = load i32, i32* @SIGALRM
%2 = load i32, i32* @SIG_IGN
%3 = call i32 @signal(i32 %1, i32 %2)
%4 = call i32 @alarm(i32 0)
%5 = load i32, i32* @LOG_ERR
%6 = call i32 @syslog(i32 %5, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@SIGALRM = global i32 0
@SIG_IGN = global i32 0
@LOG_ERR = global i32 0
@.str = [39 x i8] c"[pam_smtpauth] connection is timed out\00"
define void @sig_timeout() {
%1 = load i32, i32* @SIGALRM
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = tail call i32 @alarm(i32 0)
%5 = load i32, i32* @LOG_ERR
%6 = tail call i32 @syslog(i32 %5, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main(void) {
  char c = 128;
  printf("c is %d\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x80,-0x5(%rbp)
lea    0xed6(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"c is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext -128)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pte_osThreadSleep(int);
void pte_osYield(void) { pte_osThreadSleep(1); }


x86 assembly (clang, -O0):
<pte_osYield>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <pte_osThreadSleep@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @pte_osYield() {
%1 = call i32 @pte_osThreadSleep(i32 1)
ret void
}

LLVM IR (-O2):
define void @pte_osYield() {
%1 = tail call i32 @pte_osThreadSleep(i32 1)
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *av_mallocz(size_t size) {
  void *ptr = malloc(size);
  if (ptr)
    memset(ptr, 0, size);
  return ptr;
}


x86 assembly (clang, -O0):
<av_mallocz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <av_mallocz+0x33>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_mallocz>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <av_mallocz+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @av_mallocz(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
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = load i64, i64* %2
%11 = call i32 @memset(i8* %9, i32 0, i64 %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @av_mallocz(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void mipi_hsi_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @mipi_hsi_iomux_config() {
ret void
}