xunge/DecIR huggingface dataset:
float sqrtf_quake3(float x) {
  const float xhalf = 0.5f * x;
  union {
    float x;
    int i;
  } u;
  u.x = x;
  u.i = 0x5f3759df - (u.i >> 1);
  return x * u.x * (1.5f - xhalf * u.x * u.x);
}


x86 assembly (clang, -O0):
<sqrtf_quake3>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
sar    $0x1,%ecx
mov    $0x5f3759df,%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe99(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrtf_quake3>:
movd   %xmm0,%eax
sar    %eax
mov    $0x5f3759df,%ecx
sub    %eax,%ecx
movd   %ecx,%xmm1
movdqa %xmm1,%xmm2
mulss  %xmm0,%xmm2
mulss  0xedf(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
addss  0xed3(%rip),%xmm0
mulss  %xmm2,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @sqrtf_quake3(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca %union.anon
store float %0, float* %2
%5 = load float, float* %2
%6 = fmul float 5.000000e-01, %5
store float %6, float* %3
%7 = load float, float* %2
%8 = bitcast %union.anon* %4 to float*
store float %7, float* %8
%9 = bitcast %union.anon* %4 to i32*
%10 = load i32, i32* %9
%11 = ashr i32 %10, 1
%12 = sub nsw i32 1597463007, %11
%13 = bitcast %union.anon* %4 to i32*
store i32 %12, i32* %13
%14 = load float, float* %2
%15 = bitcast %union.anon* %4 to float*
%16 = load float, float* %15
%17 = fmul float %14, %16
%18 = load float, float* %3
%19 = bitcast %union.anon* %4 to float*
%20 = load float, float* %19
%21 = fmul float %18, %20
%22 = bitcast %union.anon* %4 to float*
%23 = load float, float* %22
%24 = fneg float %21
%25 = call float @llvm.fmuladd.f32(float %24, float %23, float 1.500000e+00)
%26 = fmul float %17, %25
ret float %26
}

LLVM IR (-O2):
define float @sqrtf_quake3(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = sub nsw i32 1597463007, %3
%5 = bitcast i32 %4 to float
%6 = fmul float %5, %0
%7 = fmul float %0, -5.000000e-01
%8 = fmul float %7, %5
%9 = tail call float @llvm.fmuladd.f32(float %8, float %5, float 1.500000e+00)
%10 = fmul float %6, %9
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ pkey_disable_set(int, int);
void pkey_write_deny(int pkey) { pkey_disable_set(pkey, 0x2); }


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

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

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

LLVM IR (-O2):
define void @pkey_write_deny(i32 %0) {
%2 = tail call i32 @pkey_disable_set(i32 %0, i32 2)
ret void
}
/* Variables and functions */
int uniRand();
int randInt(int max) {
  double r = uniRand() * max;
  return (int)r;
}


x86 assembly (clang, -O0):
<randInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <uniRand@plt>
imul   -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randInt>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <uniRand@plt>
imul   %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @randInt(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = call i32 (...) @uniRand()
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = sitofp i32 %6 to double
store double %7, double* %3
%8 = load double, double* %3
%9 = fptosi double %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @randInt(i32 %0) {
%2 = tail call i32 (...) @uniRand()
%3 = mul nsw i32 %2, %0
ret i32 %3
}
void XtInsertEventTypeHandler() {}


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

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

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

LLVM IR (-O2):
define void @XtInsertEventTypeHandler() {
ret void
}
/* Variables and functions */
int f(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", f(342, 162));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @f(i32 342, i32 162)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int StartProcessIn(char *, char *);
int StartProcess(char *process) {
  return StartProcessIn(process, (char *)NULL);
}


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

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

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

LLVM IR (-O2):
define i32 @StartProcess(i8* %0) {
%2 = tail call i32 @StartProcessIn(i8* %0, i8* null)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ClockMMC3Counter();
void MMC3_hb(void) { ClockMMC3Counter(); }


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

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

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

LLVM IR (-O2):
define void @MMC3_hb() {
%1 = tail call i32 (...) @ClockMMC3Counter()
ret void
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  printf("Introduzca un numero entero positivo ");
  scanf("%d", &num);
  printf("\nEl factorial de %d es %d\n", num, factorial(num));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedc(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1030 <factorial@plt>
lea    0xec3(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Introduzca un numero entero positivo \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"\0AEl factorial de %d es %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @factorial(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"Introduzca un numero entero positivo \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"\0AEl factorial de %d es %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @factorial(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
char *toLowercase(char *src) {
  char *p;
  p = src;
  while (*p != '\0') {
    if (*p >= 'A' && *p <= 'Z') {
      *p += 32;
    }
    p++;
  }
  return src;
}


x86 assembly (clang, -O0):
<toLowercase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115d <toLowercase+0x5d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     114c <toLowercase+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     114c <toLowercase+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
add    $0x20,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <toLowercase+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toLowercase>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <toLowercase+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <toLowercase+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <toLowercase+0x2c>
lea    -0x41(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <toLowercase+0x10>
add    $0x20,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <toLowercase+0x10>
ret

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

LLVM IR (-O2):
define i8* @toLowercase(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void __attribute__((noreturn)) die(const char *err) {
  fprintf(stderr, "fatal error: %s\n", err);
  abort();
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"fatal error: %s\0A\00"
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"fatal error: %s\0A\00"
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
int TerminalWindowSize(long *rows, long *cols) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @TerminalWindowSize(i64* nocapture readnone %0, i64* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int /*<<< orphan*/ anvil_syslog(int /*<<< orphan*/, char *);
void freelocale(locale_t locobj) {
  anvil_syslog(0, "freelocale\n");
  while (1)
    ;
  return;
}


x86 assembly (clang, -O0):
<freelocale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
lea    0xedc(%rip),%rsi
call   1030 <anvil_syslog@plt>
jmp    1129 <freelocale+0x19>

x86 assembly (clang, -O2):
<freelocale>:
push   %rax
lea    0xee8(%rip),%rsi
xor    %edi,%edi
call   1030 <anvil_syslog@plt>
nop
jmp    1120 <freelocale+0x10>

LLVM IR (-O0):
@.str = [12 x i8] c"freelocale\0A\00"
define void @freelocale(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @anvil_syslog(i32 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %1, %4
br label %4
}

LLVM IR (-O2):
@.str = [12 x i8] c"freelocale\0A\00"
define void @freelocale(i32 %0) {
%2 = tail call i32 @anvil_syslog(i32 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
br label %3
}
int checkNodeInPiece(int *pieceArr, int nodeNum) {
  int *ptr = &pieceArr[0];
  while (ptr && (*ptr) != -1) {
    if ((*ptr) == nodeNum)
      return 1;
    ptr++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<checkNodeInPiece>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x20(%rbp)
mov    %al,-0x21(%rbp)
je     1130 <checkNodeInPiece+0x30>
mov    -0x20(%rbp),%rax
cmpl   $0xffffffff,(%rax)
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1140 <checkNodeInPiece+0x40>
jmp    116c <checkNodeInPiece+0x6c>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    115b <checkNodeInPiece+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    1173 <checkNodeInPiece+0x73>
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
jmp    1113 <checkNodeInPiece+0x13>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkNodeInPiece>:
xor    %eax,%eax
test   %rdi,%rdi
je     112f <checkNodeInPiece+0x2f>
mov    (%rdi),%ecx
cmp    $0xffffffff,%ecx
je     112f <checkNodeInPiece+0x2f>
add    $0x4,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    %esi,%ecx
je     1130 <checkNodeInPiece+0x30>
mov    (%rdi),%ecx
add    $0x4,%rdi
cmp    $0xffffffff,%ecx
jne    1120 <checkNodeInPiece+0x20>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @checkNodeInPiece(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32* %8, i32** %6
br label %9
9: ; preds = %24, %2
%10 = load i32*, i32** %6
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = icmp ne i32 %14, -1
br label %16
16: ; preds = %12, %9
%17 = phi i1 [ false, %9 ], [ %15, %12 ]
br i1 %17, label %18, label %27
18: ; preds = %16
%19 = load i32*, i32** %6
%20 = load i32, i32* %19
%21 = load i32, i32* %5
%22 = icmp eq i32 %20, %21
br i1 %22, label %23, label %24
23: ; preds = %18
store i32 1, i32* %3
br label %28
24: ; preds = %18
%25 = load i32*, i32** %6
%26 = getelementptr inbounds i32, i32* %25, i32 1
store i32* %26, i32** %6
br label %9
27: ; preds = %16
store i32 0, i32* %3
br label %28
28: ; preds = %27, %23
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @checkNodeInPiece(i32* %0, i32 %1) {
%3 = icmp eq i32* %0, null
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = load i32, i32* %0
%6 = icmp eq i32 %5, -1
br i1 %6, label %15, label %10
7: ; preds = %10
%8 = load i32, i32* %14
%9 = icmp eq i32 %8, -1
br i1 %9, label %15, label %10
10: ; preds = %4, %7
%11 = phi i32 [ %8, %7 ], [ %5, %4 ]
%12 = phi i32* [ %14, %7 ], [ %0, %4 ]
%13 = icmp eq i32 %11, %1
%14 = getelementptr inbounds i32, i32* %12, i64 1
br i1 %13, label %15, label %7
15: ; preds = %7, %10, %4, %2
%16 = phi i32 [ 0, %2 ], [ 0, %4 ], [ 1, %10 ], [ 0, %7 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int main(void) {
  test1();
  test2();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test1()
%2 = tail call i32 (...) @test2()
ret i32 0
}
/* Variables and functions */
int BoostLimit(int, int);
double abs(float);
int SetSpeed(float posNow, float posTarget, int gain) {
  int speed;
  speed = gain * (posTarget - posNow);
  if (abs(posNow - posTarget) < .02) {
    speed = 0;
  }
  speed = BoostLimit(speed, 85);
  return (speed);
}


x86 assembly (clang, -O0):
<SetSpeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <abs@plt>
movaps %xmm0,%xmm1
movsd  0xe97(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    117a <SetSpeed+0x5a>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    $0x55,%esi
call   1040 <BoostLimit@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetSpeed>:
push   %rbx
cvtsi2ss %edi,%xmm2
movaps %xmm1,%xmm3
subss  %xmm0,%xmm3
mulss  %xmm2,%xmm3
cvttss2si %xmm3,%ebx
subss  %xmm1,%xmm0
call   1030 <abs@plt>
xor    %edi,%edi
movsd  0xeb9(%rip),%xmm1
ucomisd %xmm0,%xmm1
cmovbe %ebx,%edi
mov    $0x55,%esi
pop    %rbx
jmp    1040 <BoostLimit@plt>

LLVM IR (-O0):
define i32 @SetSpeed(float %0, float %1, i32 %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca i32
%7 = alloca i32
store float %0, float* %4
store float %1, float* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = sitofp i32 %8 to float
%10 = load float, float* %5
%11 = load float, float* %4
%12 = fsub float %10, %11
%13 = fmul float %9, %12
%14 = fptosi float %13 to i32
store i32 %14, i32* %7
%15 = load float, float* %4
%16 = load float, float* %5
%17 = fsub float %15, %16
%18 = call double @abs(float %17)
%19 = fcmp olt double %18, 2.000000e-02
br i1 %19, label %20, label %21
20: ; preds = %3
store i32 0, i32* %7
br label %21
21: ; preds = %20, %3
%22 = load i32, i32* %7
%23 = call i32 @BoostLimit(i32 %22, i32 85)
store i32 %23, i32* %7
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
define i32 @SetSpeed(float %0, float %1, i32 %2) {
%4 = sitofp i32 %2 to float
%5 = fsub float %1, %0
%6 = fmul float %5, %4
%7 = fptosi float %6 to i32
%8 = fsub float %0, %1
%9 = tail call double @abs(float %8)
%10 = fcmp olt double %9, 2.000000e-02
%11 = select i1 %10, i32 0, i32 %7
%12 = tail call i32 @BoostLimit(i32 %11, i32 85)
ret i32 %12
}
/* Variables and functions */
scalar_t__ isinf(double);
int /*<<< orphan*/ unit_error(char *, char const *, int);
void assert_not_inf(double real, char const *caller, int line) {
  if (isinf(real)) {
    unit_error("%s: %d unexpected INFINITY", caller, line);
  }
}


x86 assembly (clang, -O0):
<assert_not_inf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <isinf@plt>
cmp    $0x0,%rax
je     115b <assert_not_inf+0x3b>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xeaa(%rip),%rdi
call   1030 <unit_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_not_inf>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <isinf@plt>
test   %rax,%rax
je     1149 <assert_not_inf+0x29>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <unit_error@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"%s: %d unexpected INFINITY\00"
define void @assert_not_inf(double %0, i8* %1, i32 %2) {
%4 = alloca double
%5 = alloca i8*
%6 = alloca i32
store double %0, double* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load double, double* %4
%8 = call i64 @isinf(double %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @unit_error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12)
br label %14
14: ; preds = %10, %3
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"%s: %d unexpected INFINITY\00"
define void @assert_not_inf(double %0, i8* %1, i32 %2) {
%4 = tail call i64 @isinf(double %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @unit_error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
br label %8
8: ; preds = %6, %3
ret void
}
int test_imm_D9uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xD9 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D9uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 932007903232
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int sub1(int val) { return val; }


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

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

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

LLVM IR (-O2):
define i32 @sub1(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void __attribute__((noreturn)) usage(const char *filepath) {
  fprintf(stderr,
          "\nUsage: %s [options] hostname\n"
          "\nwhere options are:\n"
          "  -4:   only IPv4\n"
          "  -6:   only IPv6\n"
          "  -h:   show this message\n"
          "  -I:   request PKTINFO\n"
          "  -l N: send N bytes at a time\n"
          "  -n:   set no-payload option\n"
          "  -r:   use raw\n"
          "  -R:   use raw (IP_HDRINCL)\n"
          "  -p N: connect to port N\n"
          "  -u:   use udp\n"
          "  -x:   show payload (up to 70 bytes)\n",
          filepath);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [323 x i8] c"\0AUsage: %s [options] hostname\0A\0Awhere options are:\0A -4: only IPv4\0A -6: only IPv6\0A -h: show this message\0A -I: request PKTINFO\0A -l N: send N bytes at a time\0A -n: set no-payload option\0A -r: use raw\0A -R: use raw (IP_HDRINCL)\0A -p N: connect to port N\0A -u: use udp\0A -x: show payload (up to 70 bytes)\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([323 x i8], [323 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [323 x i8] c"\0AUsage: %s [options] hostname\0A\0Awhere options are:\0A -4: only IPv4\0A -6: only IPv6\0A -h: show this message\0A -I: request PKTINFO\0A -l N: send N bytes at a time\0A -n: set no-payload option\0A -r: use raw\0A -R: use raw (IP_HDRINCL)\0A -p N: connect to port N\0A -u: use udp\0A -x: show payload (up to 70 bytes)\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([323 x i8], [323 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
void uv75() {
  printf("\nLowering CPU VDD Voltage by 75mV\n");
  char buf[256];
  sprintf(
      buf, "/system/bin/sh -c %s",
      "'echo -75000 > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels'");
  system(buf);
}


x86 assembly (clang, -O0):
<uv75>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    -0x100(%rbp),%rdi
lea    0xece(%rip),%rsi
lea    0xedc(%rip),%rdx
call   1050 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uv75>:
push   %rbx
sub    $0x100,%rsp
lea    0xf1b(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rsi
lea    0xec3(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"\0ALowering CPU VDD Voltage by 75mV\0A\00"
@.str.1 = [21 x i8] c"/system/bin/sh -c %s\00"
@.str.2 = [69 x i8] c"'echo -75000 > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels'\00"
define void @uv75() {
%1 = alloca [256 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.2, i64 0, i64 0))
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%6 = call i32 @system(i8* %5)
ret void
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"/system/bin/sh -c %s\00"
@.str.2 = [69 x i8] c"'echo -75000 > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels'\00"
@str = [34 x i8] c"\0ALowering CPU VDD Voltage by 75mV\00"
define void @uv75() {
%1 = alloca [256 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @system(i8* %3)
ret void
}
/* Variables and functions */
int bar();
int hide_new_foo() { return 1000 + bar(); }


x86 assembly (clang, -O0):
<hide_new_foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x3e8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hide_new_foo>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
add    $0x3e8,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hide_new_foo() {
%1 = call i32 (...) @bar()
%2 = add nsw i32 1000, %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @hide_new_foo() {
%1 = tail call i32 (...) @bar()
%2 = add nsw i32 %1, 1000
ret i32 %2
}
void RTTestGuardedAllocTail(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTestGuardedAllocTail() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, char *, int);
int bytes_to_int(char *bytes) {
  int ret = 0;
  memcpy(&ret, bytes, 4);
  return ret;
}


x86 assembly (clang, -O0):
<bytes_to_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytes_to_int>:
push   %rax
mov    %rdi,%rsi
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @bytes_to_int(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
void policyBISTReceiveMode(void) {}


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

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

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

LLVM IR (-O2):
define void @policyBISTReceiveMode() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dlclose(void *);
void iposix_shared_close(void *shared) { dlclose(shared); }


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

x86 assembly (clang, -O2):
<iposix_shared_close>:
jmp    1030 <dlclose@plt>

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

LLVM IR (-O2):
define void @iposix_shared_close(i8* %0) {
%2 = tail call i32 @dlclose(i8* %0)
ret void
}
/* Variables and functions */
double exp(double);
double t1_f_attractive(double rij) { return -95.373 * exp(-1.3258 * rij); }


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

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

LLVM IR (-O0):
define double @t1_f_attractive(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double -1.325800e+00, %3
%5 = call double @exp(double %4)
%6 = fmul double -9.537300e+01, %5
ret double %6
}

LLVM IR (-O2):
define double @t1_f_attractive(double %0) {
%2 = fmul double %0, -1.325800e+00
%3 = tail call double @exp(double %2)
%4 = fmul double %3, -9.537300e+01
ret double %4
}
unsigned char check_range_do(int start, int end) { return 1; }


x86 assembly (clang, -O0):
<check_range_do>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @check_range_do(i32 %0, i32 %1) {
ret i8 1
}
/* Variables and functions */
int /*<<< orphan*/ PT(int);
int main() {
  PT(4);
  PT(7);
  PT(11);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <PT@plt>
mov    $0x7,%edi
call   1030 <PT@plt>
mov    $0xb,%edi
call   1030 <PT@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @PT(i32 4)
%3 = call i32 @PT(i32 7)
%4 = call i32 @PT(i32 11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @PT(i32 4)
%2 = tail call i32 @PT(i32 7)
%3 = tail call i32 @PT(i32 11)
ret i32 0
}
int wctomb_iso1(void *map, char *s, int wc) {
  if (!s)
    return 0;
  if (wc & ~0xff)
    return -1;
  *s = wc;
  return 1;
}


x86 assembly (clang, -O0):
<wctomb_iso1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1126 <wctomb_iso1+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1155 <wctomb_iso1+0x55>
mov    -0x1c(%rbp),%eax
and    $0xffffff00,%eax
cmp    $0x0,%eax
je     1143 <wctomb_iso1+0x43>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <wctomb_iso1+0x55>
mov    -0x1c(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wctomb_iso1>:
test   %rsi,%rsi
je     111a <wctomb_iso1+0x1a>
mov    $0xffffffff,%eax
cmp    $0xff,%edx
ja     1119 <wctomb_iso1+0x19>
mov    %dl,(%rsi)
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @wctomb_iso1(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i8*, i8** %6
%9 = icmp ne i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %3
store i32 0, i32* %4
br label %20
11: ; preds = %3
%12 = load i32, i32* %7
%13 = and i32 %12, -256
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 -1, i32* %4
br label %20
16: ; preds = %11
%17 = load i32, i32* %7
%18 = trunc i32 %17 to i8
%19 = load i8*, i8** %6
store i8 %18, i8* %19
store i32 1, i32* %4
br label %20
20: ; preds = %16, %15, %10
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @wctomb_iso1(i8* nocapture readnone %0, i8* writeonly %1, i32 %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = icmp ult i32 %2, 256
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = trunc i32 %2 to i8
store i8 %8, i8* %1
br label %9
9: ; preds = %5, %3, %7
%10 = phi i32 [ 1, %7 ], [ 0, %3 ], [ -1, %5 ]
ret i32 %10
}
int fun458() { return 458; }


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

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

LLVM IR (-O0):
define i32 @fun458() {
ret i32 458
}

LLVM IR (-O2):
define i32 @fun458() {
ret i32 458
}
int c009(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c009() {
ret i32 0
}
int g_DUMMY_console_printf(int win_id, const char *format, ...) {
  win_id = win_id;
  format = format;
  return 0;
}


x86 assembly (clang, -O0):
<g_DUMMY_console_printf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @g_DUMMY_console_printf(i32 %0, i8* nocapture readnone %1, ...) {
ret i32 0
}
float rad2deg(float rad) {
  rad = rad * 180 / 3.14159265;
  return rad;
}


x86 assembly (clang, -O0):
<rad2deg>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef7(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xede(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rad2deg>:
mulss  0xef8(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @rad2deg(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 1.800000e+02
%5 = fpext float %4 to double
%6 = fdiv double %5, 0x400921FB53C8D4F1
%7 = fptrunc double %6 to float
store float %7, float* %2
%8 = load float, float* %2
ret float %8
}

LLVM IR (-O2):
define float @rad2deg(float %0) {
%2 = fmul float %0, 1.800000e+02
%3 = fpext float %2 to double
%4 = fdiv double %3, 0x400921FB53C8D4F1
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
size_t strlen(char const *);
int write(int /*<<< orphan*/, char const *, size_t);
int puts(const char *str) {
  size_t length;
  length = strlen(str);
  return write(STDOUT_FILENO, str, length);
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    0x2ec0(%rip),%rcx
mov    (%rcx),%edi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define i32 @puts(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
store i64 %5, i64* %3
%6 = load i32, i32* @STDOUT_FILENO
%7 = load i8*, i8** %2
%8 = load i64, i64* %3
%9 = call i32 @write(i32 %6, i8* %7, i64 %8)
ret i32 %9
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define i32 @puts(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = load i32, i32* @STDOUT_FILENO
%4 = tail call i32 @write(i32 %3, i8* %0, i64 %2)
ret i32 %4
}
/* Type definitions */
struct _Locale_codecvt {
  int dummy;
};

/* Variables and functions */
int _WLocale_is_stateless(struct _Locale_codecvt *lcodecvt) { return 1; }


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

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

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

LLVM IR (-O2):
%struct._Locale_codecvt = type { i32 }
define i32 @_WLocale_is_stateless(%struct._Locale_codecvt* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int getpriority(int, int);
int getval(int sys) { return 20 - getpriority(1764, sys); }


x86 assembly (clang, -O0):
<getval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x6e4,%edi
call   1030 <getpriority@plt>
mov    %eax,%ecx
mov    $0x14,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getval>:
push   %rax
mov    %edi,%esi
mov    $0x6e4,%edi
call   1030 <getpriority@plt>
mov    $0x14,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getval(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @getpriority(i32 1764, i32 %3)
%5 = sub nsw i32 20, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @getval(i32 %0) {
%2 = tail call i32 @getpriority(i32 1764, i32 %0)
%3 = sub nsw i32 20, %2
ret i32 %3
}
/* Variables and functions */
int qdpll_main(int, char **);
int main(int argc, char **argv) { return qdpll_main(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),%edi
mov    -0x10(%rbp),%rsi
call   1030 <qdpll_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <qdpll_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 @qdpll_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @qdpll_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
double __ocml_sqrt_rtp_f64(double);
double __dsqrt_rd(double x) { return __ocml_sqrt_rtp_f64(x); }


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

x86 assembly (clang, -O2):
<__dsqrt_rd>:
jmp    1030 <__ocml_sqrt_rtp_f64@plt>

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

LLVM IR (-O2):
define double @__dsqrt_rd(double %0) {
%2 = tail call double @__ocml_sqrt_rtp_f64(double %0)
ret double %2
}
/* Variables and functions */
scalar_t__ isprint(int);
int /*<<< orphan*/ isspace(int);
int _isid(int c) { return !isspace(c) && c != '(' && c != ')' && isprint(c); }


x86 assembly (clang, -O0):
<_isid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isspace@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1173 <_isid+0x53>
xor    %eax,%eax
cmpl   $0x28,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1173 <_isid+0x53>
xor    %eax,%eax
cmpl   $0x29,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1173 <_isid+0x53>
mov    -0x4(%rbp),%edi
call   1040 <isprint@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_isid>:
push   %rbx
mov    %edi,%ebx
call   1030 <isspace@plt>
mov    %eax,%ecx
mov    %ebx,%edx
and    $0xfffffffe,%edx
xor    %eax,%eax
cmp    $0x28,%edx
je     114c <_isid+0x2c>
test   %ecx,%ecx
jne    114c <_isid+0x2c>
mov    %ebx,%edi
call   1040 <isprint@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_isid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @isspace(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 40
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 41
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %2
%14 = call i64 @isprint(i32 %13)
%15 = icmp ne i64 %14, 0
br label %16
16: ; preds = %12, %9, %6, %1
%17 = phi i1 [ false, %9 ], [ false, %6 ], [ false, %1 ], [ %15, %12 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @_isid(i32 %0) {
%2 = tail call i32 @isspace(i32 %0)
%3 = icmp eq i32 %2, 0
%4 = and i32 %0, -2
%5 = icmp ne i32 %4, 40
%6 = and i1 %5, %3
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = tail call i64 @isprint(i32 %0)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %1
%12 = phi i32 [ 0, %1 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
teste2() {
  int valor;
  printf("ok: ");
  scanf("%d", &valor);
  return valor;
}


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

x86 assembly (clang, -O2):
<teste2>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"ok: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @teste2() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}