xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ isfinite(long double);
void uninitvar_isfinite(void) {
  float f;
  (void)isfinite(f);
  double d;
  (void)isfinite(d);
  long double ld;
  (void)isfinite(ld);
}


x86 assembly (clang, -O0):
<uninitvar_isfinite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
flds   -0x4(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <isfinite@plt>
fldl   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <isfinite@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <isfinite@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_isfinite>:
sub    $0x18,%rsp
call   1030 <isfinite@plt>
call   1030 <isfinite@plt>
call   1030 <isfinite@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_isfinite() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = load float, float* %1
%5 = fpext float %4 to x86_fp80
%6 = call i32 @isfinite(x86_fp80 %5)
%7 = load double, double* %2
%8 = fpext double %7 to x86_fp80
%9 = call i32 @isfinite(x86_fp80 %8)
%10 = load x86_fp80, x86_fp80* %3
%11 = call i32 @isfinite(x86_fp80 %10)
ret void
}

LLVM IR (-O2):
define void @uninitvar_isfinite() {
%1 = tail call i32 @isfinite(x86_fp80 undef)
%2 = tail call i32 @isfinite(x86_fp80 undef)
%3 = tail call i32 @isfinite(x86_fp80 undef)
ret void
}
unsigned xrop3_201_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T | D;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_201_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_201_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
shl    $0x8,%esi
lea    0xff(%rsi),%eax
xor    %ecx,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_201_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %5
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %6
%26 = load i32, i32* %9
%27 = xor i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
ret i32 %30
}

LLVM IR (-O2):
define i32 @xrop3_201_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, 255
%8 = xor i32 %4, %7
%9 = xor i32 %8, -1
ret i32 %9
}
/* Variables and functions */
int TIOCM_RTS;
int get_mlines(int);
int get_rts(int fd) {
  if (get_mlines(fd) & TIOCM_RTS)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<get_rts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <get_mlines@plt>
mov    0x2ebe(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1141 <get_rts+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <get_rts+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rts>:
push   %rax
call   1030 <get_mlines@plt>
mov    0x2ecb(%rip),%rdx
xor    %ecx,%ecx
test   %eax,(%rdx)
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@TIOCM_RTS = global i32 0
define i32 @get_rts(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @get_mlines(i32 %4)
%6 = load i32, i32* @TIOCM_RTS
%7 = and i32 %5, %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@TIOCM_RTS = global i32 0
define i32 @get_rts(i32 %0) {
%2 = tail call i32 @get_mlines(i32 %0)
%3 = load i32, i32* @TIOCM_RTS
%4 = and i32 %3, %2
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ LBA_REG_WRITE(void *, int, int);
int mercury_util_reset(void *phys_addr) {
  LBA_REG_WRITE(phys_addr, 0x0500, 0xf);
  return 0;
}


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

x86 assembly (clang, -O2):
<mercury_util_reset>:
push   %rax
mov    $0x500,%esi
mov    $0xf,%edx
call   1030 <LBA_REG_WRITE@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @mercury_util_reset(i8* %0) {
%2 = tail call i32 @LBA_REG_WRITE(i8* %0, i32 1280, i32 15)
ret i32 0
}
/* Variables and functions */
double sas_2J1x_x(double);
double sas_sinx_x(double);
double _cyl(double vd, double besarg, double siarg) {
  return vd * sas_sinx_x(siarg) * sas_2J1x_x(besarg);
}


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

x86 assembly (clang, -O2):
<_cyl>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movapd %xmm2,%xmm0
call   1040 <sas_sinx_x@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sas_2J1x_x@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @_cyl(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = call double @sas_sinx_x(double %8)
%10 = fmul double %7, %9
%11 = load double, double* %5
%12 = call double @sas_2J1x_x(double %11)
%13 = fmul double %10, %12
ret double %13
}

LLVM IR (-O2):
define double @_cyl(double %0, double %1, double %2) {
%4 = tail call double @sas_sinx_x(double %2)
%5 = fmul double %4, %0
%6 = tail call double @sas_2J1x_x(double %1)
%7 = fmul double %5, %6
ret double %7
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, char);
int main(void) {
  char i;
  i = getchar();
  if (i >= 'a' && i <= 'w') {
    printf("%c", i + 3);
  } else {
    printf("%c", i - 23);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     116e <main+0x4e>
movsbl -0x5(%rbp),%eax
cmp    $0x77,%eax
jg     116e <main+0x4e>
movsbl -0x5(%rbp),%eax
add    $0x3,%eax
lea    0xe9f(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
jmp    1184 <main+0x64>
movsbl -0x5(%rbp),%eax
sub    $0x17,%eax
lea    0xe84(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
lea    -0x61(%rax),%ecx
cmp    $0x17,%cl
mov    $0x3,%ecx
mov    $0xe9,%edx
cmovb  %ecx,%edx
add    %al,%dl
movsbl %dl,%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %17
7: ; preds = %0
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 119
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, 3
%15 = trunc i32 %14 to i8
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %15)
br label %23
17: ; preds = %7, %0
%18 = load i8, i8* %2
%19 = sext i8 %18 to i32
%20 = sub nsw i32 %19, 23
%21 = trunc i32 %20 to i8
%22 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %21)
br label %23
23: ; preds = %17, %11
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = add i8 %1, -97
%3 = icmp ult i8 %2, 23
%4 = select i1 %3, i8 3, i8 -23
%5 = add i8 %1, %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %5)
ret i32 0
}
float convert_rad_to_decdeg(float th_rad) {
  float rad_to_decdeg = 1800.0 / 3.141592653;
  return th_rad * rad_to_decdeg;
}


x86 assembly (clang, -O0):
<convert_rad_to_decdeg>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_rad_to_decdeg>:
mulss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @convert_rad_to_decdeg(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
store float 0x4081E7A9A0000000, float* %3
%4 = load float, float* %2
%5 = load float, float* %3
%6 = fmul float %4, %5
ret float %6
}

LLVM IR (-O2):
define float @convert_rad_to_decdeg(float %0) {
%2 = fmul float %0, 0x4081E7A9A0000000
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ troca(int *, int *);
int main() {
  int a = 10, b = 9;
  troca(&a, &b);
  printf(" A = %d  B = %d", a, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x9,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <troca@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xa,0x4(%rsp)
movl   $0x9,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <troca@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c" A = %d B = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 9, i32* %2
%5 = call i32 @troca(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}
int same_array(int *pfirst, int *psecond) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @same_array(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int copyline(char *);
int readbuff(char *);
int main(void) {
  char buffer[81];
  int status = 0;
  while (status != -1) {
    status = readbuff(buffer);
    if (status == 1)
      status = copyline(buffer);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x64(%rbp)
cmpl   $0xffffffff,-0x64(%rbp)
je     1167 <main+0x47>
lea    -0x60(%rbp),%rdi
call   1040 <readbuff@plt>
mov    %eax,-0x64(%rbp)
cmpl   $0x1,-0x64(%rbp)
jne    1162 <main+0x42>
lea    -0x60(%rbp),%rdi
call   1030 <copyline@plt>
mov    %eax,-0x64(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
mov    %rsp,%rbx
jmp    1135 <main+0x15>
nopw   0x0(%rax,%rax,1)
cmp    $0xffffffff,%eax
je     114c <main+0x2c>
mov    %rbx,%rdi
call   1040 <readbuff@plt>
cmp    $0x1,%eax
jne    1130 <main+0x10>
mov    %rbx,%rdi
call   1030 <copyline@plt>
jmp    1130 <main+0x10>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [81 x i8]
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %15, %0
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%9 = call i32 @readbuff(i8* %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%14 = call i32 @copyline(i8* %13)
store i32 %14, i32* %3
br label %15
15: ; preds = %12, %7
br label %4
16: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [81 x i8]
%2 = getelementptr inbounds [81 x i8], [81 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %0, %8
%4 = call i32 @readbuff(i8* %2)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = call i32 @copyline(i8* %2)
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ %7, %6 ], [ %4, %3 ]
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %3
11: ; preds = %8
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int arg_rs(void) {
  printf("rs\n");
  return -1;
}


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"rs\00"
define i32 @arg_rs() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
bool pp_prelim_check(long num) {
  if (num < 2) {
    return false;
  }
  if (num > 2 && num % 2 == 0) {
    return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<pp_prelim_check>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x2,-0x10(%rbp)
jge    111f <pp_prelim_check+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1155 <pp_prelim_check+0x55>
cmpq   $0x2,-0x10(%rbp)
jle    114e <pp_prelim_check+0x4e>
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    114e <pp_prelim_check+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1155 <pp_prelim_check+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pp_prelim_check>:
xor    %eax,%eax
cmp    $0x2,%rdi
jl     1115 <pp_prelim_check+0x15>
sete   %al
or     %al,%dil
movzbl %dil,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @pp_prelim_check(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp slt i64 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %16
7: ; preds = %1
%8 = load i64, i64* %3
%9 = icmp sgt i64 %8, 2
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i64, i64* %3
%12 = srem i64 %11, 2
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 0, i32* %2
br label %16
15: ; preds = %10, %7
store i32 1, i32* %2
br label %16
16: ; preds = %15, %14, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @pp_prelim_check(i64 %0) {
%2 = icmp slt i64 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = icmp eq i64 %0, 2
%5 = and i64 %0, 1
%6 = icmp ne i64 %5, 0
%7 = or i1 %4, %6
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %10
}
void power_info_eeprom_def(struct edump *edump) {}


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

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

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

LLVM IR (-O2):
%struct.edump = type opaque
define void @power_info_eeprom_def(%struct.edump* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void test_vorr_u16x8(uint16_t *__restrict__ dest, uint16_t *a, uint16_t *b) {
  int i;
  for (i = 0; i < 8; i++) {
    dest[i] = a[i] | b[i];
  }
}


x86 assembly (clang, -O0):
<test_vorr_u16x8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jge    1150 <test_vorr_u16x8+0x50>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
or     (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <test_vorr_u16x8+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vorr_u16x8>:
movups (%rsi),%xmm0
movups (%rdx),%xmm1
orps   %xmm0,%xmm1
movups %xmm1,(%rdi)
movups 0x10(%rsi),%xmm0
movups 0x10(%rdx),%xmm1
orps   %xmm0,%xmm1
movups %xmm1,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @test_vorr_u16x8(i32* noalias nocapture writeonly %0, i32* nocapture %1, i32* nocapture %2) {
%4 = bitcast i32* %1 to <4 x i32>*
%5 = load <4 x i32>, <4 x i32>* %4
%6 = bitcast i32* %2 to <4 x i32>*
%7 = load <4 x i32>, <4 x i32>* %6
%8 = or <4 x i32> %7, %5
%9 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %8, <4 x i32>* %9
%10 = getelementptr inbounds i32, i32* %1, i64 4
%11 = getelementptr inbounds i32, i32* %2, i64 4
%12 = getelementptr inbounds i32, i32* %0, i64 4
%13 = bitcast i32* %10 to <4 x i32>*
%14 = load <4 x i32>, <4 x i32>* %13
%15 = bitcast i32* %11 to <4 x i32>*
%16 = load <4 x i32>, <4 x i32>* %15
%17 = or <4 x i32> %16, %14
%18 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> %17, <4 x i32>* %18
ret void
}
int pseudo_random(int i) { return (16411 * i) & (32767); }


x86 assembly (clang, -O0):
<pseudo_random>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x401b,-0x4(%rbp),%eax
and    $0x7fff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pseudo_random>:
imul   $0x401b,%edi,%eax
and    $0x7fff,%eax
ret

LLVM IR (-O0):
define i32 @pseudo_random(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 16411, %3
%5 = and i32 %4, 32767
ret i32 %5
}

LLVM IR (-O2):
define i32 @pseudo_random(i32 %0) {
%2 = mul nsw i32 %0, 16411
%3 = and i32 %2, 32767
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timespec {
  long long tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t gethrtime(void) {
  struct timespec tp;
  tp.tv_sec = 0;
  tp.tv_nsec = 0;
  clock_gettime(CLOCK_MONOTONIC, &tp);
  return (tp.tv_sec * 1000000000LL) + tp.tv_nsec;
}


x86 assembly (clang, -O0):
<gethrtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,-0x10(%rbp),%rax
3b
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gethrtime>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,(%rsp),%rax
3b
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @gethrtime() {
%1 = alloca %struct.timespec
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
store i64 0, i64* %2
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
store i64 0, i64* %3
%4 = load i32, i32* @CLOCK_MONOTONIC
%5 = call i32 @clock_gettime(i32 %4, %struct.timespec* %1)
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = mul nsw i64 %7, 1000000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%10 = load i64, i64* %9
%11 = add nsw i64 %8, %10
ret i64 %11
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @gethrtime() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%5 = bitcast %struct.timespec* %1 to i8*
%6 = load i32, i32* @CLOCK_MONOTONIC
%7 = call i32 @clock_gettime(i32 %6, %struct.timespec* %1)
%8 = load i64, i64* %3
%9 = mul nsw i64 %8, 1000000000
%10 = load i64, i64* %4
%11 = add nsw i64 %9, %10
ret i64 %11
}
void f(void) {
  void (*p)(void);
  p = f;
  p = &f;
  p();
  (*p)();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2ec6(%rip),%rax
mov    %rax,-0x8(%rbp)
call   *-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
call   1030 <f@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1120 <f+0x10>

LLVM IR (-O0):
define void @f() {
%1 = alloca void ()*
store void ()* @f, void ()** %1
store void ()* @f, void ()** %1
%2 = load void ()*, void ()** %1
%3 = load void ()*, void ()** %1
ret void
}

LLVM IR (-O2):
define void @f() {
tail call void @f()
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ test_convert_float();
int main(void) {
  printf("sizeof(float)=%lu\n", sizeof(float));
  printf("sizeof(int)=%lu\n", sizeof(int));
  test_convert_float();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <test_convert_float@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <test_convert_float@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"sizeof(float)=%lu\0A\00"
@.str.1 = [17 x i8] c"sizeof(int)=%lu\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 4)
%4 = call i32 (...) @test_convert_float()
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"sizeof(float)=%lu\0A\00"
@.str.1 = [17 x i8] c"sizeof(int)=%lu\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = tail call i32 (...) @test_convert_float()
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int main(void) {
  int six = 6;
  int seven = 7;
  return six * seven;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 6, i32* %2
store i32 7, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = mul nsw i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
void print_error(const char *function_name, char *error_msg) {
  fprintf(stderr, "Error in function %s: %s\n", function_name, error_msg);
}


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error>:
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Error in function %s: %s\0A\00"
define void @print_error(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int length(int *);
int /*<<< orphan*/ printf(char *, int);
void display(int arr[]) {
  int len, i;
  len = length(arr);
  for (i = 0; i < len; i++)
    printf("%d ", arr[i]);
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <length@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1170 <display+0x50>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <display+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r15
call   1030 <length@plt>
test   %eax,%eax
jle    1155 <display+0x35>
mov    %eax,%r12d
xor    %ebx,%ebx
lea    0xec0(%rip),%r14
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <display+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @display(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @length(i32* %5)
store i32 %6, i32* %3
store i32 0, i32* %4
br label %7
7: ; preds = %18, %1
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i32*, i32** %2
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %7
21: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @display(i32* %0) {
%2 = tail call i32 @length(i32* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %1
ret void
}
/* Variables and functions */
scalar_t__ strstr(char *, char *);
int eq(char *a, char *b) { return strstr(a, b) != 0; }


x86 assembly (clang, -O0):
<eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eq>:
push   %rax
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @eq(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strstr(i8* %5, i8* %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @eq(i8* %0, i8* %1) {
%3 = tail call i64 @strstr(i8* %0, i8* %1)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void _dedx_free_split_temp(char **temp) {
  int i = 0;
  for (i = 0; i < 10; i++)
    free(temp[i]);
  free(temp);
}


x86 assembly (clang, -O0):
<_dedx_free_split_temp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1153 <_dedx_free_split_temp+0x43>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <_dedx_free_split_temp+0x1a>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dedx_free_split_temp>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    0x8(%rbx),%rdi
call   1030 <free@plt>
mov    0x10(%rbx),%rdi
call   1030 <free@plt>
mov    0x18(%rbx),%rdi
call   1030 <free@plt>
mov    0x20(%rbx),%rdi
call   1030 <free@plt>
mov    0x28(%rbx),%rdi
call   1030 <free@plt>
mov    0x30(%rbx),%rdi
call   1030 <free@plt>
mov    0x38(%rbx),%rdi
call   1030 <free@plt>
mov    0x40(%rbx),%rdi
call   1030 <free@plt>
mov    0x48(%rbx),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @_dedx_free_split_temp(i8** nocapture %0) {
%2 = load i8*, i8** %0
tail call void @free(i8* %2)
%3 = getelementptr inbounds i8*, i8** %0, i64 1
%4 = load i8*, i8** %3
tail call void @free(i8* %4)
%5 = getelementptr inbounds i8*, i8** %0, i64 2
%6 = load i8*, i8** %5
tail call void @free(i8* %6)
%7 = getelementptr inbounds i8*, i8** %0, i64 3
%8 = load i8*, i8** %7
tail call void @free(i8* %8)
%9 = getelementptr inbounds i8*, i8** %0, i64 4
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = getelementptr inbounds i8*, i8** %0, i64 5
%12 = load i8*, i8** %11
tail call void @free(i8* %12)
%13 = getelementptr inbounds i8*, i8** %0, i64 6
%14 = load i8*, i8** %13
tail call void @free(i8* %14)
%15 = getelementptr inbounds i8*, i8** %0, i64 7
%16 = load i8*, i8** %15
tail call void @free(i8* %16)
%17 = getelementptr inbounds i8*, i8** %0, i64 8
%18 = load i8*, i8** %17
tail call void @free(i8* %18)
%19 = getelementptr inbounds i8*, i8** %0, i64 9
%20 = load i8*, i8** %19
tail call void @free(i8* %20)
%21 = bitcast i8** %0 to i8*
tail call void @free(i8* %21)
ret void
}
/* Variables and functions */
int yas_pcb_check_state(int);
int yas_pcb_test2();
int /*<<< orphan*/ yas_pcb_update_state(int);
int power_off(void) {
  int result = yas_pcb_check_state((7));
  if ((0) == result) {
    result = yas_pcb_test2();
    if ((0) == result)
      yas_pcb_update_state((7));
  }
  return result;
}


x86 assembly (clang, -O0):
<power_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x7,%edi
call   1040 <yas_pcb_check_state@plt>
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jne    1174 <power_off+0x44>
mov    $0x0,%al
call   1050 <yas_pcb_test2@plt>
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jne    116f <power_off+0x3f>
mov    $0x7,%edi
call   1030 <yas_pcb_update_state@plt>
jmp    1174 <power_off+0x44>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power_off>:
push   %rax
mov    $0x7,%edi
call   1040 <yas_pcb_check_state@plt>
test   %eax,%eax
je     1141 <power_off+0x11>
pop    %rcx
ret
xor    %eax,%eax
call   1050 <yas_pcb_test2@plt>
test   %eax,%eax
jne    113f <power_off+0xf>
mov    $0x7,%edi
call   1030 <yas_pcb_update_state@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @power_off() {
%1 = tail call i32 @yas_pcb_check_state(i32 7)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = tail call i32 (...) @yas_pcb_test2()
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @yas_pcb_update_state(i32 7)
br label %8
8: ; preds = %3, %6, %0
%9 = phi i32 [ 0, %6 ], [ %4, %3 ], [ %1, %0 ]
ret i32 %9
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) { printf("%d\n", factorial(3)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <factorial@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1030 <factorial@plt>
lea    0xece(%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 = call i32 @factorial(i32 3)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @factorial(i32 3)
%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 */
scalar_t__ integrate();
int benchmarkRun() { return (int)integrate(); }


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

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

LLVM IR (-O0):
define i32 @benchmarkRun() {
%1 = call i64 (...) @integrate()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @benchmarkRun() {
%1 = tail call i64 (...) @integrate()
%2 = trunc i64 %1 to i32
ret i32 %2
}
int check_1D(int length, int *arr) {
  int i;
  for (i = 0; i < length; i++) {
    if (arr[i] != 1)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_1D>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114f <check_1D+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
je     113c <check_1D+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1156 <check_1D+0x56>
jmp    1141 <check_1D+0x41>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <check_1D+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_1D>:
mov    $0x1,%eax
test   %edi,%edi
jle    111f <check_1D+0x1f>
mov    %edi,%ecx
xor    %edx,%edx
nopl   (%rax)
cmpl   $0x1,(%rsi,%rdx,4)
jne    1120 <check_1D+0x20>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1110 <check_1D+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @check_1D(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 0, i32* %6
br label %7
7: ; preds = %20, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %23
11: ; preds = %7
%12 = load i32*, i32** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = icmp ne i32 %16, 1
br i1 %17, label %18, label %19
18: ; preds = %11
store i32 0, i32* %3
br label %24
19: ; preds = %11
br label %20
20: ; preds = %19
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
br label %7
23: ; preds = %7
store i32 1, i32* %3
br label %24
24: ; preds = %23, %18
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @check_1D(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %13, %5
br i1 %7, label %14, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 0, %4 ], [ %13, %6 ]
%10 = getelementptr inbounds i32, i32* %1, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 1
%13 = add nuw nsw i64 %9, 1
br i1 %12, label %6, label %14
14: ; preds = %8, %6, %2
%15 = phi i32 [ 1, %2 ], [ 1, %6 ], [ 0, %8 ]
ret i32 %15
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int verify_file_exists(const char *path) {
  struct stat st;
  if (stat(path, &st) == -1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<verify_file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    113e <verify_file_exists+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1145 <verify_file_exists+0x35>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @verify_file_exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %10
9: ; preds = %1
store i32 1, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @verify_file_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp ne i32 %4, -1
%6 = zext i1 %5 to i32
ret i32 %6
}
void freeSpace(int **gridA, int **gridB, int gridSize) {
  for (int i = 0; i < gridSize; i++) {
    free(gridA[i]);
    free(gridB[i]);
  }
  free(gridA);
  free(gridB);
}


x86 assembly (clang, -O0):
<freeSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1166 <freeSpace+0x56>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <freeSpace+0x1a>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeSpace>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
test   %edx,%edx
jle    114b <freeSpace+0x3b>
mov    %edx,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
call   1030 <free@plt>
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <freeSpace+0x20>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeSpace(i32** nocapture %0, i32** nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %10
7: ; preds = %10, %3
%8 = bitcast i32** %0 to i8*
tail call void @free(i8* %8)
%9 = bitcast i32** %1 to i8*
tail call void @free(i8* %9)
ret void
10: ; preds = %5, %10
%11 = phi i64 [ 0, %5 ], [ %18, %10 ]
%12 = getelementptr inbounds i32*, i32** %0, i64 %11
%13 = bitcast i32** %12 to i8**
%14 = load i8*, i8** %13
tail call void @free(i8* %14)
%15 = getelementptr inbounds i32*, i32** %1, i64 %11
%16 = bitcast i32** %15 to i8**
%17 = load i8*, i8** %16
tail call void @free(i8* %17)
%18 = add nuw nsw i64 %11, 1
%19 = icmp eq i64 %18, %6
br i1 %19, label %7, label %10
}
/* Variables and functions */
int /*<<< orphan*/ c_fstr2hecmw_connect_conv(int, int *, int *, int *);
void fstr2hecmw_connect_conv__(int *n_elem, int elem_type[],
                               int elem_node_index[], int elem_node_item[]) {
  c_fstr2hecmw_connect_conv(*n_elem, elem_type, elem_node_index,
                            elem_node_item);
}


x86 assembly (clang, -O0):
<fstr2hecmw_connect_conv__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <c_fstr2hecmw_connect_conv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstr2hecmw_connect_conv__>:
mov    (%rdi),%edi
jmp    1030 <c_fstr2hecmw_connect_conv@plt>

LLVM IR (-O0):
define void @fstr2hecmw_connect_conv__(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = call i32 @c_fstr2hecmw_connect_conv(i32 %10, i32* %11, i32* %12, i32* %13)
ret void
}

LLVM IR (-O2):
define void @fstr2hecmw_connect_conv__(i32* nocapture %0, i32* %1, i32* %2, i32* %3) {
%5 = load i32, i32* %0
%6 = tail call i32 @c_fstr2hecmw_connect_conv(i32 %5, i32* %1, i32* %2, i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _quick_sort_(int *, int /*<<< orphan*/, int);
int quick_sort(int *array, int size) {
  _quick_sort_(array, 0, size);
  return 0;
}


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

x86 assembly (clang, -O2):
<quick_sort>:
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <_quick_sort_@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @quick_sort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @_quick_sort_(i32* %5, i32 0, i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @quick_sort(i32* %0, i32 %1) {
%3 = tail call i32 @_quick_sort_(i32* %0, i32 0, i32 %1)
ret i32 0
}