#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 */
double *svd_doubleArray(int, int /*<<< orphan*/, char const *);
double *copyVector(double *vec, int n, const char *name) {
  int i;
  double *result = svd_doubleArray(n, 0, name);
  for (i = 0; i < n; i++)
    result[i] = vec[i];
  return result;
}


x86 assembly (clang, -O0):
<copyVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <svd_doubleArray@plt>
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1170 <copyVector+0x60>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113c <copyVector+0x2c>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyVector>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %esi,%edi
xor    %esi,%esi
call   1030 <svd_doubleArray@plt>
test   %ebp,%ebp
jle    1295 <copyVector+0x185>
mov    %ebp,%ecx
cmp    $0x4,%ebp
jb     1146 <copyVector+0x36>
lea    (%rbx,%rcx,8),%rdx
cmp    %rdx,%rax
jae    11bc <copyVector+0xac>
lea    (%rax,%rcx,8),%rdx
cmp    %rbx,%rdx
jbe    11bc <copyVector+0xac>
xor    %edx,%edx
mov    %rdx,%rsi
not    %rsi
add    %rcx,%rsi
mov    %rcx,%rdi
and    $0x3,%rdi
je     1174 <copyVector+0x64>
nopw   0x0(%rax,%rax,1)
movsd  (%rbx,%rdx,8),%xmm0
movsd  %xmm0,(%rax,%rdx,8)
add    $0x1,%rdx
add    $0xffffffffffffffff,%rdi
jne    1160 <copyVector+0x50>
cmp    $0x3,%rsi
jb     1295 <copyVector+0x185>
xchg   %ax,%ax
movsd  (%rbx,%rdx,8),%xmm0
movsd  %xmm0,(%rax,%rdx,8)
movsd  0x8(%rbx,%rdx,8),%xmm0
movsd  %xmm0,0x8(%rax,%rdx,8)
movsd  0x10(%rbx,%rdx,8),%xmm0
movsd  %xmm0,0x10(%rax,%rdx,8)
movsd  0x18(%rbx,%rdx,8),%xmm0
movsd  %xmm0,0x18(%rax,%rdx,8)
add    $0x4,%rdx
cmp    %rdx,%rcx
jne    1180 <copyVector+0x70>
jmp    1295 <copyVector+0x185>
mov    %ecx,%edx
and    $0xfffffffc,%edx
lea    -0x4(%rdx),%rsi
mov    %rsi,%rdi
shr    $0x2,%rdi
add    $0x1,%rdi
mov    %edi,%r8d
and    $0x3,%r8d
cmp    $0xc,%rsi
jae    11e1 <copyVector+0xd1>
xor    %ebp,%ebp
jmp    1248 <copyVector+0x138>
and    $0xfffffffffffffffc,%rdi
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
movups (%rbx,%rbp,8),%xmm0
movups 0x10(%rbx,%rbp,8),%xmm1
movups %xmm0,(%rax,%rbp,8)
movups %xmm1,0x10(%rax,%rbp,8)
movups 0x20(%rbx,%rbp,8),%xmm0
movups 0x30(%rbx,%rbp,8),%xmm1
movups %xmm0,0x20(%rax,%rbp,8)
movups %xmm1,0x30(%rax,%rbp,8)
movups 0x40(%rbx,%rbp,8),%xmm0
movups 0x50(%rbx,%rbp,8),%xmm1
movups %xmm0,0x40(%rax,%rbp,8)
movups %xmm1,0x50(%rax,%rbp,8)
movups 0x60(%rbx,%rbp,8),%xmm0
movups 0x70(%rbx,%rbp,8),%xmm1
movups %xmm0,0x60(%rax,%rbp,8)
movups %xmm1,0x70(%rax,%rbp,8)
add    $0x10,%rbp
add    $0xfffffffffffffffc,%rdi
jne    11f0 <copyVector+0xe0>
test   %r8,%r8
je     128c <copyVector+0x17c>
lea    (%rax,%rbp,8),%rdi
add    $0x10,%rdi
lea    (%rbx,%rbp,8),%rbp
add    $0x10,%rbp
shl    $0x5,%r8
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movups -0x10(%rbp,%rsi,1),%xmm0
movups 0x0(%rbp,%rsi,1),%xmm1
movups %xmm0,-0x10(%rdi,%rsi,1)
movups %xmm1,(%rdi,%rsi,1)
add    $0x20,%rsi
cmp    %rsi,%r8
jne    1270 <copyVector+0x160>
cmp    %rcx,%rdx
jne    1148 <copyVector+0x38>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define double* @copyVector(double* nocapture %0, i32 %1, i8* %2) {
%4 = tail call double* @svd_doubleArray(i32 %1, i32 0, i8* %2)
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %131
6: ; preds = %3
%7 = zext i32 %1 to i64
%8 = icmp ult i32 %1, 4
br i1 %8, label %94, label %9
9: ; preds = %6
%10 = getelementptr double, double* %4, i64 %7
%11 = getelementptr double, double* %0, i64 %7
%12 = icmp ult double* %4, %11
%13 = icmp ugt double* %10, %0
%14 = and i1 %12, %13
br i1 %14, label %94, label %15
15: ; preds = %9
%16 = and i64 %7, 4294967292
%17 = add nsw i64 %16, -4
%18 = lshr exact i64 %17, 2
%19 = add nuw nsw i64 %18, 1
%20 = and i64 %19, 3
%21 = icmp ult i64 %17, 12
br i1 %21, label %73, label %22
22: ; preds = %15
%23 = and i64 %19, 9223372036854775804
br label %24
24: ; preds = %24, %22
%25 = phi i64 [ 0, %22 ], [ %70, %24 ]
%26 = phi i64 [ 0, %22 ], [ %71, %24 ]
%27 = getelementptr inbounds double, double* %0, i64 %25
%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 = getelementptr inbounds double, double* %4, i64 %25
%34 = bitcast double* %33 to <2 x double>*
store <2 x double> %29, <2 x double>* %34
%35 = getelementptr inbounds double, double* %33, i64 2
%36 = bitcast double* %35 to <2 x double>*
store <2 x double> %32, <2 x double>* %36
%37 = or i64 %25, 4
%38 = getelementptr inbounds double, double* %0, i64 %37
%39 = bitcast double* %38 to <2 x double>*
%40 = load <2 x double>, <2 x double>* %39
%41 = getelementptr inbounds double, double* %38, i64 2
%42 = bitcast double* %41 to <2 x double>*
%43 = load <2 x double>, <2 x double>* %42
%44 = getelementptr inbounds double, double* %4, i64 %37
%45 = bitcast double* %44 to <2 x double>*
store <2 x double> %40, <2 x double>* %45
%46 = getelementptr inbounds double, double* %44, i64 2
%47 = bitcast double* %46 to <2 x double>*
store <2 x double> %43, <2 x double>* %47
%48 = or i64 %25, 8
%49 = getelementptr inbounds double, double* %0, i64 %48
%50 = bitcast double* %49 to <2 x double>*
%51 = load <2 x double>, <2 x double>* %50
%52 = getelementptr inbounds double, double* %49, i64 2
%53 = bitcast double* %52 to <2 x double>*
%54 = load <2 x double>, <2 x double>* %53
%55 = getelementptr inbounds double, double* %4, i64 %48
%56 = bitcast double* %55 to <2 x double>*
store <2 x double> %51, <2 x double>* %56
%57 = getelementptr inbounds double, double* %55, i64 2
%58 = bitcast double* %57 to <2 x double>*
store <2 x double> %54, <2 x double>* %58
%59 = or i64 %25, 12
%60 = getelementptr inbounds double, double* %0, i64 %59
%61 = bitcast double* %60 to <2 x double>*
%62 = load <2 x double>, <2 x double>* %61
%63 = getelementptr inbounds double, double* %60, i64 2
%64 = bitcast double* %63 to <2 x double>*
%65 = load <2 x double>, <2 x double>* %64
%66 = getelementptr inbounds double, double* %4, i64 %59
%67 = bitcast double* %66 to <2 x double>*
store <2 x double> %62, <2 x double>* %67
%68 = getelementptr inbounds double, double* %66, i64 2
%69 = bitcast double* %68 to <2 x double>*
store <2 x double> %65, <2 x double>* %69
%70 = add nuw i64 %25, 16
%71 = add nuw i64 %26, 4
%72 = icmp eq i64 %71, %23
br i1 %72, label %73, label %24
73: ; preds = %24, %15
%74 = phi i64 [ 0, %15 ], [ %70, %24 ]
%75 = icmp eq i64 %20, 0
br i1 %75, label %92, label %76
76: ; preds = %73, %76
%77 = phi i64 [ %89, %76 ], [ %74, %73 ]
%78 = phi i64 [ %90, %76 ], [ 0, %73 ]
%79 = getelementptr inbounds double, double* %0, i64 %77
%80 = bitcast double* %79 to <2 x double>*
%81 = load <2 x double>, <2 x double>* %80
%82 = getelementptr inbounds double, double* %79, i64 2
%83 = bitcast double* %82 to <2 x double>*
%84 = load <2 x double>, <2 x double>* %83
%85 = getelementptr inbounds double, double* %4, i64 %77
%86 = bitcast double* %85 to <2 x double>*
store <2 x double> %81, <2 x double>* %86
%87 = getelementptr inbounds double, double* %85, i64 2
%88 = bitcast double* %87 to <2 x double>*
store <2 x double> %84, <2 x double>* %88
%89 = add nuw i64 %77, 4
%90 = add i64 %78, 1
%91 = icmp eq i64 %90, %20
br i1 %91, label %92, label %76
92: ; preds = %76, %73
%93 = icmp eq i64 %16, %7
br i1 %93, label %131, label %94
94: ; preds = %9, %6, %92
%95 = phi i64 [ 0, %9 ], [ 0, %6 ], [ %16, %92 ]
%96 = xor i64 %95, -1
%97 = add nsw i64 %96, %7
%98 = and i64 %7, 3
%99 = icmp eq i64 %98, 0
br i1 %99, label %109, label %100
100: ; preds = %94, %100
%101 = phi i64 [ %106, %100 ], [ %95, %94 ]
%102 = phi i64 [ %107, %100 ], [ 0, %94 ]
%103 = getelementptr inbounds double, double* %0, i64 %101
%104 = load double, double* %103
%105 = getelementptr inbounds double, double* %4, i64 %101
store double %104, double* %105
%106 = add nuw nsw i64 %101, 1
%107 = add i64 %102, 1
%108 = icmp eq i64 %107, %98
br i1 %108, label %109, label %100
109: ; preds = %100, %94
%110 = phi i64 [ %95, %94 ], [ %106, %100 ]
%111 = icmp ult i64 %97, 3
br i1 %111, label %131, label %112
112: ; preds = %109, %112
%113 = phi i64 [ %129, %112 ], [ %110, %109 ]
%114 = getelementptr inbounds double, double* %0, i64 %113
%115 = load double, double* %114
%116 = getelementptr inbounds double, double* %4, i64 %113
store double %115, double* %116
%117 = add nuw nsw i64 %113, 1
%118 = getelementptr inbounds double, double* %0, i64 %117
%119 = load double, double* %118
%120 = getelementptr inbounds double, double* %4, i64 %117
store double %119, double* %120
%121 = add nuw nsw i64 %113, 2
%122 = getelementptr inbounds double, double* %0, i64 %121
%123 = load double, double* %122
%124 = getelementptr inbounds double, double* %4, i64 %121
store double %123, double* %124
%125 = add nuw nsw i64 %113, 3
%126 = getelementptr inbounds double, double* %0, i64 %125
%127 = load double, double* %126
%128 = getelementptr inbounds double, double* %4, i64 %125
store double %127, double* %128
%129 = add nuw nsw i64 %113, 4
%130 = icmp eq i64 %129, %7
br i1 %130, label %131, label %112
131: ; preds = %109, %112, %92, %3
ret double* %4
}