#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 */
scalar_t__ malloc(long);
double *find_number_vector(double *vector, long lengthvector) {
  double *number_vector;
  long i;
  number_vector = (double *)malloc(lengthvector * sizeof(double));
  for (i = 0; i < lengthvector; i++) {
    number_vector[i] = vector[i];
  }
  return (number_vector);
}


x86 assembly (clang, -O0):
<find_number_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
shl    $0x3,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1172 <find_number_vector+0x62>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1139 <find_number_vector+0x29>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_number_vector>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x0(,%rsi,8),%rdi
call   1030 <malloc@plt>
test   %r14,%r14
jle    1294 <find_number_vector+0x184>
cmp    $0x4,%r14
jb     1148 <find_number_vector+0x38>
lea    (%rbx,%r14,8),%rcx
cmp    %rcx,%rax
jae    11bc <find_number_vector+0xac>
lea    (%rax,%r14,8),%rcx
cmp    %rbx,%rcx
jbe    11bc <find_number_vector+0xac>
xor    %ecx,%ecx
mov    %rcx,%rdx
not    %rdx
add    %r14,%rdx
mov    %r14,%rsi
and    $0x3,%rsi
je     1174 <find_number_vector+0x64>
nopl   0x0(%rax)
movsd  (%rbx,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rsi
jne    1160 <find_number_vector+0x50>
cmp    $0x3,%rdx
jb     1294 <find_number_vector+0x184>
xchg   %ax,%ax
movsd  (%rbx,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  0x8(%rbx,%rcx,8),%xmm0
movsd  %xmm0,0x8(%rax,%rcx,8)
movsd  0x10(%rbx,%rcx,8),%xmm0
movsd  %xmm0,0x10(%rax,%rcx,8)
movsd  0x18(%rbx,%rcx,8),%xmm0
movsd  %xmm0,0x18(%rax,%rcx,8)
add    $0x4,%rcx
cmp    %rcx,%r14
jne    1180 <find_number_vector+0x70>
jmp    1294 <find_number_vector+0x184>
mov    %r14,%rcx
and    $0xfffffffffffffffc,%rcx
lea    -0x4(%rcx),%rdx
mov    %rdx,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
mov    %esi,%r8d
and    $0x3,%r8d
cmp    $0xc,%rdx
jae    11e3 <find_number_vector+0xd3>
xor    %edi,%edi
jmp    1248 <find_number_vector+0x138>
and    $0xfffffffffffffffc,%rsi
xor    %edi,%edi
nopl   0x0(%rax)
movups (%rbx,%rdi,8),%xmm0
movups 0x10(%rbx,%rdi,8),%xmm1
movups %xmm0,(%rax,%rdi,8)
movups %xmm1,0x10(%rax,%rdi,8)
movups 0x20(%rbx,%rdi,8),%xmm0
movups 0x30(%rbx,%rdi,8),%xmm1
movups %xmm0,0x20(%rax,%rdi,8)
movups %xmm1,0x30(%rax,%rdi,8)
movups 0x40(%rbx,%rdi,8),%xmm0
movups 0x50(%rbx,%rdi,8),%xmm1
movups %xmm0,0x40(%rax,%rdi,8)
movups %xmm1,0x50(%rax,%rdi,8)
movups 0x60(%rbx,%rdi,8),%xmm0
movups 0x70(%rbx,%rdi,8),%xmm1
movups %xmm0,0x60(%rax,%rdi,8)
movups %xmm1,0x70(%rax,%rdi,8)
add    $0x10,%rdi
add    $0xfffffffffffffffc,%rsi
jne    11f0 <find_number_vector+0xe0>
test   %r8,%r8
je     128b <find_number_vector+0x17b>
lea    (%rax,%rdi,8),%rsi
add    $0x10,%rsi
lea    (%rbx,%rdi,8),%rdi
add    $0x10,%rdi
shl    $0x5,%r8
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movups -0x10(%rdi,%rdx,1),%xmm0
movups (%rdi,%rdx,1),%xmm1
movups %xmm0,-0x10(%rsi,%rdx,1)
movups %xmm1,(%rsi,%rdx,1)
add    $0x20,%rdx
cmp    %rdx,%r8
jne    1270 <find_number_vector+0x160>
cmp    %r14,%rcx
jne    114a <find_number_vector+0x3a>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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