xunge/DecIR huggingface dataset:
/* Variables and functions */
int i2c_smbus_read_byte(int);
int raspberrypiI2CRead(int fd) { return i2c_smbus_read_byte(fd); }


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

x86 assembly (clang, -O2):
<raspberrypiI2CRead>:
jmp    1030 <i2c_smbus_read_byte@plt>

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

LLVM IR (-O2):
define i32 @raspberrypiI2CRead(i32 %0) {
%2 = tail call i32 @i2c_smbus_read_byte(i32 %0)
ret i32 %2
}
fgt(int x, int y) {
  if (x > y)
    return 13;
  else
    return 140;
}


x86 assembly (clang, -O0):
<fgt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1122 <fgt+0x22>
movl   $0xd,-0x4(%rbp)
jmp    1129 <fgt+0x29>
movl   $0x8c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgt>:
cmp    %esi,%edi
mov    $0xd,%ecx
mov    $0x8c,%eax
cmovg  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @fgt(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 13, i32 140
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
size_t get_dram_row(void *phys_addr_p) {
  uint64_t phys_addr = (uint64_t)phys_addr_p;
  return phys_addr >> 18;
}


x86 assembly (clang, -O0):
<get_dram_row>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x12,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dram_row>:
sar    $0x12,%edi
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @get_dram_row(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = ashr i32 %6, 18
%8 = sext i32 %7 to i64
ret i64 %8
}

LLVM IR (-O2):
define i64 @get_dram_row(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = ashr i32 %3, 18
%5 = sext i32 %4 to i64
ret i64 %5
}
int main() {
  int a, b;
  char o;
  scanf("%d %c %d", &a, &o, &b), printf("%d %c %d = %d", a, o, b, f(a, o, b));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x9(%rbp),%rdx
lea    -0x8(%rbp),%rcx
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
movsbl -0x9(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x0,%al
call   1030 <f@plt>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    %eax,%r8d
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x7(%rsp),%rdx
lea    0x8(%rsp),%rcx
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
movsbl 0x7(%rsp),%ebp
mov    0x8(%rsp),%r14d
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <f@plt>
lea    0xe91(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d %c %d\00"
@.str.1 = [14 x i8] c"%d %c %d = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i8* %3, i32* %2)
%7 = load i32, i32* %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = load i32, i32* %2
%11 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @f to i32 (i32, i32, i32, ...)*)(i32 %7, i32 %9, i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %9, i32 %10, i32 %11)
ret i32 0
}
int do_789() { return 789; }


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

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

LLVM IR (-O0):
define i32 @do_789() {
ret i32 789
}

LLVM IR (-O2):
define i32 @do_789() {
ret i32 789
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum(int, int, int, int, ...);
int main(void) {
  printf("Sum of 10, 20 and 30 = %d\n", sum(3, 10, 20, 30));
  printf("Sum of 4, 20, 25 and 30 = %d\n", sum(4, 4, 20, 25, 30));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
mov    $0xa,%esi
mov    $0x14,%edx
mov    $0x1e,%ecx
mov    $0x0,%al
call   1040 <sum@plt>
mov    %eax,%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    $0x4,%esi
mov    $0x14,%edx
mov    $0x19,%ecx
mov    $0x1e,%r8d
mov    %esi,%edi
mov    $0x0,%al
call   1040 <sum@plt>
mov    %eax,%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0xa,%esi
mov    $0x14,%edx
mov    $0x1e,%ecx
xor    %eax,%eax
call   1040 <sum@plt>
lea    0xebd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x4,%edi
mov    $0x4,%esi
mov    $0x14,%edx
mov    $0x19,%ecx
mov    $0x1e,%r8d
xor    %eax,%eax
call   1040 <sum@plt>
lea    0xea9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Sum of 10, 20 and 30 = %d\0A\00"
@.str.1 = [30 x i8] c"Sum of 4, 20, 25 and 30 = %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i32, i32, i32, i32, ...) @sum(i32 3, i32 10, i32 20, i32 30)
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (i32, i32, i32, i32, ...) @sum(i32 4, i32 4, i32 20, i32 25, i32 30)
%5 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Sum of 10, 20 and 30 = %d\0A\00"
@.str.1 = [30 x i8] c"Sum of 4, 20, 25 and 30 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i32, i32, i32, i32, ...) @sum(i32 3, i32 10, i32 20, i32 30)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (i32, i32, i32, i32, ...) @sum(i32 4, i32 4, i32 20, i32 25, i32 30)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
double _Complex add_double_rc(double a, double _Complex b) { return a + b; }


x86 assembly (clang, -O0):
<add_double_rc>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm0
addsd  %xmm2,%xmm1
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_double_rc>:
addsd  %xmm1,%xmm0
movaps %xmm2,%xmm1
ret

LLVM IR (-O0):
define { double, double } @add_double_rc(double %0, double %1, double %2) {
%4 = alloca { double, double }
%5 = alloca { double, double }
%6 = alloca double
%7 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
store double %1, double* %7
%8 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
store double %2, double* %8
store double %0, double* %6
%9 = load double, double* %6
%10 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%11 = load double, double* %10
%12 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
%13 = load double, double* %12
%14 = fadd double %9, %11
%15 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%16 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %14, double* %15
store double %13, double* %16
%17 = load { double, double }, { double, double }* %4
ret { double, double } %17
}

LLVM IR (-O2):
define { double, double } @add_double_rc(double %0, double %1, double %2) {
%4 = fadd double %0, %1
%5 = insertvalue { double, double } poison, double %4, 0
%6 = insertvalue { double, double } %5, double %2, 1
ret { double, double } %6
}
/* Variables and functions */
int _execve(char const *, char *const *, char *const *);
int execve(const char *path, char *const argv[], char *const envp[]) {
  return _execve(path, argv, envp);
}


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

x86 assembly (clang, -O2):
<execve>:
jmp    1030 <_execve@plt>

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

LLVM IR (-O2):
define i32 @execve(i8* %0, i8** %1, i8** %2) {
%4 = tail call i32 @_execve(i8* %0, i8** %1, i8** %2)
ret i32 %4
}
double test1(double a) { return -a; }


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
xorps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @test1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
ret double %4
}

LLVM IR (-O2):
define double @test1(double %0) {
%2 = fneg double %0
ret double %2
}
/* Type definitions */
struct option {
  int dummy;
};

/* Variables and functions */
int _getopt_internal(int, char *const *, char const *, struct option const *,
                     int *, int);
int getopt_long_only(int argc, char *const *argv, const char *optstring,
                     const struct option *longopts, int *indexptr) {
  return _getopt_internal(argc, argv, optstring, longopts, indexptr, 1);
}


x86 assembly (clang, -O0):
<getopt_long_only>:
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
mov    $0x1,%r9d
call   1030 <_getopt_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt_long_only>:
mov    $0x1,%r9d
jmp    1030 <_getopt_internal@plt>

LLVM IR (-O0):
%struct.option = type { i32 }
define i32 @getopt_long_only(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_internal(i32 %11, i8** %12, i8* %13, %struct.option* %14, i32* %15, i32 1)
ret i32 %16
}

LLVM IR (-O2):
%struct.option = type { i32 }
define i32 @getopt_long_only(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = tail call i32 @_getopt_internal(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, i32 1)
ret i32 %6
}
I0R1(r0, r1, x0, x1, p0, p1) signed char r0, r1;
signed char *p0, *p1;
{
  if (22 <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<I0R1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movsbl -0x6(%rbp),%ecx
mov    $0x16,%eax
cmp    %ecx,%eax
jg     113b <I0R1+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <I0R1+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I0R1>:
xor    %eax,%eax
cmp    $0x16,%sil
setge  %al
ret

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

LLVM IR (-O2):
define i32 @I0R1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
%7 = trunc i32 %1 to i8
%8 = icmp sgt i8 %7, 21
%9 = zext i1 %8 to i32
ret i32 %9
}
__attribute__((no, noclone)) unsigned __int128 t103_1sub(signed char x,
                                                         unsigned short y) {
  unsigned __int128 r;
  if (__builtin_sub_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t103_1sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x11(%rbp)
mov    %ax,-0x14(%rbp)
movsbq -0x11(%rbp),%rdx
mov    %rdx,%r9
sar    $0x3f,%r9
movzwl -0x14(%rbp),%eax
sub    %rax,%rdx
mov    %r9,%rcx
sbb    $0x0,%rcx
mov    %r9,%r8
sbb    $0x0,%r8
sbb    $0x0,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
or     %rsi,%rax
setne  %al
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x28(%rbp)
test   $0x1,%al
jne    117f <t103_1sub+0x6f>
jmp    1186 <t103_1sub+0x76>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t103_1sub>:
push   %r14
push   %rbx
push   %rax
movslq %edi,%rbx
mov    %rbx,%rax
sar    $0x3f,%rax
mov    %esi,%ecx
sub    %rcx,%rbx
mov    %rax,%r14
sbb    $0x0,%r14
sbb    $0x0,%rax
and    $0x1,%eax
neg    %rax
jns    113d <t103_1sub+0x2d>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t103_1sub(i8 signext %0, i16 zeroext %1) {
%3 = alloca i128
%4 = alloca i8
%5 = alloca i16
%6 = alloca i128
store i8 %0, i8* %4
store i16 %1, i16* %5
%7 = load i8, i8* %4
%8 = load i16, i16* %5
%9 = sext i8 %7 to i129
%10 = zext i16 %8 to i129
%11 = call { i129, i1 } @llvm.ssub.with.overflow.i129(i129 %9, i129 %10)
%12 = extractvalue { i129, i1 } %11, 1
%13 = extractvalue { i129, i1 } %11, 0
%14 = trunc i129 %13 to i128
%15 = zext i128 %14 to i129
%16 = icmp ne i129 %13, %15
%17 = or i1 %12, %16
store i128 %14, i128* %6
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = call i32 (...) @bar()
br label %20
20: ; preds = %18, %2
%21 = load i128, i128* %6
store i128 %21, i128* %3
%22 = bitcast i128* %3 to { i64, i64 }*
%23 = load { i64, i64 }, { i64, i64 }* %22
ret { i64, i64 } %23
}

LLVM IR (-O2):
define { i64, i64 } @t103_1sub(i8 signext %0, i16 zeroext %1) {
%3 = sext i8 %0 to i129
%4 = zext i16 %1 to i129
%5 = sub nsw i129 %3, %4
%6 = icmp slt i129 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 (...) @bar()
br label %9
9: ; preds = %7, %2
%10 = trunc i129 %5 to i64
%11 = lshr i129 %5, 64
%12 = trunc i129 %11 to i64
%13 = insertvalue { i64, i64 } poison, i64 %10, 0
%14 = insertvalue { i64, i64 } %13, i64 %12, 1
ret { i64, i64 } %14
}
int fib(int n) {
  switch (n) {
  case 0:
    return 0;
  case 1:
    return 1;
  default:
    return fib(n - 1) + fib(n - 2);
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     113f <fib+0x2f>
jmp    112e <fib+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     114b <fib+0x3b>
jmp    1157 <fib+0x47>
movl   $0x0,-0x4(%rbp)
jmp    117a <fib+0x6a>
movl   $0x1,-0x4(%rbp)
jmp    117a <fib+0x6a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fib+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <fib+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fib(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i32 0, i32* %2
br label %15
6: ; preds = %1
store i32 1, i32* %2
br label %15
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = call i32 @fib(i32 %9)
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 2
%13 = call i32 @fib(i32 %12)
%14 = add nsw i32 %10, %13
store i32 %14, i32* %2
br label %15
15: ; preds = %7, %6, %5
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @fib(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -1
%8 = tail call i32 @fib(i32 %7)
%9 = add nsw i32 %4, -2
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
void tegra_init_speedo_data(void) {}


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

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

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

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


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

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

LLVM IR (-O0):
define i32 @test_imm_78uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -120
%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_78uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -120
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
double getY2(double *inputVec, int index) { return inputVec[index * 2 + 1]; }


x86 assembly (clang, -O0):
<getY2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getY2>:
lea    (%rsi,%rsi,1),%eax
add    $0x1,%eax
cltq
movsd  (%rdi,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @getY2(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 2
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds double, double* %5, i64 %9
%11 = load double, double* %10
ret double %11
}

LLVM IR (-O2):
define double @getY2(double* nocapture %0, i32 %1) {
%3 = shl nsw i32 %1, 1
%4 = or i32 %3, 1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds double, double* %0, i64 %5
%7 = load double, double* %6
ret double %7
}
int test_imm_D5uint16_reg(unsigned short val) {
  return ((val) & (-0xD5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D5uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff2b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_D5uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -213
%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_D5uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -213
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ stdout;
int fail(int err_num, char *arg) {
  fprintf(stdout, "Err.(%d): %s\n", err_num, arg);
  return (err_num);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fail>:
push   %rbx
mov    %rsi,%rcx
mov    %edi,%ebx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [14 x i8] c"Err.(%d): %s\0A\00"
define i32 @fail(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @stdout
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [14 x i8] c"Err.(%d): %s\0A\00"
define i32 @fail(i32 returned %0, i8* %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret i32 %0
}
void ff_hevc_put_hevc_bi_w_pel_pixels6_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_pel_pixels6_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addOne(int *);
int /*<<< orphan*/ assert(int);
int main(int argc, char *argv[]) {
  int a = 1;
  addOne(&a);
#pragma omp taskwait
  assert(a == 2);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <addOne@plt>
xor    %edi,%edi
cmpl   $0x2,0x4(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%7 = call i32 @addOne(i32* %6)
%8 = load i32, i32* %6
%9 = icmp eq i32 %8, 2
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%5 = call i32 @addOne(i32* %3)
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 2
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret i32 0
}
/* Variables and functions */
int FunctionToBeReplaced(int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int res = 0;
  res = FunctionToBeReplaced(6, 8);
  if (res != 1 + 2) {
    printf("application got wrong values from FunctionToBeReplaced - expected "
           "3 got %d\n",
           res);
    exit(-1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x6,%edi
mov    $0x8,%esi
call   1040 <FunctionToBeReplaced@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     117b <main+0x4b>
mov    -0x8(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x6,%edi
mov    $0x8,%esi
call   1040 <FunctionToBeReplaced@plt>
cmp    $0x3,%eax
jne    1149 <main+0x19>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [76 x i8] c"application got wrong values from FunctionToBeReplaced - expected 3 got %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @FunctionToBeReplaced(i32 6, i32 8)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 3
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @exit(i32 -1)
unreachable
10: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
@.str = [76 x i8] c"application got wrong values from FunctionToBeReplaced - expected 3 got %d\0A\00"
define i32 @main() {
%1 = tail call i32 @FunctionToBeReplaced(i32 6, i32 8)
%2 = icmp eq i32 %1, 3
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i32 %1)
%5 = tail call i32 @exit(i32 -1)
unreachable
6: ; preds = %0
ret i32 0
}
/* Variables and functions */
int omp_is_initial_device();
int check() {
  int host = omp_is_initial_device();
  int device;
#pragma omp target map(tofrom : device)
  { device = omp_is_initial_device(); }
  return host + device;
}


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

x86 assembly (clang, -O2):
<check>:
push   %rbx
xor    %eax,%eax
call   1030 <omp_is_initial_device@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <omp_is_initial_device@plt>
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @check() {
%1 = tail call i32 (...) @omp_is_initial_device()
%2 = tail call i32 (...) @omp_is_initial_device()
%3 = add nsw i32 %2, %1
ret i32 %3
}
/* Type definitions */
typedef char *uint32_t;

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


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

x86 assembly (clang, -O2):
<ckAsmGetCr4>:
mov    %cr4,%rax
ret

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

LLVM IR (-O2):
define i8* @ckAsmGetCr4() {
%1 = tail call i8* asm sideeffect "mov %cr4, $0 ", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_strh(int /*<<< orphan*/);
int /*<<< orphan*/ t16_memio_reg_op();
void t16_strh_reg() { arm_memio_strh(t16_memio_reg_op()); }


x86 assembly (clang, -O0):
<t16_strh_reg>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <t16_memio_reg_op@plt>
mov    %eax,%edi
call   1040 <arm_memio_strh@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t16_strh_reg>:
push   %rax
xor    %eax,%eax
call   1030 <t16_memio_reg_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <arm_memio_strh@plt>

LLVM IR (-O0):
define void @t16_strh_reg() {
%1 = call i32 (...) @t16_memio_reg_op()
%2 = call i32 @arm_memio_strh(i32 %1)
ret void
}

LLVM IR (-O2):
define void @t16_strh_reg() {
%1 = tail call i32 (...) @t16_memio_reg_op()
%2 = tail call i32 @arm_memio_strh(i32 %1)
ret void
}
/* Variables and functions */
int mylibA();
int mylibB();
int mylibC();
int mylibD();
int main() { return mylibA() + mylibB() + mylibC() + mylibD(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <mylibA@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <mylibB@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <mylibC@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <mylibD@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <mylibA@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <mylibB@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1050 <mylibC@plt>
mov    %eax,%ebx
add    %ebp,%ebx
xor    %eax,%eax
call   1030 <mylibD@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @mylibA()
%3 = call i32 (...) @mylibB()
%4 = add nsw i32 %2, %3
%5 = call i32 (...) @mylibC()
%6 = add nsw i32 %4, %5
%7 = call i32 (...) @mylibD()
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @mylibA()
%2 = tail call i32 (...) @mylibB()
%3 = add nsw i32 %2, %1
%4 = tail call i32 (...) @mylibC()
%5 = add nsw i32 %3, %4
%6 = tail call i32 (...) @mylibD()
%7 = add nsw i32 %5, %6
ret i32 %7
}
extern void libvampsdk_v_2_7_1_present(void) {}


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

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

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

LLVM IR (-O2):
define void @libvampsdk_v_2_7_1_present() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_elem(unsigned int, int);
void pid_print_list(unsigned index, int nowrap) { print_elem(index, nowrap); }


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

x86 assembly (clang, -O2):
<pid_print_list>:
jmp    1030 <print_elem@plt>

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

LLVM IR (-O2):
define void @pid_print_list(i32 %0, i32 %1) {
%3 = tail call i32 @print_elem(i32 %0, i32 %1)
ret void
}
long Long_bit_MINUS_shift_MINUS_right(long x, long y) { return x >> y; }


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

x86 assembly (clang, -O2):
<Long_bit_MINUS_shift_MINUS_right>:
mov    %rsi,%rcx
mov    %rdi,%rax
sar    %cl,%rax
ret

LLVM IR (-O0):
define i64 @Long_bit_MINUS_shift_MINUS_right(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 = ashr i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @Long_bit_MINUS_shift_MINUS_right(i64 %0, i64 %1) {
%3 = ashr i64 %0, %1
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ n;

/* Variables and functions */
int findMin(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int n[] = {4, 5, 6, 7, 0, 1, 2};
  printf("%d\n", findMin(n, sizeof(n) / sizeof(int)));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x7,%esi
call   1040 <findMin@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xee1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1040 <findMin@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.n = [7 x i32] [i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
store i32 0, i32* %1
%3 = bitcast [7 x i32]* %2 to i8*
%4 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%5 = call i32 @findMin(i32* %4, i32 7)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.n = [7 x i32] [i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @findMin(i32* %3, i32 7)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void av_bsf_list_alloc() {}


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

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

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

LLVM IR (-O2):
define void @av_bsf_list_alloc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *PrintHello(void *threadid) {
  long tid;
  tid = (long)threadid;
  printf("Hello world! It's me, thread #%ld!\n", tid);
  pthread_exit(NULL);
}


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

x86 assembly (clang, -O2):
<PrintHello>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Hello world! It's me, thread #%ld!\0A\00"
define i8* @PrintHello(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = call i32 @pthread_exit(i32* null)
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [36 x i8] c"Hello world! It's me, thread #%ld!\0A\00"
define noalias i8* @PrintHello(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 %2)
%4 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ main_event_loop();
int main(void) { main_event_loop(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @main_event_loop()
ret i32 0
}
void g_int_equal() {}


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

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

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

LLVM IR (-O2):
define void @g_int_equal() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *, unsigned long,
                           void *, unsigned long, void *);
int /*<<< orphan*/ stderr;
void read_trap(void *addr, void *oldPC, unsigned long oldTid, void *newPC,
               unsigned long newTid) {
  fprintf(stderr, "M[%p]: T%lu,W@%p -> T%lu,R@%p\n", addr, oldTid, oldPC,
          newTid, newPC);
}


x86 assembly (clang, -O0):
<read_trap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x20(%rbp),%rax
lea    0xeb0(%rip),%rsi
mov    %rax,(%rsp)
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_trap>:
push   %rax
mov    %r8,%r9
mov    %rdx,%rax
mov    %rsi,%r8
mov    %rdi,%rdx
mov    0x2ebc(%rip),%rsi
mov    (%rsi),%edi
mov    %rcx,(%rsp)
lea    0xecf(%rip),%rsi
mov    %rax,%rcx
call   1030 <fprintf@plt>
pop    %rax
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"M[%p]: T%lu,W@%p -> T%lu,R@%p\0A\00"
define void @read_trap(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %6
%13 = load i64, i64* %8
%14 = load i8*, i8** %7
%15 = load i64, i64* %10
%16 = load i8*, i8** %9
%17 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %12, i64 %13, i8* %14, i64 %15, i8* %16)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"M[%p]: T%lu,W@%p -> T%lu,R@%p\0A\00"
define void @read_trap(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %2, i8* %1, i64 %4, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  system("/usr/bin/pgrep -f Main|xargs kill -9");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [37 x i8] c"/usr/bin/pgrep -f Main|xargs kill -9\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @system(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"/usr/bin/pgrep -f Main|xargs kill -9\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @system(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct rw_semaphore {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __down_write_nested(struct rw_semaphore *,
                                       int /*<<< orphan*/);
__attribute__((always_)) void __down_write(struct rw_semaphore *sem) {
  __down_write_nested(sem, 0);
}


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

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

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

LLVM IR (-O2):
%struct.rw_semaphore = type { i32 }
define void @__down_write(%struct.rw_semaphore* %0) {
%2 = tail call i32 @__down_write_nested(%struct.rw_semaphore* %0, i32 0)
ret void
}
OP(dd, c8) { op_c8(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_c8@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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 = call i32 (...) @op_c8()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_c8()
ret i32 undef
}
/* Variables and functions */
int lgetc();
long larn_lrint(void) {
  unsigned long i;
  i = 255 & lgetc();
  i |= (255 & lgetc()) << 8;
  i |= (255 & lgetc()) << 16;
  i |= (255 & lgetc()) << 24;
  return (i);
}


x86 assembly (clang, -O0):
<larn_lrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <lgetc@plt>
and    $0xff,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <lgetc@plt>
and    $0xff,%eax
shl    $0x8,%eax
cltq
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <lgetc@plt>
and    $0xff,%eax
shl    $0x10,%eax
cltq
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <lgetc@plt>
and    $0xff,%eax
shl    $0x18,%eax
cltq
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<larn_lrint>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <lgetc@plt>
movzbl %al,%ebx
xor    %eax,%eax
call   1030 <lgetc@plt>
shl    $0x8,%eax
movzwl %ax,%ebp
or     %ebx,%ebp
xor    %eax,%eax
call   1030 <lgetc@plt>
movzbl %al,%ebx
shl    $0x10,%ebx
or     %ebp,%ebx
xor    %eax,%eax
call   1030 <lgetc@plt>
shl    $0x18,%eax
cltq
or     %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @larn_lrint() {
%1 = alloca i64
%2 = call i32 (...) @lgetc()
%3 = and i32 255, %2
%4 = sext i32 %3 to i64
store i64 %4, i64* %1
%5 = call i32 (...) @lgetc()
%6 = and i32 255, %5
%7 = shl i32 %6, 8
%8 = sext i32 %7 to i64
%9 = load i64, i64* %1
%10 = or i64 %9, %8
store i64 %10, i64* %1
%11 = call i32 (...) @lgetc()
%12 = and i32 255, %11
%13 = shl i32 %12, 16
%14 = sext i32 %13 to i64
%15 = load i64, i64* %1
%16 = or i64 %15, %14
store i64 %16, i64* %1
%17 = call i32 (...) @lgetc()
%18 = and i32 255, %17
%19 = shl i32 %18, 24
%20 = sext i32 %19 to i64
%21 = load i64, i64* %1
%22 = or i64 %21, %20
store i64 %22, i64* %1
%23 = load i64, i64* %1
ret i64 %23
}

LLVM IR (-O2):
define i64 @larn_lrint() {
%1 = tail call i32 (...) @lgetc()
%2 = and i32 %1, 255
%3 = tail call i32 (...) @lgetc()
%4 = shl i32 %3, 8
%5 = and i32 %4, 65280
%6 = or i32 %5, %2
%7 = tail call i32 (...) @lgetc()
%8 = shl i32 %7, 16
%9 = and i32 %8, 16711680
%10 = or i32 %6, %9
%11 = zext i32 %10 to i64
%12 = tail call i32 (...) @lgetc()
%13 = shl i32 %12, 24
%14 = sext i32 %13 to i64
%15 = or i64 %11, %14
ret i64 %15
}