#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*/ error(char *);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int, int);
int read_double_array_from_socket(int, double *, int);
void read_elements_from_socket(int sockfd, int nelements,
                               double *elements_all) {
  int i, ind, nlen, nchunks, nleftover, chunk_num;
  double *elements_local;
  if (nelements <= 6000) {
    nlen = read_double_array_from_socket(sockfd, elements_all,
                                         nelements * sizeof(double));
    if (nlen < 0)
      error("ERROR writing to socket");
  } else {
    nchunks = nelements / 6000;
    nleftover = nelements % 6000;
    printf("server: nchunks = %d and nleftover = %d\n", nchunks, nleftover);
    ind = 0;
    for (chunk_num = 0; chunk_num < nchunks; chunk_num++) {
      elements_local = (double *)malloc(6000 * sizeof(double));
      nlen = read_double_array_from_socket(sockfd, elements_local,
                                           6000 * sizeof(double));
      for (i = 0; i < 6000; i++) {
        elements_all[ind++] = elements_local[i];
      }
      free(elements_local);
    }
    elements_local = (double *)malloc(nleftover * sizeof(double));
    nlen = read_double_array_from_socket(sockfd, elements_local,
                                         nleftover * sizeof(double));
    for (i = 0; i < nleftover; i++) {
      elements_all[ind++] = elements_local[i];
    }
    free(elements_local);
  }
}


x86 assembly (clang, -O0):
<read_elements_from_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x1770,-0x8(%rbp)
jg     11a3 <read_elements_from_socket+0x53>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
movslq -0x8(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <read_double_array_from_socket@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    119e <read_elements_from_socket+0x4e>
lea    0xe67(%rip),%rdi
call   1070 <error@plt>
jmp    12e4 <read_elements_from_socket+0x194>
mov    -0x8(%rbp),%eax
mov    $0x1770,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x1770,%ecx
cltd
idiv   %ecx
mov    %edx,-0x24(%rbp)
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xe4c(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    126a <read_elements_from_socket+0x11a>
mov    $0xbb80,%edi
call   1060 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    $0xbb80,%edx
call   1030 <read_double_array_from_socket@plt>
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1770,-0x14(%rbp)
jge    1253 <read_elements_from_socket+0x103>
mov    -0x30(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1214 <read_elements_from_socket+0xc4>
mov    -0x30(%rbp),%rdi
call   1040 <free@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11df <read_elements_from_socket+0x8f>
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x30(%rbp),%rsi
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <read_double_array_from_socket@plt>
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    12db <read_elements_from_socket+0x18b>
mov    -0x30(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    129d <read_elements_from_socket+0x14d>
mov    -0x30(%rbp),%rdi
call   1040 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_elements_from_socket>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdx,%rbp
mov    %esi,%edx
mov    %edi,%r12d
cmp    $0x1770,%esi
jg     1193 <read_elements_from_socket+0x43>
shl    $0x3,%edx
mov    %r12d,%edi
mov    %rbp,%rsi
call   1030 <read_double_array_from_socket@plt>
test   %eax,%eax
js     1343 <read_elements_from_socket+0x1f3>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %edx,%eax
mov    %rax,0x18(%rsp)
imul   $0x57619f1,%rax,%rbx
shr    $0x27,%rbx
imul   $0x1770,%ebx,%eax
sub    %eax,%edx
lea    0xe64(%rip),%rdi
mov    %ebx,%esi
mov    %rdx,0x10(%rsp)
call   1050 <printf@plt>
lea    0xbb80(%rbp),%r15
mov    %rbp,0x8(%rsp)
lea    0x20(%rbp),%rax
mov    %rax,0x20(%rsp)
xor    %r14d,%r14d
xor    %r13d,%r13d
jmp    11f5 <read_elements_from_socket+0xa5>
nopl   (%rax)
mov    %rbp,%rdi
call   1040 <free@plt>
add    $0x1,%r14d
cmp    %ebx,%r14d
je     1301 <read_elements_from_socket+0x1b1>
mov    $0xbb80,%edi
call   1060 <malloc@plt>
mov    %rax,%rbp
mov    %r12d,%edi
mov    %rax,%rsi
mov    $0xbb80,%edx
call   1030 <read_double_array_from_socket@plt>
movslq %r13d,%r13
mov    0x8(%rsp),%rax
lea    (%rax,%r13,8),%rax
lea    0xbb80(%rbp),%rcx
cmp    %rcx,%rax
jae    1290 <read_elements_from_socket+0x140>
lea    (%r15,%r13,8),%rcx
cmp    %rcx,%rbp
jae    1290 <read_elements_from_socket+0x140>
mov    0x20(%rsp),%rax
lea    (%rax,%r13,8),%rcx
xor    %eax,%eax
xchg   %ax,%ax
movsd  0x0(%rbp,%rax,8),%xmm0
movsd  %xmm0,-0x20(%rcx,%rax,8)
movsd  0x8(%rbp,%rax,8),%xmm0
movsd  %xmm0,-0x18(%rcx,%rax,8)
movsd  0x10(%rbp,%rax,8),%xmm0
movsd  %xmm0,-0x10(%rcx,%rax,8)
movsd  0x18(%rbp,%rax,8),%xmm0
movsd  %xmm0,-0x8(%rcx,%rax,8)
movsd  0x20(%rbp,%rax,8),%xmm0
movsd  %xmm0,(%rcx,%rax,8)
add    $0x5,%rax
cmp    $0x1770,%rax
jne    1240 <read_elements_from_socket+0xf0>
add    %rax,%r13
jmp    11e0 <read_elements_from_socket+0x90>
nop
add    $0x1770,%r13
mov    $0xe,%ecx
nopl   0x0(%rax)
movups -0x70(%rbp,%rcx,8),%xmm0
movups -0x60(%rbp,%rcx,8),%xmm1
movups %xmm0,-0x70(%rax,%rcx,8)
movups %xmm1,-0x60(%rax,%rcx,8)
movups -0x50(%rbp,%rcx,8),%xmm0
movups -0x40(%rbp,%rcx,8),%xmm1
movups %xmm0,-0x50(%rax,%rcx,8)
movups %xmm1,-0x40(%rax,%rcx,8)
movups -0x30(%rbp,%rcx,8),%xmm0
movups -0x20(%rbp,%rcx,8),%xmm1
movups %xmm0,-0x30(%rax,%rcx,8)
movups %xmm1,-0x20(%rax,%rcx,8)
movups -0x10(%rbp,%rcx,8),%xmm0
movups 0x0(%rbp,%rcx,8),%xmm1
movups %xmm0,-0x10(%rax,%rcx,8)
movups %xmm1,(%rax,%rcx,8)
add    $0x10,%rcx
cmp    $0x177e,%rcx
jne    12a0 <read_elements_from_socket+0x150>
jmp    11e0 <read_elements_from_socket+0x90>
mov    0x10(%rsp),%r14
lea    0x0(,%r14,8),%ebp
mov    %ebp,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %r12d,%edi
mov    %rax,%rsi
mov    %ebp,%edx
call   1030 <read_double_array_from_socket@plt>
test   %r14d,%r14d
mov    0x18(%rsp),%rsi
je     14a3 <read_elements_from_socket+0x353>
movslq %r13d,%r9
cmp    $0x4,%r14d
jae    135d <read_elements_from_socket+0x20d>
xor    %ecx,%ecx
jmp    1463 <read_elements_from_socket+0x313>
lea    0xcb6(%rip),%rdi
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <error@plt>
mov    %r14d,%r8d
mov    0x8(%rsp),%r10
lea    (%r10,%r9,8),%rcx
lea    (%rbx,%r8,8),%rdx
cmp    %rdx,%rcx
jae    1388 <read_elements_from_socket+0x238>
mov    %r8,%rcx
add    %r9,%rcx
lea    (%r10,%rcx,8),%rcx
cmp    %rcx,%rbx
jae    1388 <read_elements_from_socket+0x238>
xor    %ecx,%ecx
jmp    1468 <read_elements_from_socket+0x318>
mov    %r8d,%ecx
and    $0x1ffc,%ecx
lea    -0x4(%rcx),%rdx
mov    %rdx,%rdi
shr    $0x2,%rdi
add    $0x1,%rdi
mov    %edi,%eax
and    $0x3,%eax
cmp    $0xc,%rdx
jae    13af <read_elements_from_socket+0x25f>
xor    %ebp,%ebp
jmp    1418 <read_elements_from_socket+0x2c8>
and    $0xfffffffffffffffc,%rdi
lea    (%r10,%r9,8),%rdx
add    $0x70,%rdx
xor    %ebp,%ebp
nopl   (%rax)
movups (%rbx,%rbp,8),%xmm0
movups 0x10(%rbx,%rbp,8),%xmm1
movups %xmm0,-0x70(%rdx,%rbp,8)
movups %xmm1,-0x60(%rdx,%rbp,8)
movups 0x20(%rbx,%rbp,8),%xmm0
movups 0x30(%rbx,%rbp,8),%xmm1
movups %xmm0,-0x50(%rdx,%rbp,8)
movups %xmm1,-0x40(%rdx,%rbp,8)
movups 0x40(%rbx,%rbp,8),%xmm0
movups 0x50(%rbx,%rbp,8),%xmm1
movups %xmm0,-0x30(%rdx,%rbp,8)
movups %xmm1,-0x20(%rdx,%rbp,8)
movups 0x60(%rbx,%rbp,8),%xmm0
movups 0x70(%rbx,%rbp,8),%xmm1
movups %xmm0,-0x10(%rdx,%rbp,8)
movups %xmm1,(%rdx,%rbp,8)
add    $0x10,%rbp
add    $0xfffffffffffffffc,%rdi
jne    13c0 <read_elements_from_socket+0x270>
test   %rax,%rax
je     145b <read_elements_from_socket+0x30b>
lea    (%rbx,%rbp,8),%rdx
add    $0x10,%rdx
add    %r9,%rbp
lea    (%r10,%rbp,8),%rdi
add    $0x10,%rdi
shl    $0x5,%rax
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
movups -0x10(%rdx,%rbp,1),%xmm0
movups (%rdx,%rbp,1),%xmm1
movups %xmm0,-0x10(%rdi,%rbp,1)
movups %xmm1,(%rdi,%rbp,1)
add    $0x20,%rbp
cmp    %rbp,%rax
jne    1440 <read_elements_from_socket+0x2f0>
cmp    %r8,%rcx
je     14a3 <read_elements_from_socket+0x353>
add    %rcx,%r9
mov    0x8(%rsp),%r10
lea    (%r10,%r9,8),%rax
lea    (%rbx,%rcx,8),%rdx
imul   $0x57619f1,%rsi,%rdi
sub    %rcx,%rsi
shr    $0x27,%rdi
imul   $0x1770,%rdi,%rcx
sub    %rcx,%rsi
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
movsd  (%rdx,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1490 <read_elements_from_socket+0x340>
mov    %rbx,%rdi
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <free@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"ERROR writing to socket\00"
@.str.1 = [41 x i8] c"server: nchunks = %d and nleftover = %d\0A\00"
define void @read_elements_from_socket(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca double*
store i32 %0, i32* %4
store i32 %1, i32* %5
store double* %2, double** %6
%14 = load i32, i32* %5
%15 = icmp sle i32 %14, 6000
br i1 %15, label %16, label %29
16: ; preds = %3
%17 = load i32, i32* %4
%18 = load double*, double** %6
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = mul i64 %20, 8
%22 = trunc i64 %21 to i32
%23 = call i32 @read_double_array_from_socket(i32 %17, double* %18, i32 %22)
store i32 %23, i32* %9
%24 = load i32, i32* %9
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %16
%27 = call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %28
28: ; preds = %26, %16
br label %105
29: ; preds = %3
%30 = load i32, i32* %5
%31 = sdiv i32 %30, 6000
store i32 %31, i32* %10
%32 = load i32, i32* %5
%33 = srem i32 %32, 6000
store i32 %33, i32* %11
%34 = load i32, i32* %10
%35 = load i32, i32* %11
%36 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 %34, i32 %35)
store i32 0, i32* %8
store i32 0, i32* %12
br label %37
37: ; preds = %67, %29
%38 = load i32, i32* %12
%39 = load i32, i32* %10
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %70
41: ; preds = %37
%42 = call i64 @malloc(i32 48000)
%43 = inttoptr i64 %42 to double*
store double* %43, double** %13
%44 = load i32, i32* %4
%45 = load double*, double** %13
%46 = call i32 @read_double_array_from_socket(i32 %44, double* %45, i32 48000)
store i32 %46, i32* %9
store i32 0, i32* %7
br label %47
47: ; preds = %61, %41
%48 = load i32, i32* %7
%49 = icmp slt i32 %48, 6000
br i1 %49, label %50, label %64
50: ; preds = %47
%51 = load double*, double** %13
%52 = load i32, i32* %7
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds double, double* %51, i64 %53
%55 = load double, double* %54
%56 = load double*, double** %6
%57 = load i32, i32* %8
%58 = add nsw i32 %57, 1
store i32 %58, i32* %8
%59 = sext i32 %57 to i64
%60 = getelementptr inbounds double, double* %56, i64 %59
store double %55, double* %60
br label %61
61: ; preds = %50
%62 = load i32, i32* %7
%63 = add nsw i32 %62, 1
store i32 %63, i32* %7
br label %47
64: ; preds = %47
%65 = load double*, double** %13
%66 = call i32 @free(double* %65)
br label %67
67: ; preds = %64
%68 = load i32, i32* %12
%69 = add nsw i32 %68, 1
store i32 %69, i32* %12
br label %37
70: ; preds = %37
%71 = load i32, i32* %11
%72 = sext i32 %71 to i64
%73 = mul i64 %72, 8
%74 = trunc i64 %73 to i32
%75 = call i64 @malloc(i32 %74)
%76 = inttoptr i64 %75 to double*
store double* %76, double** %13
%77 = load i32, i32* %4
%78 = load double*, double** %13
%79 = load i32, i32* %11
%80 = sext i32 %79 to i64
%81 = mul i64 %80, 8
%82 = trunc i64 %81 to i32
%83 = call i32 @read_double_array_from_socket(i32 %77, double* %78, i32 %82)
store i32 %83, i32* %9
store i32 0, i32* %7
br label %84
84: ; preds = %99, %70
%85 = load i32, i32* %7
%86 = load i32, i32* %11
%87 = icmp slt i32 %85, %86
br i1 %87, label %88, label %102
88: ; preds = %84
%89 = load double*, double** %13
%90 = load i32, i32* %7
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds double, double* %89, i64 %91
%93 = load double, double* %92
%94 = load double*, double** %6
%95 = load i32, i32* %8
%96 = add nsw i32 %95, 1
store i32 %96, i32* %8
%97 = sext i32 %95 to i64
%98 = getelementptr inbounds double, double* %94, i64 %97
store double %93, double* %98
br label %99
99: ; preds = %88
%100 = load i32, i32* %7
%101 = add nsw i32 %100, 1
store i32 %101, i32* %7
br label %84
102: ; preds = %84
%103 = load double*, double** %13
%104 = call i32 @free(double* %103)
br label %105
105: ; preds = %102, %28
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"ERROR writing to socket\00"
@.str.1 = [41 x i8] c"server: nchunks = %d and nleftover = %d\0A\00"
define void @read_elements_from_socket(i32 %0, i32 %1, double* %2) {
%4 = icmp slt i32 %1, 6001
br i1 %4, label %5, label %11
5: ; preds = %3
%6 = shl i32 %1, 3
%7 = tail call i32 @read_double_array_from_socket(i32 %0, double* %2, i32 %6)
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %241
9: ; preds = %5
%10 = tail call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %241
11: ; preds = %3
%12 = udiv i32 %1, 6000
%13 = urem i32 %1, 6000
%14 = urem i32 %1, 6000
%15 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %14)
%16 = getelementptr double, double* %2, i64 6000
br label %17
17: ; preds = %11, %115
%18 = phi i32 [ %118, %115 ], [ 0, %11 ]
%19 = phi i64 [ %116, %115 ], [ 0, %11 ]
%20 = tail call i64 @malloc(i32 48000)
%21 = inttoptr i64 %20 to double*
%22 = tail call i32 @read_double_array_from_socket(i32 %0, double* %21, i32 48000)
%23 = shl i64 %19, 32
%24 = ashr exact i64 %23, 32
%25 = inttoptr i64 %20 to i8*
%26 = getelementptr double, double* %2, i64 %24
%27 = getelementptr double, double* %16, i64 %24
%28 = bitcast double* %27 to i8*
%29 = getelementptr double, double* %21, i64 6000
%30 = icmp ult double* %26, %29
%31 = icmp ult i8* %25, %28
%32 = and i1 %30, %31
br i1 %32, label %86, label %33
33: ; preds = %17
%34 = add nsw i64 %24, 6000
br label %35
35: ; preds = %35, %33
%36 = phi i64 [ 0, %33 ], [ %84, %35 ]
%37 = add nsw i64 %24, %36
%38 = getelementptr inbounds double, double* %21, i64 %36
%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* %2, 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 %36, 4
%49 = add nsw i64 %24, %48
%50 = getelementptr inbounds double, double* %21, i64 %48
%51 = bitcast double* %50 to <2 x double>*
%52 = load <2 x double>, <2 x double>* %51
%53 = getelementptr inbounds double, double* %50, i64 2
%54 = bitcast double* %53 to <2 x double>*
%55 = load <2 x double>, <2 x double>* %54
%56 = getelementptr inbounds double, double* %2, i64 %49
%57 = bitcast double* %56 to <2 x double>*
store <2 x double> %52, <2 x double>* %57
%58 = getelementptr inbounds double, double* %56, i64 2
%59 = bitcast double* %58 to <2 x double>*
store <2 x double> %55, <2 x double>* %59
%60 = or i64 %36, 8
%61 = add nsw i64 %24, %60
%62 = getelementptr inbounds double, double* %21, i64 %60
%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* %2, 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 = or i64 %36, 12
%73 = add nsw i64 %24, %72
%74 = getelementptr inbounds double, double* %21, i64 %72
%75 = bitcast double* %74 to <2 x double>*
%76 = load <2 x double>, <2 x double>* %75
%77 = getelementptr inbounds double, double* %74, i64 2
%78 = bitcast double* %77 to <2 x double>*
%79 = load <2 x double>, <2 x double>* %78
%80 = getelementptr inbounds double, double* %2, i64 %73
%81 = bitcast double* %80 to <2 x double>*
store <2 x double> %76, <2 x double>* %81
%82 = getelementptr inbounds double, double* %80, i64 2
%83 = bitcast double* %82 to <2 x double>*
store <2 x double> %79, <2 x double>* %83
%84 = add nuw nsw i64 %36, 16
%85 = icmp eq i64 %84, 6000
br i1 %85, label %115, label %35
86: ; preds = %17, %86
%87 = phi i64 [ %111, %86 ], [ %24, %17 ]
%88 = phi i64 [ %113, %86 ], [ 0, %17 ]
%89 = getelementptr inbounds double, double* %21, i64 %88
%90 = load double, double* %89
%91 = add nsw i64 %87, 1
%92 = getelementptr inbounds double, double* %2, i64 %87
store double %90, double* %92
%93 = add nuw nsw i64 %88, 1
%94 = getelementptr inbounds double, double* %21, i64 %93
%95 = load double, double* %94
%96 = add nsw i64 %87, 2
%97 = getelementptr inbounds double, double* %2, i64 %91
store double %95, double* %97
%98 = add nuw nsw i64 %88, 2
%99 = getelementptr inbounds double, double* %21, i64 %98
%100 = load double, double* %99
%101 = add nsw i64 %87, 3
%102 = getelementptr inbounds double, double* %2, i64 %96
store double %100, double* %102
%103 = add nuw nsw i64 %88, 3
%104 = getelementptr inbounds double, double* %21, i64 %103
%105 = load double, double* %104
%106 = add nsw i64 %87, 4
%107 = getelementptr inbounds double, double* %2, i64 %101
store double %105, double* %107
%108 = add nuw nsw i64 %88, 4
%109 = getelementptr inbounds double, double* %21, i64 %108
%110 = load double, double* %109
%111 = add nsw i64 %87, 5
%112 = getelementptr inbounds double, double* %2, i64 %106
store double %110, double* %112
%113 = add nuw nsw i64 %88, 5
%114 = icmp eq i64 %113, 6000
br i1 %114, label %115, label %86
115: ; preds = %35, %86
%116 = phi i64 [ %111, %86 ], [ %34, %35 ]
%117 = tail call i32 @free(double* %21)
%118 = add nuw nsw i32 %18, 1
%119 = icmp eq i32 %118, %12
br i1 %119, label %120, label %17
120: ; preds = %115
%121 = shl nuw nsw i32 %14, 3
%122 = tail call i64 @malloc(i32 %121)
%123 = inttoptr i64 %122 to double*
%124 = inttoptr i64 %122 to i8*
%125 = tail call i32 @read_double_array_from_socket(i32 %0, double* %123, i32 %121)
%126 = icmp eq i32 %14, 0
br i1 %126, label %239, label %127
127: ; preds = %120
%128 = shl i64 %116, 32
%129 = ashr exact i64 %128, 32
%130 = zext i32 %14 to i64
%131 = icmp ult i32 %14, 4
br i1 %131, label %227, label %132
132: ; preds = %127
%133 = getelementptr double, double* %2, i64 %129
%134 = zext i32 %13 to i64
%135 = add nsw i64 %129, %134
%136 = getelementptr double, double* %2, i64 %135
%137 = bitcast double* %136 to i8*
%138 = getelementptr double, double* %123, i64 %130
%139 = icmp ult double* %133, %138
%140 = icmp ult i8* %124, %137
%141 = and i1 %139, %140
br i1 %141, label %227, label %142
142: ; preds = %132
%143 = and i64 %130, 8188
%144 = add nsw i64 %129, %143
%145 = add nsw i64 %143, -4
%146 = lshr exact i64 %145, 2
%147 = add nuw nsw i64 %146, 1
%148 = and i64 %147, 3
%149 = icmp ult i64 %145, 12
br i1 %149, label %205, label %150
150: ; preds = %142
%151 = and i64 %147, 9223372036854775804
br label %152
152: ; preds = %152, %150
%153 = phi i64 [ 0, %150 ], [ %202, %152 ]
%154 = phi i64 [ 0, %150 ], [ %203, %152 ]
%155 = add i64 %129, %153
%156 = getelementptr inbounds double, double* %123, i64 %153
%157 = bitcast double* %156 to <2 x double>*
%158 = load <2 x double>, <2 x double>* %157
%159 = getelementptr inbounds double, double* %156, i64 2
%160 = bitcast double* %159 to <2 x double>*
%161 = load <2 x double>, <2 x double>* %160
%162 = getelementptr inbounds double, double* %2, i64 %155
%163 = bitcast double* %162 to <2 x double>*
store <2 x double> %158, <2 x double>* %163
%164 = getelementptr inbounds double, double* %162, i64 2
%165 = bitcast double* %164 to <2 x double>*
store <2 x double> %161, <2 x double>* %165
%166 = or i64 %153, 4
%167 = add i64 %129, %166
%168 = getelementptr inbounds double, double* %123, i64 %166
%169 = bitcast double* %168 to <2 x double>*
%170 = load <2 x double>, <2 x double>* %169
%171 = getelementptr inbounds double, double* %168, i64 2
%172 = bitcast double* %171 to <2 x double>*
%173 = load <2 x double>, <2 x double>* %172
%174 = getelementptr inbounds double, double* %2, i64 %167
%175 = bitcast double* %174 to <2 x double>*
store <2 x double> %170, <2 x double>* %175
%176 = getelementptr inbounds double, double* %174, i64 2
%177 = bitcast double* %176 to <2 x double>*
store <2 x double> %173, <2 x double>* %177
%178 = or i64 %153, 8
%179 = add i64 %129, %178
%180 = getelementptr inbounds double, double* %123, i64 %178
%181 = bitcast double* %180 to <2 x double>*
%182 = load <2 x double>, <2 x double>* %181
%183 = getelementptr inbounds double, double* %180, i64 2
%184 = bitcast double* %183 to <2 x double>*
%185 = load <2 x double>, <2 x double>* %184
%186 = getelementptr inbounds double, double* %2, i64 %179
%187 = bitcast double* %186 to <2 x double>*
store <2 x double> %182, <2 x double>* %187
%188 = getelementptr inbounds double, double* %186, i64 2
%189 = bitcast double* %188 to <2 x double>*
store <2 x double> %185, <2 x double>* %189
%190 = or i64 %153, 12
%191 = add i64 %129, %190
%192 = getelementptr inbounds double, double* %123, i64 %190
%193 = bitcast double* %192 to <2 x double>*
%194 = load <2 x double>, <2 x double>* %193
%195 = getelementptr inbounds double, double* %192, i64 2
%196 = bitcast double* %195 to <2 x double>*
%197 = load <2 x double>, <2 x double>* %196
%198 = getelementptr inbounds double, double* %2, i64 %191
%199 = bitcast double* %198 to <2 x double>*
store <2 x double> %194, <2 x double>* %199
%200 = getelementptr inbounds double, double* %198, i64 2
%201 = bitcast double* %200 to <2 x double>*
store <2 x double> %197, <2 x double>* %201
%202 = add nuw i64 %153, 16
%203 = add nuw i64 %154, 4
%204 = icmp eq i64 %203, %151
br i1 %204, label %205, label %152
205: ; preds = %152, %142
%206 = phi i64 [ 0, %142 ], [ %202, %152 ]
%207 = icmp eq i64 %148, 0
br i1 %207, label %225, label %208
208: ; preds = %205, %208
%209 = phi i64 [ %222, %208 ], [ %206, %205 ]
%210 = phi i64 [ %223, %208 ], [ 0, %205 ]
%211 = add i64 %129, %209
%212 = getelementptr inbounds double, double* %123, i64 %209
%213 = bitcast double* %212 to <2 x double>*
%214 = load <2 x double>, <2 x double>* %213
%215 = getelementptr inbounds double, double* %212, i64 2
%216 = bitcast double* %215 to <2 x double>*
%217 = load <2 x double>, <2 x double>* %216
%218 = getelementptr inbounds double, double* %2, i64 %211
%219 = bitcast double* %218 to <2 x double>*
store <2 x double> %214, <2 x double>* %219
%220 = getelementptr inbounds double, double* %218, i64 2
%221 = bitcast double* %220 to <2 x double>*
store <2 x double> %217, <2 x double>* %221
%222 = add nuw i64 %209, 4
%223 = add i64 %210, 1
%224 = icmp eq i64 %223, %148
br i1 %224, label %225, label %208
225: ; preds = %208, %205
%226 = icmp eq i64 %143, %130
br i1 %226, label %239, label %227
227: ; preds = %132, %127, %225
%228 = phi i64 [ %129, %132 ], [ %129, %127 ], [ %144, %225 ]
%229 = phi i64 [ 0, %132 ], [ 0, %127 ], [ %143, %225 ]
br label %230
230: ; preds = %227, %230
%231 = phi i64 [ %235, %230 ], [ %228, %227 ]
%232 = phi i64 [ %237, %230 ], [ %229, %227 ]
%233 = getelementptr inbounds double, double* %123, i64 %232
%234 = load double, double* %233
%235 = add nsw i64 %231, 1
%236 = getelementptr inbounds double, double* %2, i64 %231
store double %234, double* %236
%237 = add nuw nsw i64 %232, 1
%238 = icmp eq i64 %237, %130
br i1 %238, label %239, label %230
239: ; preds = %230, %225, %120
%240 = tail call i32 @free(double* %123)
br label %241
241: ; preds = %5, %9, %239
ret void
}