#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 /*<<< orphan*/ sleep_funct2();
int write_double_array_to_socket(int, double *, int);
void write_elements_to_socket(int sockfd, int nelements, double *elements_all) {
  int i, ind, nlen, nchunks, nleftover, chunk_num;
  double *elements_local;
  if (nelements <= 6000) {
    printf("transfer all at once..\n");
    nlen = write_double_array_to_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));
      for (i = 0; i < 6000; i++) {
        elements_local[i] = elements_all[ind++];
      }
      nlen = write_double_array_to_socket(sockfd, elements_local,
                                          6000 * sizeof(double));
      sleep_funct2();
      free(elements_local);
    }
    elements_local = (double *)malloc(nleftover * sizeof(double));
    for (i = 0; i < nleftover; i++) {
      elements_local[i] = elements_all[ind++];
    }
    nlen = write_double_array_to_socket(sockfd, elements_local,
                                        nleftover * sizeof(double));
    free(elements_local);
  }
}


x86 assembly (clang, -O0):
<write_elements_to_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     11c1 <write_elements_to_socket+0x61>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
movslq -0x8(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1040 <write_double_array_to_socket@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    11bc <write_elements_to_socket+0x5c>
lea    0xe61(%rip),%rdi
call   1080 <error@plt>
jmp    130b <write_elements_to_socket+0x1ab>
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    0xe46(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1291 <write_elements_to_socket+0x131>
mov    $0xbb80,%edi
call   1070 <malloc@plt>
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1770,-0x14(%rbp)
jge    125f <write_elements_to_socket+0xff>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1220 <write_elements_to_socket+0xc0>
mov    -0x4(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    $0xbb80,%edx
call   1040 <write_double_array_to_socket@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1060 <sleep_funct2@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11ff <write_elements_to_socket+0x9f>
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    12e9 <write_elements_to_socket+0x189>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12ab <write_elements_to_socket+0x14b>
mov    -0x4(%rbp),%edi
mov    -0x30(%rbp),%rsi
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1040 <write_double_array_to_socket@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_elements_to_socket>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdx,%r14
mov    %esi,%ebx
mov    %edi,%ebp
cmp    $0x1770,%esi
jg     11bf <write_elements_to_socket+0x4f>
lea    0xead(%rip),%rdi
call   1040 <puts@plt>
shl    $0x3,%ebx
mov    %ebp,%edi
mov    %r14,%rsi
mov    %ebx,%edx
call   1050 <write_double_array_to_socket@plt>
test   %eax,%eax
js     1376 <write_elements_to_socket+0x206>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %ebp,0xc(%rsp)
mov    %ebx,%eax
mov    %rax,0x18(%rsp)
imul   $0x57619f1,%rax,%rbp
shr    $0x27,%rbp
imul   $0x1770,%ebp,%eax
sub    %eax,%ebx
lea    0xe34(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,0x10(%rsp)
mov    %ebx,%edx
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xbb80(%r14),%r15
mov    %r14,%r12
lea    0x20(%r14),%rax
mov    %rax,0x20(%rsp)
xor    %r13d,%r13d
xor    %r14d,%r14d
jmp    123d <write_elements_to_socket+0xcd>
nop
mov    0xc(%rsp),%edi
mov    %rbx,%rsi
mov    $0xbb80,%edx
call   1050 <write_double_array_to_socket@plt>
xor    %eax,%eax
call   1070 <sleep_funct2@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
add    $0x1,%r13d
cmp    %ebp,%r13d
je     1340 <write_elements_to_socket+0x1d0>
mov    $0xbb80,%edi
call   1080 <malloc@plt>
mov    %rax,%rbx
movslq %r14d,%r14
lea    (%r12,%r14,8),%rax
lea    (%r15,%r14,8),%rcx
cmp    %rcx,%rbx
jae    12d0 <write_elements_to_socket+0x160>
mov    %rbx,%rcx
add    $0xbb80,%rcx
cmp    %rcx,%rax
jae    12d0 <write_elements_to_socket+0x160>
mov    0x20(%rsp),%rax
lea    (%rax,%r14,8),%rcx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  -0x20(%rcx,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%rax,8)
movsd  -0x18(%rcx,%rax,8),%xmm0
movsd  %xmm0,0x8(%rbx,%rax,8)
movsd  -0x10(%rcx,%rax,8),%xmm0
movsd  %xmm0,0x10(%rbx,%rax,8)
movsd  -0x8(%rcx,%rax,8),%xmm0
movsd  %xmm0,0x18(%rbx,%rax,8)
movsd  (%rcx,%rax,8),%xmm0
movsd  %xmm0,0x20(%rbx,%rax,8)
add    $0x5,%rax
cmp    $0x1770,%rax
jne    1280 <write_elements_to_socket+0x110>
add    %rax,%r14
jmp    1210 <write_elements_to_socket+0xa0>
xchg   %ax,%ax
add    $0x1770,%r14
mov    $0xe,%ecx
nopl   0x0(%rax)
movups -0x70(%rax,%rcx,8),%xmm0
movups -0x60(%rax,%rcx,8),%xmm1
movups %xmm0,-0x70(%rbx,%rcx,8)
movups %xmm1,-0x60(%rbx,%rcx,8)
movups -0x50(%rax,%rcx,8),%xmm0
movups -0x40(%rax,%rcx,8),%xmm1
movups %xmm0,-0x50(%rbx,%rcx,8)
movups %xmm1,-0x40(%rbx,%rcx,8)
movups -0x30(%rax,%rcx,8),%xmm0
movups -0x20(%rax,%rcx,8),%xmm1
movups %xmm0,-0x30(%rbx,%rcx,8)
movups %xmm1,-0x20(%rbx,%rcx,8)
movups -0x10(%rax,%rcx,8),%xmm0
movups (%rax,%rcx,8),%xmm1
movups %xmm0,-0x10(%rbx,%rcx,8)
movups %xmm1,(%rbx,%rcx,8)
add    $0x10,%rcx
cmp    $0x177e,%rcx
jne    12e0 <write_elements_to_socket+0x170>
jmp    1210 <write_elements_to_socket+0xa0>
mov    0x10(%rsp),%r13
lea    0x0(,%r13,8),%r15d
mov    %r15d,%edi
call   1080 <malloc@plt>
mov    %rax,%rbp
test   %r13d,%r13d
mov    0x18(%rsp),%rbx
je     14e3 <write_elements_to_socket+0x373>
movslq %r14d,%r9
cmp    $0x4,%r13d
jae    1390 <write_elements_to_socket+0x220>
xor    %ecx,%ecx
jmp    14a3 <write_elements_to_socket+0x333>
lea    0xc83(%rip),%rdi
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1090 <error@plt>
mov    %r13d,%r8d
mov    %r8,%rax
add    %r9,%rax
mov    %r12,%r10
lea    (%r12,%rax,8),%rax
cmp    %rax,%rbp
jae    13c0 <write_elements_to_socket+0x250>
lea    0x0(,%r8,8),%rax
add    %rbp,%rax
lea    (%r10,%r9,8),%rcx
cmp    %rax,%rcx
jae    13c0 <write_elements_to_socket+0x250>
xor    %ecx,%ecx
jmp    14a6 <write_elements_to_socket+0x336>
mov    %r8d,%ecx
and    $0x1ffc,%ecx
lea    -0x4(%rcx),%rax
mov    %rax,%rdi
shr    $0x2,%rdi
add    $0x1,%rdi
mov    %edi,%esi
and    $0x3,%esi
cmp    $0xc,%rax
jae    13e7 <write_elements_to_socket+0x277>
xor    %edx,%edx
jmp    1459 <write_elements_to_socket+0x2e9>
and    $0xfffffffffffffffc,%rdi
lea    (%r10,%r9,8),%rax
add    $0x70,%rax
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
movups -0x70(%rax,%rdx,8),%xmm0
movups -0x60(%rax,%rdx,8),%xmm1
movups %xmm0,0x0(%rbp,%rdx,8)
movups %xmm1,0x10(%rbp,%rdx,8)
movups -0x50(%rax,%rdx,8),%xmm0
movups -0x40(%rax,%rdx,8),%xmm1
movups %xmm0,0x20(%rbp,%rdx,8)
movups %xmm1,0x30(%rbp,%rdx,8)
movups -0x30(%rax,%rdx,8),%xmm0
movups -0x20(%rax,%rdx,8),%xmm1
movups %xmm0,0x40(%rbp,%rdx,8)
movups %xmm1,0x50(%rbp,%rdx,8)
movups -0x10(%rax,%rdx,8),%xmm0
movups (%rax,%rdx,8),%xmm1
movups %xmm0,0x60(%rbp,%rdx,8)
movups %xmm1,0x70(%rbp,%rdx,8)
add    $0x10,%rdx
add    $0xfffffffffffffffc,%rdi
jne    1400 <write_elements_to_socket+0x290>
test   %rsi,%rsi
je     149b <write_elements_to_socket+0x32b>
lea    0x10(,%rdx,8),%rax
add    %rbp,%rax
add    %r9,%rdx
lea    (%r10,%rdx,8),%rdx
add    $0x10,%rdx
shl    $0x5,%rsi
xor    %edi,%edi
nopw   0x0(%rax,%rax,1)
movups -0x10(%rdx,%rdi,1),%xmm0
movups (%rdx,%rdi,1),%xmm1
movups %xmm0,-0x10(%rax,%rdi,1)
movups %xmm1,(%rax,%rdi,1)
add    $0x20,%rdi
cmp    %rdi,%rsi
jne    1480 <write_elements_to_socket+0x310>
cmp    %r8,%rcx
je     14e3 <write_elements_to_socket+0x373>
add    %rcx,%r9
mov    %r12,%r10
lea    (%r10,%r9,8),%rax
lea    0x0(,%rcx,8),%rdx
add    %rbp,%rdx
imul   $0x57619f1,%rbx,%rsi
sub    %rcx,%rbx
shr    $0x27,%rsi
imul   $0x1770,%rsi,%rcx
sub    %rcx,%rbx
xor    %ecx,%ecx
nop
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rdx,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rbx
jne    14d0 <write_elements_to_socket+0x360>
mov    0xc(%rsp),%edi
mov    %rbp,%rsi
mov    %r15d,%edx
call   1050 <write_double_array_to_socket@plt>
mov    %rbp,%rdi
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

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

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