xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
int outs(const char *s, int i) { write(1, s, i); }


x86 assembly (clang, -O0):
<outs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outs>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @outs(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @write(i32 1, i8* %0, i32 %1)
ret i32 undef
}
double fmin(double a, double b) { return b < a ? b : a; }


x86 assembly (clang, -O0):
<fmin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <fmin+0x31>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <fmin+0x3b>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmin>:
minsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @fmin(double %0, double %1) {
%3 = fcmp olt double %1, %0
%4 = select i1 %3, double %1, double %0
ret double %4
}
void DelayMs(int ms_time) {
  int i;
  for (i = 0; i < 1000 * ms_time; i++)
    ;
}


x86 assembly (clang, -O0):
<DelayMs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   $0x3e8,-0x4(%rbp),%ecx
cmp    %ecx,%eax
jge    1133 <DelayMs+0x33>
jmp    1125 <DelayMs+0x25>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <DelayMs+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @DelayMs(i32 %0) {
ret void
}
void test16_Mod_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test16_Mod_targetInit__I() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 1;
  int b = 2;
  int *const int_ptr_const = &a;
  *int_ptr_const = 3;
  printf("%d\n", *int_ptr_const);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t rotr32(uint32_t x, unsigned n) { return (x >> n) | (x << (32 - n)); }


x86 assembly (clang, -O0):
<rotr32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr32>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @rotr32(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 = lshr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 32, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotr32(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
unsigned long malloc(int);
int /*<<< orphan*/ runpattern(unsigned long, unsigned long, int);
int /*<<< orphan*/ stderr;
int main() {
  unsigned long mbase;
  unsigned long msize;
  mbase = malloc(1024 * 1024 * 64);
  msize = 1024 * 1024 * 64;
  if (!mbase) {
    fprintf(stderr, "Error: could not allocated %d bytes\n", 1024 * 1024 * 64);
    exit(1);
  }
  runpattern(mbase, msize, 0xfffffffe);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4000000,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
movq   $0x4000000,-0x10(%rbp)
04
cmpq   $0x0,-0x8(%rbp)
jne    118d <main+0x4d>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
lea    0xe87(%rip),%rsi
mov    $0x4000000,%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xfffffffe,%edx
call   1060 <runpattern@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4000000,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1166 <main+0x26>
mov    $0x4000000,%esi
mov    %rax,%rdi
mov    $0xfffffffe,%edx
call   1060 <runpattern@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
lea    0xe8a(%rip),%rsi
mov    $0x4000000,%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Error: could not allocated %d bytes\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 @malloc(i32 67108864)
store i64 %3, i64* %1
store i64 67108864, i64* %2
%4 = load i64, i64* %1
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 67108864)
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %0
%11 = load i64, i64* %1
%12 = load i64, i64* %2
%13 = call i32 @runpattern(i64 %11, i64 %12, i32 -2)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Error: could not allocated %d bytes\0A\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 67108864)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 67108864)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %0
%8 = tail call i32 @runpattern(i64 %1, i64 67108864, i32 -2)
ret i32 0
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRDB_set(void) { return U_WMRCORENONE_set("U_WMRDB"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRDB\00"
define i8* @U_WMRDB_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRDB\00"
define i8* @U_WMRDB_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t z80_alu_check_parity(uint8_t input) {
  input = input ^ (input >> 4);
  input = input ^ (input >> 2);
  return (input ^ (input >> 1)) & 0x1;
}


x86 assembly (clang, -O0):
<z80_alu_check_parity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
xor    %ecx,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<z80_alu_check_parity>:
mov    %edi,%eax
sar    $0x4,%eax
xor    %edi,%eax
mov    %eax,%ecx
sar    $0x2,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    %eax
xor    %ecx,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @z80_alu_check_parity(i32 %0) {
%2 = ashr i32 %0, 4
%3 = xor i32 %2, %0
%4 = ashr i32 %3, 2
%5 = xor i32 %4, %3
%6 = lshr i32 %5, 1
%7 = xor i32 %6, %5
%8 = and i32 %7, 1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int isLowerOrDigitStr(char *, int);
int /*<<< orphan*/ printf(char *);
void isLowerOrDigitStrTestA() {
  bool result = isLowerOrDigitStr("testString", 4);
  assert(result == true);
  printf("Test successful.");
}


x86 assembly (clang, -O0):
<isLowerOrDigitStrTestA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x4,%esi
call   1050 <isLowerOrDigitStr@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLowerOrDigitStrTestA>:
push   %rax
lea    0xec8(%rip),%rdi
mov    $0x4,%esi
call   1050 <isLowerOrDigitStr@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xeb4(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"testString\00"
@.str.1 = [17 x i8] c"Test successful.\00"
define void @isLowerOrDigitStrTestA() {
%1 = alloca i32
%2 = call i32 @isLowerOrDigitStr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 4)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"testString\00"
@.str.1 = [17 x i8] c"Test successful.\00"
define void @isLowerOrDigitStrTestA() {
%1 = tail call i32 @isLowerOrDigitStr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned int f33(unsigned int x, int y) {
  return (x >> y) | (x << ((-y) & (8 * 4 - 1)));
}


x86 assembly (clang, -O0):
<f33>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0x1f,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f33>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f33(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 = lshr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 0, %9
%11 = and i32 %10, 31
%12 = shl i32 %8, %11
%13 = or i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @f33(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub nsw i32 0, %1
%5 = and i32 %4, 31
%6 = shl i32 %0, %5
%7 = or i32 %6, %3
ret i32 %7
}
void kvmppc_uvmem_memslot_delete(struct kvm *kvm,
                                 const struct kvm_memory_slot *old) {}


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

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

LLVM IR (-O0):
%struct.kvm = type opaque
%struct.kvm_memory_slot = type opaque
define void @kvmppc_uvmem_memslot_delete(%struct.kvm* %0, %struct.kvm_memory_slot* %1) {
%3 = alloca %struct.kvm*
%4 = alloca %struct.kvm_memory_slot*
store %struct.kvm* %0, %struct.kvm** %3
store %struct.kvm_memory_slot* %1, %struct.kvm_memory_slot** %4
ret void
}

LLVM IR (-O2):
%struct.kvm = type opaque
%struct.kvm_memory_slot = type opaque
define void @kvmppc_uvmem_memslot_delete(%struct.kvm* nocapture %0, %struct.kvm_memory_slot* nocapture %1) {
ret void
}
int min(int x, int y) { return y ^ ((x ^ y) & -(x < y)); }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%edx
cmp    -0x8(%rbp),%edx
setl   %dl
and    $0x1,%dl
movzbl %dl,%esi
xor    %edx,%edx
sub    %esi,%edx
and    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @min(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = xor i32 %6, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
%12 = zext i1 %11 to i32
%13 = sub nsw i32 0, %12
%14 = and i32 %8, %13
%15 = xor i32 %5, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) { return islower(c) ? (c ^ 0x20) : c; }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113b <toupper+0x2b>
mov    -0x4(%rbp),%eax
xor    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <toupper+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
mov    %ebx,%ecx
xor    $0x20,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @islower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = xor i32 %7, 32
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = xor i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ go_to_next(int /*<<< orphan*/ *);
void null_ptr_deref_bad() { go_to_next(NULL); }


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

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

LLVM IR (-O0):
define void @null_ptr_deref_bad() {
%1 = call i32 @go_to_next(i32* null)
ret void
}

LLVM IR (-O2):
define void @null_ptr_deref_bad() {
%1 = tail call i32 @go_to_next(i32* null)
ret void
}
void set_engine_time(const char *centiseconds) {}


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

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

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

LLVM IR (-O2):
define void @set_engine_time(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ ASN1_TIME;

/* Variables and functions */
int /*<<< orphan*/ *ASN1_TIME_adj(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                                  long);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
ASN1_TIME *X509_time_adj_ex(ASN1_TIME *s, int offset_day, long offset_sec,
                            time_t *in_time) {
  time_t t;
  if (in_time == NULL)
    t = time(NULL);
  else
    t = *in_time;
  return ASN1_TIME_adj(s, t, offset_day, offset_sec);
}


x86 assembly (clang, -O0):
<X509_time_adj_ex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1153 <X509_time_adj_ex+0x33>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x24(%rbp)
jmp    115c <X509_time_adj_ex+0x3c>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <ASN1_TIME_adj@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<X509_time_adj_ex>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
test   %rcx,%rcx
je     1135 <X509_time_adj_ex+0x15>
mov    (%rcx),%esi
jmp    113e <X509_time_adj_ex+0x1e>
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%esi
mov    %rbx,%rdi
mov    %ebp,%edx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <ASN1_TIME_adj@plt>

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

LLVM IR (-O2):
define i32* @X509_time_adj_ex(i32* %0, i32 %1, i64 %2, i32* %3) {
%5 = icmp eq i32* %3, null
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @time(i32* null)
br label %10
8: ; preds = %4
%9 = load i32, i32* %3
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
%12 = tail call i32* @ASN1_TIME_adj(i32* %0, i32 %11, i32 %1, i64 %2)
ret i32* %12
}
/* Type definitions */
typedef int ssize_t;
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<sendfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendfile>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @sendfile(i32 %0, i32 %1, i32* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i64 %3, i64* %8
%9 = load i32, i32* @ENOSYS
%10 = call i32 @__set_errno(i32 %9)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @sendfile(i32 %0, i32 %1, i32* nocapture readnone %2, i64 %3) {
%5 = load i32, i32* @ENOSYS
%6 = tail call i32 @__set_errno(i32 %5)
ret i32 -1
}
/* Variables and functions */
int init_pair(short, short, short);
int wrap_init_pair(short color, short fg, short bg) {
  return init_pair(color, fg, bg);
}


x86 assembly (clang, -O0):
<wrap_init_pair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x2(%rbp),%cx
mov    -0x4(%rbp),%ax
movswl %cx,%edi
movswl %ax,%esi
movswl -0x6(%rbp),%edx
call   1030 <init_pair@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap_init_pair>:
jmp    1030 <init_pair@plt>

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

LLVM IR (-O2):
define i32 @wrap_init_pair(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = tail call i32 @init_pair(i16 signext %0, i16 signext %1, i16 signext %2)
ret i32 %4
}
void rlCloseEnvironmentConnection() {}


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

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

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

LLVM IR (-O2):
define void @rlCloseEnvironmentConnection() {
ret void
}
int powers_of_five(int n) {
  int c = 0;
  int i;
  for (i = 5; n / i > 0; i *= 5) {
    c++;
  }
  return c;
}


x86 assembly (clang, -O0):
<powers_of_five>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%eax
jle    113a <powers_of_five+0x3a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
imul   $0x5,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <powers_of_five+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<powers_of_five>:
xor    %ecx,%ecx
cmp    $0x5,%edi
jl     111f <powers_of_five+0x1f>
xor    %ecx,%ecx
mov    $0x5,%esi
xchg   %ax,%ax
add    $0x1,%ecx
lea    (%rsi,%rsi,4),%esi
mov    %edi,%eax
cltd
idiv   %esi
test   %eax,%eax
jg     1110 <powers_of_five+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @powers_of_five(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 5, i32* %4
br label %5
5: ; preds = %13, %1
%6 = load i32, i32* %2
%7 = load i32, i32* %4
%8 = sdiv i32 %6, %7
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %5
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %13
13: ; preds = %10
%14 = load i32, i32* %4
%15 = mul nsw i32 %14, 5
store i32 %15, i32* %4
br label %5
16: ; preds = %5
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @powers_of_five(i32 %0) {
%2 = icmp sgt i32 %0, 4
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 5, %1 ]
%5 = phi i32 [ %6, %3 ], [ 0, %1 ]
%6 = add nuw nsw i32 %5, 1
%7 = mul nuw nsw i32 %4, 5
%8 = sdiv i32 %0, %7
%9 = icmp sgt i32 %8, 0
br i1 %9, label %3, label %10
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
size_t strlen(char *);
void chomp(char *string) {
  size_t len = strlen(string);
  for (size_t i = 0; i < len; i++) {
    if (string[i] == '\n') {
      string[i] = '\0';
      break;
    }
  }
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    117b <chomp+0x6b>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1165 <chomp+0x55>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    117b <chomp+0x6b>
jmp    116a <chomp+0x5a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1131 <chomp+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %rax,%rax
je     112f <chomp+0x1f>
xor    %ecx,%ecx
cmpb   $0xa,(%rbx,%rcx,1)
je     1131 <chomp+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1120 <chomp+0x10>
pop    %rbx
ret
movb   $0x0,(%rbx,%rcx,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @chomp(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
store i64 0, i64* %4
br label %7
7: ; preds = %23, %1
%8 = load i64, i64* %4
%9 = load i64, i64* %3
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %26
11: ; preds = %7
%12 = load i8*, i8** %2
%13 = load i64, i64* %4
%14 = getelementptr inbounds i8, i8* %12, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 10
br i1 %17, label %18, label %22
18: ; preds = %11
%19 = load i8*, i8** %2
%20 = load i64, i64* %4
%21 = getelementptr inbounds i8, i8* %19, i64 %20
store i8 0, i8* %21
br label %26
22: ; preds = %11
br label %23
23: ; preds = %22
%24 = load i64, i64* %4
%25 = add i64 %24, 1
store i64 %25, i64* %4
br label %7
26: ; preds = %18, %7
ret void
}

LLVM IR (-O2):
define void @chomp(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %11
%5 = phi i64 [ %12, %11 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 10
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %10
br label %14
11: ; preds = %4
%12 = add nuw i64 %5, 1
%13 = icmp eq i64 %12, %2
br i1 %13, label %14, label %4
14: ; preds = %11, %1, %9
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int hweight32(uint32_t a) {
  register uint32_t t;
  t = a - ((a >> 1) & 033333333333) - ((a >> 2) & 011111111111);
  return ((t + (t >> 3)) & 030707070707) % 63;
}


x86 assembly (clang, -O0):
<hweight32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
and    $0xdb6db6db,%ecx
sub    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
and    $0x49249249,%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    $0x3,%ecx
add    %ecx,%eax
and    $0xc71c71c7,%eax
mov    $0x3f,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hweight32>:
mov    %edi,%eax
sar    %eax
and    $0xdb6db6db,%eax
mov    %edi,%ecx
sar    $0x2,%ecx
and    $0x49249249,%ecx
add    %eax,%ecx
sub    %ecx,%edi
mov    %edi,%ecx
sar    $0x3,%ecx
add    %edi,%ecx
and    $0xc71c71c7,%ecx
imul   $0x4104105,%rcx,%rdx
shr    $0x20,%rdx
mov    %ecx,%eax
sub    %edx,%eax
shr    %eax
add    %edx,%eax
shr    $0x5,%eax
mov    %eax,%edx
shl    $0x6,%edx
sub    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hweight32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = and i32 %6, -613566757
%8 = sub i32 %4, %7
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = and i32 %10, 1227133513
%12 = sub i32 %8, %11
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = load i32, i32* %3
%15 = ashr i32 %14, 3
%16 = add nsw i32 %13, %15
%17 = and i32 %16, -954437177
%18 = urem i32 %17, 63
ret i32 %18
}

LLVM IR (-O2):
define i32 @hweight32(i32 %0) {
%2 = ashr i32 %0, 1
%3 = and i32 %2, -613566757
%4 = ashr i32 %0, 2
%5 = and i32 %4, 1227133513
%6 = add i32 %5, %3
%7 = sub i32 %0, %6
%8 = ashr i32 %7, 3
%9 = add nsw i32 %8, %7
%10 = and i32 %9, -954437177
%11 = urem i32 %10, 63
ret i32 %11
}
int hash_code_default(void *a) { return (int)a; }


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

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

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

LLVM IR (-O2):
define i32 @hash_code_default(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int ProcessCommand(char *, char *);
int ReadTempSensors(char ret[]) {
  int err = ProcessCommand(ret, "CR6\r");
  return (err);
}


x86 assembly (clang, -O0):
<ReadTempSensors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <ProcessCommand@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadTempSensors>:
lea    0xee9(%rip),%rsi
jmp    1030 <ProcessCommand@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"CR6\0D\00"
define i32 @ReadTempSensors(i8* %0) {
%2 = tail call i32 @ProcessCommand(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
int bics_si_test1(int a, int b, int c) {
  int d = a & ~b;
  if (d <= 0)
    return a + c;
  else
    return b + d + c;
}


x86 assembly (clang, -O0):
<bics_si_test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     1133 <bics_si_test1+0x33>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113f <bics_si_test1+0x3f>
mov    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bics_si_test1>:
mov    %esi,%ecx
not    %ecx
and    %edi,%ecx
lea    (%rsi,%rcx,1),%eax
test   %ecx,%ecx
cmovle %edi,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @bics_si_test1(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %1, -1
%5 = and i32 %4, %0
%6 = icmp slt i32 %5, 1
%7 = add nsw i32 %5, %1
%8 = select i1 %6, i32 %0, i32 %7
%9 = add nsw i32 %8, %2
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ __free_cf(void *);
void CGPDFArrayRelease(void *item) { __free_cf(item); }


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

x86 assembly (clang, -O2):
<CGPDFArrayRelease>:
jmp    1030 <__free_cf@plt>

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

LLVM IR (-O2):
define void @CGPDFArrayRelease(i8* %0) {
%2 = tail call i32 @__free_cf(i8* %0)
ret void
}
double test_sin(double x) { return __builtin_sin(x); }


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

x86 assembly (clang, -O2):
<test_sin>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define double @test_sin(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ delayMicroseconds(int);
int /*<<< orphan*/ ino(int);
void delayMicrosecondsX(int x, int us) {
  ino(x);
  delayMicroseconds(us);
  return;
}


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

x86 assembly (clang, -O2):
<delayMicrosecondsX>:
push   %rbx
mov    %esi,%ebx
call   1030 <ino@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <delayMicroseconds@plt>

LLVM IR (-O0):
define void @delayMicrosecondsX(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 = call i32 @ino(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @delayMicroseconds(i32 %7)
ret void
}

LLVM IR (-O2):
define void @delayMicrosecondsX(i32 %0, i32 %1) {
%3 = tail call i32 @ino(i32 %0)
%4 = tail call i32 @delayMicroseconds(i32 %1)
ret void
}
double HeatTransferCoef(double Nusselt, double Height) {
  double HeatTrans;
  HeatTrans = (Nusselt * (0.25)) / Height;
  return HeatTrans;
}


x86 assembly (clang, -O0):
<HeatTransferCoef>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<HeatTransferCoef>:
mulsd  0xef8(%rip),%xmm0
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @HeatTransferCoef(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = fmul double %6, 2.500000e-01
%8 = load double, double* %4
%9 = fdiv double %7, %8
store double %9, double* %5
%10 = load double, double* %5
ret double %10
}

LLVM IR (-O2):
define double @HeatTransferCoef(double %0, double %1) {
%3 = fmul double %0, 2.500000e-01
%4 = fdiv double %3, %1
ret double %4
}
void skb_mark_napi_id(struct sk_buff *skb, struct napi_struct *napi) {}


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

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

LLVM IR (-O0):
%struct.sk_buff = type opaque
%struct.napi_struct = type opaque
define void @skb_mark_napi_id(%struct.sk_buff* %0, %struct.napi_struct* %1) {
%3 = alloca %struct.sk_buff*
%4 = alloca %struct.napi_struct*
store %struct.sk_buff* %0, %struct.sk_buff** %3
store %struct.napi_struct* %1, %struct.napi_struct** %4
ret void
}

LLVM IR (-O2):
%struct.sk_buff = type opaque
%struct.napi_struct = type opaque
define void @skb_mark_napi_id(%struct.sk_buff* nocapture %0, %struct.napi_struct* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fun() {
  int a;
  printf("%d\n", a);
  static int b;
  printf("%d\n", b);
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%esi
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eff(%rip),%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@fun.b = internal global i32 0
define void @fun() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @fun.b
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @fun() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 undef)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ run_lisp(int, char **);
int main(int argc, char **argv) {
  run_lisp(argc, argv);
  return EXIT_SUCCESS;
}


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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <run_lisp@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <run_lisp@plt>
mov    0x2ec3(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @run_lisp(i32 %6, i8** %7)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @run_lisp(i32 %0, i8** %1)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
void gtk_text_buffer_remove_selection_clipboard() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_remove_selection_clipboard() {
ret void
}
void pci_aer_init(struct pci_dev *d) {}


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

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

LLVM IR (-O0):
%struct.pci_dev = type opaque
define void @pci_aer_init(%struct.pci_dev* %0) {
%2 = alloca %struct.pci_dev*
store %struct.pci_dev* %0, %struct.pci_dev** %2
ret void
}

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_aer_init(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
double atan2(double, double);
double ml_atan2(double x, double y) { return atan2(x, y); }


x86 assembly (clang, -O0):
<ml_atan2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <atan2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ml_atan2>:
jmp    1030 <atan2@plt>

LLVM IR (-O0):
define double @ml_atan2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @atan2(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @ml_atan2(double %0, double %1) {
%3 = tail call double @atan2(double %0, double %1)
ret double %3
}
void vec2_add(float *dst, float *b) {
  dst[0] = dst[0] + b[0];
  dst[1] = dst[1] + b[1];
}


x86 assembly (clang, -O0):
<vec2_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_add>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
addss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
addss  0x4(%rsi),%xmm1
movss  %xmm1,0x4(%rdi)
ret

LLVM IR (-O0):
define void @vec2_add(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = fadd float %7, %10
%12 = load float*, float** %3
%13 = getelementptr inbounds float, float* %12, i64 0
store float %11, float* %13
%14 = load float*, float** %3
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = load float*, float** %4
%18 = getelementptr inbounds float, float* %17, i64 1
%19 = load float, float* %18
%20 = fadd float %16, %19
%21 = load float*, float** %3
%22 = getelementptr inbounds float, float* %21, i64 1
store float %20, float* %22
ret void
}

LLVM IR (-O2):
define void @vec2_add(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = fadd float %3, %4
store float %5, float* %0
%6 = getelementptr inbounds float, float* %0, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %1, i64 1
%9 = load float, float* %8
%10 = fadd float %7, %9
store float %10, float* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ native_halt();
__attribute__((always_)) void halt(void) { native_halt(); }


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

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

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

LLVM IR (-O2):
define void @halt() {
%1 = tail call i32 (...) @native_halt()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: ucrypt [--cipher caesar|vigenere] [-ed] [-o output_file] "
         "input_file key\n");
}


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

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

LLVM IR (-O0):
@.str = [80 x i8] c"Usage: ucrypt [--cipher caesar|vigenere] [-ed] [-o output_file] input_file key\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [79 x i8] c"Usage: ucrypt [--cipher caesar|vigenere] [-ed] [-o output_file] input_file key\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int popNumber();
int /*<<< orphan*/ pushStringCopy(int /*<<< orphan*/);
int /*<<< orphan*/ wrapsqlcoltext(int, int);
void basSqlGetText() {
  int n, col;
  col = popNumber();
  n = popNumber();
  pushStringCopy(wrapsqlcoltext(n, col));
}


x86 assembly (clang, -O0):
<basSqlGetText>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <wrapsqlcoltext@plt>
mov    %eax,%edi
call   1040 <pushStringCopy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basSqlGetText>:
push   %rbx
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1030 <wrapsqlcoltext@plt>
mov    %eax,%edi
pop    %rbx
jmp    1040 <pushStringCopy@plt>

LLVM IR (-O0):
define void @basSqlGetText() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @popNumber()
store i32 %3, i32* %2
%4 = call i32 (...) @popNumber()
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @wrapsqlcoltext(i32 %5, i32 %6)
%8 = call i32 @pushStringCopy(i32 %7)
ret void
}

LLVM IR (-O2):
define void @basSqlGetText() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 (...) @popNumber()
%3 = tail call i32 @wrapsqlcoltext(i32 %2, i32 %1)
%4 = tail call i32 @pushStringCopy(i32 %3)
ret void
}
unsigned short SIO1_readStat16(void) { return 0; }


x86 assembly (clang, -O0):
<SIO1_readStat16>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
movzwl %ax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @SIO1_readStat16() {
ret i16 0
}

LLVM IR (-O2):
define zeroext i16 @SIO1_readStat16() {
ret i16 0
}
/* Variables and functions */
int /*<<< orphan*/ term_cmd_mode_set();
int /*<<< orphan*/ term_conn_mode_set(int /*<<< orphan*/);
int /*<<< orphan*/ term_state_save();
int susp_cmd(void) {
  term_cmd_mode_set();
  term_state_save();
  term_conn_mode_set(0);
  return 1;
}


x86 assembly (clang, -O0):
<susp_cmd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <term_cmd_mode_set@plt>
mov    $0x0,%al
call   1040 <term_state_save@plt>
xor    %edi,%edi
call   1030 <term_conn_mode_set@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<susp_cmd>:
push   %rax
xor    %eax,%eax
call   1050 <term_cmd_mode_set@plt>
xor    %eax,%eax
call   1040 <term_state_save@plt>
xor    %edi,%edi
call   1030 <term_conn_mode_set@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @susp_cmd() {
%1 = call i32 (...) @term_cmd_mode_set()
%2 = call i32 (...) @term_state_save()
%3 = call i32 @term_conn_mode_set(i32 0)
ret i32 1
}

LLVM IR (-O2):
define i32 @susp_cmd() {
%1 = tail call i32 (...) @term_cmd_mode_set()
%2 = tail call i32 (...) @term_state_save()
%3 = tail call i32 @term_conn_mode_set(i32 0)
ret i32 1
}