#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 */
scalar_t__ floor(double);
void cmyk_to_rgb(int rgb[], double cmyk[]) {
  int i;
  for (i = 0; i < 3; i++)
    rgb[i] = (int)floor((100.0 - cmyk[i] - cmyk[3]) * 2.55999);
}


x86 assembly (clang, -O0):
<cmyk_to_rgb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    117b <cmyk_to_rgb+0x6b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  0xec7(%rip),%xmm0
subsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x18(%rax),%xmm0
movsd  0xea9(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <floor@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <cmyk_to_rgb+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmyk_to_rgb>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movsd  0xede(%rip),%xmm0
subsd  (%rsi),%xmm0
subsd  0x18(%rsi),%xmm0
mulsd  0xed5(%rip),%xmm0
call   1030 <floor@plt>
mov    %eax,(%r14)
movsd  0xebd(%rip),%xmm0
subsd  0x8(%rbx),%xmm0
subsd  0x18(%rbx),%xmm0
mulsd  0xeb3(%rip),%xmm0
call   1030 <floor@plt>
mov    %eax,0x4(%r14)
movsd  0xe9a(%rip),%xmm0
subsd  0x10(%rbx),%xmm0
subsd  0x18(%rbx),%xmm0
mulsd  0xe90(%rip),%xmm0
call   1030 <floor@plt>
mov    %eax,0x8(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @cmyk_to_rgb(i32* %0, double* %1) {
%3 = alloca i32*
%4 = alloca double*
%5 = alloca i32
store i32* %0, i32** %3
store double* %1, double** %4
store i32 0, i32* %5
br label %6
6: ; preds = %27, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %30
9: ; preds = %6
%10 = load double*, double** %4
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds double, double* %10, i64 %12
%14 = load double, double* %13
%15 = fsub double 1.000000e+02, %14
%16 = load double*, double** %4
%17 = getelementptr inbounds double, double* %16, i64 3
%18 = load double, double* %17
%19 = fsub double %15, %18
%20 = fmul double %19, 2.559990e+00
%21 = call i64 @floor(double %20)
%22 = trunc i64 %21 to i32
%23 = load i32*, i32** %3
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
br label %27
27: ; preds = %9
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %6
30: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @cmyk_to_rgb(i32* nocapture writeonly %0, double* nocapture %1) {
%3 = getelementptr inbounds double, double* %1, i64 3
%4 = load double, double* %1
%5 = fsub double 1.000000e+02, %4
%6 = load double, double* %3
%7 = fsub double %5, %6
%8 = fmul double %7, 2.559990e+00
%9 = tail call i64 @floor(double %8)
%10 = trunc i64 %9 to i32
store i32 %10, i32* %0
%11 = getelementptr inbounds double, double* %1, i64 1
%12 = load double, double* %11
%13 = fsub double 1.000000e+02, %12
%14 = load double, double* %3
%15 = fsub double %13, %14
%16 = fmul double %15, 2.559990e+00
%17 = tail call i64 @floor(double %16)
%18 = trunc i64 %17 to i32
%19 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %18, i32* %19
%20 = getelementptr inbounds double, double* %1, i64 2
%21 = load double, double* %20
%22 = fsub double 1.000000e+02, %21
%23 = load double, double* %3
%24 = fsub double %22, %23
%25 = fmul double %24, 2.559990e+00
%26 = tail call i64 @floor(double %25)
%27 = trunc i64 %26 to i32
%28 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %27, i32* %28
ret void
}