xunge/DecIR huggingface dataset:
int Q_strcmp(char *s1, char *s2) {
  while (1) {
    if (*s1 != *s2)
      return -1;
    if (!*s1)
      return 0;
    s1++;
    s2++;
  }
  return -1;
}


x86 assembly (clang, -O0):
<Q_strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     112e <Q_strcmp+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <Q_strcmp+0x64>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1147 <Q_strcmp+0x47>
movl   $0x0,-0x4(%rbp)
jmp    1164 <Q_strcmp+0x64>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <Q_strcmp+0xc>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_strcmp>:
mov    (%rdi),%cl
mov    $0xffffffff,%eax
cmp    (%rsi),%cl
jne    1124 <Q_strcmp+0x24>
mov    $0x1,%edx
test   %cl,%cl
je     1125 <Q_strcmp+0x25>
movzbl (%rdi,%rdx,1),%ecx
lea    0x1(%rdx),%r8
cmp    (%rsi,%rdx,1),%cl
mov    %r8,%rdx
je     1110 <Q_strcmp+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Q_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %17, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %6, %2
%18 = phi i32 [ -1, %2 ], [ 0, %6 ], [ -1, %11 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  int a[8] __attribute__((unused));
  fprintf(stderr, "CheCKpOInT\n");
#pragma acc declare present(a)
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"CheCKpOInT\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int SplitConstraintPenalty(int nOn1, int nOff1, int nOn2, int nOff2) {
  return (nOn1 + nOff2 < nOn2 + nOff1 ? (nOn1 < nOff2 ? nOn1 : nOff2)
                                      : (nOn2 < nOff1 ? nOn2 : nOff1));
}


x86 assembly (clang, -O0):
<SplitConstraintPenalty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    114c <SplitConstraintPenalty+0x4c>
mov    -0x4(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    113b <SplitConstraintPenalty+0x3b>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <SplitConstraintPenalty+0x41>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    116f <SplitConstraintPenalty+0x6f>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1163 <SplitConstraintPenalty+0x63>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1169 <SplitConstraintPenalty+0x69>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SplitConstraintPenalty>:
mov    %esi,%eax
lea    (%rcx,%rdi,1),%esi
cmp    %ecx,%edi
cmovl  %edi,%ecx
lea    (%rdx,%rax,1),%edi
cmp    %eax,%edx
cmovl  %edx,%eax
cmp    %edi,%esi
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @SplitConstraintPenalty(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %3, %0
%6 = add nsw i32 %2, %1
%7 = icmp slt i32 %5, %6
%8 = icmp slt i32 %0, %3
%9 = select i1 %8, i32 %0, i32 %3
%10 = icmp slt i32 %2, %1
%11 = select i1 %10, i32 %2, i32 %1
%12 = select i1 %7, i32 %9, i32 %11
ret i32 %12
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ isPrime(int);
int right_trunc(int32_t right) {
  for (; right; right /= 10) {
    if (!isPrime(right))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<right_trunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115a <right_trunc+0x4a>
mov    -0x8(%rbp),%edi
call   1030 <isPrime@plt>
cmp    $0x0,%eax
jne    1142 <right_trunc+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1161 <right_trunc+0x51>
jmp    1147 <right_trunc+0x37>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    111b <right_trunc+0xb>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<right_trunc>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebx
test   %edi,%edi
je     1150 <right_trunc+0x40>
mov    %edi,%ebp
xchg   %ax,%ax
mov    %ebp,%edi
call   1030 <isPrime@plt>
test   %eax,%eax
je     114e <right_trunc+0x3e>
movslq %ebp,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    $0x9,%ebp
cmp    $0x12,%ebp
mov    %eax,%ebp
ja     1120 <right_trunc+0x10>
jmp    1150 <right_trunc+0x40>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @right_trunc(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %7
%4 = phi i32 [ %8, %7 ], [ %0, %1 ]
%5 = tail call i32 @isPrime(i32 %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = sdiv i32 %4, 10
%9 = add i32 %4, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %3
11: ; preds = %3, %7, %1
%12 = phi i32 [ 1, %1 ], [ 1, %7 ], [ 0, %3 ]
ret i32 %12
}
double r19(void *x) { return *(double *)(x + 32749); }


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

x86 assembly (clang, -O2):
<r19>:
movsd  0x7fed(%rdi),%xmm0
ret

LLVM IR (-O0):
define double @r19(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr i8, i8* %3, i64 32749
%5 = bitcast i8* %4 to double*
%6 = load double, double* %5
ret double %6
}

LLVM IR (-O2):
define double @r19(i8* nocapture %0) {
%2 = getelementptr i8, i8* %0, i64 32749
%3 = bitcast i8* %2 to double*
%4 = load double, double* %3
ret double %4
}
float test_floorf(float x) { return __builtin_floorf(x); }


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

x86 assembly (clang, -O2):
<test_floorf>:
jmp    1030 <floorf@plt>

LLVM IR (-O0):
define float @test_floorf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.floor.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @test_floorf(float %0) {
%2 = tail call float @llvm.floor.f32(float %0)
ret float %2
}
int transition(char ch1, char ch2) {}


x86 assembly (clang, -O0):
<transition>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @transition(i8 signext %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @transition(i8 signext %0, i8 signext %1) {
ret i32 undef
}
unsigned long foo(unsigned long base, unsigned int val) {
  return base + (val & 0x80000001);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
and    $0x80000001,%ecx
mov    %ecx,%ecx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
and    $0x80000001,%esi
lea    (%rsi,%rdi,1),%rax
ret

LLVM IR (-O0):
define i64 @foo(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = and i32 %6, -2147483647
%8 = zext i32 %7 to i64
%9 = add i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @foo(i64 %0, i32 %1) {
%3 = and i32 %1, -2147483647
%4 = zext i32 %3 to i64
%5 = add i64 %4, %0
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void mailimf_no_fold_literal_free(char *nfl) { free(nfl); }


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

x86 assembly (clang, -O2):
<mailimf_no_fold_literal_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @mailimf_no_fold_literal_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int pmi_simple_client_lookup_name(struct pmi_simple_client *pmi,
                                  const char *service_name, char *port) {
  return -1;
}


x86 assembly (clang, -O0):
<pmi_simple_client_lookup_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.pmi_simple_client = type opaque
define i32 @pmi_simple_client_lookup_name(%struct.pmi_simple_client* %0, i8* %1, i8* %2) {
%4 = alloca %struct.pmi_simple_client*
%5 = alloca i8*
%6 = alloca i8*
store %struct.pmi_simple_client* %0, %struct.pmi_simple_client** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret i32 -1
}

LLVM IR (-O2):
%struct.pmi_simple_client = type opaque
define i32 @pmi_simple_client_lookup_name(%struct.pmi_simple_client* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 -1
}
void ff_hevc_put_hevc_uni_qpel_h64_8_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_h64_8_avx2() {
ret void
}
/* Variables and functions */
unsigned long HSI2RGB99(unsigned long);
unsigned long hsi2rgb(unsigned long hsn) { return HSI2RGB99(hsn); }


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

x86 assembly (clang, -O2):
<hsi2rgb>:
jmp    1030 <HSI2RGB99@plt>

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

LLVM IR (-O2):
define i64 @hsi2rgb(i64 %0) {
%2 = tail call i64 @HSI2RGB99(i64 %0)
ret i64 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ x;
};
typedef TYPE_1__ XButtonPressedEvent;

/* Variables and functions */
int get_XButtonPressedEvent_x(void *_p) {
  return (int)((XButtonPressedEvent *)_p)->x;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XButtonPressedEvent_x(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XButtonPressedEvent_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ scanf(char *, char *);
int main(int argc, char *argv[]) {
  char arr[400];
  while (scanf("%399s", arr) != EOF) {
    printf("%s\n", arr);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1a0(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <scanf@plt>
mov    0x2e95(%rip),%rcx
cmp    (%rcx),%rax
je     1174 <main+0x54>
lea    -0x1a0(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x198,%rsp
lea    0xecb(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    0x2ea4(%rip),%r12
cmp    (%r12),%rax
je     117c <main+0x5c>
lea    0xeb5(%rip),%r14
mov    %rsp,%rbx
lea    0xea5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    (%r12),%rax
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x198,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%399s\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [400 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %12, %2
%8 = getelementptr inbounds [400 x i8], [400 x i8]* %6, i64 0, i64 0
%9 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i64, i64* @EOF
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = getelementptr inbounds [400 x i8], [400 x i8]* %6, i64 0, i64 0
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %13)
br label %7
15: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%399s\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [400 x i8]
%4 = getelementptr inbounds [400 x i8], [400 x i8]* %3, i64 0, i64 0
%5 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %13, label %8
8: ; preds = %2, %8
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%10 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %4)
%11 = load i64, i64* @EOF
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %8
13: ; preds = %8, %2
ret i32 0
}
/* Variables and functions */
double get_timer();
int /*<<< orphan*/ printf(char *, double, double, double);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ start_timer();
void callibrate_tod() {
  double quick, slow;
  start_timer();
  quick = get_timer();
  start_timer();
  sleep(1);
  slow = get_timer();
  printf("%.2f - %f = %.2f seconds/sleep second\n", slow, quick, slow - quick);
}


x86 assembly (clang, -O0):
<callibrate_tod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <start_timer@plt>
mov    $0x0,%al
call   1040 <get_timer@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1050 <start_timer@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x0,%al
call   1040 <get_timer@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callibrate_tod>:
push   %rax
xor    %eax,%eax
call   1050 <start_timer@plt>
xor    %eax,%eax
call   1040 <get_timer@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1050 <start_timer@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
call   1040 <get_timer@plt>
movapd %xmm0,%xmm2
movsd  (%rsp),%xmm1
subsd  %xmm1,%xmm2
lea    0xe80(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"%.2f - %f = %.2f seconds/sleep second\0A\00"
define void @callibrate_tod() {
%1 = alloca double
%2 = alloca double
%3 = call i32 (...) @start_timer()
%4 = call double (...) @get_timer()
store double %4, double* %1
%5 = call i32 (...) @start_timer()
%6 = call i32 @sleep(i32 1)
%7 = call double (...) @get_timer()
store double %7, double* %2
%8 = load double, double* %2
%9 = load double, double* %1
%10 = load double, double* %2
%11 = load double, double* %1
%12 = fsub double %10, %11
%13 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), double %8, double %9, double %12)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"%.2f - %f = %.2f seconds/sleep second\0A\00"
define void @callibrate_tod() {
%1 = tail call i32 (...) @start_timer()
%2 = tail call double (...) @get_timer()
%3 = tail call i32 (...) @start_timer()
%4 = tail call i32 @sleep(i32 1)
%5 = tail call double (...) @get_timer()
%6 = fsub double %5, %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), double %5, double %2, double %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void g4(void) { printf("g4\n"); }


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"g4\00"
define void @g4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cache_wait(int, int);
void l2x0_clean_line(unsigned long addr) {
  cache_wait((0xC4200000 + 0x780), 1);
  (*((volatile unsigned *)(0xC4200000 + 0x780)) = addr);
}


x86 assembly (clang, -O0):
<l2x0_clean_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xc4200780,%edi
mov    $0x1,%esi
call   1030 <cache_wait@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    $0xc4200780,%eax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l2x0_clean_line>:
push   %rbx
mov    %rdi,%rbx
mov    $0xc4200780,%edi
mov    $0x1,%esi
call   1030 <cache_wait@plt>
mov    $0xc4200780,%eax
mov    %ebx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @l2x0_clean_line(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @cache_wait(i32 -1004533888, i32 1)
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
store volatile i32 %5, i32* inttoptr (i64 3290433408 to i32*)
ret void
}

LLVM IR (-O2):
define void @l2x0_clean_line(i64 %0) {
%2 = tail call i32 @cache_wait(i32 -1004533888, i32 1)
%3 = trunc i64 %0 to i32
store volatile i32 %3, i32* inttoptr (i64 3290433408 to i32*)
ret void
}
unsigned long next_power_of_2(unsigned long n) {
  int shifts = 0;
  if (n == 0) {
    return 1l;
  }
  --n;
  while (n) {
    n >>= 1;
    ++shifts;
  }
  return 1l << shifts;
}


x86 assembly (clang, -O0):
<next_power_of_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1127 <next_power_of_2+0x27>
movq   $0x1,-0x8(%rbp)
jmp    1169 <next_power_of_2+0x69>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1158 <next_power_of_2+0x58>
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1133 <next_power_of_2+0x33>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_power_of_2>:
test   %rdi,%rdi
je     1129 <next_power_of_2+0x29>
xor    %ecx,%ecx
add    $0xffffffffffffffff,%rdi
je     1120 <next_power_of_2+0x20>
mov    %rdi,%rax
shr    %rax
add    $0x1,%rcx
cmp    $0x1,%rdi
mov    %rax,%rdi
ja     1110 <next_power_of_2+0x10>
mov    $0x1,%eax
shl    %cl,%rax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i64 @next_power_of_2(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 0, i32* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 1, i64* %2
br label %23
8: ; preds = %1
%9 = load i64, i64* %3
%10 = add i64 %9, -1
store i64 %10, i64* %3
br label %11
11: ; preds = %14, %8
%12 = load i64, i64* %3
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i64, i64* %3
%16 = lshr i64 %15, 1
store i64 %16, i64* %3
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %11
19: ; preds = %11
%20 = load i32, i32* %4
%21 = zext i32 %20 to i64
%22 = shl i64 1, %21
store i64 %22, i64* %2
br label %23
23: ; preds = %19, %7
%24 = load i64, i64* %2
ret i64 %24
}

LLVM IR (-O2):
define i64 @next_power_of_2(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %17, label %3
3: ; preds = %1
%4 = add i64 %0, -1
%5 = icmp eq i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 0, %3 ]
%8 = phi i64 [ %9, %6 ], [ %4, %3 ]
%9 = lshr i64 %8, 1
%10 = add nuw nsw i32 %7, 1
%11 = icmp ult i64 %8, 2
br i1 %11, label %12, label %6
12: ; preds = %6
%13 = zext i32 %10 to i64
br label %14
14: ; preds = %12, %3
%15 = phi i64 [ 0, %3 ], [ %13, %12 ]
%16 = shl nuw i64 1, %15
br label %17
17: ; preds = %1, %14
%18 = phi i64 [ %16, %14 ], [ 1, %1 ]
ret i64 %18
}
int RowSize(int m, int l) {
  if (l < m)
    return 0;
  else {
    if ((m % 2) == 0)
      return ((l / 2) + 1);
    else
      return (((l - 1) / 2) + 1);
  }
}


x86 assembly (clang, -O0):
<RowSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1122 <RowSize+0x22>
movl   $0x0,-0x4(%rbp)
jmp    1160 <RowSize+0x60>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114c <RowSize+0x4c>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <RowSize+0x60>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RowSize>:
xor    %eax,%eax
cmp    %edi,%esi
jl     1127 <RowSize+0x27>
test   $0x1,%dil
jne    1115 <RowSize+0x15>
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
jmp    1122 <RowSize+0x22>
mov    %esi,%eax
add    $0xffffffff,%eax
shr    $0x1f,%eax
add    %esi,%eax
add    $0xffffffff,%eax
sar    %eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @RowSize(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %23
10: ; preds = %2
%11 = load i32, i32* %4
%12 = srem i32 %11, 2
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i32, i32* %5
%16 = sdiv i32 %15, 2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %23
18: ; preds = %10
%19 = load i32, i32* %5
%20 = sub nsw i32 %19, 1
%21 = sdiv i32 %20, 2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %23
23: ; preds = %18, %14, %9
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @RowSize(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = and i32 %0, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = sdiv i32 %1, 2
%9 = add nsw i32 %8, 1
br label %14
10: ; preds = %4
%11 = add nsw i32 %1, -1
%12 = sdiv i32 %11, 2
%13 = add nsw i32 %12, 1
br label %14
14: ; preds = %2, %10, %7
%15 = phi i32 [ %9, %7 ], [ %13, %10 ], [ 0, %2 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ RL_lagged64_g(unsigned long long *);
unsigned long long int RL_lagged64(void) {
  static unsigned long long int n[1009];
  static int i = 100;
  unsigned long long int a;
  if (i == 100) {
    RL_lagged64_g(n);
    i = 0;
  }
  a = n[i++];
  return a;
}


x86 assembly (clang, -O0):
<RL_lagged64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x64,0x2f09(%rip)
jne    113b <RL_lagged64+0x2b>
lea    0x2f14(%rip),%rdi
call   1030 <RL_lagged64_g@plt>
movl   $0x0,0x2eed(%rip)
mov    0x2ee7(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2edc(%rip)
movslq %eax,%rcx
lea    0x2eea(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RL_lagged64>:
push   %rax
mov    0x2f11(%rip),%eax
cmp    $0x64,%eax
jne    112a <RL_lagged64+0x1a>
lea    0x2f1d(%rip),%rdi
call   1030 <RL_lagged64_g@plt>
xor    %eax,%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2ef5(%rip)
cltq
lea    0x2f04(%rip),%rcx
mov    (%rcx,%rax,8),%rax
pop    %rcx
ret

LLVM IR (-O0):
@RL_lagged64.n = internal global [1009 x i64] zeroinitializer
@RL_lagged64.i = internal global i32 100
define i64 @RL_lagged64() {
%1 = alloca i64
%2 = load i32, i32* @RL_lagged64.i
%3 = icmp eq i32 %2, 100
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @RL_lagged64_g(i64* getelementptr inbounds ([1009 x i64], [1009 x i64]* @RL_lagged64.n, i64 0, i64 0))
store i32 0, i32* @RL_lagged64.i
br label %6
6: ; preds = %4, %0
%7 = load i32, i32* @RL_lagged64.i
%8 = add nsw i32 %7, 1
store i32 %8, i32* @RL_lagged64.i
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds [1009 x i64], [1009 x i64]* @RL_lagged64.n, i64 0, i64 %9
%11 = load i64, i64* %10
store i64 %11, i64* %1
%12 = load i64, i64* %1
ret i64 %12
}

LLVM IR (-O2):
@RL_lagged64.n = internal global [1009 x i64] zeroinitializer
@RL_lagged64.i = internal unnamed_addr global i32 100
define i64 @RL_lagged64() {
%1 = load i32, i32* @RL_lagged64.i
%2 = icmp eq i32 %1, 100
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @RL_lagged64_g(i64* getelementptr inbounds ([1009 x i64], [1009 x i64]* @RL_lagged64.n, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ 0, %3 ], [ %1, %0 ]
%7 = add nsw i32 %6, 1
store i32 %7, i32* @RL_lagged64.i
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds [1009 x i64], [1009 x i64]* @RL_lagged64.n, i64 0, i64 %8
%10 = load i64, i64* %9
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ bar4();
void prime4(void) { bar4(); }


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

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

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

LLVM IR (-O2):
define void @prime4() {
%1 = tail call i32 (...) @bar4()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int puts(char *s) {
  char c;
  while ((c = *s++) != 0)
    putchar(c);
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     114a <puts+0x3a>
movsbl -0x9(%rbp),%edi
call   1030 <putchar@plt>
jmp    111c <puts+0xc>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @puts(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* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @putchar(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int _start(unsigned long args) {
  printf("hello\n");
  return (int)args + 32;
}


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

x86 assembly (clang, -O2):
<_start>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
add    $0x20,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hello\0A\00"
define i32 @_start(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%6 = add nsw i32 %5, 32
ret i32 %6
}

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define i32 @_start(i64 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%3 = trunc i64 %0 to i32
%4 = add nsw i32 %3, 32
ret i32 %4
}
int test_imm_67int16_reg(short val) {
  return ((val) & (-0x67 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_67int16_reg(i16 signext %0) {
%2 = and i16 %0, -103
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char *mallocate(unsigned int);
int /*<<< orphan*/ strcpy(char *, char *);
char *copys(char *s) {
  register int i;
  register char *cp;
  register char *result;
  i = 1;
  for (cp = s; *cp; cp++)
    i++;
  result = mallocate((unsigned int)i);
  strcpy(result, s);
  return (result);
}


x86 assembly (clang, -O0):
<copys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1162 <copys+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113b <copys+0x1b>
mov    -0xc(%rbp),%edi
call   1040 <mallocate@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copys>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     114c <copys+0x2c>
mov    $0x1,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,(%rbx,%rdi,1)
lea    0x1(%rdi),%rdi
jne    1140 <copys+0x20>
jmp    1151 <copys+0x31>
mov    $0x1,%edi
call   1040 <mallocate@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @copys(i8* %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 i32 [ %7, %4 ], [ 1, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%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
%12 = phi i32 [ 1, %1 ], [ %7, %4 ]
%13 = tail call i8* @mallocate(i32 %12)
%14 = tail call i32 @strcpy(i8* %13, i8* %0)
ret i8* %13
}
void wifi_lock() {}


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

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

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

LLVM IR (-O2):
define void @wifi_lock() {
ret void
}
void atomic_inc_int(volatile int *var) {
  asm volatile("lock ;"
               " "
               "incl %0"
               " \n\t"
               : "=m"(*var)
               : "m"(*var)
               : "cc", "memory");
}


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

x86 assembly (clang, -O2):
<atomic_inc_int>:
lock incl (%rdi)
ret

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

LLVM IR (-O2):
define void @atomic_inc_int(i32* %0) {
tail call void asm sideeffect "lock ; incl $0 \0A\09", "=*m,*m,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32* elementtype(i32) %0)
ret void
}
/* Variables and functions */
int cvmx_helper_get_interface_index_num(int);
int INDEX(int ipd_port) {
  return cvmx_helper_get_interface_index_num(ipd_port);
}


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

x86 assembly (clang, -O2):
<INDEX>:
jmp    1030 <cvmx_helper_get_interface_index_num@plt>

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

LLVM IR (-O2):
define i32 @INDEX(i32 %0) {
%2 = tail call i32 @cvmx_helper_get_interface_index_num(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int main() {
  printf("\n\n*****   Running Test 1 ********");
  test1();
  printf("\n\n*****   Running Test 2 ********");
  test2();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <test1@plt>
lea    0xed4(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <test2@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <test1@plt>
lea    0xed7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <test2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"\0A\0A***** Running Test 1 ********\00"
@.str.1 = [34 x i8] c"\0A\0A***** Running Test 2 ********\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @test1()
%3 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @test2()
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"\0A\0A***** Running Test 1 ********\00"
@.str.1 = [34 x i8] c"\0A\0A***** Running Test 2 ********\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @test1()
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @test2()
ret i32 0
}
/* Variables and functions */
bool SHAREMIND_SET_KEY_LESS_THAN_signed_char(signed char const k1,
                                             signed char const k2) {
  return k1 < k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_SET_KEY_LESS_THAN_signed_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_SET_KEY_LESS_THAN_signed_char>:
xor    %eax,%eax
cmp    %sil,%dil
setl   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_SET_KEY_LESS_THAN_signed_char(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp slt i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_LESS_THAN_signed_char(i8 signext %0, i8 signext %1) {
%3 = icmp slt i8 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int abs(int val) {
  if (val < 0) {
    return ~val + 1;
  } else
    return val;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1122 <abs+0x22>
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1128 <abs+0x28>
mov    -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 slt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = xor i32 %7, -1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %3
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 false)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ testDevice(int);
int main() {
  int i;
  for (i = 0; i < 4; i++) {
    testDevice(i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1146 <main+0x36>
mov    -0x8(%rbp),%edi
call   1030 <testDevice@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <testDevice@plt>
mov    $0x1,%edi
call   1030 <testDevice@plt>
mov    $0x2,%edi
call   1030 <testDevice@plt>
mov    $0x3,%edi
call   1030 <testDevice@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @testDevice(i32 0)
%2 = tail call i32 @testDevice(i32 1)
%3 = tail call i32 @testDevice(i32 2)
%4 = tail call i32 @testDevice(i32 3)
ret i32 0
}
/* Type definitions */
struct _tuple26 {
  int dummy;
};
struct Cyc_Lexing_lexbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_suck_line_rec(struct Cyc_Lexing_lexbuf *, int);
struct _tuple26 *Cyc_suck_line(struct Cyc_Lexing_lexbuf *lexbuf) {
  return ({ Cyc_suck_line_rec(lexbuf, 10); });
}


x86 assembly (clang, -O0):
<Cyc_suck_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <Cyc_suck_line_rec@plt>
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_suck_line>:
push   %rax
mov    $0xa,%esi
call   1030 <Cyc_suck_line_rec@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
%struct._tuple26 = type { i32 }
%struct.Cyc_Lexing_lexbuf = type { i32 }
define %struct._tuple26* @Cyc_suck_line(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = alloca %struct.Cyc_Lexing_lexbuf*
%3 = alloca i32
store %struct.Cyc_Lexing_lexbuf* %0, %struct.Cyc_Lexing_lexbuf** %2
%4 = load %struct.Cyc_Lexing_lexbuf*, %struct.Cyc_Lexing_lexbuf** %2
%5 = call i32 @Cyc_suck_line_rec(%struct.Cyc_Lexing_lexbuf* %4, i32 10)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to %struct._tuple26*
ret %struct._tuple26* %8
}

LLVM IR (-O2):
%struct._tuple26 = type { i32 }
%struct.Cyc_Lexing_lexbuf = type { i32 }
define %struct._tuple26* @Cyc_suck_line(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = tail call i32 @Cyc_suck_line_rec(%struct.Cyc_Lexing_lexbuf* %0, i32 10)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to %struct._tuple26*
ret %struct._tuple26* %4
}
void good2() {
  int(TYP)(void);
  TYP();
}


x86 assembly (clang, -O0):
<good2>:
push   %rbp
mov    %rsp,%rbp
call   1030 <TYP@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<good2>:
jmp    1030 <TYP@plt>

LLVM IR (-O0):
define void @good2() {
%1 = call i32 @TYP()
ret void
}

LLVM IR (-O2):
define void @good2() {
%1 = tail call i32 @TYP()
ret void
}
int mdp4_mddi_overlay_blt_start(struct msm_fb_data_type *mfd) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.msm_fb_data_type = type opaque
define i32 @mdp4_mddi_overlay_blt_start(%struct.msm_fb_data_type* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void mpga_set_bitrate_index(uint8_t *p_mpga, uint8_t i_index) {
  p_mpga[2] &= ~0xf0;
  p_mpga[2] |= i_index << 4;
}


x86 assembly (clang, -O0):
<mpga_set_bitrate_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
and    $0xffffff0f,%ecx
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
shl    $0x4,%ecx
mov    -0x8(%rbp),%rax
or     0x8(%rax),%ecx
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpga_set_bitrate_index>:
mov    $0xffffff0f,%eax
and    0x8(%rdi),%eax
shl    $0x4,%esi
or     %eax,%esi
mov    %esi,0x8(%rdi)
ret

LLVM IR (-O0):
define void @mpga_set_bitrate_index(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 = getelementptr inbounds i32, i32* %5, i64 2
%7 = load i32, i32* %6
%8 = and i32 %7, -241
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = shl i32 %9, 4
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i32, i32* %12
%14 = or i32 %13, %10
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @mpga_set_bitrate_index(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 2
%4 = load i32, i32* %3
%5 = and i32 %4, -241
%6 = shl i32 %1, 4
%7 = or i32 %5, %6
store i32 %7, i32* %3
ret void
}