#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ check_vect();
int /*<<< orphan*/ main1(float *);
int main(void) {
  int i;
  float a[3001] __attribute__((__aligned__(16)));
  float b[3001] __attribute__((__aligned__(16)));
  check_vect();
  for (i = 0; i < 3001; i++)
    b[i] = i;
  a[0] = 0;
  for (i = 1; i <= 256; i++)
    a[i] = b[i - 1];
  for (i = 1; i <= 256; i++) {
    if (a[i] != i - 1)
      abort();
  }
  if (a[0] != 0)
    abort();
  main1(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x5de0,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <check_vect@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xbb9,-0x8(%rbp)
jge    117d <main+0x4d>
cvtsi2ssl -0x8(%rbp),%xmm0
movslq -0x8(%rbp),%rax
movss  %xmm0,-0x5de0(%rbp,%rax,4)
ff ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1150 <main+0x20>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x2ef0(%rbp)
ff
movl   $0x1,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jg     11c8 <main+0x98>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
movss  -0x5de0(%rbp,%rax,4),%xmm0
ff ff
movslq -0x8(%rbp),%rax
movss  %xmm0,-0x2ef0(%rbp,%rax,4)
ff ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    118f <main+0x5f>
movl   $0x1,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jg     1221 <main+0xf1>
movslq -0x8(%rbp),%rax
movss  -0x2ef0(%rbp,%rax,4),%xmm0
ff ff
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cvtsi2ss %eax,%xmm1
ucomiss %xmm1,%xmm0
jne    1207 <main+0xd7>
jp     1207 <main+0xd7>
jmp    120e <main+0xde>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1213 <main+0xe3>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11cf <main+0x9f>
movss  -0x2ef0(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1240 <main+0x110>
jp     1240 <main+0x110>
jmp    1247 <main+0x117>
mov    $0x0,%al
call   1030 <abort@plt>
lea    -0x2ef0(%rbp),%rdi
call   1050 <main1@plt>
xor    %eax,%eax
add    $0x5de0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x5dd8,%rsp
xor    %eax,%eax
call   1040 <check_vect@plt>
movdqa 0xeaa(%rip),%xmm0
mov    $0x14,%eax
movdqa 0xeac(%rip),%xmm8
movdqa 0xeb4(%rip),%xmm2
movdqa 0xebc(%rip),%xmm3
movdqa 0xec4(%rip),%xmm4
movdqa 0xecc(%rip),%xmm5
movdqa 0xed4(%rip),%xmm6
nopl   0x0(%rax)
movdqa %xmm0,%xmm7
paddd  %xmm8,%xmm7
cvtdq2ps %xmm0,%xmm1
cvtdq2ps %xmm7,%xmm7
movaps %xmm1,-0x50(%rsp,%rax,4)
movaps %xmm7,-0x40(%rsp,%rax,4)
movdqa %xmm0,%xmm1
paddd  %xmm2,%xmm1
movdqa %xmm0,%xmm7
paddd  %xmm3,%xmm7
cvtdq2ps %xmm1,%xmm1
cvtdq2ps %xmm7,%xmm7
movaps %xmm1,-0x30(%rsp,%rax,4)
movaps %xmm7,-0x20(%rsp,%rax,4)
movdqa %xmm0,%xmm1
paddd  %xmm4,%xmm1
movdqa %xmm0,%xmm7
paddd  %xmm5,%xmm7
cvtdq2ps %xmm1,%xmm1
cvtdq2ps %xmm7,%xmm7
movaps %xmm1,-0x10(%rsp,%rax,4)
movaps %xmm7,(%rsp,%rax,4)
paddd  %xmm6,%xmm0
add    $0x18,%rax
cmp    $0xbcc,%rax
jne    1190 <main+0x50>
movl   $0x453b8000,0x2ee0(%rsp)
movl   $0x0,0x2ef0(%rsp)
lea    0x2ef4(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x400,%edx
call   1060 <memcpy@plt>
mov    $0xffffffffffffff00,%rax
nopw   0x0(%rax,%rax,1)
lea    0x100(%rax),%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
movss  0x32f4(%rsp,%rax,4),%xmm1
ucomiss %xmm0,%xmm1
jne    12c1 <main+0x181>
jp     12c1 <main+0x181>
lea    0x101(%rax),%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
movss  0x32f8(%rsp,%rax,4),%xmm1
ucomiss %xmm0,%xmm1
jne    12c1 <main+0x181>
jp     12c1 <main+0x181>
lea    0x102(%rax),%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
movss  0x32fc(%rsp,%rax,4),%xmm1
ucomiss %xmm0,%xmm1
jne    12c1 <main+0x181>
jp     12c1 <main+0x181>
lea    0x103(%rax),%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
movss  0x3300(%rsp,%rax,4),%xmm1
ucomiss %xmm0,%xmm1
jne    12c1 <main+0x181>
jp     12c1 <main+0x181>
add    $0x4,%rax
jne    1230 <main+0xf0>
lea    0x2ef0(%rsp),%rdi
call   1050 <main1@plt>
xor    %eax,%eax
add    $0x5dd8,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [3001 x float]
%4 = alloca [3001 x float]
store i32 0, i32* %1
%5 = call i32 (...) @check_vect()
store i32 0, i32* %2
br label %6
6: ; preds = %15, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 3001
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load i32, i32* %2
%11 = sitofp i32 %10 to float
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [3001 x float], [3001 x float]* %4, i64 0, i64 %13
store float %11, float* %14
br label %15
15: ; preds = %9
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %6
18: ; preds = %6
%19 = getelementptr inbounds [3001 x float], [3001 x float]* %3, i64 0, i64 0
store float 0.000000e+00, float* %19
store i32 1, i32* %2
br label %20
20: ; preds = %32, %18
%21 = load i32, i32* %2
%22 = icmp sle i32 %21, 256
br i1 %22, label %23, label %35
23: ; preds = %20
%24 = load i32, i32* %2
%25 = sub nsw i32 %24, 1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [3001 x float], [3001 x float]* %4, i64 0, i64 %26
%28 = load float, float* %27
%29 = load i32, i32* %2
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [3001 x float], [3001 x float]* %3, i64 0, i64 %30
store float %28, float* %31
br label %32
32: ; preds = %23
%33 = load i32, i32* %2
%34 = add nsw i32 %33, 1
store i32 %34, i32* %2
br label %20
35: ; preds = %20
store i32 1, i32* %2
br label %36
36: ; preds = %51, %35
%37 = load i32, i32* %2
%38 = icmp sle i32 %37, 256
br i1 %38, label %39, label %54
39: ; preds = %36
%40 = load i32, i32* %2
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [3001 x float], [3001 x float]* %3, i64 0, i64 %41
%43 = load float, float* %42
%44 = load i32, i32* %2
%45 = sub nsw i32 %44, 1
%46 = sitofp i32 %45 to float
%47 = fcmp une float %43, %46
br i1 %47, label %48, label %50
48: ; preds = %39
%49 = call i32 (...) @abort()
unreachable
50: ; preds = %39
br label %51
51: ; preds = %50
%52 = load i32, i32* %2
%53 = add nsw i32 %52, 1
store i32 %53, i32* %2
br label %36
54: ; preds = %36
%55 = getelementptr inbounds [3001 x float], [3001 x float]* %3, i64 0, i64 0
%56 = load float, float* %55
%57 = fcmp une float %56, 0.000000e+00
br i1 %57, label %58, label %60
58: ; preds = %54
%59 = call i32 (...) @abort()
unreachable
60: ; preds = %54
%61 = getelementptr inbounds [3001 x float], [3001 x float]* %3, i64 0, i64 0
%62 = call i32 @main1(float* %61)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [3001 x float]
%2 = alloca [3001 x float]
%3 = bitcast [3001 x float]* %2 to i8*
%4 = bitcast [3001 x float]* %1 to i8*
%5 = tail call i32 (...) @check_vect()
br label %6
6: ; preds = %6, %0
%7 = phi i64 [ 0, %0 ], [ %34, %6 ]
%8 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %0 ], [ %35, %6 ]
%9 = add <4 x i32> %8, <i32 4, i32 4, i32 4, i32 4>
%10 = sitofp <4 x i32> %8 to <4 x float>
%11 = sitofp <4 x i32> %9 to <4 x float>
%12 = getelementptr inbounds [3001 x float], [3001 x float]* %2, i64 0, i64 %7
%13 = bitcast float* %12 to <4 x float>*
store <4 x float> %10, <4 x float>* %13
%14 = getelementptr inbounds float, float* %12, i64 4
%15 = bitcast float* %14 to <4 x float>*
store <4 x float> %11, <4 x float>* %15
%16 = add nuw nsw i64 %7, 8
%17 = add <4 x i32> %8, <i32 8, i32 8, i32 8, i32 8>
%18 = add <4 x i32> %8, <i32 12, i32 12, i32 12, i32 12>
%19 = sitofp <4 x i32> %17 to <4 x float>
%20 = sitofp <4 x i32> %18 to <4 x float>
%21 = getelementptr inbounds [3001 x float], [3001 x float]* %2, i64 0, i64 %16
%22 = bitcast float* %21 to <4 x float>*
store <4 x float> %19, <4 x float>* %22
%23 = getelementptr inbounds float, float* %21, i64 4
%24 = bitcast float* %23 to <4 x float>*
store <4 x float> %20, <4 x float>* %24
%25 = add nuw nsw i64 %7, 16
%26 = add <4 x i32> %8, <i32 16, i32 16, i32 16, i32 16>
%27 = add <4 x i32> %8, <i32 20, i32 20, i32 20, i32 20>
%28 = sitofp <4 x i32> %26 to <4 x float>
%29 = sitofp <4 x i32> %27 to <4 x float>
%30 = getelementptr inbounds [3001 x float], [3001 x float]* %2, i64 0, i64 %25
%31 = bitcast float* %30 to <4 x float>*
store <4 x float> %28, <4 x float>* %31
%32 = getelementptr inbounds float, float* %30, i64 4
%33 = bitcast float* %32 to <4 x float>*
store <4 x float> %29, <4 x float>* %33
%34 = add nuw nsw i64 %7, 24
%35 = add <4 x i32> %8, <i32 24, i32 24, i32 24, i32 24>
%36 = icmp eq i64 %34, 3000
br i1 %36, label %37, label %6
37: ; preds = %6
%38 = getelementptr inbounds [3001 x float], [3001 x float]* %2, i64 0, i64 3000
store float 3.000000e+03, float* %38
%39 = getelementptr inbounds [3001 x float], [3001 x float]* %1, i64 0, i64 0
store float 0.000000e+00, float* %39
%40 = getelementptr inbounds [3001 x float], [3001 x float]* %1, i64 0, i64 1
%41 = bitcast float* %40 to i8*
br label %69
42: ; preds = %69
%43 = add nuw nsw i64 %70, 1
%44 = getelementptr inbounds [3001 x float], [3001 x float]* %1, i64 0, i64 %43
%45 = load float, float* %44
%46 = trunc i64 %43 to i32
%47 = add nsw i32 %46, -1
%48 = sitofp i32 %47 to float
%49 = fcmp une float %45, %48
br i1 %49, label %77, label %50
50: ; preds = %42
%51 = add nuw nsw i64 %70, 2
%52 = getelementptr inbounds [3001 x float], [3001 x float]* %1, i64 0, i64 %51
%53 = load float, float* %52
%54 = trunc i64 %51 to i32
%55 = add nsw i32 %54, -1
%56 = sitofp i32 %55 to float
%57 = fcmp une float %53, %56
br i1 %57, label %77, label %58
58: ; preds = %50
%59 = add nuw nsw i64 %70, 3
%60 = getelementptr inbounds [3001 x float], [3001 x float]* %1, i64 0, i64 %59
%61 = load float, float* %60
%62 = trunc i64 %59 to i32
%63 = add nsw i32 %62, -1
%64 = sitofp i32 %63 to float
%65 = fcmp une float %61, %64
br i1 %65, label %77, label %66
66: ; preds = %58
%67 = add nuw nsw i64 %70, 4
%68 = icmp eq i64 %67, 257
br i1 %68, label %79, label %69
69: ; preds = %66, %37
%70 = phi i64 [ 1, %37 ], [ %67, %66 ]
%71 = getelementptr inbounds [3001 x float], [3001 x float]* %1, i64 0, i64 %70
%72 = load float, float* %71
%73 = trunc i64 %70 to i32
%74 = add nsw i32 %73, -1
%75 = sitofp i32 %74 to float
%76 = fcmp une float %72, %75
br i1 %76, label %77, label %42
77: ; preds = %58, %50, %42, %69
%78 = tail call i32 (...) @abort()
unreachable
79: ; preds = %66
%80 = call i32 @main1(float* %39)
ret i32 0
}