xunge/DecIR huggingface dataset:
int getter() {
  int x = 10;
  int y = 20;
  return x * y;
}


x86 assembly (clang, -O0):
<getter>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @getter() {
%1 = alloca i32
%2 = alloca i32
store i32 10, i32* %1
store i32 20, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @getter() {
ret i32 200
}
double c2(double x) { return 3.14 + x; }


x86 assembly (clang, -O0):
<c2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<c2>:
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @c2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double 3.140000e+00, %3
ret double %4
}

LLVM IR (-O2):
define double @c2(double %0) {
%2 = fadd double %0, 3.140000e+00
ret double %2
}
/* Variables and functions */
char const *dlopen_pong();
__attribute__((visibility("default"))) const char *dlopen_ping(void) {
  return dlopen_pong();
}


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

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

LLVM IR (-O0):
define i8* @dlopen_ping() {
%1 = call i8* (...) @dlopen_pong()
ret i8* %1
}

LLVM IR (-O2):
define i8* @dlopen_ping() {
%1 = tail call i8* (...) @dlopen_pong()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ print_object(void *);
void *read_cell_contents(void *);
void print_cell(void *cell) {
  void *contents = read_cell_contents(cell);
  print_object(contents);
}


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

x86 assembly (clang, -O2):
<print_cell>:
push   %rax
call   1030 <read_cell_contents@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <print_object@plt>

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

LLVM IR (-O2):
define void @print_cell(i8* %0) {
%2 = tail call i8* @read_cell_contents(i8* %0)
%3 = tail call i32 @print_object(i8* %2)
ret void
}
int fun247() { return 247; }


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

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

LLVM IR (-O0):
define i32 @fun247() {
ret i32 247
}

LLVM IR (-O2):
define i32 @fun247() {
ret i32 247
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
main() {
  int i = 10;
  printf("%d %d", i++ + i, i-- - i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
add    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    %edx,%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
sub    -0x4(%rbp),%edx
lea    0xebe(%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    $0x15,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 21, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sgenrand(long);
long time(int /*<<< orphan*/ *);
long initmyrand(long seed) {
  if (seed < 0)
    seed = time(NULL);
  sgenrand(seed);
  return seed;
}


x86 assembly (clang, -O0):
<initmyrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1144 <initmyrand+0x24>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sgenrand@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initmyrand>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jns    1133 <initmyrand+0x13>
xor    %edi,%edi
call   1040 <time@plt>
mov    %rax,%rbx
mov    %rbx,%rdi
call   1030 <sgenrand@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @initmyrand(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 %7
5: ; preds = %1
%6 = call i64 @time(i32* null)
store i64 %6, i64* %2
br label %7
7: ; preds = %5, %1
%8 = load i64, i64* %2
%9 = call i32 @sgenrand(i64 %8)
%10 = load i64, i64* %2
ret i64 %10
}

LLVM IR (-O2):
define i64 @initmyrand(i64 %0) {
%2 = icmp slt i64 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i64 @time(i32* null)
br label %5
5: ; preds = %3, %1
%6 = phi i64 [ %4, %3 ], [ %0, %1 ]
%7 = tail call i32 @sgenrand(i64 %6)
ret i64 %6
}
void X509_REQ_digest(void) {}


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

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

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

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

/* Variables and functions */
int __getopt_long(int, char *const *, char const *, struct option const *,
                  int *, int /*<<< orphan*/);
int getopt_long(int argc, char *const *argv, const char *optstring,
                const struct option *longopts, int *idx) {
  return __getopt_long(argc, argv, optstring, longopts, idx, 0);
}


x86 assembly (clang, -O0):
<getopt_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
xor    %r9d,%r9d
call   1030 <__getopt_long@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt_long>:
xor    %r9d,%r9d
jmp    1030 <__getopt_long@plt>

LLVM IR (-O0):
%struct.option = type { i32 }
define i32 @getopt_long(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca %struct.option*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store %struct.option* %3, %struct.option** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = load %struct.option*, %struct.option** %9
%15 = load i32*, i32** %10
%16 = call i32 @__getopt_long(i32 %11, i8** %12, i8* %13, %struct.option* %14, i32* %15, i32 0)
ret i32 %16
}

LLVM IR (-O2):
%struct.option = type { i32 }
define i32 @getopt_long(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = tail call i32 @__getopt_long(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, i32 0)
ret i32 %6
}
char *corta_string(char *apuntador) {
  int len;
  for (len = 0; *(apuntador + len) != '\0'; ++len) {
  }
  if (len > 0) {
    apuntador = apuntador + 1;
    return apuntador;
  } else {
    return "Error!!!";
  }
}


x86 assembly (clang, -O0):
<corta_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <corta_string+0x37>
jmp    1129 <corta_string+0x29>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <corta_string+0xf>
cmpl   $0x0,-0x14(%rbp)
jle    115a <corta_string+0x5a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1165 <corta_string+0x65>
lea    0xe9f(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<corta_string>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <corta_string+0x10>
add    $0x1,%rdi
cmp    $0x1,%eax
lea    0xed8(%rip),%rax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Error!!!\00"
define i8* @corta_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %14, %1
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %5
br label %14
14: ; preds = %13
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
br label %5
17: ; preds = %5
%18 = load i32, i32* %4
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8* %22, i8** %3
%23 = load i8*, i8** %3
store i8* %23, i8** %2
br label %25
24: ; preds = %17
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2
br label %25
25: ; preds = %24, %20
%26 = load i8*, i8** %2
ret i8* %26
}

LLVM IR (-O2):
@.str = [9 x i8] c"Error!!!\00"
define i8* @corta_string(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = icmp eq i32 %9, 0
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = select i1 %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %11
ret i8* %12
}
int is_utf16_be(const unsigned char *data) {
  return data[0] == 0xFF && data[1] == 0xFE;
}


x86 assembly (clang, -O0):
<is_utf16_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xff,%ecx
mov    %al,-0x9(%rbp)
jne    1133 <is_utf16_be+0x33>
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
cmp    $0xfe,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_utf16_be>:
xor    %eax,%eax
cmpb   $0xff,(%rdi)
je     1108 <is_utf16_be+0x8>
ret
xor    %eax,%eax
cmpb   $0xfe,0x1(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_utf16_be(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = icmp eq i32 %6, 255
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = icmp eq i32 %12, 254
br label %14
14: ; preds = %8, %1
%15 = phi i1 [ false, %1 ], [ %13, %8 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_utf16_be(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, -1
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, -2
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
int g(int x) { int y; }


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

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

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ kernel_updatememhandlers();
int mem_init() {
  kernel_updatememhandlers();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @mem_init() {
%1 = call i32 (...) @kernel_updatememhandlers()
ret i32 0
}

LLVM IR (-O2):
define i32 @mem_init() {
%1 = tail call i32 (...) @kernel_updatememhandlers()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ I2C_SLAVE;
int ioctl(int, int /*<<< orphan*/, int);
int set_slave_addr(int fd, int addr) { return ioctl(fd, I2C_SLAVE, addr); }


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

x86 assembly (clang, -O2):
<set_slave_addr>:
mov    %esi,%edx
mov    0x2ecf(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
@I2C_SLAVE = global i32 0
define i32 @set_slave_addr(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* @I2C_SLAVE
%7 = load i32, i32* %4
%8 = call i32 @ioctl(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@I2C_SLAVE = global i32 0
define i32 @set_slave_addr(i32 %0, i32 %1) {
%3 = load i32, i32* @I2C_SLAVE
%4 = tail call i32 @ioctl(i32 %0, i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ M_PI_4;
int /*<<< orphan*/ printf(char *, double);
double sin(int /*<<< orphan*/);
int main() {
  printf("SUCCESS %f\n", sin(M_PI_4));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1040 <sin@plt>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1040 <sin@plt>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"SUCCESS %f\0A\00"
@M_PI_4 = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @M_PI_4
%3 = call double @sin(i32 %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"SUCCESS %f\0A\00"
@M_PI_4 = global i32 0
define i32 @main() {
%1 = load i32, i32* @M_PI_4
%2 = tail call double @sin(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}
double b(double orig_price) { return 2.50 + 1.15 * orig_price; }


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<b>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @b(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fmuladd.f64(double 1.150000e+00, double %3, double 2.500000e+00)
ret double %4
}

LLVM IR (-O2):
define double @b(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 1.150000e+00, double 2.500000e+00)
ret double %2
}
int triplet(int a, int b, int c) {
  return (((a & 0xff) << 16) | ((b & 0xff) << 8) | (c & 0xff));
}


x86 assembly (clang, -O0):
<triplet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<triplet>:
movzbl %dil,%eax
shl    $0x10,%eax
shl    $0x8,%esi
movzwl %si,%ecx
or     %eax,%ecx
movzbl %dl,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @triplet(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = and i32 %7, 255
%9 = shl i32 %8, 16
%10 = load i32, i32* %5
%11 = and i32 %10, 255
%12 = shl i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %6
%15 = and i32 %14, 255
%16 = or i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @triplet(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 16
%5 = and i32 %4, 16711680
%6 = shl i32 %1, 8
%7 = and i32 %6, 65280
%8 = or i32 %7, %5
%9 = and i32 %2, 255
%10 = or i32 %8, %9
ret i32 %10
}
char eiki_hex_char(unsigned char x) {
  x &= 0xf;
  if (x < 10) {
    return x + '0';
  } else {
    return x + 'a' - 10;
  }
}


x86 assembly (clang, -O0):
<eiki_hex_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
and    $0xf,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jge    1130 <eiki_hex_char+0x30>
movzbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    113d <eiki_hex_char+0x3d>
movzbl -0x2(%rbp),%eax
add    $0x61,%eax
sub    $0xa,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eiki_hex_char>:
and    $0xf,%dil
lea    0x30(%rdi),%eax
lea    0x57(%rdi),%ecx
cmp    $0xa,%dil
movzbl %al,%edx
movzbl %cl,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @eiki_hex_char(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 15
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %16
11: ; preds = %1
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = add nsw i32 %13, 48
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %22
16: ; preds = %1
%17 = load i8, i8* %3
%18 = zext i8 %17 to i32
%19 = add nsw i32 %18, 97
%20 = sub nsw i32 %19, 10
%21 = trunc i32 %20 to i8
store i8 %21, i8* %2
br label %22
22: ; preds = %16, %11
%23 = load i8, i8* %2
ret i8 %23
}

LLVM IR (-O2):
define signext i8 @eiki_hex_char(i8 zeroext %0) {
%2 = and i8 %0, 15
%3 = icmp ult i8 %2, 10
%4 = or i8 %2, 48
%5 = add nuw nsw i8 %2, 87
%6 = select i1 %3, i8 %4, i8 %5
ret i8 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ StubBug(char *);
int sigprocmask(int how, const sigset_t *set, sigset_t *oldset) {
  (void)how;
  (void)set;
  (void)oldset;
  StubBug("STUB:"
          "sigprocmask");
  return 0;
}


x86 assembly (clang, -O0):
<sigprocmask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <StubBug@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"STUB:sigprocmask\00"
define i32 @sigprocmask(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = load i32*, i32** %6
%10 = call i32 @StubBug(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"STUB:sigprocmask\00"
define i32 @sigprocmask(i32 %0, i32* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = tail call i32 @StubBug(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
float dot(const int *g, const float x, const float y) {
  return g[0] * x + g[1] * y;
}


x86 assembly (clang, -O0):
<dot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
movss  -0xc(%rbp),%xmm2
mov    -0x8(%rbp),%rax
cvtsi2ssl 0x4(%rax),%xmm1
mulss  -0x10(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot>:
cvtsi2ssl (%rdi),%xmm2
cvtsi2ssl 0x4(%rdi),%xmm3
mulss  %xmm1,%xmm3
mulss  %xmm2,%xmm0
addss  %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @dot(i32* %0, float %1, float %2) {
%4 = alloca i32*
%5 = alloca float
%6 = alloca float
store i32* %0, i32** %4
store float %1, float* %5
store float %2, float* %6
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to float
%11 = load float, float* %5
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = sitofp i32 %14 to float
%16 = load float, float* %6
%17 = fmul float %15, %16
%18 = call float @llvm.fmuladd.f32(float %10, float %11, float %17)
ret float %18
}

LLVM IR (-O2):
define float @dot(i32* nocapture %0, float %1, float %2) {
%4 = load i32, i32* %0
%5 = sitofp i32 %4 to float
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to float
%9 = fmul float %8, %2
%10 = tail call float @llvm.fmuladd.f32(float %5, float %1, float %9)
ret float %10
}
/* Type definitions */
typedef char *uint32_t;

/* Variables and functions */
uint32_t ckAsmGetCr3(void) {
  uint32_t ret;
  __asm__ __volatile__("mov %%cr3, %0 " : "=r"(ret));
  return ret;
}


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

x86 assembly (clang, -O2):
<ckAsmGetCr3>:
mov    %cr3,%rax
ret

LLVM IR (-O0):
define i8* @ckAsmGetCr3() {
%1 = alloca i8*
%2 = call i8* asm sideeffect "mov %cr3, $0 ", "=r,~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @ckAsmGetCr3() {
%1 = tail call i8* asm sideeffect "mov %cr3, $0 ", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
/* Variables and functions */
float _tanf(float);
float tanf(float angle) { return _tanf(angle); }


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

x86 assembly (clang, -O2):
<tanf>:
jmp    1030 <_tanf@plt>

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

LLVM IR (-O2):
define float @tanf(float %0) {
%2 = tail call float @_tanf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/, int /*<<< orphan*/);
void testTortureExecute(void) {
  foo(0, 0);
  return;
}


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

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

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = call i32 @foo(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = tail call i32 @foo(i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bplus_tree_abnormal_test();
int /*<<< orphan*/ bplus_tree_normal_test();
int main(void) {
  bplus_tree_normal_test();
  bplus_tree_abnormal_test();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bplus_tree_normal_test()
%2 = tail call i32 (...) @bplus_tree_abnormal_test()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ RIPEMD160_CTX;

/* Variables and functions */
int /*<<< orphan*/ ripemd160_block_data_order(int /*<<< orphan*/ *,
                                              unsigned char const *, int);
void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *data) {
  ripemd160_block_data_order(c, data, 1);
}


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

x86 assembly (clang, -O2):
<RIPEMD160_Transform>:
mov    $0x1,%edx
jmp    1030 <ripemd160_block_data_order@plt>

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

LLVM IR (-O2):
define void @RIPEMD160_Transform(i32* %0, i8* %1) {
%3 = tail call i32 @ripemd160_block_data_order(i32* %0, i8* %1, i32 1)
ret void
}
/* Variables and functions */
int flash_erase_datafs();
int erase() { return flash_erase_datafs(); }


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

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

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

LLVM IR (-O2):
define i32 @erase() {
%1 = tail call i32 (...) @flash_erase_datafs()
ret i32 %1
}
int test_imm_81int8_reg(signed char val) {
  return ((val) & (-0x81 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_81int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -129
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_81int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -129
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
long *alloc_long(int);
int /*<<< orphan*/ dealloc_long(long *);
void test_nowarn_long(int n) {
  {
    long *p = alloc_long(n);
    dealloc_long(p);
  }
  {
    long *p = alloc_long(n);
    dealloc_long(p + 1);
  }
}


x86 assembly (clang, -O0):
<test_nowarn_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_long@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <dealloc_long@plt>
mov    -0x4(%rbp),%edi
call   1030 <alloc_long@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x8,%rdi
call   1040 <dealloc_long@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_nowarn_long>:
push   %rbx
mov    %edi,%ebx
call   1030 <alloc_long@plt>
mov    %rax,%rdi
call   1040 <dealloc_long@plt>
mov    %ebx,%edi
call   1030 <alloc_long@plt>
lea    0x8(%rax),%rdi
pop    %rbx
jmp    1040 <dealloc_long@plt>

LLVM IR (-O0):
define void @test_nowarn_long(i32 %0) {
%2 = alloca i32
%3 = alloca i64*
%4 = alloca i64*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i64* @alloc_long(i32 %5)
store i64* %6, i64** %3
%7 = load i64*, i64** %3
%8 = call i32 @dealloc_long(i64* %7)
%9 = load i32, i32* %2
%10 = call i64* @alloc_long(i32 %9)
store i64* %10, i64** %4
%11 = load i64*, i64** %4
%12 = getelementptr inbounds i64, i64* %11, i64 1
%13 = call i32 @dealloc_long(i64* %12)
ret void
}

LLVM IR (-O2):
define void @test_nowarn_long(i32 %0) {
%2 = tail call i64* @alloc_long(i32 %0)
%3 = tail call i32 @dealloc_long(i64* %2)
%4 = tail call i64* @alloc_long(i32 %0)
%5 = getelementptr inbounds i64, i64* %4, i64 1
%6 = tail call i32 @dealloc_long(i64* %5)
ret void
}
f(a, b) int a, b;
{ return a + b; }


x86 assembly (clang, -O0):
<f>:
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):
<f>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @f(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 @f(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
double s_LnGamma(double);
double BLAST_LnFactorial(double x) {
  if (x <= 0.0)
    return 0.0;
  else
    return s_LnGamma(x + 1.0);
}


x86 assembly (clang, -O0):
<BLAST_LnFactorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1138 <BLAST_LnFactorial+0x28>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114f <BLAST_LnFactorial+0x3f>
movsd  0xec0(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1030 <s_LnGamma@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BLAST_LnFactorial>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    1127 <BLAST_LnFactorial+0x17>
addsd  0xede(%rip),%xmm0
jmp    1030 <s_LnGamma@plt>
xorpd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @BLAST_LnFactorial(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ole double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %11
7: ; preds = %1
%8 = load double, double* %3
%9 = fadd double %8, 1.000000e+00
%10 = call double @s_LnGamma(double %9)
store double %10, double* %2
br label %11
11: ; preds = %7, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @BLAST_LnFactorial(double %0) {
%2 = fcmp ugt double %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fadd double %0, 1.000000e+00
%5 = tail call double @s_LnGamma(double %4)
br label %6
6: ; preds = %1, %3
%7 = phi double [ %5, %3 ], [ 0.000000e+00, %1 ]
ret double %7
}
void print_mcast_map(void) {}


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

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

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

LLVM IR (-O2):
define void @print_mcast_map() {
ret void
}
void g() { f(1.0i); }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mov    $0x2,%al
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
movsd  0xee8(%rip),%xmm1
xorps  %xmm0,%xmm0
mov    $0x2,%al
jmp    1030 <f@plt>

LLVM IR (-O0):
define void @g() {
%1 = alloca { double, double }
%2 = getelementptr inbounds { double, double }, { double, double }* %1, i32 0, i32 0
%3 = getelementptr inbounds { double, double }, { double, double }* %1, i32 0, i32 1
store double 0.000000e+00, double* %2
store double 1.000000e+00, double* %3
%4 = getelementptr inbounds { double, double }, { double, double }* %1, i32 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds { double, double }, { double, double }* %1, i32 0, i32 1
%7 = load double, double* %6
%8 = call i32 (double, double, ...) bitcast (i32 (...)* @f to i32 (double, double, ...)*)(double %5, double %7)
ret void
}

LLVM IR (-O2):
define void @g() {
%1 = tail call i32 (double, double, ...) bitcast (i32 (...)* @f to i32 (double, double, ...)*)(double 0.000000e+00, double 1.000000e+00)
ret void
}
void av_timecode_make_string() {}


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

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

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

LLVM IR (-O2):
define void @av_timecode_make_string() {
ret void
}
int type_mode_one(struct pobj_bench *bench_priv, int worker_idx, int op_idx) {
  return 0;
}


x86 assembly (clang, -O0):
<type_mode_one>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.pobj_bench = type opaque
define i32 @type_mode_one(%struct.pobj_bench* %0, i32 %1, i32 %2) {
%4 = alloca %struct.pobj_bench*
%5 = alloca i32
%6 = alloca i32
store %struct.pobj_bench* %0, %struct.pobj_bench** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.pobj_bench = type opaque
define i32 @type_mode_one(%struct.pobj_bench* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Type definitions */
struct kgsl_device_private {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ BUG();
long adreno_compat_ioctl(struct kgsl_device_private *dev_priv, unsigned int cmd,
                         void *data) {
  BUG();
  return 0;
}


x86 assembly (clang, -O0):
<adreno_compat_ioctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <BUG@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.kgsl_device_private = type { i32 }
define i64 @adreno_compat_ioctl(%struct.kgsl_device_private* %0, i32 %1, i8* %2) {
%4 = alloca %struct.kgsl_device_private*
%5 = alloca i32
%6 = alloca i8*
store %struct.kgsl_device_private* %0, %struct.kgsl_device_private** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = call i32 (...) @BUG()
ret i64 0
}

LLVM IR (-O2):
%struct.kgsl_device_private = type { i32 }
define i64 @adreno_compat_ioctl(%struct.kgsl_device_private* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @BUG()
ret i64 0
}
/* Type definitions */
typedef int /*<<< orphan*/ *gzFile;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fexists(char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ *gzopen(char const *, char const *);
int /*<<< orphan*/ stderr;
gzFile getGz(const char *fname, const char *mode) {
  if (0 && fexists(fname)) {
    fprintf(stderr, "\t->File exists: %s exiting...\n", fname);
    exit(0);
  }
  gzFile fp;
  if (NULL == (fp = gzopen(fname, mode))) {
    fprintf(stderr, "\t-> Error opening gzFile handle for file:%s exiting\n",
            fname);
    exit(0);
  }
  return fp;
}


x86 assembly (clang, -O0):
<getGz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <gzopen@plt>
mov    %rax,%rcx
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
jne    117f <getGz+0x4f>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe8d(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getGz>:
push   %rbx
mov    %rdi,%rbx
call   1040 <gzopen@plt>
test   %rax,%rax
je     1140 <getGz+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"\09-> Error opening gzFile handle for file:%s exiting\0A\00"
define i32* @getGz(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @gzopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = icmp eq i32* null, %8
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %3
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %2
%16 = load i32*, i32** %5
ret i32* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"\09-> Error opening gzFile handle for file:%s exiting\0A\00"
define i32* @getGz(i8* %0, i8* %1) {
%3 = tail call i32* @gzopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %2
ret i32* %3
}
int same_coordinate(int *coor1, int *coor2, int d) {
  int i;
  for (i = 0; i < d; i++)
    if (coor1[i] != coor2[i])
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<same_coordinate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    115d <same_coordinate+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     114a <same_coordinate+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1164 <same_coordinate+0x64>
jmp    114f <same_coordinate+0x4f>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <same_coordinate+0x16>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<same_coordinate>:
mov    $0x1,%eax
test   %edx,%edx
jle    1121 <same_coordinate+0x21>
mov    %edx,%r8d
xor    %edx,%edx
xchg   %ax,%ax
mov    (%rdi,%rdx,4),%ecx
cmp    (%rsi,%rdx,4),%ecx
jne    1122 <same_coordinate+0x22>
add    $0x1,%rdx
cmp    %rdx,%r8
jne    1110 <same_coordinate+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @same_coordinate(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 0, i32* %8
br label %9
9: ; preds = %27, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %30
13: ; preds = %9
%14 = load i32*, i32** %5
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32*, i32** %6
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
%24 = icmp ne i32 %18, %23
br i1 %24, label %25, label %26
25: ; preds = %13
store i32 0, i32* %4
br label %31
26: ; preds = %13
br label %27
27: ; preds = %26
%28 = load i32, i32* %8
%29 = add nsw i32 %28, 1
store i32 %29, i32* %8
br label %9
30: ; preds = %9
store i32 1, i32* %4
br label %31
31: ; preds = %30, %25
%32 = load i32, i32* %4
ret i32 %32
}

LLVM IR (-O2):
define i32 @same_coordinate(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %17, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %16, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %1, i64 %10
%14 = load i32, i32* %13
%15 = icmp eq i32 %12, %14
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %7, label %17
17: ; preds = %9, %7, %3
%18 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ getenv(char *);
int /*<<< orphan*/ printf(char *, char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  printf("%s memloc: %p\n", argv[1], getenv(argv[1]));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <getenv@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rbx
mov    %rbx,%rdi
call   1030 <getenv@plt>
lea    0xecc(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%s memloc: %p\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @getenv(i8* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s memloc: %p\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @getenv(i8* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %5)
ret i32 0
}
/* Variables and functions */
#define FE_DOWNWARD 131
#define FE_TONEAREST 130
#define FE_TOWARDZERO 129
#define FE_UPWARD 128
int __flt_rounds(void) {
  int mode;
  mode = FE_TOWARDZERO;
  switch (mode) {
  case FE_TOWARDZERO:
    return (0);
  case FE_TONEAREST:
    return (1);
  case FE_UPWARD:
    return (2);
  case FE_DOWNWARD:
    return (3);
  }
  return (-1);
}


x86 assembly (clang, -O0):
<__flt_rounds>:
push   %rbp
mov    %rsp,%rbp
movl   $0x81,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     1164 <__flt_rounds+0x64>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    116b <__flt_rounds+0x6b>
movl   $0x1,-0x4(%rbp)
jmp    116b <__flt_rounds+0x6b>
movl   $0x2,-0x4(%rbp)
jmp    116b <__flt_rounds+0x6b>
movl   $0x3,-0x4(%rbp)
jmp    116b <__flt_rounds+0x6b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__flt_rounds() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long, unsigned long, unsigned long);
void print_local(unsigned long l1, unsigned long l2) {
  printf("  punteros locales....: %lx %lx (diferencia: %lu)\n", l1, l2,
         l1 - l2);
}


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

x86 assembly (clang, -O2):
<print_local>:
mov    %rsi,%rdx
mov    %rdi,%rcx
sub    %rsi,%rcx
lea    0xee0(%rip),%rax
mov    %rdi,%rsi
mov    %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [51 x i8] c" punteros locales....: %lx %lx (diferencia: %lu)\0A\00"
define void @print_local(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = sub i64 %7, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i64 %5, i64 %6, i64 %9)
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c" punteros locales....: %lx %lx (diferencia: %lu)\0A\00"
define void @print_local(i64 %0, i64 %1) {
%3 = sub i64 %0, %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1, i64 %3)
ret void
}
void INT_Excep_RTC_PRD(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_RTC_PRD() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void PrintUsage() { printf("usage: [ -o outpath ] files ...\n"); }


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"usage: [ -o outpath ] files ...\0A\00"
define void @PrintUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"usage: [ -o outpath ] files ...\00"
define void @PrintUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dopost(char const *);
void poststring(const char *s) {
  dopost(" ");
  dopost(s);
}


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

x86 assembly (clang, -O2):
<poststring>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <dopost@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <dopost@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @poststring(i8* %0) {
%2 = tail call i32 @dopost(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @dopost(i8* %0)
ret void
}
void TestMiscStmts(void) {
  ({
    int a = 10;
    a;
  });
}


x86 assembly (clang, -O0):
<TestMiscStmts>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

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

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