xunge/DecIR huggingface dataset:
unsigned int hash_string(const void *key) {
  const char *str = (const char *)key;
  unsigned int hash = 0;
  int i;
  for (i = 0; str[i] != 0; i++) {
    hash = (hash << 4) + str[i];
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1158 <hash_string+0x58>
mov    -0x14(%rbp),%eax
shl    $0x4,%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111e <hash_string+0x1e>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @hash_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = shl i32 %7, 4
%10 = add i32 %9, %8
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int EMACPHYRead(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ EMACPHYWrite(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                int);
void EMACPHYPowerOff(uint32_t ui32Base, uint8_t ui8PhyAddr) {
  EMACPHYWrite(ui32Base, ui8PhyAddr, 0x00000000,
               (EMACPHYRead(ui32Base, ui8PhyAddr, 0x00000000) & ~0x00001000) |
                   0x00000800);
}


x86 assembly (clang, -O0):
<EMACPHYPowerOff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
call   1030 <EMACPHYRead@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    %eax,%ecx
and    $0xffffefff,%ecx
or     $0x800,%ecx
xor    %edx,%edx
call   1040 <EMACPHYWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACPHYPowerOff>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edx,%edx
call   1030 <EMACPHYRead@plt>
and    $0xffffe7ff,%eax
lea    0x800(%rax),%ecx
mov    %ebp,%edi
mov    %ebx,%esi
xor    %edx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <EMACPHYWrite@plt>

LLVM IR (-O0):
define void @EMACPHYPowerOff(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @EMACPHYRead(i32 %7, i32 %8, i32 0)
%10 = and i32 %9, -4097
%11 = or i32 %10, 2048
%12 = call i32 @EMACPHYWrite(i32 %5, i32 %6, i32 0, i32 %11)
ret void
}

LLVM IR (-O2):
define void @EMACPHYPowerOff(i32 %0, i32 %1) {
%3 = tail call i32 @EMACPHYRead(i32 %0, i32 %1, i32 0)
%4 = and i32 %3, -6145
%5 = or i32 %4, 2048
%6 = tail call i32 @EMACPHYWrite(i32 %0, i32 %1, i32 0, i32 %5)
ret void
}
double jac_chain_nm10_sign(double x) { return x < 0 ? -1 : x > 0 ? 1 : x; }


x86 assembly (clang, -O0):
<jac_chain_nm10_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <jac_chain_nm10_sign+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <jac_chain_nm10_sign+0x61>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <jac_chain_nm10_sign+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <jac_chain_nm10_sign+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_chain_nm10_sign>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm2,%xmm1
movsd  0xed2(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @jac_chain_nm10_sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load double, double* %2
br label %12
12: ; preds = %10, %9
%13 = phi double [ 1.000000e+00, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi double [ -1.000000e+00, %5 ], [ %13, %12 ]
ret double %15
}

LLVM IR (-O2):
define double @jac_chain_nm10_sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
void RTMd5Final(void) {}


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

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

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

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


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

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

LLVM IR (-O0):
define i32 @XPutBackEvent() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XPutBackEvent() {
ret i32 undef
}
blsvdp_set_cram() {}


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

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

LLVM IR (-O0):
define i32 @blsvdp_set_cram() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @blsvdp_set_cram() {
ret i32 undef
}
void RandomFunc(unsigned char input[1], unsigned char output[1]) {
  unsigned char state[1];
  {
    state[0UL] = input[0UL] + (unsigned char)69;
    if ((state[0UL] >> (unsigned char)4) & (unsigned char)1) {
      state[0UL] += state[0UL];
    } else {
      state[0UL] += state[0UL];
    }
    output[0UL] = (state[0UL] + 295067127UL) + (unsigned char)132;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
add    $0x45,%eax
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
sar    $0x4,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113e <RandomFunc+0x3e>
movzbl -0x11(%rbp),%ecx
movzbl -0x11(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x11(%rbp)
jmp    114b <RandomFunc+0x4b>
movzbl -0x11(%rbp),%ecx
movzbl -0x11(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
add    $0x11965df7,%rax
add    $0x84,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%al
add    %al,%al
add    $0x5,%al
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = add nsw i32 %9, 69
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %11, i8* %12
%13 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = ashr i32 %15, 4
%17 = and i32 %16, 1
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %28
19: ; preds = %2
%20 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = add nsw i32 %25, %22
%27 = trunc i32 %26 to i8
store i8 %27, i8* %23
br label %37
28: ; preds = %2
%29 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = add nsw i32 %34, %31
%36 = trunc i32 %35 to i8
store i8 %36, i8* %32
br label %37
37: ; preds = %28, %19
%38 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%39 = load i8, i8* %38
%40 = zext i8 %39 to i64
%41 = add i64 %40, 295067127
%42 = add i64 %41, 132
%43 = trunc i64 %42 to i8
%44 = load i8*, i8** %4
%45 = getelementptr inbounds i8, i8* %44, i64 0
store i8 %43, i8* %45
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = shl i8 %3, 1
%5 = add i8 %4, 5
store i8 %5, i8* %1
ret void
}
void f2() {
  int f2_a = 2;
  float f2_b[2];
#pragma acc data copyin(f2_a) copyout(f2_b)
  {
#pragma acc kernels default(none)
    { f2_b[0] = f2_a; }
#pragma acc parallel default(none)
    { f2_b[0] = f2_a; }
  }
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f2() {
%1 = alloca i32
%2 = alloca [2 x float]
store i32 2, i32* %1
%3 = load i32, i32* %1
%4 = sitofp i32 %3 to float
%5 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 0
store float %4, float* %5
%6 = load i32, i32* %1
%7 = sitofp i32 %6 to float
%8 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 0
store float %7, float* %8
ret void
}

LLVM IR (-O2):
define void @f2() {
ret void
}
/* Variables and functions */
int judgeCircle(char *);
char *whenEmptyString_ShouldReturnTrue() {
  int result = judgeCircle("");
  do {
    if (!(1 == result))
      return "When moves are empty, the result should be 1";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<whenEmptyString_ShouldReturnTrue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xf0d(%rip),%rdi
call   1030 <judgeCircle@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1,%eax
cmp    -0xc(%rbp),%eax
je     1145 <whenEmptyString_ShouldReturnTrue+0x35>
lea    0xec4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <whenEmptyString_ShouldReturnTrue+0x42>
jmp    114a <whenEmptyString_ShouldReturnTrue+0x3a>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<whenEmptyString_ShouldReturnTrue>:
push   %rax
lea    0xf14(%rip),%rdi
call   1030 <judgeCircle@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
lea    0xed7(%rip),%rax
cmovne %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [45 x i8] c"When moves are empty, the result should be 1\00"
define i8* @whenEmptyString_ShouldReturnTrue() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i32 @judgeCircle(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %2
br label %4
4: ; preds = %0
%5 = load i32, i32* %2
%6 = icmp eq i32 1, %5
br i1 %6, label %8, label %7
7: ; preds = %4
store i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %10
8: ; preds = %4
br label %9
9: ; preds = %8
store i8* null, i8** %1
br label %10
10: ; preds = %9, %7
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [45 x i8] c"When moves are empty, the result should be 1\00"
define i8* @whenEmptyString_ShouldReturnTrue() {
%1 = tail call i32 @judgeCircle(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 1
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
short doubleToFixed(int /*<<< orphan*/);
int /*<<< orphan*/ sin(int);
short fullScaleSine(int n) {
  return doubleToFixed(sin(2 * 3.1415926535 * 60000 * n / 345));
}


x86 assembly (clang, -O0):
<fullScaleSine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xed0(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xebc(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sin@plt>
mov    %eax,%edi
call   1030 <doubleToFixed@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fullScaleSine>:
push   %rax
cvtsi2sd %edi,%xmm0
mulsd  0xed3(%rip),%xmm0
divsd  0xed3(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sin@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <doubleToFixed@plt>

LLVM IR (-O0):
define signext i16 @fullScaleSine(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double 0x4117027C794317AD, %4
%6 = fdiv double %5, 3.450000e+02
%7 = fptosi double %6 to i32
%8 = call i32 @sin(i32 %7)
%9 = call signext i16 @doubleToFixed(i32 %8)
ret i16 %9
}

LLVM IR (-O2):
define signext i16 @fullScaleSine(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 0x4117027C794317AD
%4 = fdiv double %3, 3.450000e+02
%5 = fptosi double %4 to i32
%6 = tail call i32 @sin(i32 %5)
%7 = tail call signext i16 @doubleToFixed(i32 %6)
ret i16 %7
}
/* Variables and functions */
long LONG_MIN;
scalar_t__ errno;
long strtol(char *, int /*<<< orphan*/ *, int);
long parse_long(char *str) {
  long value;
  errno = 0;
  value = strtol(str, NULL, 10);
  return !errno ? value : LONG_MIN;
}


x86 assembly (clang, -O0):
<parse_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e91(%rip),%rax
cmpq   $0x0,(%rax)
jne    115e <parse_long+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    116c <parse_long+0x5c>
mov    0x2e83(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_long>:
push   %rbx
mov    0x2ec0(%rip),%rbx
movq   $0x0,(%rbx)
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
cmpq   $0x0,(%rbx)
je     113b <parse_long+0x2b>
mov    0x2eb0(%rip),%rax
mov    (%rax),%rax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i64 0
@LONG_MIN = global i64 0
define i64 @parse_long(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* @errno
%4 = load i8*, i8** %2
%5 = call i64 @strtol(i8* %4, i32* null, i32 10)
store i64 %5, i64* %3
%6 = load i64, i64* @errno
%7 = icmp ne i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = load i64, i64* %3
br label %12
10: ; preds = %1
%11 = load i64, i64* @LONG_MIN
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
@errno = global i64 0
@LONG_MIN = global i64 0
define i64 @parse_long(i8* nocapture %0) {
store i64 0, i64* @errno
%2 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 10)
%3 = load i64, i64* @errno
%4 = icmp eq i64 %3, 0
%5 = load i64, i64* @LONG_MIN
%6 = select i1 %4, i64 %2, i64 %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ io_process(int, int);
int cwirc_spawn_io_process(int shmid, int ext_shmid) {
  int iopid = -1;
  switch (iopid = fork()) {
  case -1:
    return (-1);
    break;
  case 0:
    _exit(io_process(shmid, ext_shmid));
    break;
  }
  return (iopid);
}


x86 assembly (clang, -O0):
<cwirc_spawn_io_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
xor    %eax,%eax
call   1050 <fork@plt>
mov    %eax,-0x10(%rbp)
mov    %eax,%ecx
mov    %ecx,-0x14(%rbp)
sub    $0xffffffff,%eax
je     1172 <cwirc_spawn_io_process+0x42>
jmp    1162 <cwirc_spawn_io_process+0x32>
mov    -0x14(%rbp),%eax
test   %eax,%eax
je     117e <cwirc_spawn_io_process+0x4e>
jmp    1190 <cwirc_spawn_io_process+0x60>
movl   $0xffffffff,-0x4(%rbp)
jmp    1196 <cwirc_spawn_io_process+0x66>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <io_process@plt>
mov    %eax,%edi
call   1040 <_exit@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cwirc_spawn_io_process>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <fork@plt>
test   %eax,%eax
je     1149 <cwirc_spawn_io_process+0x19>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <io_process@plt>
mov    %eax,%edi
call   1040 <_exit@plt>

LLVM IR (-O0):
define i32 @cwirc_spawn_io_process(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
store i32 -1, i32* %6
%7 = call i32 (...) @fork()
store i32 %7, i32* %6
switch i32 %7, label %14 [
i32 -1, label %8
i32 0, label %9
]
8: ; preds = %2
store i32 -1, i32* %3
br label %16
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = call i32 @io_process(i32 %10, i32 %11)
%13 = call i32 @_exit(i32 %12)
unreachable
14: ; preds = %2
%15 = load i32, i32* %6
store i32 %15, i32* %3
br label %16
16: ; preds = %14, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @cwirc_spawn_io_process(i32 %0, i32 %1) {
%3 = tail call i32 (...) @fork()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @io_process(i32 %0, i32 %1)
%7 = tail call i32 @_exit(i32 %6)
unreachable
8: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void doesTheTestWork() { printf("YES"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"YES\00"
define void @doesTheTestWork() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
char is_primitive_type(unsigned tag) {
  return (tag & 0xc0) == 0 && (tag & 0x1f) != ((0x10 | 0x20) & 0x1f) &&
         (tag & 0x1f) != ((0x11 | 0x20) & 0x1f);
}


x86 assembly (clang, -O0):
<is_primitive_type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xc0,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1141 <is_primitive_type+0x41>
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
xor    %eax,%eax
cmp    $0x10,%ecx
mov    %al,-0x5(%rbp)
je     1141 <is_primitive_type+0x41>
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
cmp    $0x11,%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_primitive_type>:
test   $0xc0,%dil
jne    110e <is_primitive_type+0xe>
and    $0x1f,%edi
cmp    $0x10,%edi
jne    1111 <is_primitive_type+0x11>
xor    %eax,%eax
ret
cmp    $0x11,%edi
setne  %al
ret

LLVM IR (-O0):
define signext i8 @is_primitive_type(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 192
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = and i32 %7, 31
%9 = icmp ne i32 %8, 16
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i32, i32* %2
%12 = and i32 %11, 31
%13 = icmp ne i32 %12, 17
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ false, %6 ], [ false, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @is_primitive_type(i32 %0) {
%2 = and i32 %0, 192
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = and i32 %0, 31
%6 = icmp eq i32 %5, 16
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = icmp ne i32 %5, 17
%9 = zext i1 %8 to i8
br label %10
10: ; preds = %7, %4, %1
%11 = phi i8 [ 0, %4 ], [ 0, %1 ], [ %9, %7 ]
ret i8 %11
}
void fill(int *a) {
  a[0] = 1;
  a[1] = 2;
  a[2] = 3;
}


x86 assembly (clang, -O0):
<fill>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x2,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x3,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill>:
movabs $0x200000001,%rax
mov    %rax,(%rdi)
movl   $0x3,0x8(%rdi)
ret

LLVM IR (-O0):
define void @fill(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 1, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 2, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32 3, i32* %8
ret void
}

LLVM IR (-O2):
define void @fill(i32* nocapture writeonly %0) {
store i32 1, i32* %0
%2 = getelementptr inbounds i32, i32* %0, i64 1
store i32 2, i32* %2
%3 = getelementptr inbounds i32, i32* %0, i64 2
store i32 3, i32* %3
ret void
}
double Tween_QuarticOutEasing(double k) {
  --k;
  return 1 - (k * k * k * k);
}


x86 assembly (clang, -O0):
<Tween_QuarticOutEasing>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeae(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tween_QuarticOutEasing>:
addsd  0xef8(%rip),%xmm0
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xee8(%rip),%xmm0
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Tween_QuarticOutEasing(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, -1.000000e+00
store double %4, double* %2
%5 = load double, double* %2
%6 = load double, double* %2
%7 = fmul double %5, %6
%8 = load double, double* %2
%9 = fmul double %7, %8
%10 = load double, double* %2
%11 = fneg double %9
%12 = call double @llvm.fmuladd.f64(double %11, double %10, double 1.000000e+00)
ret double %12
}

LLVM IR (-O2):
define double @Tween_QuarticOutEasing(double %0) {
%2 = fadd double %0, -1.000000e+00
%3 = fneg double %2
%4 = fmul double %2, %3
%5 = fmul double %2, %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double %2, double 1.000000e+00)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void foo(void) {
#pragma omp critical(xyzzy)
  bar();
}


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

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

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

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 (...) @bar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fn11();
int __attribute__((noipa)) fn12(int x) {
  if (x < 6 || x >= 29)
    fn11();
}


x86 assembly (clang, -O0):
<fn12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jl     112f <fn12+0x1f>
cmpl   $0x1d,-0x8(%rbp)
jl     1136 <fn12+0x26>
mov    $0x0,%al
call   1030 <fn11@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn12>:
add    $0xffffffe3,%edi
cmp    $0xffffffe8,%edi
ja     1124 <fn12+0x14>
push   %rax
xor    %eax,%eax
call   1030 <fn11@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @fn12(i32 %0) {
%2 = add i32 %0, -29
%3 = icmp ult i32 %2, -23
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @fn11()
br label %6
6: ; preds = %1, %4
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char, unsigned char);
void uart_putc(unsigned char data) {
  printf("uart_putc(%X := %c)\n", data, data);
}


x86 assembly (clang, -O0):
<uart_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
lea    0xed8(%rip),%rdi
movzbl %al,%esi
movzbl -0x1(%rbp),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"uart_putc(%X := %c)\0A\00"
define void @uart_putc(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = load i8, i8* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8 zeroext %3, i8 zeroext %4)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"uart_putc(%X := %c)\0A\00"
define void @uart_putc(i8 zeroext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8 zeroext %0, i8 zeroext %0)
ret void
}
long double __atan2l(y, x)
long double y, x;
{ return ((long double)__atan2((double)y, (double)x)); }


x86 assembly (clang, -O0):
<__atan2l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
fldt   -0x20(%rbp)
fstpl  -0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
mov    $0x2,%al
call   1030 <__atan2@plt>
mov    %eax,-0x24(%rbp)
fildl  -0x24(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atan2l>:
sub    $0x18,%rsp
fldt   0x30(%rsp)
fldt   0x20(%rsp)
fstpl  0x10(%rsp)
movsd  0x10(%rsp),%xmm0
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm1
mov    $0x2,%al
call   1030 <__atan2@plt>
mov    %eax,0x4(%rsp)
fildl  0x4(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @__atan2l(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = fptrunc x86_fp80 %5 to double
%7 = load x86_fp80, x86_fp80* %4
%8 = fptrunc x86_fp80 %7 to double
%9 = call i32 (double, double, ...) bitcast (i32 (...)* @__atan2 to i32 (double, double, ...)*)(double %6, double %8)
%10 = sitofp i32 %9 to x86_fp80
ret x86_fp80 %10
}

LLVM IR (-O2):
define x86_fp80 @__atan2l(x86_fp80 %0, x86_fp80 %1) {
%3 = fptrunc x86_fp80 %0 to double
%4 = fptrunc x86_fp80 %1 to double
%5 = tail call i32 (double, double, ...) bitcast (i32 (...)* @__atan2 to i32 (double, double, ...)*)(double %3, double %4)
%6 = sitofp i32 %5 to x86_fp80
ret x86_fp80 %6
}
/* Variables and functions */
int /*<<< orphan*/ deposit(double);
scalar_t__ odd(unsigned long);
int /*<<< orphan*/ withdraw(double);
void do1000Transactions(unsigned long id) {
  for (unsigned i = 0; i < 1000; i++) {
    if (odd(id)) {
      deposit(100.00);
    } else {
      withdraw(100.00);
    }
  }
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jae    1195 <do1000Transactions+0x65>
mov    -0x8(%rbp),%rdi
call   1050 <odd@plt>
cmp    $0x0,%rax
je     1175 <do1000Transactions+0x45>
movsd  0xe95(%rip),%xmm0
call   1040 <deposit@plt>
jmp    1182 <do1000Transactions+0x52>
movsd  0xe83(%rip),%xmm0
call   1030 <withdraw@plt>
jmp    1187 <do1000Transactions+0x57>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <do1000Transactions+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x3e8,%ebp
jmp    114a <do1000Transactions+0x1a>
nopl   (%rax)
call   1030 <withdraw@plt>
add    $0xffffffff,%ebp
je     1169 <do1000Transactions+0x39>
mov    %rbx,%rdi
call   1050 <odd@plt>
movsd  0xea6(%rip),%xmm0
test   %rax,%rax
je     1140 <do1000Transactions+0x10>
call   1040 <deposit@plt>
add    $0xffffffff,%ebp
jne    114a <do1000Transactions+0x1a>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @do1000Transactions(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i32, i32* %3
%6 = icmp ult i32 %5, 1000
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = load i64, i64* %2
%9 = call i64 @odd(i64 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 @deposit(double 1.000000e+02)
br label %15
13: ; preds = %7
%14 = call i32 @withdraw(double 1.000000e+02)
br label %15
15: ; preds = %13, %11
br label %16
16: ; preds = %15
%17 = load i32, i32* %3
%18 = add i32 %17, 1
store i32 %18, i32* %3
br label %4
19: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @do1000Transactions(i64 %0) {
br label %3
2: ; preds = %11
ret void
3: ; preds = %1, %11
%4 = phi i32 [ 0, %1 ], [ %12, %11 ]
%5 = tail call i64 @odd(i64 %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @deposit(double 1.000000e+02)
br label %11
9: ; preds = %3
%10 = tail call i32 @withdraw(double 1.000000e+02)
br label %11
11: ; preds = %7, %9
%12 = add nuw nsw i32 %4, 1
%13 = icmp eq i32 %12, 1000
br i1 %13, label %2, label %3
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
void rmlastch(const char *pw, char *ret) {
  strcpy(ret, pw);
  int n = strlen(pw);
  ret[n - 1] = '\0';
}


x86 assembly (clang, -O0):
<rmlastch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmlastch>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%r14,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @rmlastch(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %5
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
store i8 0, i8* %15
ret void
}

LLVM IR (-O2):
define void @rmlastch(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %1, i8* %0)
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %1, i64 %6
store i8 0, i8* %7
ret void
}
/* Variables and functions */
void swap(int a[], size_t i, size_t j) {
  int tmp = a[i];
  a[i] = a[j];
  a[j] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi,%rsi,4),%eax
mov    (%rdi,%rdx,4),%ecx
mov    %ecx,(%rdi,%rsi,4)
mov    %eax,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 %1
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %0, i64 %2
%7 = load i32, i32* %6
store i32 %7, i32* %4
store i32 %5, i32* %6
ret void
}
float lerp(float a, float b, float t) { return a * (1.0 - t) + b * t; }


x86 assembly (clang, -O0):
<lerp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xed3(%rip),%xmm2
subsd  %xmm1,%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerp>:
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm2,%xmm3
movsd  0xef0(%rip),%xmm4
subsd  %xmm3,%xmm4
mulsd  %xmm0,%xmm4
mulss  %xmm2,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
addsd  %xmm4,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @lerp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = load float, float* %6
%10 = fpext float %9 to double
%11 = fsub double 1.000000e+00, %10
%12 = load float, float* %5
%13 = load float, float* %6
%14 = fmul float %12, %13
%15 = fpext float %14 to double
%16 = call double @llvm.fmuladd.f64(double %8, double %11, double %15)
%17 = fptrunc double %16 to float
ret float %17
}

LLVM IR (-O2):
define float @lerp(float %0, float %1, float %2) {
%4 = fpext float %0 to double
%5 = fpext float %2 to double
%6 = fsub double 1.000000e+00, %5
%7 = fmul float %1, %2
%8 = fpext float %7 to double
%9 = tail call double @llvm.fmuladd.f64(double %4, double %6, double %8)
%10 = fptrunc double %9 to float
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ parser();
int /*<<< orphan*/ printf(char *);
int main() {
  char ans[10];
  printf("\n Enter the expression ");
  printf("And place ; at the end\n");
  printf("Press Ctrl-Z to terminate\n");
  parser();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"\0A Enter the expression \00"
@.str.1 = [24 x i8] c"And place ; at the end\0A\00"
@.str.2 = [27 x i8] c"Press Ctrl-Z to terminate\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 (...) @parser()
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0A Enter the expression \00"
@str = [23 x i8] c"And place ; at the end\00"
@str.3 = [26 x i8] c"Press Ctrl-Z to terminate\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 (...) @parser()
ret i32 0
}
void memrlimit_cgroup_uncharge_as(struct mm_struct *mm,
                                  unsigned long nr_pages) {}


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

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

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

LLVM IR (-O2):
%struct.mm_struct = type opaque
define void @memrlimit_cgroup_uncharge_as(%struct.mm_struct* nocapture %0, i64 %1) {
ret void
}
/* Variables and functions */
scalar_t__ INADDR_NONE;
scalar_t__ inet_addr(char *);
int verifyIP(char *IpAddr) {
  if (NULL == IpAddr) {
    return 1;
  }
  return (INADDR_NONE != inet_addr(IpAddr));
}


x86 assembly (clang, -O0):
<verifyIP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1134 <verifyIP+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1160 <verifyIP+0x50>
mov    0x2ead(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <inet_addr@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verifyIP>:
test   %rdi,%rdi
je     1132 <verifyIP+0x22>
push   %rbx
mov    0x2ecb(%rip),%rax
mov    (%rax),%rbx
call   1030 <inet_addr@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rbx
setne  %al
pop    %rbx
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
@INADDR_NONE = global i64 0
define i32 @verifyIP(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i64, i64* @INADDR_NONE
%5 = tail call i64 @inet_addr(i8* %0)
%6 = icmp ne i64 %4, %5
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %1, %3
%9 = phi i32 [ %7, %3 ], [ 1, %1 ]
ret i32 %9
}
int FFC(unsigned long x) { return __builtin_ffs(~x); }


x86 assembly (clang, -O0):
<FFC>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    %eax,%edx
bsf    %edx,%eax
add    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FFC>:
mov    %edi,%eax
not    %eax
bsf    %eax,%ecx
add    $0x1,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%edi
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @FFC(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = xor i64 %3, -1
%5 = trunc i64 %4 to i32
%6 = call i32 @llvm.cttz.i32(i32 %5, i1 true)
%7 = add i32 %6, 1
%8 = icmp eq i32 %5, 0
%9 = select i1 %8, i32 0, i32 %7
ret i32 %9
}

LLVM IR (-O2):
define i32 @FFC(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = xor i32 %2, -1
%4 = tail call i32 @llvm.cttz.i32(i32 %3, i1 true)
%5 = add nuw nsw i32 %4, 1
%6 = icmp eq i32 %2, -1
%7 = select i1 %6, i32 0, i32 %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ f1(int);
int main() {
  f1(0);
  f1(1);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f1(i32 0)
%2 = tail call i32 @f1(i32 1)
ret i32 0
}
int main1() {
  int *arr2 = (int *)0x04000000;
  int temp = 0;
  *(arr2 + 1) = 1;
  for (int i = 0; i <= 100; i++) {
    temp += i;
  }
  *(arr2 + 3) = temp;
  return 0;
}


x86 assembly (clang, -O0):
<main1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4000000,%eax
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,0x4(%rax)
movl   $0x0,-0x10(%rbp)
cmpl   $0x64,-0x10(%rbp)
jg     1147 <main1+0x47>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <main1+0x26>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main1>:
movl   $0x1,0x4000004
movl   $0x13ba,0x400000c
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main1() {
store i32 1, i32* inttoptr (i64 67108868 to i32*)
store i32 5050, i32* inttoptr (i64 67108876 to i32*)
ret i32 0
}
adrx0regx1_set(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (((short *)10000000)[x0]) = (p1[x1]); }


x86 assembly (clang, -O0):
<adrx0regx1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,2),%dx
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
mov    %dx,(%rax,%rcx,2)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0regx1_set>:
movslq %ecx,%rax
movzwl (%r9,%rax,2),%eax
movslq %edx,%rcx
mov    %ax,0x989680(%rcx,%rcx,1)
ret

LLVM IR (-O0):
define i32 @adrx0regx1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %13
%17 = load i32, i32* %11
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i16, i16* %16, i64 %18
%20 = load i16, i16* %19
%21 = load i32, i32* %10
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %22
store i16 %20, i16* %23
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
define i32 @adrx0regx1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i16, i16* %5, i64 %7
%9 = load i16, i16* %8
%10 = sext i32 %2 to i64
%11 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %10
store i16 %9, i16* %11
ret i32 undef
}
char *hash_plugin_summary(void) {
  return ("dmg \t\tFileVault (v1)  passwords plugin");
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"dmg \09\09FileVault (v1) passwords plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [39 x i8] c"dmg \09\09FileVault (v1) passwords plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0)
}