#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void base_label(double **rxyz, char *label_style, double *rgbv, char bname,
                FILE *fp) {
  static char *format = "%9.3f";
  double cxyz[4];
  long i;
  for (i = 1; i <= 3; i++)
    cxyz[i] = 0.5 * (rxyz[1][i] + rxyz[4][i]);
  fprintf(fp, "10\n%s11\n", label_style);
  for (i = 1; i <= 3; i++)
    fprintf(fp, format, cxyz[i]);
  for (i = 1; i <= 3; i++)
    fprintf(fp, format, rgbv[i]);
  fprintf(fp, "\n%c\n", bname);
}


x86 assembly (clang, -O0):
<base_label>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    %r8,-0x28(%rbp)
movq   $0x1,-0x58(%rbp)
cmpq   $0x3,-0x58(%rbp)
jg     1189 <base_label+0x79>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x58(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rax
mov    -0x58(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm1
movsd  0xe96(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x58(%rbp),%rax
movsd  %xmm0,-0x50(%rbp,%rax,8)
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
jmp    1135 <base_label+0x25>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe76(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movq   $0x1,-0x58(%rbp)
cmpq   $0x3,-0x58(%rbp)
jg     11df <base_label+0xcf>
mov    -0x28(%rbp),%rdi
mov    0x2e6b(%rip),%rsi
mov    -0x58(%rbp),%rax
movsd  -0x50(%rbp,%rax,8),%xmm0
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
jmp    11a7 <base_label+0x97>
movq   $0x1,-0x58(%rbp)
cmpq   $0x3,-0x58(%rbp)
jg     1222 <base_label+0x112>
mov    -0x28(%rbp),%rdi
mov    0x2e2b(%rip),%rsi
mov    -0x18(%rbp),%rax
mov    -0x58(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
jmp    11e7 <base_label+0xd7>
mov    -0x28(%rbp),%rdi
movsbl -0x19(%rbp),%edx
lea    0xde6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base_label>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %r8,%rbx
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rdx
mov    0x8(%rdi),%rax
mov    0x20(%rdi),%rcx
movsd  0x8(%rax),%xmm2
movsd  0x10(%rax),%xmm1
addsd  0x8(%rcx),%xmm2
movsd  0xebb(%rip),%xmm0
mulsd  %xmm0,%xmm2
movsd  %xmm2,(%rsp)
addsd  0x10(%rcx),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x18(%rax),%xmm1
addsd  0x18(%rcx),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
lea    0xe96(%rip),%rsi
mov    %r8,%rdi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xe7f(%rip),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1030 <fprintf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
movsd  0x10(%rsp),%xmm0
mov    $0x1,%al
call   1030 <fprintf@plt>
movsd  0x8(%r15),%xmm0
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
movsd  0x10(%r15),%xmm0
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
movsd  0x18(%r15),%xmm0
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
lea    0xe16(%rip),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@base_label.format = internal global i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0)
@.str = [6 x i8] c"%9.3f\00"
@.str.1 = [9 x i8] c"10\0A%s11\0A\00"
@.str.2 = [5 x i8] c"\0A%c\0A\00"
define void @base_label(double** %0, i8* %1, double* %2, i8 signext %3, i32* %4) {
%6 = alloca double**
%7 = alloca i8*
%8 = alloca double*
%9 = alloca i8
%10 = alloca i32*
%11 = alloca [4 x double]
%12 = alloca i64
store double** %0, double*** %6
store i8* %1, i8** %7
store double* %2, double** %8
store i8 %3, i8* %9
store i32* %4, i32** %10
store i64 1, i64* %12
br label %13
13: ; preds = %33, %5
%14 = load i64, i64* %12
%15 = icmp sle i64 %14, 3
br i1 %15, label %16, label %36
16: ; preds = %13
%17 = load double**, double*** %6
%18 = getelementptr inbounds double*, double** %17, i64 1
%19 = load double*, double** %18
%20 = load i64, i64* %12
%21 = getelementptr inbounds double, double* %19, i64 %20
%22 = load double, double* %21
%23 = load double**, double*** %6
%24 = getelementptr inbounds double*, double** %23, i64 4
%25 = load double*, double** %24
%26 = load i64, i64* %12
%27 = getelementptr inbounds double, double* %25, i64 %26
%28 = load double, double* %27
%29 = fadd double %22, %28
%30 = fmul double 5.000000e-01, %29
%31 = load i64, i64* %12
%32 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %31
store double %30, double* %32
br label %33
33: ; preds = %16
%34 = load i64, i64* %12
%35 = add nsw i64 %34, 1
store i64 %35, i64* %12
br label %13
36: ; preds = %13
%37 = load i32*, i32** %10
%38 = load i8*, i8** %7
%39 = call i32 (i32*, i8*, ...) @fprintf(i32* %37, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %38)
store i64 1, i64* %12
br label %40
40: ; preds = %50, %36
%41 = load i64, i64* %12
%42 = icmp sle i64 %41, 3
br i1 %42, label %43, label %53
43: ; preds = %40
%44 = load i32*, i32** %10
%45 = load i8*, i8** @base_label.format
%46 = load i64, i64* %12
%47 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %46
%48 = load double, double* %47
%49 = call i32 (i32*, i8*, ...) @fprintf(i32* %44, i8* %45, double %48)
br label %50
50: ; preds = %43
%51 = load i64, i64* %12
%52 = add nsw i64 %51, 1
store i64 %52, i64* %12
br label %40
53: ; preds = %40
store i64 1, i64* %12
br label %54
54: ; preds = %65, %53
%55 = load i64, i64* %12
%56 = icmp sle i64 %55, 3
br i1 %56, label %57, label %68
57: ; preds = %54
%58 = load i32*, i32** %10
%59 = load i8*, i8** @base_label.format
%60 = load double*, double** %8
%61 = load i64, i64* %12
%62 = getelementptr inbounds double, double* %60, i64 %61
%63 = load double, double* %62
%64 = call i32 (i32*, i8*, ...) @fprintf(i32* %58, i8* %59, double %63)
br label %65
65: ; preds = %57
%66 = load i64, i64* %12
%67 = add nsw i64 %66, 1
store i64 %67, i64* %12
br label %54
68: ; preds = %54
%69 = load i32*, i32** %10
%70 = load i8, i8* %9
%71 = sext i8 %70 to i32
%72 = call i32 (i32*, i8*, ...) @fprintf(i32* %69, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %71)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%9.3f\00"
@.str.1 = [9 x i8] c"10\0A%s11\0A\00"
@.str.2 = [5 x i8] c"\0A%c\0A\00"
define void @base_label(double** nocapture %0, i8* %1, double* nocapture %2, i8 signext %3, i32* nocapture %4) {
%6 = getelementptr inbounds double*, double** %0, i64 1
%7 = load double*, double** %6
%8 = getelementptr inbounds double*, double** %0, i64 4
%9 = load double*, double** %8
%10 = getelementptr inbounds double, double* %7, i64 1
%11 = load double, double* %10
%12 = getelementptr inbounds double, double* %9, i64 1
%13 = load double, double* %12
%14 = fadd double %11, %13
%15 = fmul double %14, 5.000000e-01
%16 = getelementptr inbounds double, double* %7, i64 2
%17 = load double, double* %16
%18 = getelementptr inbounds double, double* %9, i64 2
%19 = load double, double* %18
%20 = fadd double %17, %19
%21 = fmul double %20, 5.000000e-01
%22 = getelementptr inbounds double, double* %7, i64 3
%23 = load double, double* %22
%24 = getelementptr inbounds double, double* %9, i64 3
%25 = load double, double* %24
%26 = fadd double %23, %25
%27 = fmul double %26, 5.000000e-01
%28 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%29 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %15)
%30 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %21)
%31 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %27)
%32 = getelementptr inbounds double, double* %2, i64 1
%33 = load double, double* %32
%34 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %33)
%35 = getelementptr inbounds double, double* %2, i64 2
%36 = load double, double* %35
%37 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %36)
%38 = getelementptr inbounds double, double* %2, i64 3
%39 = load double, double* %38
%40 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %39)
%41 = sext i8 %3 to i32
%42 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %41)
ret void
}