#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 *addVec(double *, double *, int);
int /*<<< orphan*/ findMinMax2(double **, double *, int, int);
int isParallel(double *, double *, int);
double lVec(double *, int);
double **malloc(int);
int /*<<< orphan*/ printTab(double *, int);
int /*<<< orphan*/ printf(char *, ...);
double *readVector(int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
double *vector(int);
int main() {
  int size = 4;
  srand(time(0));
  double *a = readVector(size);
  double *b = readVector(size);
  double *c = addVec(a, b, size);
  printf("\n");
  printf("%d isParal", isParallel(a, b, size));
  printTab(a, size);
  printf("%f \n", lVec(a, size));
  printTab(b, size);
  printf("%f \n", lVec(b, size));
  double **mat = malloc(2 * sizeof(double *));
  mat[0] = a;
  mat[1] = b;
  printTab(c, size);
  double *minmaxes = vector(2);
  findMinMax2(mat, minmaxes, 2, size);
  printTab(minmaxes, 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x4,-0x4(%rbp)
xor    %edi,%edi
call   1090 <time@plt>
mov    %eax,%edi
call   1080 <srand@plt>
mov    -0x4(%rbp),%edi
call   10d0 <readVector@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   10d0 <readVector@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1050 <addVec@plt>
mov    %rax,-0x20(%rbp)
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   10c0 <isParallel@plt>
mov    %eax,%esi
lea    0xde0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1060 <printTab@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1070 <lVec@plt>
lea    0xdc5(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1060 <printTab@plt>
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1070 <lVec@plt>
lea    0xd9f(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x10,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1060 <printTab@plt>
mov    $0x2,%edi
call   10a0 <vector@plt>
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x4(%rbp),%ecx
mov    $0x2,%edx
call   1030 <findMinMax2@plt>
mov    -0x30(%rbp),%rdi
mov    $0x2,%esi
call   1060 <printTab@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
xor    %edi,%edi
call   10a0 <time@plt>
mov    %eax,%edi
call   1090 <srand@plt>
mov    $0x4,%edi
call   10e0 <readVector@plt>
mov    %rax,%r14
mov    $0x4,%edi
call   10e0 <readVector@plt>
mov    %rax,%r13
mov    %r14,%rdi
mov    %rax,%rsi
mov    $0x4,%edx
call   1060 <addVec@plt>
mov    %rax,%r15
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    %r14,%rdi
mov    %r13,%rsi
mov    $0x4,%edx
call   10d0 <isParallel@plt>
lea    0xddb(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    $0x4,%esi
call   1070 <printTab@plt>
mov    %r14,%rdi
mov    $0x4,%esi
call   1080 <lVec@plt>
lea    0xdbc(%rip),%r12
mov    %r12,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    %r13,%rdi
mov    $0x4,%esi
call   1070 <printTab@plt>
mov    %r13,%rdi
mov    $0x4,%esi
call   1080 <lVec@plt>
mov    %r12,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x10,%edi
call   10c0 <malloc@plt>
mov    %rax,%rbx
mov    %r14,(%rax)
mov    %r13,0x8(%rax)
mov    %r15,%rdi
mov    $0x4,%esi
call   1070 <printTab@plt>
mov    $0x2,%edi
call   10b0 <vector@plt>
mov    %rax,%r14
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x2,%edx
mov    $0x4,%ecx
call   1030 <findMinMax2@plt>
mov    %r14,%rdi
mov    $0x2,%esi
call   1070 <printTab@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [11 x i8] c"%d isParal\00"
@.str.2 = [5 x i8] c"%f \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double*
%3 = alloca double*
%4 = alloca double*
%5 = alloca double**
%6 = alloca double*
store i32 4, i32* %1
%7 = call i32 @time(i32 0)
%8 = call i32 @srand(i32 %7)
%9 = load i32, i32* %1
%10 = call double* @readVector(i32 %9)
store double* %10, double** %2
%11 = load i32, i32* %1
%12 = call double* @readVector(i32 %11)
store double* %12, double** %3
%13 = load double*, double** %2
%14 = load double*, double** %3
%15 = load i32, i32* %1
%16 = call double* @addVec(double* %13, double* %14, i32 %15)
store double* %16, double** %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%18 = load double*, double** %2
%19 = load double*, double** %3
%20 = load i32, i32* %1
%21 = call i32 @isParallel(double* %18, double* %19, i32 %20)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = load double*, double** %2
%24 = load i32, i32* %1
%25 = call i32 @printTab(double* %23, i32 %24)
%26 = load double*, double** %2
%27 = load i32, i32* %1
%28 = call double @lVec(double* %26, i32 %27)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %28)
%30 = load double*, double** %3
%31 = load i32, i32* %1
%32 = call i32 @printTab(double* %30, i32 %31)
%33 = load double*, double** %3
%34 = load i32, i32* %1
%35 = call double @lVec(double* %33, i32 %34)
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %35)
%37 = call double** @malloc(i32 16)
store double** %37, double*** %5
%38 = load double*, double** %2
%39 = load double**, double*** %5
%40 = getelementptr inbounds double*, double** %39, i64 0
store double* %38, double** %40
%41 = load double*, double** %3
%42 = load double**, double*** %5
%43 = getelementptr inbounds double*, double** %42, i64 1
store double* %41, double** %43
%44 = load double*, double** %4
%45 = load i32, i32* %1
%46 = call i32 @printTab(double* %44, i32 %45)
%47 = call double* @vector(i32 2)
store double* %47, double** %6
%48 = load double**, double*** %5
%49 = load double*, double** %6
%50 = load i32, i32* %1
%51 = call i32 @findMinMax2(double** %48, double* %49, i32 2, i32 %50)
%52 = load double*, double** %6
%53 = call i32 @printTab(double* %52, i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"%d isParal\00"
@.str.2 = [5 x i8] c"%f \0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32 0)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call double* @readVector(i32 4)
%4 = tail call double* @readVector(i32 4)
%5 = tail call double* @addVec(double* %3, double* %4, i32 4)
%6 = tail call i32 @putchar(i32 10)
%7 = tail call i32 @isParallel(double* %3, double* %4, i32 4)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = tail call i32 @printTab(double* %3, i32 4)
%10 = tail call double @lVec(double* %3, i32 4)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %10)
%12 = tail call i32 @printTab(double* %4, i32 4)
%13 = tail call double @lVec(double* %4, i32 4)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %13)
%15 = tail call double** @malloc(i32 16)
store double* %3, double** %15
%16 = getelementptr inbounds double*, double** %15, i64 1
store double* %4, double** %16
%17 = tail call i32 @printTab(double* %5, i32 4)
%18 = tail call double* @vector(i32 2)
%19 = tail call i32 @findMinMax2(double** %15, double* %18, i32 2, i32 4)
%20 = tail call i32 @printTab(double* %18, i32 2)
ret i32 0
}