#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(int);
int /*<<< orphan*/ perror(char *);
void generate_results(float ****results, unsigned int number_of_sorting,
                      unsigned int tab_sizes_length,
                      unsigned int number_of_tests) {
  unsigned int sorting_number;
  unsigned int tab_sizes_index;
  unsigned int test_number;
  if ((*results = malloc(sizeof(**results) * number_of_sorting)) == NULL) {
    perror("Malloc error.");
    exit(EXIT_FAILURE);
  }
  for (sorting_number = 0; sorting_number < number_of_sorting;
       sorting_number++) {
    if (((*results)[sorting_number] =
             malloc(sizeof(***results) * tab_sizes_length)) == NULL) {
      perror("Malloc error.");
      exit(EXIT_FAILURE);
    }
    for (tab_sizes_index = 0; tab_sizes_index < tab_sizes_length;
         tab_sizes_index++) {
      if (((*results)[sorting_number][tab_sizes_index] =
               malloc(sizeof(****results) * number_of_tests)) == NULL) {
        perror("Malloc error.");
        exit(EXIT_FAILURE);
      }
      for (test_number = 0; test_number < number_of_tests; test_number++)
        (*results)[sorting_number][tab_sizes_index][test_number] = 0;
    }
  }
}


x86 assembly (clang, -O0):
<generate_results>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    -0x8(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    117e <generate_results+0x4e>
lea    0xe95(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1292 <generate_results+0x162>
mov    -0x10(%rbp),%eax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
mov    -0x18(%rbp),%edx
mov    %rax,(%rcx,%rdx,8)
cmp    $0x0,%rax
jne    11d1 <generate_results+0xa1>
lea    0xe42(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e16(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jae    127f <generate_results+0x14f>
mov    -0x14(%rbp),%eax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
mov    -0x18(%rbp),%edx
mov    (%rcx,%rdx,8),%rcx
mov    -0x1c(%rbp),%edx
mov    %rax,(%rcx,%rdx,8)
cmp    $0x0,%rax
jne    122b <generate_results+0xfb>
lea    0xde8(%rip),%rdi
call   1040 <perror@plt>
mov    0x2dbc(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    126c <generate_results+0x13c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%ecx
mov    (%rax,%rcx,8),%rax
mov    -0x1c(%rbp),%ecx
mov    (%rax,%rcx,8),%rax
mov    -0x20(%rbp),%ecx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1232 <generate_results+0x102>
jmp    1271 <generate_results+0x141>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11d8 <generate_results+0xa8>
jmp    1284 <generate_results+0x154>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1185 <generate_results+0x55>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_results>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %ecx,%r15d
mov    %rdx,0x8(%rsp)
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0x0(,%r14,8),%edi
call   1040 <malloc@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     1241 <generate_results+0x101>
test   %r14d,%r14d
je     125b <generate_results+0x11b>
mov    %rax,%rbp
mov    0x8(%rsp),%rax
lea    0x0(,%rax,8),%edi
mov    %edi,0x14(%rsp)
call   1040 <malloc@plt>
mov    %rax,0x0(%rbp)
test   %rax,%rax
je     1241 <generate_results+0x101>
lea    0x0(,%r15,4),%ebp
mov    %r15d,%eax
shl    $0x2,%rax
mov    %rax,0x20(%rsp)
mov    %r14d,%eax
mov    %rax,0x18(%rsp)
mov    0x8(%rsp),%r12d
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
cmpl   $0x0,0x8(%rsp)
je     1220 <generate_results+0xe0>
xor    %r13d,%r13d
jmp    11e9 <generate_results+0xa9>
nopl   0x0(%rax)
add    $0x1,%r13
cmp    %r13,%r12
je     1220 <generate_results+0xe0>
mov    %ebp,%edi
call   1040 <malloc@plt>
mov    (%rbx),%rcx
mov    (%rcx,%r14,8),%rcx
mov    %rax,(%rcx,%r13,8)
test   %rax,%rax
je     1241 <generate_results+0x101>
test   %r15d,%r15d
je     11e0 <generate_results+0xa0>
mov    (%rbx),%rax
mov    (%rax,%r14,8),%rax
mov    (%rax,%r13,8),%rdi
xor    %esi,%esi
mov    0x20(%rsp),%rdx
call   1030 <memset@plt>
jmp    11e0 <generate_results+0xa0>
xchg   %ax,%ax
add    $0x1,%r14
cmp    0x18(%rsp),%r14
je     125b <generate_results+0x11b>
mov    (%rbx),%r13
mov    0x14(%rsp),%edi
call   1040 <malloc@plt>
mov    %rax,0x0(%r13,%r14,8)
test   %rax,%rax
jne    11d0 <generate_results+0x90>
lea    0xdb8(%rip),%rdi
call   1050 <perror@plt>
mov    0x2d8c(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Malloc error.\00"
@EXIT_FAILURE = global i32 0
define void @generate_results(float**** %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca float****
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store float**** %0, float***** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%12 = load i32, i32* %6
%13 = zext i32 %12 to i64
%14 = mul i64 8, %13
%15 = trunc i64 %14 to i32
%16 = call i8* @malloc(i32 %15)
%17 = bitcast i8* %16 to float***
%18 = load float****, float***** %5
store float*** %17, float**** %18
%19 = icmp eq float*** %17, null
br i1 %19, label %20, label %24
20: ; preds = %4
%21 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%22 = load i32, i32* @EXIT_FAILURE
%23 = call i32 @exit(i32 %22)
unreachable
24: ; preds = %4
store i32 0, i32* %9
br label %25
25: ; preds = %99, %24
%26 = load i32, i32* %9
%27 = load i32, i32* %6
%28 = icmp ult i32 %26, %27
br i1 %28, label %29, label %102
29: ; preds = %25
%30 = load i32, i32* %7
%31 = zext i32 %30 to i64
%32 = mul i64 8, %31
%33 = trunc i64 %32 to i32
%34 = call i8* @malloc(i32 %33)
%35 = bitcast i8* %34 to float**
%36 = load float****, float***** %5
%37 = load float***, float**** %36
%38 = load i32, i32* %9
%39 = zext i32 %38 to i64
%40 = getelementptr inbounds float**, float*** %37, i64 %39
store float** %35, float*** %40
%41 = icmp eq float** %35, null
br i1 %41, label %42, label %46
42: ; preds = %29
%43 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%44 = load i32, i32* @EXIT_FAILURE
%45 = call i32 @exit(i32 %44)
unreachable
46: ; preds = %29
store i32 0, i32* %10
br label %47
47: ; preds = %95, %46
%48 = load i32, i32* %10
%49 = load i32, i32* %7
%50 = icmp ult i32 %48, %49
br i1 %50, label %51, label %98
51: ; preds = %47
%52 = load i32, i32* %8
%53 = zext i32 %52 to i64
%54 = mul i64 4, %53
%55 = trunc i64 %54 to i32
%56 = call i8* @malloc(i32 %55)
%57 = bitcast i8* %56 to float*
%58 = load float****, float***** %5
%59 = load float***, float**** %58
%60 = load i32, i32* %9
%61 = zext i32 %60 to i64
%62 = getelementptr inbounds float**, float*** %59, i64 %61
%63 = load float**, float*** %62
%64 = load i32, i32* %10
%65 = zext i32 %64 to i64
%66 = getelementptr inbounds float*, float** %63, i64 %65
store float* %57, float** %66
%67 = icmp eq float* %57, null
br i1 %67, label %68, label %72
68: ; preds = %51
%69 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%70 = load i32, i32* @EXIT_FAILURE
%71 = call i32 @exit(i32 %70)
unreachable
72: ; preds = %51
store i32 0, i32* %11
br label %73
73: ; preds = %91, %72
%74 = load i32, i32* %11
%75 = load i32, i32* %8
%76 = icmp ult i32 %74, %75
br i1 %76, label %77, label %94
77: ; preds = %73
%78 = load float****, float***** %5
%79 = load float***, float**** %78
%80 = load i32, i32* %9
%81 = zext i32 %80 to i64
%82 = getelementptr inbounds float**, float*** %79, i64 %81
%83 = load float**, float*** %82
%84 = load i32, i32* %10
%85 = zext i32 %84 to i64
%86 = getelementptr inbounds float*, float** %83, i64 %85
%87 = load float*, float** %86
%88 = load i32, i32* %11
%89 = zext i32 %88 to i64
%90 = getelementptr inbounds float, float* %87, i64 %89
store float 0.000000e+00, float* %90
br label %91
91: ; preds = %77
%92 = load i32, i32* %11
%93 = add i32 %92, 1
store i32 %93, i32* %11
br label %73
94: ; preds = %73
br label %95
95: ; preds = %94
%96 = load i32, i32* %10
%97 = add i32 %96, 1
store i32 %97, i32* %10
br label %47
98: ; preds = %47
br label %99
99: ; preds = %98
%100 = load i32, i32* %9
%101 = add i32 %100, 1
store i32 %101, i32* %9
br label %25
102: ; preds = %25
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Malloc error.\00"
@EXIT_FAILURE = global i32 0
define void @generate_results(float**** nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %1, 3
%6 = tail call i8* @malloc(i32 %5)
%7 = bitcast float**** %0 to i8**
store i8* %6, i8** %7
%8 = icmp eq i8* %6, null
br i1 %8, label %23, label %9
9: ; preds = %4
%10 = icmp eq i32 %1, 0
br i1 %10, label %66, label %11
11: ; preds = %9
%12 = shl i32 %2, 3
%13 = icmp eq i32 %2, 0
%14 = shl i32 %3, 2
%15 = icmp eq i32 %3, 0
%16 = zext i32 %3 to i64
%17 = shl nuw nsw i64 %16, 2
%18 = zext i32 %1 to i64
%19 = zext i32 %2 to i64
%20 = tail call i8* @malloc(i32 %12)
%21 = bitcast i8* %6 to i8**
store i8* %20, i8** %21
%22 = icmp eq i8* %20, null
br i1 %22, label %29, label %27
23: ; preds = %4
%24 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%25 = load i32, i32* @EXIT_FAILURE
%26 = tail call i32 @exit(i32 %25)
unreachable
27: ; preds = %11, %60
%28 = phi i64 [ %58, %60 ], [ 0, %11 ]
br i1 %13, label %57, label %33
29: ; preds = %60, %11
%30 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%31 = load i32, i32* @EXIT_FAILURE
%32 = tail call i32 @exit(i32 %31)
unreachable
33: ; preds = %27, %54
%34 = phi i64 [ %55, %54 ], [ 0, %27 ]
%35 = tail call i8* @malloc(i32 %14)
%36 = load float***, float**** %0
%37 = getelementptr inbounds float**, float*** %36, i64 %28
%38 = load float**, float*** %37
%39 = getelementptr inbounds float*, float** %38, i64 %34
%40 = bitcast float** %39 to i8**
store i8* %35, i8** %40
%41 = icmp eq i8* %35, null
br i1 %41, label %50, label %42
42: ; preds = %33
br i1 %15, label %54, label %43
43: ; preds = %42
%44 = load float***, float**** %0
%45 = getelementptr inbounds float**, float*** %44, i64 %28
%46 = load float**, float*** %45
%47 = getelementptr inbounds float*, float** %46, i64 %34
%48 = bitcast float** %47 to i8**
%49 = load i8*, i8** %48
br label %54
50: ; preds = %33
%51 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%52 = load i32, i32* @EXIT_FAILURE
%53 = tail call i32 @exit(i32 %52)
unreachable
54: ; preds = %43, %42
%55 = add nuw nsw i64 %34, 1
%56 = icmp eq i64 %55, %19
br i1 %56, label %57, label %33
57: ; preds = %54, %27
%58 = add nuw nsw i64 %28, 1
%59 = icmp eq i64 %58, %18
br i1 %59, label %66, label %60
60: ; preds = %57
%61 = load float***, float**** %0
%62 = tail call i8* @malloc(i32 %12)
%63 = getelementptr inbounds float**, float*** %61, i64 %58
%64 = bitcast float*** %63 to i8**
store i8* %62, i8** %64
%65 = icmp eq i8* %62, null
br i1 %65, label %29, label %27
66: ; preds = %57, %9
ret void
}