xunge/DecIR huggingface dataset:
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, unsigned long);
int main() {
  unsigned long result = 0, sum = 0;
  for (short i = 1; i <= 100; i++) {
    sum += i * i;
    result += i;
  }
  result *= result;
  result -= sum;
  printf("%lu\n", result);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movw   $0x1,-0x1a(%rbp)
movswl -0x1a(%rbp),%eax
cmp    $0x64,%eax
jg     1175 <main+0x65>
movswl -0x1a(%rbp),%eax
movswl -0x1a(%rbp),%ecx
imul   %ecx,%eax
cltq
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
movswq -0x1a(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x1a(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x1a(%rbp)
jmp    1135 <main+0x25>
mov    -0x10(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e38(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"%lu\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i16
store i32 0, i32* %1
store i64 0, i64* %2
store i64 0, i64* %3
store i16 1, i16* %4
br label %5
5: ; preds = %22, %0
%6 = load i16, i16* %4
%7 = sext i16 %6 to i32
%8 = icmp sle i32 %7, 100
br i1 %8, label %9, label %25
9: ; preds = %5
%10 = load i16, i16* %4
%11 = sext i16 %10 to i32
%12 = load i16, i16* %4
%13 = sext i16 %12 to i32
%14 = mul nsw i32 %11, %13
%15 = sext i32 %14 to i64
%16 = load i64, i64* %3
%17 = add i64 %16, %15
store i64 %17, i64* %3
%18 = load i16, i16* %4
%19 = sext i16 %18 to i64
%20 = load i64, i64* %2
%21 = add i64 %20, %19
store i64 %21, i64* %2
br label %22
22: ; preds = %9
%23 = load i16, i16* %4
%24 = add i16 %23, 1
store i16 %24, i16* %4
br label %5
25: ; preds = %5
%26 = load i64, i64* %2
%27 = load i64, i64* %2
%28 = mul i64 %27, %26
store i64 %28, i64* %2
%29 = load i64, i64* %3
%30 = load i64, i64* %2
%31 = sub i64 %30, %29
store i64 %31, i64* %2
%32 = load i64, i64* %2
%33 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %32)
%34 = load i32, i32* @EXIT_SUCCESS
ret i32 %34
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 25164150)
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ nop_milli();
void wait_millis(uint16_t millis) {
  for (int i = 1; i <= millis; i++) {
    nop_milli();
  }
}


x86 assembly (clang, -O0):
<wait_millis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1143 <wait_millis+0x33>
mov    $0x0,%al
call   1030 <nop_milli@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <wait_millis+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_millis>:
push   %rbx
test   %edi,%edi
jle    112c <wait_millis+0x1c>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <nop_milli@plt>
add    $0xffffffff,%ebx
jne    1120 <wait_millis+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @wait_millis(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp sle i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 (...) @nop_milli()
br label %10
10: ; preds = %8
%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 @wait_millis(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %3, label %4
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 1, %1 ]
%6 = tail call i32 (...) @nop_milli()
%7 = add nuw i32 %5, 1
%8 = icmp eq i32 %5, %0
br i1 %8, label %3, label %4
}
long foo(int x, long *y) {
  long a = 0;
  switch (x) {
  case 0:
    a = *y;
    break;
  case 1:
    a = *y;
    break;
  case 2:
    a = *y;
    break;
  case 3:
    a = *y;
    break;
  case 4:
    a = *y;
    break;
  }
  return a;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x20(%rbp)
sub    $0x4,%rax
ja     1183 <foo+0x83>
mov    -0x20(%rbp),%rax
lea    0xed1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1183 <foo+0x83>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1183 <foo+0x83>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1183 <foo+0x83>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1183 <foo+0x83>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0x4,%edi
ja     1109 <foo+0x9>
mov    (%rsi),%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @foo(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
store i32 %0, i32* %3
store i64* %1, i64** %4
store i64 0, i64* %5
%6 = load i32, i32* %3
switch i32 %6, label %22 [
i32 0, label %7
i32 1, label %10
i32 2, label %13
i32 3, label %16
i32 4, label %19
]
7: ; preds = %2
%8 = load i64*, i64** %4
%9 = load i64, i64* %8
store i64 %9, i64* %5
br label %22
10: ; preds = %2
%11 = load i64*, i64** %4
%12 = load i64, i64* %11
store i64 %12, i64* %5
br label %22
13: ; preds = %2
%14 = load i64*, i64** %4
%15 = load i64, i64* %14
store i64 %15, i64* %5
br label %22
16: ; preds = %2
%17 = load i64*, i64** %4
%18 = load i64, i64* %17
store i64 %18, i64* %5
br label %22
19: ; preds = %2
%20 = load i64*, i64** %4
%21 = load i64, i64* %20
store i64 %21, i64* %5
br label %22
22: ; preds = %2, %19, %16, %13, %10, %7
%23 = load i64, i64* %5
ret i64 %23
}

LLVM IR (-O2):
define i64 @foo(i32 %0, i64* nocapture %1) {
%3 = icmp ult i32 %0, 5
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = load i64, i64* %1
br label %6
6: ; preds = %2, %4
%7 = phi i64 [ 0, %2 ], [ %5, %4 ]
ret i64 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ burnstack(int);
int /*<<< orphan*/ genpub(int /*<<< orphan*/ *, int /*<<< orphan*/ const *);
void eddsa_genpub(uint8_t pub[32], const uint8_t sec[32]) {
  genpub(pub, sec);
  burnstack(2048);
}


x86 assembly (clang, -O0):
<eddsa_genpub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <genpub@plt>
mov    $0x800,%edi
call   1040 <burnstack@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eddsa_genpub>:
push   %rax
call   1030 <genpub@plt>
mov    $0x800,%edi
pop    %rax
jmp    1040 <burnstack@plt>

LLVM IR (-O0):
define void @eddsa_genpub(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 @genpub(i32* %5, i32* %6)
%8 = call i32 @burnstack(i32 2048)
ret void
}

LLVM IR (-O2):
define void @eddsa_genpub(i32* %0, i32* %1) {
%3 = tail call i32 @genpub(i32* %0, i32* %1)
%4 = tail call i32 @burnstack(i32 2048)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arc_mul64(int, int);
void bar(int x) { __builtin_arc_mul64(x, 0x10); }


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

x86 assembly (clang, -O2):
<bar>:
mov    $0x10,%esi
jmp    1030 <__builtin_arc_mul64@plt>

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

LLVM IR (-O2):
define void @bar(i32 %0) {
%2 = tail call i32 @__builtin_arc_mul64(i32 %0, i32 16)
ret void
}
int do_565() { return 565; }


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

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

LLVM IR (-O0):
define i32 @do_565() {
ret i32 565
}

LLVM IR (-O2):
define i32 @do_565() {
ret i32 565
}
double subtraktion(double zahl1, double zahl2) { return (zahl1 - zahl2); }


x86 assembly (clang, -O0):
<subtraktion>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<subtraktion>:
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @subtraktion(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 = fsub double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @subtraktion(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int *, int *);
int main() {
  int girls = 12;
  int boys = 11;
  printf("girls: %d  boys: %d\n", girls, boys);
  swap(&girls, &boys);
  printf("girls: %d  boys: %d\n", girls, boys);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0xc,0xc(%rsp)
movl   $0xb,0x8(%rsp)
lea    0xec4(%rip),%rbx
mov    %rbx,%rdi
mov    $0xc,%esi
mov    $0xb,%edx
call   1030 <printf@plt>
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <swap@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"girls: %d boys: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 12, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 11, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 12, i32 11)
%6 = call i32 @swap(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Type definitions */
struct benchtime {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bench_end(struct benchtime *);
int /*<<< orphan*/ bench_print(struct benchtime *);
int /*<<< orphan*/ free(struct benchtime *);
void bench_done(struct benchtime *bt) {
  bench_end(bt);
  bench_print(bt);
  free(bt);
}


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

x86 assembly (clang, -O2):
<bench_done>:
push   %rbx
mov    %rdi,%rbx
call   1050 <bench_end@plt>
mov    %rbx,%rdi
call   1040 <bench_print@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.benchtime = type { i32 }
define void @bench_done(%struct.benchtime* %0) {
%2 = alloca %struct.benchtime*
store %struct.benchtime* %0, %struct.benchtime** %2
%3 = load %struct.benchtime*, %struct.benchtime** %2
%4 = call i32 @bench_end(%struct.benchtime* %3)
%5 = load %struct.benchtime*, %struct.benchtime** %2
%6 = call i32 @bench_print(%struct.benchtime* %5)
%7 = load %struct.benchtime*, %struct.benchtime** %2
%8 = call i32 @free(%struct.benchtime* %7)
ret void
}

LLVM IR (-O2):
%struct.benchtime = type { i32 }
define void @bench_done(%struct.benchtime* %0) {
%2 = tail call i32 @bench_end(%struct.benchtime* %0)
%3 = tail call i32 @bench_print(%struct.benchtime* %0)
%4 = tail call i32 @free(%struct.benchtime* %0)
ret void
}
int test_imm_71int16_reg(short val) {
  return ((val) & (-0x71 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_71int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -113
%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_71int16_reg(i16 signext %0) {
%2 = and i16 %0, -113
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_2Duint16_mem(unsigned short *val) {
  return ((*val) & (0x2D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Duint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x2d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_2Duint16_mem>:
testb  $0x2d,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_2Duint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 45
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void title(char *title) {
  printf("\033[%sm", "35");
  printf("\n%s", title);
  printf("\033[%sm", "0");
}


x86 assembly (clang, -O0):
<title>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    0xedc(%rip),%rsi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<title>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%r14
lea    0xee1(%rip),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xeca(%rip),%rsi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%sm\00"
@.str.1 = [3 x i8] c"35\00"
@.str.2 = [4 x i8] c"\0A%s\00"
@.str.3 = [2 x i8] c"0\00"
define void @title(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int my_system(char const *);
int my_io_system(const char *command_line) { return my_system(command_line); }


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

x86 assembly (clang, -O2):
<my_io_system>:
jmp    1030 <my_system@plt>

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

LLVM IR (-O2):
define i32 @my_io_system(i8* %0) {
%2 = tail call i32 @my_system(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void OneWireIntClear(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ASSERT(ui32Base == 0x400B6000);
  ASSERT((ui32IntFlags & ~(0x00000001 | 0x00000002 | 0x00000010 | 0x00000004 |
                           0x00000008)) == 0);
  (*((volatile uint32_t *)(ui32Base + 0x0000010C))) = ui32IntFlags;
}


x86 assembly (clang, -O0):
<OneWireIntClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x400b6000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%eax
and    $0xffffffe0,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x10c,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OneWireIntClear>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x400b6000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x20,%ebx
setb   %dil
call   1030 <ASSERT@plt>
movslq %ebp,%rax
mov    %ebx,0x10c(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @OneWireIntClear(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 = icmp eq i32 %5, 1074487296
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = and i32 %9, -32
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @ASSERT(i32 %12)
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 268
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
store volatile i32 %14, i32* %18
ret void
}

LLVM IR (-O2):
define void @OneWireIntClear(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1074487296
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = icmp ult i32 %1, 32
%7 = zext i1 %6 to i32
%8 = tail call i32 @ASSERT(i32 %7)
%9 = add nsw i32 %0, 268
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store volatile i32 %1, i32* %11
ret void
}
/* Variables and functions */
char *ATest();
char *BTest();
int /*<<< orphan*/ printf(char *, char *, char *);
int main() {
  printf("Hello from %s and %s\n", ATest(), BTest());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <ATest@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <BTest@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <ATest@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <BTest@plt>
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Hello from %s and %s\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i8* (...) @ATest()
%3 = call i8* (...) @BTest()
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Hello from %s and %s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @ATest()
%2 = tail call i8* (...) @BTest()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret i32 0
}
int foobar(int n) {
  switch (n) {
  case 0:
    return 1;
  case 1:
    return 12;
  case 2:
    return 123;
  case 3:
    return 1234;
  case 4:
    return 12345;
  default:
    return 42;
  }
}


x86 assembly (clang, -O0):
<foobar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x4,%rax
ja     1168 <foobar+0x68>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    116f <foobar+0x6f>
movl   $0xc,-0x4(%rbp)
jmp    116f <foobar+0x6f>
movl   $0x7b,-0x4(%rbp)
jmp    116f <foobar+0x6f>
movl   $0x4d2,-0x4(%rbp)
jmp    116f <foobar+0x6f>
movl   $0x3039,-0x4(%rbp)
jmp    116f <foobar+0x6f>
movl   $0x2a,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foobar>:
mov    $0x2a,%eax
cmp    $0x4,%edi
ja     1117 <foobar+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @foobar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %10 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 4, label %9
]
5: ; preds = %1
store i32 1, i32* %2
br label %11
6: ; preds = %1
store i32 12, i32* %2
br label %11
7: ; preds = %1
store i32 123, i32* %2
br label %11
8: ; preds = %1
store i32 1234, i32* %2
br label %11
9: ; preds = %1
store i32 12345, i32* %2
br label %11
10: ; preds = %1
store i32 42, i32* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6, %5
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@switch.table.foobar = [5 x i32] [i32 1, i32 12, i32 123, i32 1234, i32 12345]
define i32 @foobar(i32 %0) {
%2 = icmp ult i32 %0, 5
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [5 x i32], [5 x i32]* @switch.table.foobar, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 42, %1 ]
ret i32 %8
}
int tdefault_set_syscall_catchpoint(struct target_ops *self, int arg1, int arg2,
                                    int arg3, int arg4, int *arg5) {
  return 1;
}


x86 assembly (clang, -O0):
<tdefault_set_syscall_catchpoint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.target_ops = type opaque
define i32 @tdefault_set_syscall_catchpoint(%struct.target_ops* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32* %5) {
%7 = alloca %struct.target_ops*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
store %struct.target_ops* %0, %struct.target_ops** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32* %5, i32** %12
ret i32 1
}

LLVM IR (-O2):
%struct.target_ops = type opaque
define i32 @tdefault_set_syscall_catchpoint(%struct.target_ops* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4, i32* nocapture readnone %5) {
ret i32 1
}
long vdso_arch_syscall(long nr, long arg1, long arg2) {
  long ret;
  __asm__ volatile("lea .Lret%=(%%rip), %%rcx\n"
                   "jmp *%%gs:%c[syscalldb]\n"
                   ".Lret%=:\n"
                   : "=a"(ret)
                   : "0"(nr), "D"(arg1), "S"(arg2), [syscalldb] "i"(32)
                   : "memory", "rcx", "r11");
  return ret;
}


x86 assembly (clang, -O0):
<vdso_arch_syscall>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0x8(%rip),%rcx
jmp    *%gs:0x20
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vdso_arch_syscall>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
lea    0x8(%rip),%rcx
jmp    *%gs:0x20
ret

LLVM IR (-O0):
define i64 @vdso_arch_syscall(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = call i64 asm sideeffect "lea .Lret${:uid}(%rip), %rcx\0Ajmp *%gs:${4:c}\0A.Lret${:uid}:\0A", "={ax},0,{di},{si},i,~{memory},~{rcx},~{r11},~{dirflag},~{fpsr},~{flags}"(i64 %8, i64 %9, i64 %10, i32 32)
store i64 %11, i64* %7
%12 = load i64, i64* %7
ret i64 %12
}

LLVM IR (-O2):
define i64 @vdso_arch_syscall(i64 %0, i64 %1, i64 %2) {
%4 = tail call i64 asm sideeffect "lea .Lret${:uid}(%rip), %rcx\0Ajmp *%gs:${4:c}\0A.Lret${:uid}:\0A", "={ax},0,{di},{si},i,~{memory},~{rcx},~{r11},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i32 32)
ret i64 %4
}
unsigned long DRV_WIFI_SET_RX_FCTL(unsigned long para1, unsigned long para2) {
  return 0;
}


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

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

LLVM IR (-O0):
define i64 @DRV_WIFI_SET_RX_FCTL(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
ret i64 0
}

LLVM IR (-O2):
define i64 @DRV_WIFI_SET_RX_FCTL(i64 %0, i64 %1) {
ret i64 0
}
/* Variables and functions */
long double scalbnl(long double, int);
long double scalblnl(long double x, long n) {
  return (scalbnl(x, (n > 65536) ? 65536 : (n < -65536) ? -65536 : (int)n));
}


x86 assembly (clang, -O0):
<scalblnl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
fstpt  -0x24(%rbp)
cmpq   $0x10000,-0x18(%rbp)
jle    1143 <scalblnl+0x33>
mov    $0x10000,%eax
mov    %eax,-0x28(%rbp)
jmp    116b <scalblnl+0x5b>
cmpq   $0xffffffffffff0000,-0x18(%rbp)
ff
jge    115e <scalblnl+0x4e>
mov    $0xffff0000,%eax
mov    %eax,-0x2c(%rbp)
jmp    1165 <scalblnl+0x55>
mov    -0x18(%rbp),%rax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x28(%rbp)
fldt   -0x24(%rbp)
mov    -0x28(%rbp),%edi
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <scalbnl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalblnl>:
cmp    $0xffffffffffff0001,%rdi
mov    $0xffffffffffff0000,%rax
cmovl  %rax,%rdi
cmp    $0x10000,%rdi
mov    $0x10000,%eax
cmovge %eax,%edi
jmp    1030 <scalbnl@plt>

LLVM IR (-O0):
define x86_fp80 @scalblnl(x86_fp80 %0, i64 %1) {
%3 = alloca x86_fp80
%4 = alloca i64
store x86_fp80 %0, x86_fp80* %3
store i64 %1, i64* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %6, 65536
br i1 %7, label %8, label %9
8: ; preds = %2
br label %18
9: ; preds = %2
%10 = load i64, i64* %4
%11 = icmp slt i64 %10, -65536
br i1 %11, label %12, label %13
12: ; preds = %9
br label %16
13: ; preds = %9
%14 = load i64, i64* %4
%15 = trunc i64 %14 to i32
br label %16
16: ; preds = %13, %12
%17 = phi i32 [ -65536, %12 ], [ %15, %13 ]
br label %18
18: ; preds = %16, %8
%19 = phi i32 [ 65536, %8 ], [ %17, %16 ]
%20 = call x86_fp80 @scalbnl(x86_fp80 %5, i32 %19)
ret x86_fp80 %20
}

LLVM IR (-O2):
define x86_fp80 @scalblnl(x86_fp80 %0, i64 %1) {
%3 = icmp sgt i64 %1, -65536
%4 = select i1 %3, i64 %1, i64 -65536
%5 = icmp slt i64 %4, 65536
%6 = select i1 %5, i64 %4, i64 65536
%7 = trunc i64 %6 to i32
%8 = tail call x86_fp80 @scalbnl(x86_fp80 %0, i32 %7)
ret x86_fp80 %8
}
void encode(unsigned char *string, unsigned short string_len, int format) {
  if (format == 0x2) {
    xor(string, string_len);
  }
}


x86 assembly (clang, -O0):
<encode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jne    113f <encode+0x2f>
mov    -0x8(%rbp),%rdi
movzwl -0xa(%rbp),%esi
mov    $0x0,%al
call   1030 <xor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode>:
cmp    $0x2,%edx
jne    111f <encode+0xf>
movzwl %si,%esi
xor    %eax,%eax
jmp    1030 <xor@plt>
ret

LLVM IR (-O0):
define void @encode(i8* %0, i16 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i32
store i8* %0, i8** %4
store i16 %1, i16* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i16, i16* %5
%12 = zext i16 %11 to i32
%13 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @xor to i32 (i8*, i32, ...)*)(i8* %10, i32 %12)
br label %14
14: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
define void @encode(i8* %0, i16 zeroext %1, i32 %2) {
%4 = icmp eq i32 %2, 2
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = zext i16 %1 to i32
%7 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @xor to i32 (i8*, i32, ...)*)(i8* %0, i32 %6)
br label %8
8: ; preds = %5, %3
ret void
}
void C_HEAT_Get_Actual_temperature(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @foo171() {
ret void
}
long int lrintf(float x) { return x; }


x86 assembly (clang, -O0):
<lrintf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrintf>:
cvttss2si %xmm0,%rax
ret

LLVM IR (-O0):
define i64 @lrintf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptosi float %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @lrintf(float %0) {
%2 = fptosi float %0 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("This is a test.\n");
  printf("\c");
  printf("\nEnd of test.\n");
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
mov    $0x63,%edi
call   1030 <putchar@plt>
lea    0xed2(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"This is a test.\0A\00"
@.str.1 = [2 x i8] c"c\00"
@.str.2 = [15 x i8] c"\0AEnd of test.\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"This is a test.\00"
@str.3 = [14 x i8] c"\0AEnd of test.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 99)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int setenv(char const *, char const *, int);
int UnixVfs_Setenv(const char *zName, const char *zValue) {
  int rc;
  rc = setenv(zName, zValue, 1);
  return rc == 0 ? 0 : -1;
}


x86 assembly (clang, -O0):
<UnixVfs_Setenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UnixVfs_Setenv>:
push   %rax
mov    $0x1,%edx
call   1030 <setenv@plt>
neg    %eax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @UnixVfs_Setenv(i8* %0, i8* %1) {
%3 = tail call i32 @setenv(i8* %0, i8* %1, i32 1)
%4 = icmp ne i32 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
void f2(void) {
  char buf[1000];
  int i;
  for (i = 0; i < sizeof(buf); ++i)
    buf[i] = 0;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x380,%rsp
movl   $0x0,-0x3f4(%rbp)
movslq -0x3f4(%rbp),%rax
cmp    $0x3e8,%rax
jae    114b <f2+0x4b>
movslq -0x3f4(%rbp),%rax
movb   $0x0,-0x3f0(%rbp,%rax,1)
mov    -0x3f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f4(%rbp)
jmp    1115 <f2+0x15>
add    $0x380,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f2() {
%1 = alloca [1000 x i8]
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = icmp ult i64 %5, 1000
br i1 %6, label %7, label %14
7: ; preds = %3
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %9
store i8 0, i8* %10
br label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @f2() {
ret void
}
/* Variables and functions */
double exp(double);
double df3(double x) { return exp(x) - 2; }


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

x86 assembly (clang, -O2):
<df3>:
push   %rax
call   1030 <exp@plt>
addsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @df3(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @exp(double %3)
%5 = fsub double %4, 2.000000e+00
ret double %5
}

LLVM IR (-O2):
define double @df3(double %0) {
%2 = tail call double @exp(double %0)
%3 = fadd double %2, -2.000000e+00
ret double %3
}
float __ocl_select_float_int(float a, float b, int c) { return c ? b : a; }


x86 assembly (clang, -O0):
<__ocl_select_float_int>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     112a <__ocl_select_float_int+0x2a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1134 <__ocl_select_float_int+0x34>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_select_float_int>:
test   %edi,%edi
je     1107 <__ocl_select_float_int+0x7>
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @__ocl_select_float_int(float %0, float %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = select i1 %4, float %0, float %1
ret float %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ tmp;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ ivory_serialize_pack_prim_1_be(int /*<<< orphan*/ *,
                                                  int /*<<< orphan*/ *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ **, int /*<<< orphan*/ const *,
                          int);
void ivory_serialize_pack_int8_be(uint8_t *dst, uint32_t offs,
                                  const int8_t *src) {
  uint8_t tmp[1] = {0};
  memcpy(&tmp, src, sizeof(tmp));
  ivory_serialize_pack_prim_1_be(dst + offs, tmp);
}


x86 assembly (clang, -O0):
<ivory_serialize_pack_int8_be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x1c(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
lea    -0x1c(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
lea    -0x1c(%rbp),%rsi
call   1030 <ivory_serialize_pack_prim_1_be@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_pack_int8_be>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %rdi,%r14
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%r15
mov    %r15,%rdi
mov    %rdx,%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
movslq %ebx,%rax
lea    (%r14,%rax,4),%rdi
mov    %r15,%rsi
call   1030 <ivory_serialize_pack_prim_1_be@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ivory_serialize_pack_int8_be(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca [1 x i32]
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = bitcast [1 x i32]* %7 to i8*
%9 = bitcast [1 x i32]* %7 to i32**
%10 = load i32*, i32** %6
%11 = call i32 @memcpy(i32** %9, i32* %10, i32 4)
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = getelementptr inbounds [1 x i32], [1 x i32]* %7, i64 0, i64 0
%17 = call i32 @ivory_serialize_pack_prim_1_be(i32* %15, i32* %16)
ret void
}

LLVM IR (-O2):
define void @ivory_serialize_pack_int8_be(i32* %0, i32 %1, i32* %2) {
%4 = alloca [1 x i32]
%5 = bitcast [1 x i32]* %4 to i8*
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 0
store i32 0, i32* %6
%7 = bitcast [1 x i32]* %4 to i32**
%8 = call i32 @memcpy(i32** %7, i32* %2, i32 4)
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = call i32 @ivory_serialize_pack_prim_1_be(i32* %10, i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dynamic_test();
int main() {
  dynamic_test();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @dynamic_test()
ret i32 0
}
int test_imm_B9int64_lowword_reg(long long val) {
  return ((val) & (0xB9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B9int64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xb9,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_B9int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 185
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void library_dispatcher(void (*func)(void)) { (*func)(); }


x86 assembly (clang, -O0):
<library_dispatcher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<library_dispatcher>:
jmp    *%rdi

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

LLVM IR (-O2):
define void @library_dispatcher(void ()* nocapture %0) {
tail call void %0()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ compilerAssert();
void chpl_incRefCountsForDomainsInArrayEltTypes4(void) {
  compilerAssert();
  return;
}


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

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

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

LLVM IR (-O2):
define void @chpl_incRefCountsForDomainsInArrayEltTypes4() {
%1 = tail call i32 (...) @compilerAssert()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void USBIntEnableEndpoint(uint32_t ui32Base, uint32_t ui32Flags) {
  ;
  (*((volatile unsigned short *)(ui32Base + 0x00000006))) |=
      ui32Flags & (0x0000FFFE | 0x0000FFFE | 0x00000001);
  (*((volatile unsigned short *)(ui32Base + 0x00000008))) |=
      ((ui32Flags & (0xFFFE0000 | 0xFFFE0000)) >> 16);
}


x86 assembly (clang, -O0):
<USBIntEnableEndpoint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
and    $0xffff,%edx
mov    -0x4(%rbp),%eax
add    $0x6,%eax
cltq
mov    (%rax),%cx
movzwl %cx,%ecx
or     %edx,%ecx
mov    %cx,(%rax)
mov    -0x8(%rbp),%edx
and    $0xfffe0000,%edx
shr    $0x10,%edx
mov    -0x4(%rbp),%eax
add    $0x8,%eax
cltq
mov    (%rax),%cx
movzwl %cx,%ecx
or     %edx,%ecx
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBIntEnableEndpoint>:
movslq %edi,%rax
or     %si,0x6(%rax)
shr    $0x10,%esi
and    $0xfffffffe,%esi
or     %si,0x8(%rax)
ret

LLVM IR (-O0):
define void @USBIntEnableEndpoint(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 = and i32 %5, 65535
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 6
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i16*
%11 = load volatile i16, i16* %10
%12 = zext i16 %11 to i32
%13 = or i32 %12, %6
%14 = trunc i32 %13 to i16
store volatile i16 %14, i16* %10
%15 = load i32, i32* %4
%16 = and i32 %15, -131072
%17 = lshr i32 %16, 16
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 8
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i16*
%22 = load volatile i16, i16* %21
%23 = zext i16 %22 to i32
%24 = or i32 %23, %17
%25 = trunc i32 %24 to i16
store volatile i16 %25, i16* %21
ret void
}

LLVM IR (-O2):
define void @USBIntEnableEndpoint(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 6
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i16*
%6 = load volatile i16, i16* %5
%7 = trunc i32 %1 to i16
%8 = or i16 %6, %7
store volatile i16 %8, i16* %5
%9 = lshr i32 %1, 16
%10 = add nsw i32 %0, 8
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i16*
%13 = load volatile i16, i16* %12
%14 = trunc i32 %9 to i16
%15 = and i16 %14, -2
%16 = or i16 %13, %15
store volatile i16 %16, i16* %12
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *my_calloc(size_t num, size_t size) {
  void *allocd = malloc(num * size);
  if (allocd == NULL)
    return allocd;
  memset(allocd, 0, num * size);
  return allocd;
}


x86 assembly (clang, -O0):
<my_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
imul   -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115a <my_calloc+0x3a>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1176 <my_calloc+0x56>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rdx
imul   -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

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