xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ __get_cpuid(int, unsigned int *, unsigned int *,
                               unsigned int *, unsigned int *);
int have_avx(void) {
  unsigned int eax, ebx, ecx, edx;
  if (!__get_cpuid(1, &eax, &ebx, &ecx, &edx))
    return 0;
  if ((ecx & ((1 << 28) | (1 << 27))) == ((1 << 28) | (1 << 27)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<have_avx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x1,%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <__get_cpuid@plt>
cmp    $0x0,%eax
jne    1147 <have_avx+0x37>
movl   $0x0,-0x4(%rbp)
jmp    116d <have_avx+0x5d>
mov    -0x10(%rbp),%eax
and    $0x18000000,%eax
cmp    $0x18000000,%eax
jne    1166 <have_avx+0x56>
movl   $0x1,-0x4(%rbp)
jmp    116d <have_avx+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<have_avx>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    $0x1,%edi
call   1030 <__get_cpuid@plt>
test   %eax,%eax
setne  %al
mov    0x8(%rsp),%ecx
not    %ecx
test   $0x18000000,%ecx
sete   %cl
and    %al,%cl
movzbl %cl,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @have_avx() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = call i32 @__get_cpuid(i32 1, i32* %2, i32* %3, i32* %4, i32* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %0
store i32 0, i32* %1
br label %15
9: ; preds = %0
%10 = load i32, i32* %4
%11 = and i32 %10, 402653184
%12 = icmp eq i32 %11, 402653184
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 1, i32* %1
br label %15
14: ; preds = %9
store i32 0, i32* %1
br label %15
15: ; preds = %14, %13, %8
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @have_avx() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @__get_cpuid(i32 1, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = icmp ne i32 %9, 0
%11 = load i32, i32* %3
%12 = and i32 %11, 402653184
%13 = icmp eq i32 %12, 402653184
%14 = select i1 %10, i1 %13, i1 false
%15 = zext i1 %14 to i32
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int const);
void show_int(FILE *fp, const int i) { fprintf(fp, "%d", i); }


x86 assembly (clang, -O0):
<show_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_int>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @show_int(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 @fprintf(i32* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @show_int(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void ble_rsp_system_aes_encrypt(
    const struct ble_msg_system_aes_encrypt_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_system_aes_encrypt_rsp_t = type opaque
define void @ble_rsp_system_aes_encrypt(%struct.ble_msg_system_aes_encrypt_rsp_t* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p448_relax(uintptr_t, uintptr_t);
void fiat_p448_relax(uint64_t out1[8], const uint64_t arg1[8]) {
  internal_fiat_p448_relax((uintptr_t)out1, (uintptr_t)arg1);
}


x86 assembly (clang, -O0):
<fiat_p448_relax>:
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 <internal_fiat_p448_relax@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiat_p448_relax>:
jmp    1030 <internal_fiat_p448_relax@plt>

LLVM IR (-O0):
define void @fiat_p448_relax(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_p448_relax(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_p448_relax(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_p448_relax(i64 %3, i64 %4)
ret void
}
/* Variables and functions */
int getchar();
int getch(void) {
  extern int pre;
  int re = pre;
  pre = 0;
  return (re != 0) ? re : getchar();
}


x86 assembly (clang, -O0):
<getch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    0x2ebd(%rip),%rax
movl   $0x0,(%rax)
cmpl   $0x0,-0x4(%rbp)
je     1146 <getch+0x36>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1150 <getch+0x40>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getch>:
mov    0x2ed1(%rip),%rcx
mov    (%rcx),%eax
movl   $0x0,(%rcx)
test   %eax,%eax
je     1124 <getch+0x14>
ret
xor    %eax,%eax
jmp    1030 <getchar@plt>

LLVM IR (-O0):
@pre = external global i32
define i32 @getch() {
%1 = alloca i32
%2 = load i32, i32* @pre
store i32 %2, i32* %1
store i32 0, i32* @pre
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i32, i32* %1
br label %9
7: ; preds = %0
%8 = call i32 (...) @getchar()
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}

LLVM IR (-O2):
@pre = external global i32
define i32 @getch() {
%1 = load i32, i32* @pre
store i32 0, i32* @pre
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @getchar()
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  int n;
  char s[100];
  n = 1723;
  itoa(n, s);
  printf("%s", s);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    $0x6bb,%edi
mov    %rbx,%rsi
call   1040 <itoa@plt>
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @itoa(i32 1723, i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
unsigned int gcd(unsigned int a, unsigned int b) {
  if (a == 0)
    return b;
  if (b == 0)
    return a;
  while (a != b)
    if (a > b)
      a -= b;
    else
      b -= a;
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111f <gcd+0x1f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <gcd+0x77>
cmpl   $0x0,-0xc(%rbp)
jne    1134 <gcd+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <gcd+0x77>
jmp    1139 <gcd+0x39>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1171 <gcd+0x71>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    1161 <gcd+0x61>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    116c <gcd+0x6c>
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1139 <gcd+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
test   %edi,%edi
je     1128 <gcd+0x28>
mov    %edi,%eax
test   %esi,%esi
je     1127 <gcd+0x27>
cmp    %esi,%eax
je     1127 <gcd+0x27>
xor    %ecx,%ecx
cmp    %eax,%esi
mov    $0x0,%edx
cmovb  %esi,%edx
mov    %eax,%edi
cmovb  %ecx,%edi
sub    %edx,%eax
sub    %edi,%esi
cmp    %esi,%eax
jne    1110 <gcd+0x10>
ret
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %5
store i32 %9, i32* %3
br label %35
10: ; preds = %2
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = load i32, i32* %4
store i32 %14, i32* %3
br label %35
15: ; preds = %10
br label %16
16: ; preds = %32, %15
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = icmp ne i32 %17, %18
br i1 %19, label %20, label %33
20: ; preds = %16
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = icmp ugt i32 %21, %22
br i1 %23, label %24, label %28
24: ; preds = %20
%25 = load i32, i32* %5
%26 = load i32, i32* %4
%27 = sub i32 %26, %25
store i32 %27, i32* %4
br label %32
28: ; preds = %20
%29 = load i32, i32* %4
%30 = load i32, i32* %5
%31 = sub i32 %30, %29
store i32 %31, i32* %5
br label %32
32: ; preds = %28, %24
br label %16
33: ; preds = %16
%34 = load i32, i32* %4
store i32 %34, i32* %3
br label %35
35: ; preds = %33, %13, %8
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = icmp eq i32 %1, 0
%6 = icmp eq i32 %0, %1
%7 = or i1 %5, %6
br i1 %7, label %17, label %8
8: ; preds = %4, %8
%9 = phi i32 [ %15, %8 ], [ %1, %4 ]
%10 = phi i32 [ %13, %8 ], [ %0, %4 ]
%11 = icmp ult i32 %9, %10
%12 = select i1 %11, i32 %9, i32 0
%13 = sub i32 %10, %12
%14 = select i1 %11, i32 0, i32 %10
%15 = sub i32 %9, %14
%16 = icmp eq i32 %13, %15
br i1 %16, label %17, label %8
17: ; preds = %8, %4, %2
%18 = phi i32 [ %1, %2 ], [ %0, %4 ], [ %13, %8 ]
ret i32 %18
}
/* Variables and functions */
double ceil(double);
double floor(double);
double my_rint(double nr) {
  double f = floor(nr);
  double c = ceil(nr);
  return (((c - nr) >= (nr - f)) ? f : c);
}


x86 assembly (clang, -O0):
<my_rint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jb     1178 <my_rint+0x58>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1182 <my_rint+0x62>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_rint>:
sub    $0x28,%rsp
movaps %xmm0,(%rsp)
call   1040 <floor@plt>
movaps %xmm0,0x10(%rsp)
movapd (%rsp),%xmm0
call   1030 <ceil@plt>
movapd %xmm0,%xmm1
movapd (%rsp),%xmm2
subsd  %xmm2,%xmm1
movapd 0x10(%rsp),%xmm3
subsd  %xmm3,%xmm2
cmplesd %xmm1,%xmm2
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
movapd %xmm2,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @my_rint(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = call double @llvm.floor.f64(double %5)
store double %6, double* %3
%7 = load double, double* %2
%8 = call double @llvm.ceil.f64(double %7)
store double %8, double* %4
%9 = load double, double* %4
%10 = load double, double* %2
%11 = fsub double %9, %10
%12 = load double, double* %2
%13 = load double, double* %3
%14 = fsub double %12, %13
%15 = fcmp oge double %11, %14
br i1 %15, label %16, label %18
16: ; preds = %1
%17 = load double, double* %3
br label %20
18: ; preds = %1
%19 = load double, double* %4
br label %20
20: ; preds = %18, %16
%21 = phi double [ %17, %16 ], [ %19, %18 ]
ret double %21
}

LLVM IR (-O2):
define double @my_rint(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
%3 = tail call double @llvm.ceil.f64(double %0)
%4 = fsub double %3, %0
%5 = fsub double %0, %2
%6 = fcmp oge double %4, %5
%7 = select i1 %6, double %2, double %3
ret double %7
}
void proc_call_0() {}


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

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

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

LLVM IR (-O2):
define void @proc_call_0() {
ret void
}
/* Variables and functions */
double horner(unsigned int, double *, double);
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char const *argv[]) {
  unsigned int n = 3;
  double a[4] = {36, 4, 12, 1};
  double x = 3;
  double result = horner(n, a, x);
  printf("(3)^3+12(3)^2+4(3)+36 = %f\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
mov    0xecc(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xec9(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xec6(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x28(%rbp)
movsd  0xe8f(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x40(%rbp),%rsi
movsd  -0x48(%rbp),%xmm0
call   1040 <horner@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
movsd  0xeba(%rip),%xmm0
mov    $0x3,%edi
call   1040 <horner@plt>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [4 x double] [double 3.600000e+01, double 4.000000e+00, double 1.200000e+01, double 1.000000e+00]
@.str = [28 x i8] c"(3)^3+12(3)^2+4(3)+36 = %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [4 x double]
%8 = alloca double
%9 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 3, i32* %6
%10 = bitcast [4 x double]* %7 to i8*
store double 3.000000e+00, double* %8
%11 = load i32, i32* %6
%12 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%13 = load double, double* %8
%14 = call double @horner(i32 %11, double* %12, double %13)
store double %14, double* %9
%15 = load double, double* %9
%16 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), double %15)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [4 x double] [double 3.600000e+01, double 4.000000e+00, double 1.200000e+01, double 1.000000e+00]
@.str = [28 x i8] c"(3)^3+12(3)^2+4(3)+36 = %f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4 x double]
%4 = bitcast [4 x double]* %3 to i8*
%5 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%6 = call double @horner(i32 3, double* %5, double 3.000000e+00)
%7 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), double %6)
ret i32 0
}
/* Variables and functions */
short *anShortPlease();
int /*<<< orphan*/ assert(int);
int t5() {
  int x, y, z;
  short *a = anShortPlease();
  x = y;
  *a = 3;
  assert(x == y);
  return 0;
}


x86 assembly (clang, -O0):
<t5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <anShortPlease@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%rax
movw   $0x3,(%rax)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t5>:
push   %rax
xor    %eax,%eax
call   1040 <anShortPlease@plt>
movw   $0x3,(%rax)
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @t5() {
%1 = tail call i16* (...) @anShortPlease()
store i16 3, i16* %1
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
int max2(int a, int b) {
  {
    if (a > b)
      return a;
    else
      return b;
  }
}


x86 assembly (clang, -O0):
<max2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <max2+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <max2+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @max2(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ print_int(int);
int /*<<< orphan*/ print_string(char *);
void loopNoInitialization(int times) {
  int i;
  i = times;
  for (; i > 0; i = i - 1) {
    print_int(i);
    print_string(" ");
  }
  print_int(i);
  print_string(" ");
}


x86 assembly (clang, -O0):
<loopNoInitialization>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    115d <loopNoInitialization+0x3d>
mov    -0x8(%rbp),%edi
call   1040 <print_int@plt>
lea    0xeb6(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1131 <loopNoInitialization+0x11>
mov    -0x8(%rbp),%edi
call   1040 <print_int@plt>
lea    0xe94(%rip),%rdi
call   1030 <print_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loopNoInitialization>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
test   %edi,%edi
jle    115b <loopNoInitialization+0x3b>
lea    0xecf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1040 <print_int@plt>
mov    %r14,%rdi
call   1030 <print_string@plt>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
ja     1140 <loopNoInitialization+0x20>
xor    %ebx,%ebx
mov    %ebx,%edi
call   1040 <print_int@plt>
lea    0xe97(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <print_string@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @loopNoInitialization(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
br label %5
5: ; preds = %12, %1
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = load i32, i32* %3
%10 = call i32 @print_int(i32 %9)
%11 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %8
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 1
store i32 %14, i32* %3
br label %5
15: ; preds = %5
%16 = load i32, i32* %3
%17 = call i32 @print_int(i32 %16)
%18 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @loopNoInitialization(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = tail call i32 @print_int(i32 %4)
%6 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = add nsw i32 %4, -1
%8 = icmp ugt i32 %4, 1
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ %0, %1 ], [ 0, %3 ]
%11 = tail call i32 @print_int(i32 %10)
%12 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned xrop3_10_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = ~T;
  stk1 = D & stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_10_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_10_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
not    %sil
movzbl %sil,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_10_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = xor i32 %22, -1
store i32 %23, i32* %9
%24 = load i32, i32* %5
%25 = load i32, i32* %9
%26 = and i32 %24, %25
store i32 %26, i32* %8
%27 = load i32, i32* %8
%28 = load i32, i32* %6
%29 = xor i32 %28, -1
%30 = and i32 %27, %29
%31 = load i32, i32* %5
%32 = load i32, i32* %6
%33 = and i32 %31, %32
%34 = or i32 %30, %33
ret i32 %34
}

LLVM IR (-O2):
define i32 @xrop3_10_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = xor i8 %1, -1
%6 = zext i8 %5 to i32
%7 = xor i32 %4, -1
%8 = and i32 %7, %6
%9 = or i32 %8, %3
ret i32 %9
}
/* Variables and functions */
int __socketcall(int, unsigned long *);
int listen(int sockfd, int backlog) {
  unsigned long args[2];
  args[0] = sockfd;
  args[1] = backlog;
  return __socketcall(4, args);
}


x86 assembly (clang, -O0):
<listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x20(%rbp)
movslq -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rsi
mov    $0x4,%edi
call   1030 <__socketcall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<listen>:
sub    $0x18,%rsp
movslq %edi,%rax
mov    %rax,(%rsp)
movslq %esi,%rax
mov    %rax,0x8(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
call   1030 <__socketcall@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @listen(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i64]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 0
store i64 %7, i64* %8
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 1
store i64 %10, i64* %11
%12 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 0
%13 = call i32 @__socketcall(i32 4, i64* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @listen(i32 %0, i32 %1) {
%3 = alloca [2 x i64]
%4 = bitcast [2 x i64]* %3 to i8*
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 0
store i64 %5, i64* %6
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 1
store i64 %7, i64* %8
%9 = call i32 @__socketcall(i32 4, i64* %6)
ret i32 %9
}
/* Variables and functions */
int strlen(char *str) {
  int i = 0;
  for (i; str[i] != '\0'; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <strlen+0x37>
jmp    1129 <strlen+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_stwio(int volatile *, unsigned char);
int sendSerialMessage(unsigned char msg) {
  __builtin_stwio(((volatile int *)0x10001010), (msg));
}


x86 assembly (clang, -O0):
<sendSerialMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    $0x10001010,%edi
movzbl -0x5(%rbp),%esi
call   1030 <__builtin_stwio@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendSerialMessage>:
mov    %edi,%esi
mov    $0x10001010,%edi
jmp    1030 <__builtin_stwio@plt>

LLVM IR (-O0):
define i32 @sendSerialMessage(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i32 @__builtin_stwio(i32* inttoptr (i64 268439568 to i32*), i8 zeroext %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @sendSerialMessage(i8 zeroext %0) {
%2 = tail call i32 @__builtin_stwio(i32* inttoptr (i64 268439568 to i32*), i8 zeroext %0)
ret i32 undef
}
/* Variables and functions */
int foo();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("a is %d\n", foo());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"a is %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int Game24Points(int, int, int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", Game24Points(7, 2, 1, 10));
  printf("%d\n", Game24Points(7, 2, 2, 10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7,%edi
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0xa,%ecx
call   1040 <Game24Points@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    $0x7,%edi
mov    $0x2,%edx
mov    $0xa,%ecx
mov    %edx,%esi
call   1040 <Game24Points@plt>
mov    %eax,%esi
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x7,%edi
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0xa,%ecx
call   1040 <Game24Points@plt>
lea    0xebf(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x7,%edi
mov    $0x2,%esi
mov    $0x2,%edx
mov    $0xa,%ecx
call   1040 <Game24Points@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @Game24Points(i32 7, i32 2, i32 1, i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @Game24Points(i32 7, i32 2, i32 2, i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test(int *);
int main(void) {
  int arr[] = {1, 2, 3, 4, 5, 6};
  test(arr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6]
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
store i32 0, i32* %1
%3 = bitcast [6 x i32]* %2 to i8*
%4 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%5 = call i32 @test(i32* %4)
ret i32 0
}

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

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
void setx_end(FILE *buf) {
  fputc(0x0A, buf);
  fputc(0x03, buf);
  fflush(buf);
}


x86 assembly (clang, -O0):
<setx_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0xa,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rsi
mov    $0x3,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setx_end>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x3,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
define void @setx_end(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputc(i32 10, i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @fputc(i32 3, i32* %5)
%7 = load i32*, i32** %2
%8 = call i32 @fflush(i32* %7)
ret void
}

LLVM IR (-O2):
define void @setx_end(i32* nocapture %0) {
%2 = tail call i32 @fputc(i32 10, i32* %0)
%3 = tail call i32 @fputc(i32 3, i32* %0)
%4 = tail call i32 @fflush(i32* %0)
ret void
}
void foo_1_1_2_2_2_1_2_2_2() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_xor_si64(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test56(__m64 a, __m64 b) { return _mm_xor_si64(a, b); }


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

x86 assembly (clang, -O2):
<test56>:
jmp    1030 <_mm_xor_si64@plt>

LLVM IR (-O0):
define i32 @test56(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 @_mm_xor_si64(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test56(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_xor_si64(i32 %0, i32 %1)
ret i32 %3
}
void *Sys_GetGameAPI(void *parms) { return ((void *)0); }


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

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

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

LLVM IR (-O2):
define noalias i8* @Sys_GetGameAPI(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int partition(int *, int);
void quick_sort(int numbers[], int len) {
  if (len <= 1)
    return;
  int pivot = partition(numbers, len);
  quick_sort(numbers, pivot);
  quick_sort(numbers + pivot + 1, len - pivot - 1);
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jg     113e <quick_sort+0x1e>
jmp    117a <quick_sort+0x5a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <partition@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0x4,%rdi
mov    -0xc(%rbp),%esi
sub    -0x10(%rbp),%esi
sub    $0x1,%esi
call   1040 <quick_sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     115f <quick_sort+0x3f>
mov    %esi,%r14d
mov    %rdi,%rbx
nop
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <partition@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <quick_sort@plt>
movslq %ebp,%rax
lea    (%rbx,%rax,4),%rbx
add    $0x4,%rbx
not    %eax
add    %r14d,%eax
mov    %eax,%r14d
cmp    $0x1,%eax
jg     1130 <quick_sort+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %14, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %12, %4 ], [ %1, %2 ]
%6 = phi i32* [ %10, %4 ], [ %0, %2 ]
%7 = tail call i32 @partition(i32* %6, i32 %5)
tail call void @quick_sort(i32* %6, i32 %7)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 1
%10 = getelementptr inbounds i32, i32* %9, i64 %8
%11 = xor i32 %7, -1
%12 = add i32 %5, %11
%13 = icmp slt i32 %12, 2
br i1 %13, label %14, label %4
14: ; preds = %4, %2
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int sort_callback(const void *pa, const void *pb) {
  const char **a = (const char **)pa;
  const char **b = (const char **)pb;
  return strcmp(*a, *b);
}


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

x86 assembly (clang, -O2):
<sort_callback>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @sort_callback(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %6
%14 = load i8*, i8** %13
%15 = call i32 @strcmp(i8* %12, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @sort_callback(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Type definitions */
typedef unsigned long time_t;

/* Variables and functions */
unsigned long gethrtime();
time_t gethrestime_sec() { return ((gethrtime()) / (1000000000ul / 1ul)); }


x86 assembly (clang, -O0):
<gethrestime_sec>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gethrtime@plt>
mov    $0x3b9aca00,%ecx
xor    %edx,%edx
div    %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<gethrestime_sec>:
push   %rax
xor    %eax,%eax
call   1030 <gethrtime@plt>
shr    $0x9,%rax
movabs $0x44b82fa09b5a53,%rcx
mul    %rcx
mov    %rdx,%rax
shr    $0xb,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @gethrestime_sec() {
%1 = call i64 (...) @gethrtime()
%2 = udiv i64 %1, 1000000000
ret i64 %2
}

LLVM IR (-O2):
define i64 @gethrestime_sec() {
%1 = tail call i64 (...) @gethrtime()
%2 = udiv i64 %1, 1000000000
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print(char (*arr)[10], int len) {
  int i;
  for (i = 0; i < len; i++) {
    printf("%s ", arr[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115d <print+0x4d>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
imul   $0xa,%rax,%rax
add    %rax,%rsi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1157 <print+0x37>
mov    %rdi,%rbx
mov    %esi,%r15d
lea    0xeca(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xa,%rbx
add    $0xffffffffffffffff,%r15
jne    1140 <print+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define void @print([10 x i8]* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %0, i64 %7, i64 0
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int random();
long urandom() { return random() ^ (random() << 1); }


x86 assembly (clang, -O0):
<urandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
shl    $0x1,%ecx
xor    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @urandom() {
%1 = call i32 (...) @random()
%2 = call i32 (...) @random()
%3 = shl i32 %2, 1
%4 = xor i32 %1, %3
%5 = sext i32 %4 to i64
ret i64 %5
}

LLVM IR (-O2):
define i64 @urandom() {
%1 = tail call i32 (...) @random()
%2 = tail call i32 (...) @random()
%3 = shl i32 %2, 1
%4 = xor i32 %3, %1
%5 = sext i32 %4 to i64
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ one(int);
void two(int size) { one(size); }


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

x86 assembly (clang, -O2):
<two>:
jmp    1030 <one@plt>

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

LLVM IR (-O2):
define void @two(i32 %0) {
%2 = tail call i32 @one(i32 %0)
ret void
}
int get_pointer(void *stub) {
  int *i_ptr = *((int **)((int)stub + 6));
  return *i_ptr + (int)i_ptr + 4;
}


x86 assembly (clang, -O0):
<get_pointer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x6,%eax
cltq
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
add    %ecx,%eax
add    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pointer>:
add    $0x6,%edi
movslq %edi,%rax
mov    (%rax),%rax
mov    (%rax),%ecx
add    %ecx,%eax
add    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @get_pointer(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
%6 = add nsw i32 %5, 6
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32**
%9 = load i32*, i32** %8
store i32* %9, i32** %3
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = load i32*, i32** %3
%13 = ptrtoint i32* %12 to i32
%14 = add nsw i32 %11, %13
%15 = add nsw i32 %14, 4
ret i32 %15
}

LLVM IR (-O2):
define i32 @get_pointer(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = shl i64 %2, 32
%4 = add i64 %3, 25769803776
%5 = ashr exact i64 %4, 32
%6 = inttoptr i64 %5 to i32**
%7 = load i32*, i32** %6
%8 = load i32, i32* %7
%9 = ptrtoint i32* %7 to i64
%10 = trunc i64 %9 to i32
%11 = add i32 %8, 4
%12 = add i32 %11, %10
ret i32 %12
}
/* Variables and functions */
unsigned long base64_decode_long(char const *, int);
unsigned long str2snum(const char *str) { return base64_decode_long(str, 2); }


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

x86 assembly (clang, -O2):
<str2snum>:
mov    $0x2,%esi
jmp    1030 <base64_decode_long@plt>

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

LLVM IR (-O2):
define i64 @str2snum(i8* %0) {
%2 = tail call i64 @base64_decode_long(i8* %0, i32 2)
ret i64 %2
}