#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*/ printf(char *, ...);
double rand_double();
double rand_range_double(double, double);
int /*<<< orphan*/ srandom(int);
void gen_path_pixels(void) {
  int i;
  srandom(20050728);
  printf("static const int babl_num_path_test_pixels = %d;\n\n", 3072);
  printf("static const double babl_path_test_pixels[%d] = {\n", 3072 * 4);
  for (i = 0; i < 256; i++) {
    printf("%a, %a, %a, %a,\n", rand_double(), rand_double(), rand_double(),
           rand_double());
  }
  for (i = 0; i < 16; i++) {
    printf("%a, %a, %a, %a,\n", rand_range_double(-1.0, 0.0),
           rand_range_double(-1.0, 0.0), rand_range_double(-1.0, 0.0),
           rand_range_double(-1.0, 0.0));
  }
  for (i = 0; i < 16; i++) {
    printf("%a, %a, %a, %a,\n", rand_range_double(1.0, 2.0),
           rand_range_double(1.0, 2.0), rand_range_double(1.0, 2.0),
           rand_range_double(1.0, 2.0));
  }
  for (i = 288; i < 3072; i++) {
    printf("%a, %a, %a, %a,\n", rand_double(), rand_double(), rand_double(),
           rand_double());
  }
  printf("};\n\n");
  printf("static const int babl_num_conversion_test_pixels = %d;\n\n", 128);
  printf("static const double *babl_conversion_test_pixels = "
         "babl_path_test_pixels;\n\n");
  printf("static const int babl_num_format_test_pixels = %d;\n\n", 256);
  printf("static const double *babl_format_test_pixels = "
         "babl_path_test_pixels;\n\n");
}


x86 assembly (clang, -O0):
<gen_path_pixels>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    $0x131f328,%edi
call   1030 <srandom@plt>
lea    0xebf(%rip),%rdi
mov    $0xc00,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x3000,%esi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    11e5 <gen_path_pixels+0xa5>
mov    $0x0,%al
call   1050 <rand_double@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1050 <rand_double@plt>
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1050 <rand_double@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1050 <rand_double@plt>
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x10(%rbp),%xmm0
lea    0xeae(%rip),%rdi
mov    $0x4,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    117f <gen_path_pixels+0x3f>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1273 <gen_path_pixels+0x133>
movsd  0xe12(%rip),%xmm0
xorps  %xmm1,%xmm1
call   1060 <rand_range_double@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  0xdfd(%rip),%xmm0
xorps  %xmm1,%xmm1
call   1060 <rand_range_double@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  0xde8(%rip),%xmm0
xorps  %xmm1,%xmm1
call   1060 <rand_range_double@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  0xdd3(%rip),%xmm0
xorps  %xmm1,%xmm1
call   1060 <rand_range_double@plt>
movsd  -0x38(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x28(%rbp),%xmm0
lea    0xe20(%rip),%rdi
mov    $0x4,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11ec <gen_path_pixels+0xac>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1315 <gen_path_pixels+0x1d5>
movsd  0xd74(%rip),%xmm0
movsd  0xd74(%rip),%xmm1
call   1060 <rand_range_double@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  0xd5a(%rip),%xmm0
movsd  0xd5a(%rip),%xmm1
call   1060 <rand_range_double@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  0xd40(%rip),%xmm0
movsd  0xd40(%rip),%xmm1
call   1060 <rand_range_double@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  0xd26(%rip),%xmm0
movsd  0xd26(%rip),%xmm1
call   1060 <rand_range_double@plt>
movsd  -0x50(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x40(%rbp),%xmm0
lea    0xd7e(%rip),%rdi
mov    $0x4,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    127a <gen_path_pixels+0x13a>
movl   $0x120,-0x4(%rbp)
cmpl   $0xc00,-0x4(%rbp)
jge    1382 <gen_path_pixels+0x242>
mov    $0x0,%al
call   1050 <rand_double@plt>
movsd  %xmm0,-0x58(%rbp)
mov    $0x0,%al
call   1050 <rand_double@plt>
movsd  %xmm0,-0x68(%rbp)
mov    $0x0,%al
call   1050 <rand_double@plt>
movsd  %xmm0,-0x60(%rbp)
mov    $0x0,%al
call   1050 <rand_double@plt>
movsd  -0x68(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x58(%rbp),%xmm0
lea    0xd11(%rip),%rdi
mov    $0x4,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    131c <gen_path_pixels+0x1dc>
lea    0xd06(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xcfd(%rip),%rdi
mov    $0x80,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd23(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd61(%rip),%rdi
mov    $0x100,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd83(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_path_pixels>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    $0x131f328,%edi
call   1030 <srandom@plt>
lea    0xeb1(%rip),%rdi
mov    $0xc00,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xed1(%rip),%rdi
mov    $0x3000,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x100,%ebp
lea    0xeec(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1060 <rand_double@plt>
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1060 <rand_double@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1060 <rand_double@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1060 <rand_double@plt>
movaps %xmm0,%xmm3
mov    %rbx,%rdi
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
mov    $0x4,%al
call   1050 <printf@plt>
add    $0xffffffff,%ebp
jne    11a0 <gen_path_pixels+0x50>
mov    $0x10,%ebp
lea    0xe82(%rip),%rbx
nopl   0x0(%rax)
xorps  %xmm1,%xmm1
movsd  0xdf5(%rip),%xmm0
call   1070 <rand_range_double@plt>
movsd  %xmm0,0x10(%rsp)
xorps  %xmm1,%xmm1
movsd  0xddf(%rip),%xmm0
call   1070 <rand_range_double@plt>
movsd  %xmm0,0x8(%rsp)
xorps  %xmm1,%xmm1
movsd  0xdc9(%rip),%xmm0
call   1070 <rand_range_double@plt>
movsd  %xmm0,(%rsp)
xorps  %xmm1,%xmm1
movsd  0xdb4(%rip),%xmm0
call   1070 <rand_range_double@plt>
movaps %xmm0,%xmm3
mov    %rbx,%rdi
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
mov    $0x4,%al
call   1050 <printf@plt>
add    $0xffffffff,%ebp
jne    1200 <gen_path_pixels+0xb0>
mov    $0x10,%ebp
lea    0xdfe(%rip),%rbx
movsd  0xd80(%rip),%xmm0
movsd  0xd80(%rip),%xmm1
call   1070 <rand_range_double@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0xd65(%rip),%xmm0
movsd  0xd65(%rip),%xmm1
call   1070 <rand_range_double@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xd4a(%rip),%xmm0
movsd  0xd4a(%rip),%xmm1
call   1070 <rand_range_double@plt>
movsd  %xmm0,(%rsp)
movsd  0xd30(%rip),%xmm0
movsd  0xd30(%rip),%xmm1
call   1070 <rand_range_double@plt>
movaps %xmm0,%xmm3
mov    %rbx,%rdi
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
mov    $0x4,%al
call   1050 <printf@plt>
add    $0xffffffff,%ebp
jne    1280 <gen_path_pixels+0x130>
mov    $0xae0,%ebp
lea    0xd66(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <rand_double@plt>
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1060 <rand_double@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1060 <rand_double@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1060 <rand_double@plt>
movaps %xmm0,%xmm3
mov    %rbx,%rdi
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
mov    $0x4,%al
call   1050 <printf@plt>
add    $0xffffffff,%ebp
jne    1320 <gen_path_pixels+0x1d0>
lea    0xd86(%rip),%rdi
call   1040 <puts@plt>
lea    0xd0c(%rip),%rdi
mov    $0x80,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd6b(%rip),%rdi
call   1040 <puts@plt>
lea    0xd26(%rip),%rdi
mov    $0x100,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd97(%rip),%rdi
add    $0x18,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"static const int babl_num_path_test_pixels = %d;\0A\0A\00"
@.str.1 = [51 x i8] c"static const double babl_path_test_pixels[%d] = {\0A\00"
@.str.2 = [17 x i8] c"%a, %a, %a, %a,\0A\00"
@.str.3 = [5 x i8] c"};\0A\0A\00"
@.str.4 = [57 x i8] c"static const int babl_num_conversion_test_pixels = %d;\0A\0A\00"
@.str.5 = [76 x i8] c"static const double *babl_conversion_test_pixels = babl_path_test_pixels;\0A\0A\00"
@.str.6 = [53 x i8] c"static const int babl_num_format_test_pixels = %d;\0A\0A\00"
@.str.7 = [72 x i8] c"static const double *babl_format_test_pixels = babl_path_test_pixels;\0A\0A\00"
define void @gen_path_pixels() {
%1 = alloca i32
%2 = call i32 @srandom(i32 20050728)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 3072)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i32 12288)
store i32 0, i32* %1
br label %5
5: ; preds = %14, %0
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 256
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = call double (...) @rand_double()
%10 = call double (...) @rand_double()
%11 = call double (...) @rand_double()
%12 = call double (...) @rand_double()
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %9, double %10, double %11, double %12)
br label %14
14: ; preds = %8
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
br label %5
17: ; preds = %5
store i32 0, i32* %1
br label %18
18: ; preds = %27, %17
%19 = load i32, i32* %1
%20 = icmp slt i32 %19, 16
br i1 %20, label %21, label %30
21: ; preds = %18
%22 = call double @rand_range_double(double -1.000000e+00, double 0.000000e+00)
%23 = call double @rand_range_double(double -1.000000e+00, double 0.000000e+00)
%24 = call double @rand_range_double(double -1.000000e+00, double 0.000000e+00)
%25 = call double @rand_range_double(double -1.000000e+00, double 0.000000e+00)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %22, double %23, double %24, double %25)
br label %27
27: ; preds = %21
%28 = load i32, i32* %1
%29 = add nsw i32 %28, 1
store i32 %29, i32* %1
br label %18
30: ; preds = %18
store i32 0, i32* %1
br label %31
31: ; preds = %40, %30
%32 = load i32, i32* %1
%33 = icmp slt i32 %32, 16
br i1 %33, label %34, label %43
34: ; preds = %31
%35 = call double @rand_range_double(double 1.000000e+00, double 2.000000e+00)
%36 = call double @rand_range_double(double 1.000000e+00, double 2.000000e+00)
%37 = call double @rand_range_double(double 1.000000e+00, double 2.000000e+00)
%38 = call double @rand_range_double(double 1.000000e+00, double 2.000000e+00)
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %35, double %36, double %37, double %38)
br label %40
40: ; preds = %34
%41 = load i32, i32* %1
%42 = add nsw i32 %41, 1
store i32 %42, i32* %1
br label %31
43: ; preds = %31
store i32 288, i32* %1
br label %44
44: ; preds = %53, %43
%45 = load i32, i32* %1
%46 = icmp slt i32 %45, 3072
br i1 %46, label %47, label %56
47: ; preds = %44
%48 = call double (...) @rand_double()
%49 = call double (...) @rand_double()
%50 = call double (...) @rand_double()
%51 = call double (...) @rand_double()
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %48, double %49, double %50, double %51)
br label %53
53: ; preds = %47
%54 = load i32, i32* %1
%55 = add nsw i32 %54, 1
store i32 %55, i32* %1
br label %44
56: ; preds = %44
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.4, i64 0, i64 0), i32 128)
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.5, i64 0, i64 0))
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.6, i64 0, i64 0), i32 256)
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.7, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"static const int babl_num_path_test_pixels = %d;\0A\0A\00"
@.str.1 = [51 x i8] c"static const double babl_path_test_pixels[%d] = {\0A\00"
@.str.2 = [17 x i8] c"%a, %a, %a, %a,\0A\00"
@.str.4 = [57 x i8] c"static const int babl_num_conversion_test_pixels = %d;\0A\0A\00"
@.str.6 = [53 x i8] c"static const int babl_num_format_test_pixels = %d;\0A\0A\00"
@str = [4 x i8] c"};\0A\00"
@str.8 = [75 x i8] c"static const double *babl_conversion_test_pixels = babl_path_test_pixels;\0A\00"
@str.9 = [71 x i8] c"static const double *babl_format_test_pixels = babl_path_test_pixels;\0A\00"
define void @gen_path_pixels() {
%1 = tail call i32 @srandom(i32 20050728)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 3072)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i32 12288)
br label %4
4: ; preds = %0, %4
%5 = phi i32 [ 0, %0 ], [ %11, %4 ]
%6 = tail call double (...) @rand_double()
%7 = tail call double (...) @rand_double()
%8 = tail call double (...) @rand_double()
%9 = tail call double (...) @rand_double()
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %6, double %7, double %8, double %9)
%11 = add nuw nsw i32 %5, 1
%12 = icmp eq i32 %11, 256
br i1 %12, label %13, label %4
13: ; preds = %4, %13
%14 = phi i32 [ %20, %13 ], [ 0, %4 ]
%15 = tail call double @rand_range_double(double -1.000000e+00, double 0.000000e+00)
%16 = tail call double @rand_range_double(double -1.000000e+00, double 0.000000e+00)
%17 = tail call double @rand_range_double(double -1.000000e+00, double 0.000000e+00)
%18 = tail call double @rand_range_double(double -1.000000e+00, double 0.000000e+00)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %15, double %16, double %17, double %18)
%20 = add nuw nsw i32 %14, 1
%21 = icmp eq i32 %20, 16
br i1 %21, label %22, label %13
22: ; preds = %13, %22
%23 = phi i32 [ %29, %22 ], [ 0, %13 ]
%24 = tail call double @rand_range_double(double 1.000000e+00, double 2.000000e+00)
%25 = tail call double @rand_range_double(double 1.000000e+00, double 2.000000e+00)
%26 = tail call double @rand_range_double(double 1.000000e+00, double 2.000000e+00)
%27 = tail call double @rand_range_double(double 1.000000e+00, double 2.000000e+00)
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %24, double %25, double %26, double %27)
%29 = add nuw nsw i32 %23, 1
%30 = icmp eq i32 %29, 16
br i1 %30, label %31, label %22
31: ; preds = %22, %31
%32 = phi i32 [ %38, %31 ], [ 288, %22 ]
%33 = tail call double (...) @rand_double()
%34 = tail call double (...) @rand_double()
%35 = tail call double (...) @rand_double()
%36 = tail call double (...) @rand_double()
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %33, double %34, double %35, double %36)
%38 = add nuw nsw i32 %32, 1
%39 = icmp eq i32 %38, 3072
br i1 %39, label %40, label %31
40: ; preds = %31
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.4, i64 0, i64 0), i32 128)
%43 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.8, i64 0, i64 0))
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.6, i64 0, i64 0), i32 256)
%45 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.9, i64 0, i64 0))
ret void
}