xunge/DecIR huggingface dataset:
void arraytest() {
  int array[10000], i;
  for (i = 0; i < 10000; ++i) {
    array[i] = i * i;
  }
}


x86 assembly (clang, -O0):
<arraytest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9bd0,%rsp
movl   $0x0,-0x9c44(%rbp)
cmpl   $0x2710,-0x9c44(%rbp)
jge    1154 <arraytest+0x54>
mov    -0x9c44(%rbp),%ecx
imul   -0x9c44(%rbp),%ecx
movslq -0x9c44(%rbp),%rax
mov    %ecx,-0x9c40(%rbp,%rax,4)
mov    -0x9c44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c44(%rbp)
jmp    1115 <arraytest+0x15>
add    $0x9bd0,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @arraytest() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ twoDsim_simulateFor(double);
void skipFor(double t) { twoDsim_simulateFor(t); }


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

x86 assembly (clang, -O2):
<skipFor>:
jmp    1030 <twoDsim_simulateFor@plt>

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

LLVM IR (-O2):
define void @skipFor(double %0) {
%2 = tail call i32 @twoDsim_simulateFor(double %0)
ret void
}
/* Variables and functions */
scalar_t__ isASpace(char);
int is_empty(char *text) {
  int i = 0;
  while (isASpace(text[i]))
    i++;
  if (text[i] != '\0')
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isASpace@plt>
cmp    $0x0,%rax
je     114c <is_empty+0x3c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <is_empty+0x13>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     116d <is_empty+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    1174 <is_empty+0x64>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_empty>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0xffffffffffffffff,%rbx
xchg   %ax,%ax
movsbl 0x1(%r14,%rbx,1),%edi
call   1030 <isASpace@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1120 <is_empty+0x10>
mov    %ebx,%ecx
xor    %eax,%eax
cmpb   $0x0,(%r14,%rcx,1)
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @is_empty(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %8, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = tail call i64 @isASpace(i8 signext %5)
%7 = icmp eq i64 %6, 0
%8 = add nuw i64 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
%10 = and i64 %3, 4294967295
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
%14 = zext i1 %13 to i32
ret i32 %14
}
void gtk_accel_group_activate() {}


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

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

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

LLVM IR (-O2):
define void @gtk_accel_group_activate() {
ret void
}
/* Variables and functions */
scalar_t__ gethostname(char *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
void SMB_Get_My_Name(char *name, int len) {
  int loc;
  if (gethostname(name, len) < 0) {
    strncpy(name, "unknown", len);
  }
}


x86 assembly (clang, -O0):
<SMB_Get_My_Name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <gethostname@plt>
cmp    $0x0,%rax
jge    1158 <SMB_Get_My_Name+0x38>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xead(%rip),%rsi
call   1030 <strncpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SMB_Get_My_Name>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <gethostname@plt>
test   %rax,%rax
js     1139 <SMB_Get_My_Name+0x19>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <strncpy@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"unknown\00"
define void @SMB_Get_My_Name(i8* %0, i32 %1) {
%3 = tail call i64 @gethostname(i8* %0, i32 %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @strncpy(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int func0(int);
int func4(int a) { return func0(a) + a; }


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

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

LLVM IR (-O0):
define i32 @func4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @func0(i32 %3)
%5 = load i32, i32* %2
%6 = add nsw i32 %4, %5
ret i32 %6
}

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

/* Variables and functions */
int /*<<< orphan*/ _mm_max_pi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 __attribute__((no, unused)) test(__m64 s1, __m64 s2) {
  return _mm_max_pi16(s1, s2);
}


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <_mm_max_pi16@plt>

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

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_max_pi16(i32 %0, i32 %1)
ret i32 %3
}
void glmCopyVector3d(const double source[3], double target[3]) {
  target[0] = source[0];
  target[1] = source[1];
  target[2] = source[2];
}


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

x86 assembly (clang, -O2):
<glmCopyVector3d>:
movsd  (%rdi),%xmm0
movsd  %xmm0,(%rsi)
movsd  0x8(%rdi),%xmm0
movsd  %xmm0,0x8(%rsi)
movsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x10(%rsi)
ret

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

LLVM IR (-O2):
define void @glmCopyVector3d(double* nocapture %0, double* nocapture writeonly %1) {
%3 = load double, double* %0
store double %3, double* %1
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %1, i64 1
store double %5, double* %6
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 2
store double %8, double* %9
ret void
}
/* Type definitions */
struct sdfe4 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sdfe4_clear_channel(struct sdfe4 *);
int sdfe4_setup_chan(int, struct sdfe4 *);
int sdfe4_setup_channel(int ch, struct sdfe4 *hwdev) {
  sdfe4_clear_channel(hwdev);
  return sdfe4_setup_chan(ch, hwdev);
}


x86 assembly (clang, -O0):
<sdfe4_setup_channel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <sdfe4_clear_channel@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <sdfe4_setup_chan@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sdfe4 = type { i32 }
define i32 @sdfe4_setup_channel(i32 %0, %struct.sdfe4* %1) {
%3 = alloca i32
%4 = alloca %struct.sdfe4*
store i32 %0, i32* %3
store %struct.sdfe4* %1, %struct.sdfe4** %4
%5 = load %struct.sdfe4*, %struct.sdfe4** %4
%6 = call i32 @sdfe4_clear_channel(%struct.sdfe4* %5)
%7 = load i32, i32* %3
%8 = load %struct.sdfe4*, %struct.sdfe4** %4
%9 = call i32 @sdfe4_setup_chan(i32 %7, %struct.sdfe4* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.sdfe4 = type { i32 }
define i32 @sdfe4_setup_channel(i32 %0, %struct.sdfe4* %1) {
%3 = tail call i32 @sdfe4_clear_channel(%struct.sdfe4* %1)
%4 = tail call i32 @sdfe4_setup_chan(i32 %0, %struct.sdfe4* %1)
ret i32 %4
}
/* Variables and functions */
int snprintf(char *, int, char *, int);
int uwsgi_num2str2(int num, char *ptr) { return snprintf(ptr, 11, "%d", num); }


x86 assembly (clang, -O0):
<uwsgi_num2str2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0xb,%esi
lea    0xece(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_num2str2>:
mov    %edi,%ecx
lea    0xee7(%rip),%rdx
mov    %rsi,%rdi
mov    $0xb,%esi
jmp    1030 <snprintf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @uwsgi_num2str2(i32 %0, i8* %1) {
%3 = tail call i32 @snprintf(i8* %1, i32 11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %3
}
/* Variables and functions */
double fabs(double);
double powf(double, double);
double Raise(double b, double e) {
  if (b > 0)
    return powf(b, e);
  else
    return -powf(fabs(b), e);
}


x86 assembly (clang, -O0):
<Raise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <Raise+0x3d>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <powf@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1183 <Raise+0x73>
movsd  -0x10(%rbp),%xmm0
movaps 0xea7(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <powf@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Raise>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jbe    111f <Raise+0xf>
jmp    1030 <powf@plt>
push   %rax
andpd  0xed8(%rip),%xmm0
call   1030 <powf@plt>
xorpd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @Raise(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = fcmp ogt double %6, 0.000000e+00
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load double, double* %4
%10 = load double, double* %5
%11 = call double @powf(double %9, double %10)
store double %11, double* %3
br label %18
12: ; preds = %2
%13 = load double, double* %4
%14 = call double @llvm.fabs.f64(double %13)
%15 = load double, double* %5
%16 = call double @powf(double %14, double %15)
%17 = fneg double %16
store double %17, double* %3
br label %18
18: ; preds = %12, %8
%19 = load double, double* %3
ret double %19
}

LLVM IR (-O2):
define double @Raise(double %0, double %1) {
%3 = fcmp ogt double %0, 0.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call double @powf(double %0, double %1)
br label %10
6: ; preds = %2
%7 = tail call double @llvm.fabs.f64(double %0)
%8 = tail call double @powf(double %7, double %1)
%9 = fneg double %8
br label %10
10: ; preds = %6, %4
%11 = phi double [ %5, %4 ], [ %9, %6 ]
ret double %11
}
void rop3_85_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = ~*D;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_85_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_85_0_0>:
notb   (%rdi)
ret

LLVM IR (-O0):
define void @rop3_85_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = xor i32 %10, -1
%12 = trunc i32 %11 to i8
store i8 %12, i8* %7
%13 = load i8, i8* %7
%14 = load i8*, i8** %4
store i8 %13, i8* %14
ret void
}

LLVM IR (-O2):
define void @rop3_85_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, -1
store i8 %5, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ Status;

/* Variables and functions */
Status IceInitThreads() { return (0); }


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

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

LLVM IR (-O0):
define i32 @IceInitThreads() {
ret i32 0
}

LLVM IR (-O2):
define i32 @IceInitThreads() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void *busy(void *ptr) {
  puts("Hello World");
  return NULL;
}


x86 assembly (clang, -O0):
<busy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
define i8* @busy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define noalias i8* @busy(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
void __DELETE_java_lang_SecurityManager(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_lang_SecurityManager(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void ARGBToI420() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToI420() {
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long qtime_current_milli(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  long time = (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
  return time;
}


x86 assembly (clang, -O0):
<qtime_current_milli>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qtime_current_milli>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0x3e8,%rax,%rcx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @qtime_current_milli() {
%1 = alloca %struct.timeval
%2 = alloca i64
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %6, %9
%11 = sext i32 %10 to i64
store i64 %11, i64* %2
%12 = load i64, i64* %2
ret i64 %12
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @qtime_current_milli() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
%11 = sext i32 %10 to i64
ret i64 %11
}
int test() {
  int a = 2;
  int b = 2;
  int res = a * b;
  if (res == 4)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jne    1132 <test+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1139 <test+0x39>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test() {
ret i32 0
}
int rho_ruby_unpack_byte_array(unsigned long array_value, unsigned char *buf,
                               int max_length) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @rho_ruby_unpack_byte_array(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @rho_ruby_unpack_byte_array(i64 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *p = malloc(size);
  if (p == NULL) {
    if (size == 0)
      return xmalloc(1u);
    abort();
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1179 <xmalloc+0x49>
cmpq   $0x0,-0x10(%rbp)
jne    1172 <xmalloc+0x42>
mov    $0x1,%edi
call   1040 <xmalloc@plt>
mov    %rax,-0x8(%rbp)
jmp    1181 <xmalloc+0x51>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
jne    1142 <xmalloc+0x22>
test   %rbx,%rbx
jne    1144 <xmalloc+0x24>
mov    $0x1,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1144 <xmalloc+0x24>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = icmp eq i64 %0, 0
br i1 %5, label %6, label %11
6: ; preds = %4
%7 = tail call dereferenceable_or_null(1) i8* @malloc(i64 1)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = tail call i32 (...) @abort()
unreachable
11: ; preds = %4
%12 = tail call i32 (...) @abort()
unreachable
13: ; preds = %6, %1
%14 = phi i8* [ %2, %1 ], [ %7, %6 ]
ret i8* %14
}
int compare_ushort(const void *s1, const void *s2) {
  unsigned short a, b;
  a = (long)s1;
  b = (long)s2;
  return (a > b) - (a < b);
}


x86 assembly (clang, -O0):
<compare_ushort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %ax,-0x12(%rbp)
mov    -0x10(%rbp),%rax
mov    %ax,-0x14(%rbp)
movzwl -0x12(%rbp),%eax
movzwl -0x14(%rbp),%ecx
cmp    %ecx,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
movzwl -0x12(%rbp),%ecx
movzwl -0x14(%rbp),%edx
cmp    %edx,%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_ushort>:
movzwl %di,%ecx
movzwl %si,%edx
xor    %eax,%eax
cmp    %edx,%ecx
seta   %al
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @compare_ushort(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i16
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %7 to i64
%9 = trunc i64 %8 to i16
store i16 %9, i16* %5
%10 = load i8*, i8** %4
%11 = ptrtoint i8* %10 to i64
%12 = trunc i64 %11 to i16
store i16 %12, i16* %6
%13 = load i16, i16* %5
%14 = zext i16 %13 to i32
%15 = load i16, i16* %6
%16 = zext i16 %15 to i32
%17 = icmp sgt i32 %14, %16
%18 = zext i1 %17 to i32
%19 = load i16, i16* %5
%20 = zext i16 %19 to i32
%21 = load i16, i16* %6
%22 = zext i16 %21 to i32
%23 = icmp slt i32 %20, %22
%24 = zext i1 %23 to i32
%25 = sub nsw i32 %18, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @compare_ushort(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint i8* %1 to i64
%6 = trunc i64 %5 to i32
%7 = and i32 %4, 65535
%8 = and i32 %6, 65535
%9 = icmp ugt i32 %7, %8
%10 = zext i1 %9 to i32
%11 = icmp ult i32 %7, %8
%12 = sext i1 %11 to i32
%13 = add nsw i32 %12, %10
ret i32 %13
}
void free_array_slow(double **m, int dim) {
  int i;
  for (i = 0; i < dim; i++)
    free(m[i]);
  free(m);
}


x86 assembly (clang, -O0):
<free_array_slow>:
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    1151 <free_array_slow+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_array_slow+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_array_slow>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_array_slow+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_array_slow+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_array_slow(double** %0, i32 %1) {
%3 = alloca double**
%4 = alloca i32
%5 = alloca i32
store double** %0, double*** %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 double**, double*** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double*, double** %11, i64 %13
%15 = load double*, double** %14
%16 = bitcast double* %15 to i8*
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 = load double**, double*** %3
%22 = bitcast double** %21 to i8*
ret void
}

LLVM IR (-O2):
define void @free_array_slow(double** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double*, double** %0, i64 %7
%9 = bitcast double** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast double** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  printf("uint64_t : %d\n", sizeof(uint64_t));
  printf("long: %d\n", sizeof(long));
  printf("unsigned long: %d\n", sizeof(unsigned long));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"uint64_t : %d\0A\00"
@.str.1 = [10 x i8] c"long: %d\0A\00"
@.str.2 = [19 x i8] c"unsigned long: %d\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 8)
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"uint64_t : %d\0A\00"
@.str.1 = [10 x i8] c"long: %d\0A\00"
@.str.2 = [19 x i8] c"unsigned long: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 8)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 8)
ret i32 0
}
/* Variables and functions */
char *quotearg_n(int /*<<< orphan*/, char const *);
char *quotearg(char const *arg) { return quotearg_n(0, arg); }


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

x86 assembly (clang, -O2):
<quotearg>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <quotearg_n@plt>

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

LLVM IR (-O2):
define i8* @quotearg(i8* %0) {
%2 = tail call i8* @quotearg_n(i32 0, i8* %0)
ret i8* %2
}
/* Type definitions */
struct cmd_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
struct cmd_struct *get_builtin(char const *);
int /*<<< orphan*/ run_builtin(struct cmd_struct *, int, char const **);
void handle_builtin(int argc, const char **argv) {
  const char *cmd;
  struct cmd_struct *builtin;
  cmd = argv[0];
  builtin = get_builtin(cmd);
  if (builtin) {
    exit(run_builtin(builtin, argc, argv));
  }
}


x86 assembly (clang, -O0):
<handle_builtin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <get_builtin@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1179 <handle_builtin+0x49>
mov    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <run_builtin@plt>
mov    %eax,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_builtin>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    (%rsi),%rdi
call   1030 <get_builtin@plt>
test   %rax,%rax
jne    114c <handle_builtin+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rax,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1040 <run_builtin@plt>
mov    %eax,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.cmd_struct = type { i32 }
define void @handle_builtin(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca %struct.cmd_struct*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = call %struct.cmd_struct* @get_builtin(i8* %10)
store %struct.cmd_struct* %11, %struct.cmd_struct** %6
%12 = load %struct.cmd_struct*, %struct.cmd_struct** %6
%13 = icmp ne %struct.cmd_struct* %12, null
br i1 %13, label %14, label %20
14: ; preds = %2
%15 = load %struct.cmd_struct*, %struct.cmd_struct** %6
%16 = load i32, i32* %3
%17 = load i8**, i8*** %4
%18 = call i32 @run_builtin(%struct.cmd_struct* %15, i32 %16, i8** %17)
%19 = call i32 @exit(i32 %18)
unreachable
20: ; preds = %2
ret void
}

LLVM IR (-O2):
%struct.cmd_struct = type { i32 }
define void @handle_builtin(i32 %0, i8** %1) {
%3 = load i8*, i8** %1
%4 = tail call %struct.cmd_struct* @get_builtin(i8* %3)
%5 = icmp eq %struct.cmd_struct* %4, null
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @run_builtin(%struct.cmd_struct* %4, i32 %0, i8** %1)
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage:\n");
  printf("	pasc [-ehjqu] [-c ipv6_addr] [-l name]\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [41 x i8] c"\09pasc [-ehjqu] [-c ipv6_addr] [-l name]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.2 = [40 x i8] c"\09pasc [-ehjqu] [-c ipv6_addr] [-l name]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.2, i64 0, i64 0))
ret void
}
void opal_atomic_mb(void) { (*((void (*)(void))(0xffff0fa0)))(); }


x86 assembly (clang, -O0):
<opal_atomic_mb>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffff0fa0,%eax
call   *%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opal_atomic_mb>:
mov    $0xffff0fa0,%eax
jmp    *%rax

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

LLVM IR (-O2):
define void @opal_atomic_mb() {
tail call void inttoptr (i64 4294905760 to void ()*)()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(int, int, int, int);
int /*<<< orphan*/ st_usleep(int);
void *unlock(void *p) {
  bar(2, 4, 6, 8);
  float f = 1234.5678;
  st_usleep(1);
}


x86 assembly (clang, -O0):
<unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x2,%edi
mov    $0x4,%esi
mov    $0x6,%edx
mov    $0x8,%ecx
call   1030 <bar@plt>
movss  0xeb3(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    $0x1,%edi
call   1040 <st_usleep@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlock>:
push   %rax
mov    $0x2,%edi
mov    $0x4,%esi
mov    $0x6,%edx
mov    $0x8,%ecx
call   1030 <bar@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <st_usleep@plt>

LLVM IR (-O0):
define i8* @unlock(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %3
%5 = call i32 @bar(i32 2, i32 4, i32 6, i32 8)
store float 0x40934A4560000000, float* %4
%6 = call i32 @st_usleep(i32 1)
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @unlock(i8* nocapture readnone %0) {
%2 = tail call i32 @bar(i32 2, i32 4, i32 6, i32 8)
%3 = tail call i32 @st_usleep(i32 1)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("haha\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"haha\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char const *);
int scanf(char *, int *);
int promptValue(const char *msg, int *result) {
  puts(msg);
  int retVal = scanf("%d", result);
  return (retVal == 1) ? 0 : 1;
}


x86 assembly (clang, -O0):
<promptValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
mov    -0x10(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1040 <scanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<promptValue>:
push   %rbx
mov    %rsi,%rbx
call   1030 <puts@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @promptValue(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i8*, i8** %3
%7 = call i32 @puts(i8* %6)
%8 = load i32*, i32** %4
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 1
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 0, i32 1
ret i32 %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @promptValue(i8* nocapture %0, i32* %1) {
%3 = tail call i32 @puts(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)
%5 = icmp ne i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ iowrite8(int, int);
void irq_remap(void) {
  iowrite8(0x20, 0x11);
  iowrite8(0xA0, 0x11);
  iowrite8(0x21, 0x20);
  iowrite8(0xA1, 0x28);
  iowrite8(0x21, 0x04);
  iowrite8(0xA1, 0x02);
  iowrite8(0x21, 0x01);
  iowrite8(0xA1, 0x01);
  iowrite8(0x21, 0x0);
  iowrite8(0xA1, 0x0);
}


x86 assembly (clang, -O0):
<irq_remap>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <iowrite8@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <iowrite8@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <iowrite8@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <iowrite8@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <iowrite8@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <iowrite8@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <iowrite8@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <iowrite8@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <iowrite8@plt>
mov    $0xa1,%edi
xor    %esi,%esi
call   1030 <iowrite8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_remap>:
push   %rax
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <iowrite8@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <iowrite8@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <iowrite8@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <iowrite8@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <iowrite8@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <iowrite8@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <iowrite8@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <iowrite8@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <iowrite8@plt>
mov    $0xa1,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <iowrite8@plt>

LLVM IR (-O0):
define void @irq_remap() {
%1 = call i32 @iowrite8(i32 32, i32 17)
%2 = call i32 @iowrite8(i32 160, i32 17)
%3 = call i32 @iowrite8(i32 33, i32 32)
%4 = call i32 @iowrite8(i32 161, i32 40)
%5 = call i32 @iowrite8(i32 33, i32 4)
%6 = call i32 @iowrite8(i32 161, i32 2)
%7 = call i32 @iowrite8(i32 33, i32 1)
%8 = call i32 @iowrite8(i32 161, i32 1)
%9 = call i32 @iowrite8(i32 33, i32 0)
%10 = call i32 @iowrite8(i32 161, i32 0)
ret void
}

LLVM IR (-O2):
define void @irq_remap() {
%1 = tail call i32 @iowrite8(i32 32, i32 17)
%2 = tail call i32 @iowrite8(i32 160, i32 17)
%3 = tail call i32 @iowrite8(i32 33, i32 32)
%4 = tail call i32 @iowrite8(i32 161, i32 40)
%5 = tail call i32 @iowrite8(i32 33, i32 4)
%6 = tail call i32 @iowrite8(i32 161, i32 2)
%7 = tail call i32 @iowrite8(i32 33, i32 1)
%8 = tail call i32 @iowrite8(i32 161, i32 1)
%9 = tail call i32 @iowrite8(i32 33, i32 0)
%10 = tail call i32 @iowrite8(i32 161, i32 0)
ret void
}
/* Variables and functions */
int stk_named_main(int /*<<< orphan*/, int, char **);
int main(int argc, char *argv[]) { return stk_named_main(0, argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
mov    %rsi,%rdx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <stk_named_main@plt>

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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @stk_named_main(i32 0, i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @stk_named_main(i32 0, i32 %0, i8** %1)
ret i32 %3
}
/* Type definitions */
struct sk_measurement {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sk_m_print_const(struct sk_measurement *,
                                    int /*<<< orphan*/);
void sk_m_print(struct sk_measurement *m) { sk_m_print_const(m, 0); }


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

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

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

LLVM IR (-O2):
%struct.sk_measurement = type { i32 }
define void @sk_m_print(%struct.sk_measurement* %0) {
%2 = tail call i32 @sk_m_print_const(%struct.sk_measurement* %0, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
int _xml_wfgetc(FILE *fp_in, FILE *fp_out) {
  int c;
  c = fgetc(fp_in);
  if (c != EOF) {
    fputc(c, fp_out);
  }
  return (c);
}


x86 assembly (clang, -O0):
<_xml_wfgetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2ea2(%rip),%rcx
cmp    (%rcx),%eax
je     115a <_xml_wfgetc+0x3a>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <fputc@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_xml_wfgetc>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    0x2eb4(%rip),%rax
cmp    (%rax),%ebp
je     1142 <_xml_wfgetc+0x22>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @_xml_wfgetc(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** %3
%7 = call i32 @fgetc(i32* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* %5
%13 = load i32*, i32** %4
%14 = call i32 @fputc(i32 %12, i32* %13)
br label %15
15: ; preds = %11, %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @_xml_wfgetc(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @fgetc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @fputc(i32 %3, i32* %1)
br label %8
8: ; preds = %6, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __NR_symlinkat;
scalar_t__ syscall(int /*<<< orphan*/, char const *, int, char const *);
int xsymlinkat(const char *target, int newdirfd, const char *linkpath) {
  int ret = (int)syscall(__NR_symlinkat, target, newdirfd, linkpath);
  if (ret == -1) {
    ;
  }
  return ret;
}


x86 assembly (clang, -O0):
<xsymlinkat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <syscall@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    114e <xsymlinkat+0x3e>
jmp    114e <xsymlinkat+0x3e>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsymlinkat>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_symlinkat = global i32 0
define i32 @xsymlinkat(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i32, i32* @__NR_symlinkat
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = call i64 @syscall(i32 %8, i8* %9, i32 %10, i8* %11)
%13 = trunc i64 %12 to i32
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %17
16: ; preds = %3
br label %17
17: ; preds = %16, %3
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
@__NR_symlinkat = global i32 0
define i32 @xsymlinkat(i8* %0, i32 %1, i8* %2) {
%4 = load i32, i32* @__NR_symlinkat
%5 = tail call i64 @syscall(i32 %4, i8* %0, i32 %1, i8* %2)
%6 = trunc i64 %5 to i32
ret i32 %6
}