#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*/ RGB2XYZ(unsigned char, unsigned char, unsigned char,
                           double *, double *, double *);
int /*<<< orphan*/ XYZ2Lab(double, double, double, double *, double *,
                           double *);
void RGB2Lab(unsigned char B, unsigned char G, unsigned char R, double *L,
             double *a, double *b) {
  double X, Y, Z;
  RGB2XYZ(B, G, R, &X, &Y, &Z);
  XYZ2Lab(X, Y, Z, L, a, b);
}


x86 assembly (clang, -O0):
<RGB2Lab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %dl,%al
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    %rcx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x1(%rbp),%dl
mov    -0x2(%rbp),%al
lea    -0x28(%rbp),%rcx
lea    -0x30(%rbp),%r8
lea    -0x38(%rbp),%r9
movzbl %dl,%edi
movzbl %al,%esi
movzbl -0x3(%rbp),%edx
call   1040 <RGB2XYZ@plt>
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <XYZ2Lab@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RGB2Lab>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%rbx
lea    0x18(%rsp),%rcx
lea    0x10(%rsp),%r8
lea    0x8(%rsp),%r9
call   1040 <RGB2XYZ@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <XYZ2Lab@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @RGB2Lab(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, double* %3, double* %4, double* %5) {
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double
%14 = alloca double
%15 = alloca double
store i8 %0, i8* %7
store i8 %1, i8* %8
store i8 %2, i8* %9
store double* %3, double** %10
store double* %4, double** %11
store double* %5, double** %12
%16 = load i8, i8* %7
%17 = load i8, i8* %8
%18 = load i8, i8* %9
%19 = call i32 @RGB2XYZ(i8 zeroext %16, i8 zeroext %17, i8 zeroext %18, double* %13, double* %14, double* %15)
%20 = load double, double* %13
%21 = load double, double* %14
%22 = load double, double* %15
%23 = load double*, double** %10
%24 = load double*, double** %11
%25 = load double*, double** %12
%26 = call i32 @XYZ2Lab(double %20, double %21, double %22, double* %23, double* %24, double* %25)
ret void
}

LLVM IR (-O2):
define void @RGB2Lab(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, double* %3, double* %4, double* %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = bitcast double* %7 to i8*
%11 = bitcast double* %8 to i8*
%12 = bitcast double* %9 to i8*
%13 = call i32 @RGB2XYZ(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, double* %7, double* %8, double* %9)
%14 = load double, double* %7
%15 = load double, double* %8
%16 = load double, double* %9
%17 = call i32 @XYZ2Lab(double %14, double %15, double %16, double* %3, double* %4, double* %5)
ret void
}