#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*/ foo(int *, int const *, int);
int /*<<< orphan*/ foo_novec(int *, int const *, int);
int main(void) {
  const int lp[25] = {
      0,  2,  4,  6,  8,  10, 12, 14, 16, 18, 20, 22, 24,
      26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48,
  };
  int out[49] = {0};
  int out2[49] = {0};
  int s;
  foo(out + 2, lp + 1, 48);
  foo_novec(out2 + 2, lp + 1, 48);
  for (s = 0; s < 49; s++)
    if (out[s] != out2[s])
      abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xe93(%rip),%rsi
mov    $0x64,%edx
call   1050 <memcpy@plt>
lea    -0x140(%rbp),%rdi
xor    %esi,%esi
mov    $0xc4,%edx
call   1040 <memset@plt>
lea    -0x210(%rbp),%rdi
xor    %esi,%esi
mov    $0xc4,%edx
call   1040 <memset@plt>
lea    -0x140(%rbp),%rdi
add    $0x8,%rdi
lea    -0x70(%rbp),%rsi
add    $0x4,%rsi
mov    $0x30,%edx
call   1070 <foo@plt>
lea    -0x210(%rbp),%rdi
add    $0x8,%rdi
lea    -0x70(%rbp),%rsi
add    $0x4,%rsi
mov    $0x30,%edx
call   1060 <foo_novec@plt>
movl   $0x0,-0x214(%rbp)
cmpl   $0x31,-0x214(%rbp)
jge    1230 <main+0xe0>
movslq -0x214(%rbp),%rax
mov    -0x140(%rbp,%rax,4),%eax
movslq -0x214(%rbp),%rcx
cmp    -0x210(%rbp,%rcx,4),%eax
je     1217 <main+0xc7>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    121c <main+0xcc>
mov    -0x214(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x214(%rbp)
jmp    11e1 <main+0x91>
xor    %eax,%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x210,%rsp
mov    0xf22(%rip),%eax
mov    %eax,0x200(%rsp)
movaps 0xf04(%rip),%xmm0
movaps %xmm0,0x1f0(%rsp)
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x1e0(%rsp)
movaps 0xec6(%rip),%xmm0
movaps %xmm0,0x1d0(%rsp)
movaps 0xea7(%rip),%xmm0
movaps %xmm0,0x1c0(%rsp)
movaps 0xe88(%rip),%xmm0
movaps %xmm0,0x1b0(%rsp)
movaps 0xe69(%rip),%xmm0
movaps %xmm0,0x1a0(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x180(%rsp)
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movl   $0x0,0x190(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x0,0xc0(%rsp)
lea    0xd8(%rsp),%rdi
lea    0x1a4(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x30,%edx
call   1050 <foo@plt>
lea    0x8(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x30,%edx
call   1040 <foo_novec@plt>
mov    $0x3,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0xc4(%rsp,%rax,4),%ecx
cmp    -0xc(%rsp,%rax,4),%ecx
jne    12ea <main+0x1ba>
cmp    $0x33,%rax
je     12df <main+0x1af>
mov    0xc8(%rsp,%rax,4),%ecx
cmp    -0x8(%rsp,%rax,4),%ecx
jne    12ea <main+0x1ba>
mov    0xcc(%rsp,%rax,4),%ecx
cmp    -0x4(%rsp,%rax,4),%ecx
jne    12ea <main+0x1ba>
mov    0xd0(%rsp,%rax,4),%ecx
cmp    (%rsp,%rax,4),%ecx
jne    12ea <main+0x1ba>
add    $0x4,%rax
jmp    12a0 <main+0x170>
xor    %eax,%eax
add    $0x210,%rsp
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@__const.main.lp = [25 x i32] [i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14, i32 16, i32 18, i32 20, i32 22, i32 24, i32 26, i32 28, i32 30, i32 32, i32 34, i32 36, i32 38, i32 40, i32 42, i32 44, i32 46, i32 48]
define i32 @main() {
%1 = alloca i32
%2 = alloca [25 x i32]
%3 = alloca [49 x i32]
%4 = alloca [49 x i32]
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [25 x i32]* %2 to i8*
%7 = bitcast [49 x i32]* %3 to i8*
%8 = bitcast [49 x i32]* %4 to i8*
%9 = getelementptr inbounds [49 x i32], [49 x i32]* %3, i64 0, i64 0
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = getelementptr inbounds [25 x i32], [25 x i32]* %2, i64 0, i64 0
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = call i32 @foo(i32* %10, i32* %12, i32 48)
%14 = getelementptr inbounds [49 x i32], [49 x i32]* %4, i64 0, i64 0
%15 = getelementptr inbounds i32, i32* %14, i64 2
%16 = getelementptr inbounds [25 x i32], [25 x i32]* %2, i64 0, i64 0
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = call i32 @foo_novec(i32* %15, i32* %17, i32 48)
store i32 0, i32* %5
br label %19
19: ; preds = %35, %0
%20 = load i32, i32* %5
%21 = icmp slt i32 %20, 49
br i1 %21, label %22, label %38
22: ; preds = %19
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [49 x i32], [49 x i32]* %3, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = load i32, i32* %5
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [49 x i32], [49 x i32]* %4, i64 0, i64 %28
%30 = load i32, i32* %29
%31 = icmp ne i32 %26, %30
br i1 %31, label %32, label %34
32: ; preds = %22
%33 = call i32 (...) @abort()
unreachable
34: ; preds = %22
br label %35
35: ; preds = %34
%36 = load i32, i32* %5
%37 = add nsw i32 %36, 1
store i32 %37, i32* %5
br label %19
38: ; preds = %19
ret i32 0
}

LLVM IR (-O2):
@__const.main.lp = [25 x i32] [i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14, i32 16, i32 18, i32 20, i32 22, i32 24, i32 26, i32 28, i32 30, i32 32, i32 34, i32 36, i32 38, i32 40, i32 42, i32 44, i32 46, i32 48]
define i32 @main() {
%1 = alloca [25 x i32]
%2 = alloca [49 x i32]
%3 = alloca [49 x i32]
%4 = bitcast [25 x i32]* %1 to i8*
%5 = bitcast [49 x i32]* %2 to i8*
%6 = bitcast [49 x i32]* %3 to i8*
%7 = getelementptr inbounds [49 x i32], [49 x i32]* %2, i64 0, i64 2
%8 = getelementptr inbounds [25 x i32], [25 x i32]* %1, i64 0, i64 1
%9 = call i32 @foo(i32* %7, i32* %8, i32 48)
%10 = getelementptr inbounds [49 x i32], [49 x i32]* %3, i64 0, i64 2
%11 = call i32 @foo_novec(i32* %10, i32* %8, i32 48)
br label %37
12: ; preds = %37
%13 = or i64 %38, 1
%14 = icmp eq i64 %13, 49
br i1 %14, label %46, label %15
15: ; preds = %12
%16 = getelementptr inbounds [49 x i32], [49 x i32]* %2, i64 0, i64 %13
%17 = load i32, i32* %16
%18 = getelementptr inbounds [49 x i32], [49 x i32]* %3, i64 0, i64 %13
%19 = load i32, i32* %18
%20 = icmp eq i32 %17, %19
br i1 %20, label %21, label %44
21: ; preds = %15
%22 = or i64 %38, 2
%23 = getelementptr inbounds [49 x i32], [49 x i32]* %2, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = getelementptr inbounds [49 x i32], [49 x i32]* %3, i64 0, i64 %22
%26 = load i32, i32* %25
%27 = icmp eq i32 %24, %26
br i1 %27, label %28, label %44
28: ; preds = %21
%29 = or i64 %38, 3
%30 = getelementptr inbounds [49 x i32], [49 x i32]* %2, i64 0, i64 %29
%31 = load i32, i32* %30
%32 = getelementptr inbounds [49 x i32], [49 x i32]* %3, i64 0, i64 %29
%33 = load i32, i32* %32
%34 = icmp eq i32 %31, %33
br i1 %34, label %35, label %44
35: ; preds = %28
%36 = add nuw nsw i64 %38, 4
br label %37
37: ; preds = %35, %0
%38 = phi i64 [ 0, %0 ], [ %36, %35 ]
%39 = getelementptr inbounds [49 x i32], [49 x i32]* %2, i64 0, i64 %38
%40 = load i32, i32* %39
%41 = getelementptr inbounds [49 x i32], [49 x i32]* %3, i64 0, i64 %38
%42 = load i32, i32* %41
%43 = icmp eq i32 %40, %42
br i1 %43, label %12, label %44
44: ; preds = %28, %21, %15, %37
%45 = call i32 (...) @abort()
unreachable
46: ; preds = %12
ret i32 0
}