#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*/ convertRGBtoHSV(unsigned char, unsigned char, unsigned char,
                                   unsigned char *, unsigned char *,
                                   unsigned char *);
int /*<<< orphan*/ sendCommand(unsigned char, int, unsigned char, unsigned char,
                               unsigned char);
void LivingColors_setLampColourRGB(unsigned char index, unsigned char r,
                                   unsigned char g, unsigned char b) {
  unsigned char h = 0;
  unsigned char s = 0;
  unsigned char v = 0;
  convertRGBtoHSV(r, g, b, &h, &s, &v);
  sendCommand(index, 0x03, h, s, v);
}


x86 assembly (clang, -O0):
<LivingColors_setLampColourRGB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movb   $0x0,-0x6(%rbp)
movb   $0x0,-0x7(%rbp)
mov    -0x2(%rbp),%dl
mov    -0x3(%rbp),%al
lea    -0x5(%rbp),%rcx
lea    -0x6(%rbp),%r8
lea    -0x7(%rbp),%r9
movzbl %dl,%edi
movzbl %al,%esi
movzbl -0x4(%rbp),%edx
call   1040 <convertRGBtoHSV@plt>
mov    -0x1(%rbp),%dl
mov    -0x5(%rbp),%cl
mov    -0x6(%rbp),%al
mov    $0x3,%esi
movzbl %dl,%edi
movzbl %cl,%edx
movzbl %al,%ecx
movzbl -0x7(%rbp),%r8d
call   1030 <sendCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LivingColors_setLampColourRGB>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movb   $0x0,0xf(%rsp)
movb   $0x0,0xe(%rsp)
movb   $0x0,0xd(%rsp)
lea    0xf(%rsp),%rax
lea    0xe(%rsp),%r8
lea    0xd(%rsp),%r9
mov    %esi,%edi
mov    %edx,%esi
mov    %ecx,%edx
mov    %rax,%rcx
call   1040 <convertRGBtoHSV@plt>
movzbl 0xf(%rsp),%edx
movzbl 0xe(%rsp),%ecx
movzbl 0xd(%rsp),%r8d
mov    %ebx,%edi
mov    $0x3,%esi
call   1030 <sendCommand@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @LivingColors_setLampColourRGB(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
store i8 0, i8* %9
store i8 0, i8* %10
store i8 0, i8* %11
%12 = load i8, i8* %6
%13 = load i8, i8* %7
%14 = load i8, i8* %8
%15 = call i32 @convertRGBtoHSV(i8 zeroext %12, i8 zeroext %13, i8 zeroext %14, i8* %9, i8* %10, i8* %11)
%16 = load i8, i8* %5
%17 = load i8, i8* %9
%18 = load i8, i8* %10
%19 = load i8, i8* %11
%20 = call i32 @sendCommand(i8 zeroext %16, i32 3, i8 zeroext %17, i8 zeroext %18, i8 zeroext %19)
ret void
}

LLVM IR (-O2):
define void @LivingColors_setLampColourRGB(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8 0, i8* %5
store i8 0, i8* %6
store i8 0, i8* %7
%8 = call i32 @convertRGBtoHSV(i8 zeroext %1, i8 zeroext %2, i8 zeroext %3, i8* %5, i8* %6, i8* %7)
%9 = load i8, i8* %5
%10 = load i8, i8* %6
%11 = load i8, i8* %7
%12 = call i32 @sendCommand(i8 zeroext %0, i32 3, i8 zeroext %9, i8 zeroext %10, i8 zeroext %11)
ret void
}