#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*/ bar(double *, double *, double *);
__attribute__((no)) int main1(int n, double *__restrict__ pa,
                              double *__restrict__ pb,
                              double *__restrict__ pc) {
  int i;
  for (i = 0; i < n; i++) {
    pa[i] = pb[i] * pc[i];
  }
  bar(pa, pb, pc);
  return 0;
}


x86 assembly (clang, -O0):
<main1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116f <main1+0x5f>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    112e <main1+0x1e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <bar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main1>:
push   %rax
mov    %rsi,%r10
test   %edi,%edi
jle    1219 <main1+0x109>
mov    %edi,%r8d
cmp    $0x4,%edi
jae    112b <main1+0x1b>
xor    %edi,%edi
jmp    1200 <main1+0xf0>
mov    %r8d,%edi
and    $0xfffffffc,%edi
lea    -0x4(%rdi),%rax
mov    %rax,%r9
shr    $0x2,%r9
add    $0x1,%r9
test   %rax,%rax
je     122b <main1+0x11b>
mov    %r9,%rsi
and    $0xfffffffffffffffe,%rsi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movupd (%rdx,%rax,8),%xmm0
movupd 0x10(%rdx,%rax,8),%xmm1
movupd (%rcx,%rax,8),%xmm2
mulpd  %xmm0,%xmm2
movupd 0x10(%rcx,%rax,8),%xmm0
mulpd  %xmm1,%xmm0
movupd %xmm2,(%r10,%rax,8)
movupd %xmm0,0x10(%r10,%rax,8)
movupd 0x20(%rdx,%rax,8),%xmm0
movupd 0x30(%rdx,%rax,8),%xmm1
movupd 0x20(%rcx,%rax,8),%xmm2
mulpd  %xmm0,%xmm2
movupd 0x30(%rcx,%rax,8),%xmm0
mulpd  %xmm1,%xmm0
movupd %xmm2,0x20(%r10,%rax,8)
movupd %xmm0,0x30(%r10,%rax,8)
add    $0x8,%rax
add    $0xfffffffffffffffe,%rsi
jne    1160 <main1+0x50>
test   $0x1,%r9b
je     11f4 <main1+0xe4>
movupd (%rdx,%rax,8),%xmm0
movupd 0x10(%rdx,%rax,8),%xmm1
movupd (%rcx,%rax,8),%xmm2
mulpd  %xmm0,%xmm2
movupd 0x10(%rcx,%rax,8),%xmm0
mulpd  %xmm1,%xmm0
movupd %xmm2,(%r10,%rax,8)
movupd %xmm0,0x10(%r10,%rax,8)
cmp    %r8,%rdi
je     1219 <main1+0x109>
nopl   0x0(%rax)
movsd  (%rdx,%rdi,8),%xmm0
mulsd  (%rcx,%rdi,8),%xmm0
movsd  %xmm0,(%r10,%rdi,8)
add    $0x1,%rdi
cmp    %rdi,%r8
jne    1200 <main1+0xf0>
mov    %r10,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
test   $0x1,%r9b
jne    11c9 <main1+0xb9>
jmp    11f4 <main1+0xe4>

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

LLVM IR (-O2):
define i32 @main1(i32 %0, double* noalias %1, double* noalias %2, double* noalias %3) {
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %97
6: ; preds = %4
%7 = zext i32 %0 to i64
%8 = icmp ult i32 %0, 4
br i1 %8, label %85, label %9
9: ; preds = %6
%10 = and i64 %7, 4294967292
%11 = add nsw i64 %10, -4
%12 = lshr exact i64 %11, 2
%13 = add nuw nsw i64 %12, 1
%14 = and i64 %13, 1
%15 = icmp eq i64 %11, 0
br i1 %15, label %61, label %16
16: ; preds = %9
%17 = and i64 %13, 9223372036854775806
br label %18
18: ; preds = %18, %16
%19 = phi i64 [ 0, %16 ], [ %58, %18 ]
%20 = phi i64 [ 0, %16 ], [ %59, %18 ]
%21 = getelementptr inbounds double, double* %2, i64 %19
%22 = bitcast double* %21 to <2 x double>*
%23 = load <2 x double>, <2 x double>* %22
%24 = getelementptr inbounds double, double* %21, i64 2
%25 = bitcast double* %24 to <2 x double>*
%26 = load <2 x double>, <2 x double>* %25
%27 = getelementptr inbounds double, double* %3, i64 %19
%28 = bitcast double* %27 to <2 x double>*
%29 = load <2 x double>, <2 x double>* %28
%30 = getelementptr inbounds double, double* %27, i64 2
%31 = bitcast double* %30 to <2 x double>*
%32 = load <2 x double>, <2 x double>* %31
%33 = fmul <2 x double> %23, %29
%34 = fmul <2 x double> %26, %32
%35 = getelementptr inbounds double, double* %1, i64 %19
%36 = bitcast double* %35 to <2 x double>*
store <2 x double> %33, <2 x double>* %36
%37 = getelementptr inbounds double, double* %35, i64 2
%38 = bitcast double* %37 to <2 x double>*
store <2 x double> %34, <2 x double>* %38
%39 = or i64 %19, 4
%40 = getelementptr inbounds double, double* %2, i64 %39
%41 = bitcast double* %40 to <2 x double>*
%42 = load <2 x double>, <2 x double>* %41
%43 = getelementptr inbounds double, double* %40, i64 2
%44 = bitcast double* %43 to <2 x double>*
%45 = load <2 x double>, <2 x double>* %44
%46 = getelementptr inbounds double, double* %3, i64 %39
%47 = bitcast double* %46 to <2 x double>*
%48 = load <2 x double>, <2 x double>* %47
%49 = getelementptr inbounds double, double* %46, i64 2
%50 = bitcast double* %49 to <2 x double>*
%51 = load <2 x double>, <2 x double>* %50
%52 = fmul <2 x double> %42, %48
%53 = fmul <2 x double> %45, %51
%54 = getelementptr inbounds double, double* %1, i64 %39
%55 = bitcast double* %54 to <2 x double>*
store <2 x double> %52, <2 x double>* %55
%56 = getelementptr inbounds double, double* %54, i64 2
%57 = bitcast double* %56 to <2 x double>*
store <2 x double> %53, <2 x double>* %57
%58 = add nuw i64 %19, 8
%59 = add i64 %20, 2
%60 = icmp eq i64 %59, %17
br i1 %60, label %61, label %18
61: ; preds = %18, %9
%62 = phi i64 [ 0, %9 ], [ %58, %18 ]
%63 = icmp eq i64 %14, 0
br i1 %63, label %83, label %64
64: ; preds = %61
%65 = getelementptr inbounds double, double* %2, i64 %62
%66 = bitcast double* %65 to <2 x double>*
%67 = load <2 x double>, <2 x double>* %66
%68 = getelementptr inbounds double, double* %65, i64 2
%69 = bitcast double* %68 to <2 x double>*
%70 = load <2 x double>, <2 x double>* %69
%71 = getelementptr inbounds double, double* %3, i64 %62
%72 = bitcast double* %71 to <2 x double>*
%73 = load <2 x double>, <2 x double>* %72
%74 = getelementptr inbounds double, double* %71, i64 2
%75 = bitcast double* %74 to <2 x double>*
%76 = load <2 x double>, <2 x double>* %75
%77 = fmul <2 x double> %67, %73
%78 = fmul <2 x double> %70, %76
%79 = getelementptr inbounds double, double* %1, i64 %62
%80 = bitcast double* %79 to <2 x double>*
store <2 x double> %77, <2 x double>* %80
%81 = getelementptr inbounds double, double* %79, i64 2
%82 = bitcast double* %81 to <2 x double>*
store <2 x double> %78, <2 x double>* %82
br label %83
83: ; preds = %61, %64
%84 = icmp eq i64 %10, %7
br i1 %84, label %97, label %85
85: ; preds = %6, %83
%86 = phi i64 [ 0, %6 ], [ %10, %83 ]
br label %87
87: ; preds = %85, %87
%88 = phi i64 [ %95, %87 ], [ %86, %85 ]
%89 = getelementptr inbounds double, double* %2, i64 %88
%90 = load double, double* %89
%91 = getelementptr inbounds double, double* %3, i64 %88
%92 = load double, double* %91
%93 = fmul double %90, %92
%94 = getelementptr inbounds double, double* %1, i64 %88
store double %93, double* %94
%95 = add nuw nsw i64 %88, 1
%96 = icmp eq i64 %95, %7
br i1 %96, label %97, label %87
97: ; preds = %87, %83, %4
%98 = tail call i32 @bar(double* %1, double* %2, double* %3)
ret i32 0
}