#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__ FerMem_Malloc(int, char *, int);
void cache_full_array_(double *array, int *alen, double **pointer_val) {
  double *ptr;
  int i;
  ptr = (double *)FerMem_Malloc(
      sizeof(double) * (*alen),
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/NOAA-PMEL/Ferret/refs/heads/master/fer/ccr/"
      "cache_full_array.c",
      67);
  for (i = 0; i < *alen; i++) {
    ptr[i] = array[i];
  }
  *pointer_val = ptr;
  return;
}


x86 assembly (clang, -O0):
<cache_full_array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
shl    $0x3,%rax
mov    %eax,%edi
lea    0xec8(%rip),%rsi
mov    $0x43,%edx
call   1030 <FerMem_Malloc@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jge    1184 <cache_full_array_+0x74>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    114d <cache_full_array_+0x3d>
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cache_full_array_>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    (%rsi),%edi
shl    $0x3,%edi
lea    0xed6(%rip),%rsi
mov    $0x43,%edx
call   1030 <FerMem_Malloc@plt>
mov    (%r15),%r9d
test   %r9d,%r9d
jle    12a4 <cache_full_array_+0x194>
cmp    $0x4,%r9d
jb     1158 <cache_full_array_+0x48>
lea    (%rbx,%r9,8),%rcx
cmp    %rcx,%rax
jae    11cc <cache_full_array_+0xbc>
lea    (%rax,%r9,8),%rcx
cmp    %rbx,%rcx
jbe    11cc <cache_full_array_+0xbc>
xor    %edx,%edx
mov    %rdx,%rsi
not    %rsi
add    %r9,%rsi
mov    %r9,%rdi
and    $0x3,%rdi
je     1184 <cache_full_array_+0x74>
nopl   0x0(%rax)
movsd  (%rbx,%rdx,8),%xmm0
movsd  %xmm0,(%rax,%rdx,8)
add    $0x1,%rdx
add    $0xffffffffffffffff,%rdi
jne    1170 <cache_full_array_+0x60>
cmp    $0x3,%rsi
jb     12a4 <cache_full_array_+0x194>
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,%r9
jne    1190 <cache_full_array_+0x80>
jmp    12a4 <cache_full_array_+0x194>
mov    %r9d,%edx
and    $0xfffffffc,%edx
lea    -0x4(%rdx),%rcx
mov    %rcx,%rdi
shr    $0x2,%rdi
add    $0x1,%rdi
mov    %edi,%r8d
and    $0x3,%r8d
cmp    $0xc,%rcx
jae    11f2 <cache_full_array_+0xe2>
xor    %esi,%esi
jmp    1258 <cache_full_array_+0x148>
and    $0xfffffffffffffffc,%rdi
xor    %esi,%esi
nopl   0x0(%rax,%rax,1)
movups (%rbx,%rsi,8),%xmm0
movups 0x10(%rbx,%rsi,8),%xmm1
movups %xmm0,(%rax,%rsi,8)
movups %xmm1,0x10(%rax,%rsi,8)
movups 0x20(%rbx,%rsi,8),%xmm0
movups 0x30(%rbx,%rsi,8),%xmm1
movups %xmm0,0x20(%rax,%rsi,8)
movups %xmm1,0x30(%rax,%rsi,8)
movups 0x40(%rbx,%rsi,8),%xmm0
movups 0x50(%rbx,%rsi,8),%xmm1
movups %xmm0,0x40(%rax,%rsi,8)
movups %xmm1,0x50(%rax,%rsi,8)
movups 0x60(%rbx,%rsi,8),%xmm0
movups 0x70(%rbx,%rsi,8),%xmm1
movups %xmm0,0x60(%rax,%rsi,8)
movups %xmm1,0x70(%rax,%rsi,8)
add    $0x10,%rsi
add    $0xfffffffffffffffc,%rdi
jne    1200 <cache_full_array_+0xf0>
test   %r8,%r8
je     129b <cache_full_array_+0x18b>
lea    (%rax,%rsi,8),%rdi
add    $0x10,%rdi
lea    (%rbx,%rsi,8),%rsi
add    $0x10,%rsi
shl    $0x5,%r8
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movups -0x10(%rsi,%rcx,1),%xmm0
movups (%rsi,%rcx,1),%xmm1
movups %xmm0,-0x10(%rdi,%rcx,1)
movups %xmm1,(%rdi,%rcx,1)
add    $0x20,%rcx
cmp    %rcx,%r8
jne    1280 <cache_full_array_+0x170>
cmp    %r9,%rdx
jne    115a <cache_full_array_+0x4a>
mov    %rax,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [152 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/NOAA-PMEL/Ferret/refs/heads/master/fer/ccr/cache_full_array.c\00"
define void @cache_full_array_(double* %0, i32* %1, double** %2) {
%4 = alloca double*
%5 = alloca i32*
%6 = alloca double**
%7 = alloca double*
%8 = alloca i32
store double* %0, double** %4
store i32* %1, i32** %5
store double** %2, double*** %6
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = sext i32 %10 to i64
%12 = mul i64 8, %11
%13 = trunc i64 %12 to i32
%14 = call i64 @FerMem_Malloc(i32 %13, i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i32 67)
%15 = inttoptr i64 %14 to double*
store double* %15, double** %7
store i32 0, i32* %8
br label %16
16: ; preds = %31, %3
%17 = load i32, i32* %8
%18 = load i32*, i32** %5
%19 = load i32, i32* %18
%20 = icmp slt i32 %17, %19
br i1 %20, label %21, label %34
21: ; preds = %16
%22 = load double*, double** %4
%23 = load i32, i32* %8
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %22, i64 %24
%26 = load double, double* %25
%27 = load double*, double** %7
%28 = load i32, i32* %8
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %27, i64 %29
store double %26, double* %30
br label %31
31: ; preds = %21
%32 = load i32, i32* %8
%33 = add nsw i32 %32, 1
store i32 %33, i32* %8
br label %16
34: ; preds = %16
%35 = load double*, double** %7
%36 = load double**, double*** %6
store double* %35, double** %36
ret void
}

LLVM IR (-O2):
@.str = [152 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/NOAA-PMEL/Ferret/refs/heads/master/fer/ccr/cache_full_array.c\00"
define void @cache_full_array_(double* nocapture %0, i32* nocapture %1, double** nocapture writeonly %2) {
%4 = load i32, i32* %1
%5 = shl i32 %4, 3
%6 = tail call i64 @FerMem_Malloc(i32 %5, i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i32 67)
%7 = inttoptr i64 %6 to double*
%8 = inttoptr i64 %6 to i8*
%9 = load i32, i32* %1
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %137
11: ; preds = %3
%12 = zext i32 %9 to i64
%13 = icmp ult i32 %9, 4
br i1 %13, label %100, label %14
14: ; preds = %11
%15 = getelementptr double, double* %7, i64 %12
%16 = getelementptr double, double* %0, i64 %12
%17 = bitcast double* %16 to i8*
%18 = icmp ult i8* %8, %17
%19 = icmp ugt double* %15, %0
%20 = and i1 %18, %19
br i1 %20, label %100, label %21
21: ; preds = %14
%22 = and i64 %12, 4294967292
%23 = add nsw i64 %22, -4
%24 = lshr exact i64 %23, 2
%25 = add nuw nsw i64 %24, 1
%26 = and i64 %25, 3
%27 = icmp ult i64 %23, 12
br i1 %27, label %79, label %28
28: ; preds = %21
%29 = and i64 %25, 9223372036854775804
br label %30
30: ; preds = %30, %28
%31 = phi i64 [ 0, %28 ], [ %76, %30 ]
%32 = phi i64 [ 0, %28 ], [ %77, %30 ]
%33 = getelementptr inbounds double, double* %0, i64 %31
%34 = bitcast double* %33 to <2 x double>*
%35 = load <2 x double>, <2 x double>* %34
%36 = getelementptr inbounds double, double* %33, i64 2
%37 = bitcast double* %36 to <2 x double>*
%38 = load <2 x double>, <2 x double>* %37
%39 = getelementptr inbounds double, double* %7, i64 %31
%40 = bitcast double* %39 to <2 x double>*
store <2 x double> %35, <2 x double>* %40
%41 = getelementptr inbounds double, double* %39, i64 2
%42 = bitcast double* %41 to <2 x double>*
store <2 x double> %38, <2 x double>* %42
%43 = or i64 %31, 4
%44 = getelementptr inbounds double, double* %0, i64 %43
%45 = bitcast double* %44 to <2 x double>*
%46 = load <2 x double>, <2 x double>* %45
%47 = getelementptr inbounds double, double* %44, i64 2
%48 = bitcast double* %47 to <2 x double>*
%49 = load <2 x double>, <2 x double>* %48
%50 = getelementptr inbounds double, double* %7, i64 %43
%51 = bitcast double* %50 to <2 x double>*
store <2 x double> %46, <2 x double>* %51
%52 = getelementptr inbounds double, double* %50, i64 2
%53 = bitcast double* %52 to <2 x double>*
store <2 x double> %49, <2 x double>* %53
%54 = or i64 %31, 8
%55 = getelementptr inbounds double, double* %0, i64 %54
%56 = bitcast double* %55 to <2 x double>*
%57 = load <2 x double>, <2 x double>* %56
%58 = getelementptr inbounds double, double* %55, i64 2
%59 = bitcast double* %58 to <2 x double>*
%60 = load <2 x double>, <2 x double>* %59
%61 = getelementptr inbounds double, double* %7, i64 %54
%62 = bitcast double* %61 to <2 x double>*
store <2 x double> %57, <2 x double>* %62
%63 = getelementptr inbounds double, double* %61, i64 2
%64 = bitcast double* %63 to <2 x double>*
store <2 x double> %60, <2 x double>* %64
%65 = or i64 %31, 12
%66 = getelementptr inbounds double, double* %0, i64 %65
%67 = bitcast double* %66 to <2 x double>*
%68 = load <2 x double>, <2 x double>* %67
%69 = getelementptr inbounds double, double* %66, i64 2
%70 = bitcast double* %69 to <2 x double>*
%71 = load <2 x double>, <2 x double>* %70
%72 = getelementptr inbounds double, double* %7, i64 %65
%73 = bitcast double* %72 to <2 x double>*
store <2 x double> %68, <2 x double>* %73
%74 = getelementptr inbounds double, double* %72, i64 2
%75 = bitcast double* %74 to <2 x double>*
store <2 x double> %71, <2 x double>* %75
%76 = add nuw i64 %31, 16
%77 = add nuw i64 %32, 4
%78 = icmp eq i64 %77, %29
br i1 %78, label %79, label %30
79: ; preds = %30, %21
%80 = phi i64 [ 0, %21 ], [ %76, %30 ]
%81 = icmp eq i64 %26, 0
br i1 %81, label %98, label %82
82: ; preds = %79, %82
%83 = phi i64 [ %95, %82 ], [ %80, %79 ]
%84 = phi i64 [ %96, %82 ], [ 0, %79 ]
%85 = getelementptr inbounds double, double* %0, i64 %83
%86 = bitcast double* %85 to <2 x double>*
%87 = load <2 x double>, <2 x double>* %86
%88 = getelementptr inbounds double, double* %85, i64 2
%89 = bitcast double* %88 to <2 x double>*
%90 = load <2 x double>, <2 x double>* %89
%91 = getelementptr inbounds double, double* %7, i64 %83
%92 = bitcast double* %91 to <2 x double>*
store <2 x double> %87, <2 x double>* %92
%93 = getelementptr inbounds double, double* %91, i64 2
%94 = bitcast double* %93 to <2 x double>*
store <2 x double> %90, <2 x double>* %94
%95 = add nuw i64 %83, 4
%96 = add i64 %84, 1
%97 = icmp eq i64 %96, %26
br i1 %97, label %98, label %82
98: ; preds = %82, %79
%99 = icmp eq i64 %22, %12
br i1 %99, label %137, label %100
100: ; preds = %14, %11, %98
%101 = phi i64 [ 0, %14 ], [ 0, %11 ], [ %22, %98 ]
%102 = xor i64 %101, -1
%103 = add nsw i64 %102, %12
%104 = and i64 %12, 3
%105 = icmp eq i64 %104, 0
br i1 %105, label %115, label %106
106: ; preds = %100, %106
%107 = phi i64 [ %112, %106 ], [ %101, %100 ]
%108 = phi i64 [ %113, %106 ], [ 0, %100 ]
%109 = getelementptr inbounds double, double* %0, i64 %107
%110 = load double, double* %109
%111 = getelementptr inbounds double, double* %7, i64 %107
store double %110, double* %111
%112 = add nuw nsw i64 %107, 1
%113 = add i64 %108, 1
%114 = icmp eq i64 %113, %104
br i1 %114, label %115, label %106
115: ; preds = %106, %100
%116 = phi i64 [ %101, %100 ], [ %112, %106 ]
%117 = icmp ult i64 %103, 3
br i1 %117, label %137, label %118
118: ; preds = %115, %118
%119 = phi i64 [ %135, %118 ], [ %116, %115 ]
%120 = getelementptr inbounds double, double* %0, i64 %119
%121 = load double, double* %120
%122 = getelementptr inbounds double, double* %7, i64 %119
store double %121, double* %122
%123 = add nuw nsw i64 %119, 1
%124 = getelementptr inbounds double, double* %0, i64 %123
%125 = load double, double* %124
%126 = getelementptr inbounds double, double* %7, i64 %123
store double %125, double* %126
%127 = add nuw nsw i64 %119, 2
%128 = getelementptr inbounds double, double* %0, i64 %127
%129 = load double, double* %128
%130 = getelementptr inbounds double, double* %7, i64 %127
store double %129, double* %130
%131 = add nuw nsw i64 %119, 3
%132 = getelementptr inbounds double, double* %0, i64 %131
%133 = load double, double* %132
%134 = getelementptr inbounds double, double* %7, i64 %131
store double %133, double* %134
%135 = add nuw nsw i64 %119, 4
%136 = icmp eq i64 %135, %12
br i1 %136, label %137, label %118
137: ; preds = %115, %118, %98, %3
store double* %7, double** %2
ret void
}