xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ window;
  int /*<<< orphan*/ parent;
};
typedef TYPE_1__ XMapRequestEvent;
typedef int /*<<< orphan*/ XEvent;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int /*<<< orphan*/);
void do_MapRequest(XEvent *eventp) {
  XMapRequestEvent *e = (XMapRequestEvent *)eventp;
  printf("    parent 0x%lx, window 0x%lx\n", e->parent, e->window);
}


x86 assembly (clang, -O0):
<do_MapRequest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_MapRequest>:
mov    (%rdi),%edx
mov    0x4(%rdi),%esi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32, i32 }
@.str = [32 x i8] c" parent 0x%lx, window 0x%lx\0A\00"
define void @do_MapRequest(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.TYPE_2__*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = bitcast i32* %4 to %struct.TYPE_2__*
store %struct.TYPE_2__* %5, %struct.TYPE_2__** %3
%6 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%7 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %6, i32 0, i32 1
%8 = load i32, i32* %7
%9 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%10 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c" parent 0x%lx, window 0x%lx\0A\00"
define void @do_MapRequest(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = load i32, i32* %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret void
}
void _Z10_Jv_equalnP13_Jv_Utf8ConstPN4java4lang6StringEi(void) {}


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

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

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

LLVM IR (-O2):
define void @_Z10_Jv_equalnP13_Jv_Utf8ConstPN4java4lang6StringEi() {
ret void
}
int abs(int i) {
  if (i >= 0) {
    return i;
  } else {
    return -i;
  }
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111c <abs+0x1c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <abs+0x24>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
int intComparison(const void *a, const void *b) {
  return *(int *)a - *(int *)b;
}


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

x86 assembly (clang, -O2):
<intComparison>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @intComparison(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @intComparison(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
double pow(double, double);
double Mu(double T, double T_ref, double beta, double mu_ref) {
  return mu_ref * pow((T / T_ref), beta);
}


x86 assembly (clang, -O0):
<Mu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mu>:
push   %rax
movsd  %xmm3,(%rsp)
divsd  %xmm1,%xmm0
movaps %xmm2,%xmm1
call   1030 <pow@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @Mu(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %8
%10 = load double, double* %5
%11 = load double, double* %6
%12 = fdiv double %10, %11
%13 = load double, double* %7
%14 = call double @pow(double %12, double %13)
%15 = fmul double %9, %14
ret double %15
}

LLVM IR (-O2):
define double @Mu(double %0, double %1, double %2, double %3) {
%5 = fdiv double %0, %1
%6 = tail call double @pow(double %5, double %2)
%7 = fmul double %6, %3
ret double %7
}
int foo(int a) { return a + 1; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

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


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

x86 assembly (clang, -O2):
<test_mm_adds_pu8>:
jmp    1030 <_mm_adds_pu8@plt>

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

LLVM IR (-O2):
define i32 @test_mm_adds_pu8(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_adds_pu8(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_gcd();
int main(int argc, char const *argv[]) {
  test_gcd();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_gcd()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_gcd()
ret i32 0
}
unsigned int test_13(int x) { return ~(x >> 31) << 1; }


x86 assembly (clang, -O0):
<test_13>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
xor    $0xffffffff,%eax
shl    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_13>:
sar    $0x1f,%edi
not    %edi
lea    (%rdi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @test_13(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 31
%5 = xor i32 %4, -1
%6 = shl i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @test_13(i32 %0) {
%2 = ashr i32 %0, 31
%3 = xor i32 %2, -1
%4 = shl nsw i32 %3, 1
ret i32 %4
}
void glPointSize(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glPointSize() {
ret void
}
/* Variables and functions */
int sock_write(int, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int sock_puts(int sockfd, const char *str) {
  return sock_write(sockfd, str, strlen(str));
}


x86 assembly (clang, -O0):
<sock_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <sock_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_puts>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <sock_write@plt>

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

LLVM IR (-O2):
define i32 @sock_puts(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @sock_write(i32 %0, i8* %1, i32 %3)
ret i32 %4
}
/* Type definitions */
struct tinyrl {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tinyrl_printf(struct tinyrl *, char *, unsigned int);
void tinyrl_vt100_cursor_forward(struct tinyrl *this, unsigned count) {
  tinyrl_printf(this, "\x1b[%dC", count);
}


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

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

LLVM IR (-O0):
%struct.tinyrl = type { i32 }
@.str = [6 x i8] c"\1B[%dC\00"
define void @tinyrl_vt100_cursor_forward(%struct.tinyrl* %0, i32 %1) {
%3 = alloca %struct.tinyrl*
%4 = alloca i32
store %struct.tinyrl* %0, %struct.tinyrl** %3
store i32 %1, i32* %4
%5 = load %struct.tinyrl*, %struct.tinyrl** %3
%6 = load i32, i32* %4
%7 = call i32 @tinyrl_printf(%struct.tinyrl* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
%struct.tinyrl = type { i32 }
@.str = [6 x i8] c"\1B[%dC\00"
define void @tinyrl_vt100_cursor_forward(%struct.tinyrl* %0, i32 %1) {
%3 = tail call i32 @tinyrl_printf(%struct.tinyrl* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
double test_f2d(float f) {
  double d;
  d = f;
  return d;
}


x86 assembly (clang, -O0):
<test_f2d>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_f2d>:
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @test_f2d(float %0) {
%2 = alloca float
%3 = alloca double
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @test_f2d(float %0) {
%2 = fpext float %0 to double
ret double %2
}
long composite_diff(long x, long y) {
  long r = (x >> 16 & 0xFF) - (y >> 16 & 0xFF);
  long g = (x >> 8 & 0xFF) - (y >> 8 & 0xFF);
  long b = (x & 0xFF) - (y & 0xFF);
  return (r * r + g * g + b * b);
}


x86 assembly (clang, -O0):
<composite_diff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x10,%rax
and    $0xff,%rax
mov    -0x10(%rbp),%rcx
sar    $0x10,%rcx
and    $0xff,%rcx
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x8,%rax
and    $0xff,%rax
mov    -0x10(%rbp),%rcx
sar    $0x8,%rcx
and    $0xff,%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
and    $0xff,%rax
mov    -0x10(%rbp),%rcx
and    $0xff,%rcx
sub    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x20(%rbp),%rcx
add    %rcx,%rax
mov    -0x28(%rbp),%rcx
imul   -0x28(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<composite_diff>:
mov    %rsi,%rcx
mov    %rdi,%rdx
movzbl %dh,%esi
movzbl %dl,%eax
shr    $0x10,%edx
movzbl %dl,%edx
movzbl %ch,%edi
movzbl %cl,%r8d
shr    $0x10,%ecx
movzbl %cl,%ecx
sub    %rcx,%rdx
sub    %rdi,%rsi
sub    %r8,%rax
imul   %rdx,%rdx
imul   %rsi,%rsi
imul   %rax,%rax
add    %rsi,%rax
add    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @composite_diff(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%8 = load i64, i64* %3
%9 = ashr i64 %8, 16
%10 = and i64 %9, 255
%11 = load i64, i64* %4
%12 = ashr i64 %11, 16
%13 = and i64 %12, 255
%14 = sub nsw i64 %10, %13
store i64 %14, i64* %5
%15 = load i64, i64* %3
%16 = ashr i64 %15, 8
%17 = and i64 %16, 255
%18 = load i64, i64* %4
%19 = ashr i64 %18, 8
%20 = and i64 %19, 255
%21 = sub nsw i64 %17, %20
store i64 %21, i64* %6
%22 = load i64, i64* %3
%23 = and i64 %22, 255
%24 = load i64, i64* %4
%25 = and i64 %24, 255
%26 = sub nsw i64 %23, %25
store i64 %26, i64* %7
%27 = load i64, i64* %5
%28 = load i64, i64* %5
%29 = mul nsw i64 %27, %28
%30 = load i64, i64* %6
%31 = load i64, i64* %6
%32 = mul nsw i64 %30, %31
%33 = add nsw i64 %29, %32
%34 = load i64, i64* %7
%35 = load i64, i64* %7
%36 = mul nsw i64 %34, %35
%37 = add nsw i64 %33, %36
ret i64 %37
}

LLVM IR (-O2):
define i64 @composite_diff(i64 %0, i64 %1) {
%3 = lshr i64 %0, 16
%4 = and i64 %3, 255
%5 = lshr i64 %1, 16
%6 = and i64 %5, 255
%7 = sub nsw i64 %4, %6
%8 = lshr i64 %0, 8
%9 = and i64 %8, 255
%10 = lshr i64 %1, 8
%11 = and i64 %10, 255
%12 = sub nsw i64 %9, %11
%13 = and i64 %0, 255
%14 = and i64 %1, 255
%15 = sub nsw i64 %13, %14
%16 = mul nsw i64 %7, %7
%17 = mul nsw i64 %12, %12
%18 = mul nsw i64 %15, %15
%19 = add nuw nsw i64 %17, %18
%20 = add nuw nsw i64 %19, %16
ret i64 %20
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dapxsumkbn(int, double, double *, int);
int main() {
  double x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  double v = stdlib_strided_dapxsumkbn(N, 5.0, x, stride);
  printf("sum: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
movl   $0x4,-0x44(%rbp)
movl   $0x2,-0x48(%rbp)
mov    -0x44(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%edx
movsd  0xe93(%rip),%xmm0
call   1050 <stdlib_strided_dapxsumkbn@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
movsd  0xea5(%rip),%xmm0
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_dapxsumkbn@plt>
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [10 x i8] c"sum: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x double]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dapxsumkbn(i32 %6, double 5.000000e+00, double* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [10 x i8] c"sum: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dapxsumkbn(i32 4, double 5.000000e+00, double* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
int hashit(const char *source) {
  unsigned int x = 0;
  unsigned int c;
  while (c = *source++) {
    x = 3 * x + c;
  }
  return x;
}


x86 assembly (clang, -O0):
<hashit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     113c <hashit+0x3c>
imul   $0x3,-0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hashit+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashit>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <hashit+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,2),%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hashit+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hashit(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 3
%11 = add i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
char *strcpy(char *, char const *);
char *copy_string_result(char *dest, char const *src) {
  if (!src)
    return 0;
  return strcpy(dest, src);
}


x86 assembly (clang, -O0):
<copy_string_result>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1138 <copy_string_result+0x28>
movq   $0x0,-0x8(%rbp)
jmp    1149 <copy_string_result+0x39>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_string_result>:
push   %rbx
test   %rsi,%rsi
je     1120 <copy_string_result+0x10>
mov    %rdi,%rbx
call   1030 <strcpy@plt>
jmp    1122 <copy_string_result+0x12>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @copy_string_result(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* %1)
br label %6
6: ; preds = %2, %4
%7 = phi i8* [ %0, %4 ], [ null, %2 ]
ret i8* %7
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int read_quaddobl_target_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(241, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<read_quaddobl_target_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xf1,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_quaddobl_target_system>:
mov    $0xf1,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @read_quaddobl_target_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 241, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @read_quaddobl_target_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 241, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ check_intInput(int *);
int /*<<< orphan*/ print_address_of_variable(int);
int /*<<< orphan*/ print_address_of_variable_ptr(int *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int n;
  printf("Enter number: ");
  check_intInput(&n);
  printf("%p - Main address of n.\n", &n);
  print_address_of_variable(n);
  print_address_of_variable_ptr(&n);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1040 <check_intInput@plt>
lea    0xea2(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%edi
call   1030 <print_address_of_variable@plt>
lea    -0x8(%rbp),%rdi
call   1060 <print_address_of_variable_ptr@plt>
mov    0x2e50(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <check_intInput@plt>
lea    0xea8(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%edi
call   1030 <print_address_of_variable@plt>
mov    %rbx,%rdi
call   1060 <print_address_of_variable_ptr@plt>
mov    0x2e57(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Enter number: \00"
@.str.1 = [25 x i8] c"%p - Main address of n.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @check_intInput(i32* %2)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @print_address_of_variable(i32 %6)
%8 = call i32 @print_address_of_variable_ptr(i32* %2)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@.str = [15 x i8] c"Enter number: \00"
@.str.1 = [25 x i8] c"%p - Main address of n.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @check_intInput(i32* %1)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = call i32 @print_address_of_variable(i32 %6)
%8 = call i32 @print_address_of_variable_ptr(i32* %1)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}
void mult1(double *x, double y) {
  x[0] *= y;
  x[1] *= y;
}


x86 assembly (clang, -O0):
<mult1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mult1>:
movupd (%rdi),%xmm1
unpcklpd %xmm0,%xmm0
mulpd  %xmm1,%xmm0
movupd %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @mult1(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double*, double** %3
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = fmul double %8, %5
store double %9, double* %7
%10 = load double, double* %4
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = fmul double %13, %10
store double %14, double* %12
ret void
}

LLVM IR (-O2):
define void @mult1(double* nocapture %0, double %1) {
%3 = bitcast double* %0 to <2 x double>*
%4 = load <2 x double>, <2 x double>* %3
%5 = insertelement <2 x double> poison, double %1, i64 0
%6 = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> zeroinitializer
%7 = fmul <2 x double> %4, %6
%8 = bitcast double* %0 to <2 x double>*
store <2 x double> %7, <2 x double>* %8
ret void
}
void check_and_discard(struct state *s, int id) {}


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

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

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

LLVM IR (-O2):
%struct.state = type opaque
define void @check_and_discard(%struct.state* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_OSERR;
int /*<<< orphan*/ pfpanic(char *, unsigned short, unsigned short, char const *,
                           char const *, int, int, int /*<<< orphan*/);
void __pfpanic_mutex_unlock(unsigned short _syslog, unsigned short _verbose,
                            const char *_function_name, const char *_file_name,
                            int _line_number, int _errno) {
  pfpanic("Unable to unlock mutex", _syslog, _verbose, _function_name,
          _file_name, _line_number, _errno, EX_OSERR);
}


x86 assembly (clang, -O0):
<__pfpanic_mutex_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %si,%ax
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x2(%rbp),%si
mov    -0x4(%rbp),%dx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
mov    -0x20(%rbp),%r10d
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
lea    0xea2(%rip),%rdi
movzwl %si,%esi
movzwl %dx,%edx
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <pfpanic@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pfpanic_mutex_unlock>:
push   %rax
mov    %r9d,%r10d
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2eb8(%rip),%rdi
mov    (%rdi),%eax
lea    0xecf(%rip),%rdi
push   %rax
push   %r10
call   1030 <pfpanic@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Unable to unlock mutex\00"
@EX_OSERR = global i32 0
define void @__pfpanic_mutex_unlock(i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5) {
%7 = alloca i16
%8 = alloca i16
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
store i16 %0, i16* %7
store i16 %1, i16* %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i16, i16* %7
%14 = load i16, i16* %8
%15 = load i8*, i8** %9
%16 = load i8*, i8** %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = load i32, i32* @EX_OSERR
%20 = call i32 @pfpanic(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i16 zeroext %13, i16 zeroext %14, i8* %15, i8* %16, i32 %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Unable to unlock mutex\00"
@EX_OSERR = global i32 0
define void @__pfpanic_mutex_unlock(i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5) {
%7 = load i32, i32* @EX_OSERR
%8 = tail call i32 @pfpanic(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_outb(unsigned char, int);
void print(char *str) {
  while (1) {
    unsigned char ch;
    ch = *str;
    if (ch == '\0') {
      break;
    }
    __builtin_outb(ch, 0x1234);
    str += 1;
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jne    1137 <print+0x27>
jmp    1156 <print+0x46>
mov    $0x1234,%esi
movzbl -0x9(%rbp),%edi
call   1030 <__builtin_outb@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <print+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1138 <print+0x28>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movzbl %al,%edi
mov    $0x1234,%esi
call   1030 <__builtin_outb@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <print+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @print(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
br label %4
4: ; preds = %1, %11
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %4
br label %16
11: ; preds = %4
%12 = load i8, i8* %3
%13 = call i32 @__builtin_outb(i8 zeroext %12, i32 4660)
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8* %15, i8** %2
br label %4
16: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @print(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @__builtin_outb(i8 zeroext %5, i32 4660)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
long syscall1(long nr, long a1) {
  register long r0 asm("rax") = nr;
  register long r1 asm("rdi") = a1;
  asm volatile("syscall"
               : "=r"(r0)
               : "r"(r0), "r"(r1)
               : "rcx", "r11", "memory");
  return r0;
}


x86 assembly (clang, -O0):
<syscall1>:
push   %rbp
mov    %rsp,%rbp
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    -0x20(%rbp),%rdi
syscall
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @syscall1(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
store i64 %7, i64* %5
%8 = load i64, i64* %4
store i64 %8, i64* %6
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = call i64 asm sideeffect "syscall", "={rax},{rax},{rdi},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %9, i64 %10)
store i64 %11, i64* %5
%12 = load i64, i64* %5
ret i64 %12
}

LLVM IR (-O2):
define i64 @syscall1(i64 %0, i64 %1) {
%3 = tail call i64 asm sideeffect "syscall", "={rax},{rax},{rdi},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
int open_csi_device() {
  int fd;
  fd = open("/dev/CSI_dev", O_RDWR);
  return fd;
}


x86 assembly (clang, -O0):
<open_csi_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xed8(%rip),%rdi
call   1030 <open@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_csi_device>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <open@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/CSI_dev\00"
@O_RDWR = global i32 0
define i32 @open_csi_device() {
%1 = alloca i32
%2 = load i32, i32* @O_RDWR
%3 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/CSI_dev\00"
@O_RDWR = global i32 0
define i32 @open_csi_device() {
%1 = load i32, i32* @O_RDWR
%2 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
int getCounter() { return 1; }


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

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

LLVM IR (-O0):
define i32 @getCounter() {
ret i32 1
}

LLVM IR (-O2):
define i32 @getCounter() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void read_int(char *title, int *value) {
  printf(title);
  scanf("%d", value);
}


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

x86 assembly (clang, -O2):
<read_int>:
push   %rbx
mov    %rsi,%rbx
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scanf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @read_int(i8* nocapture %0, i32* %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) %0)
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ replaceWhitespace();
int /*<<< orphan*/ trimWhitespace();
main() {
  replaceWhitespace();
  trimWhitespace();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @replaceWhitespace()
%2 = tail call i32 (...) @trimWhitespace()
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool mp2vpicx_get_intravlc(const uint8_t *p_mp2vpicx) {
  return !!(p_mp2vpicx[7] & 0x8);
}


x86 assembly (clang, -O0):
<mp2vpicx_get_intravlc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vpicx_get_intravlc>:
mov    0x1c(%rdi),%eax
shr    $0x3,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @mp2vpicx_get_intravlc(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 7
%5 = load i32, i32* %4
%6 = and i32 %5, 8
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @mp2vpicx_get_intravlc(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 7
%3 = load i32, i32* %2
%4 = lshr i32 %3, 3
%5 = and i32 %4, 1
ret i32 %5
}
char *create_random_file() { return "fff"; }


x86 assembly (clang, -O0):
<create_random_file>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_random_file>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"fff\00"
define i8* @create_random_file() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"fff\00"
define i8* @create_random_file() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ UtilFree(char *);
void GlbspFree(const char *str) {
  if (!str)
    return;
  UtilFree((char *)str);
}


x86 assembly (clang, -O0):
<GlbspFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <GlbspFree+0x1c>
jmp    1135 <GlbspFree+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <UtilFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GlbspFree>:
test   %rdi,%rdi
je     111a <GlbspFree+0xa>
jmp    1030 <UtilFree@plt>
ret

LLVM IR (-O0):
define void @GlbspFree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @UtilFree(i8* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @GlbspFree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @UtilFree(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ I2C_SLAVE;
scalar_t__ ioctl(int, int /*<<< orphan*/, unsigned char);
int i2c_set_address(int device, unsigned char address) {
  if (ioctl(device, I2C_SLAVE, address) < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<i2c_set_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
movzbl -0x9(%rbp),%edx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    114c <i2c_set_address+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <i2c_set_address+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_set_address>:
push   %rax
mov    %esi,%edx
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
@I2C_SLAVE = global i32 0
define i32 @i2c_set_address(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %4
store i8 %1, i8* %5
%6 = load i32, i32* %4
%7 = load i32, i32* @I2C_SLAVE
%8 = load i8, i8* %5
%9 = call i64 @ioctl(i32 %6, i32 %7, i8 zeroext %8)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@I2C_SLAVE = global i32 0
define i32 @i2c_set_address(i32 %0, i8 zeroext %1) {
%3 = load i32, i32* @I2C_SLAVE
%4 = tail call i64 @ioctl(i32 %0, i32 %3, i8 zeroext %1)
%5 = ashr i64 %4, 63
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ LCD_Write_COM(int);
int /*<<< orphan*/ LCD_Write_COM_DATA(int, int);
void LCD_Disp_Filp() {
  LCD_Write_COM_DATA(0x11, 0x6068);
  LCD_Write_COM(0x22);
}


x86 assembly (clang, -O0):
<LCD_Disp_Filp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x11,%edi
mov    $0x6068,%esi
call   1030 <LCD_Write_COM_DATA@plt>
mov    $0x22,%edi
call   1040 <LCD_Write_COM@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_Disp_Filp>:
push   %rax
mov    $0x11,%edi
mov    $0x6068,%esi
call   1030 <LCD_Write_COM_DATA@plt>
mov    $0x22,%edi
pop    %rax
jmp    1040 <LCD_Write_COM@plt>

LLVM IR (-O0):
define void @LCD_Disp_Filp() {
%1 = call i32 @LCD_Write_COM_DATA(i32 17, i32 24680)
%2 = call i32 @LCD_Write_COM(i32 34)
ret void
}

LLVM IR (-O2):
define void @LCD_Disp_Filp() {
%1 = tail call i32 @LCD_Write_COM_DATA(i32 17, i32 24680)
%2 = tail call i32 @LCD_Write_COM(i32 34)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foobar(char *);
void func2(void) {
  int i;
  for (i = 0; i < 10; i++)
    foobar("Hello world");
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1143 <func2+0x33>
lea    0xed0(%rip),%rdi
call   1030 <foobar@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <func2+0xf>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello world\00"
define void @func2() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 @foobar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello world\00"
define void @func2() {
%1 = tail call i32 @foobar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @foobar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @foobar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @foobar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @foobar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @foobar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @foobar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @foobar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @foobar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @foobar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int foo();
int /*<<< orphan*/ printf(char *, int);
void C() { printf("A: %d\n", foo()); }


x86 assembly (clang, -O0):
<C>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <foo@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"A: %d\0A\00"
define void @C() {
%1 = call i32 (...) @foo()
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

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


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <collision@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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


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

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

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

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