#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 */
char D2Hex(int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  int i, j, k;
  int iR, iG, iB;
  char ColorCode[7];
  for (i = 0; i < 100; i += 4) {
    iR = 128;
    iG = i * 2.56;
    iB = 255;
    ColorCode[0] = D2Hex(iR / 16);
    ColorCode[1] = D2Hex(iR % 16);
    ColorCode[2] = D2Hex(iG / 16);
    ColorCode[3] = D2Hex(iG % 16);
    ColorCode[4] = D2Hex(iB / 16);
    ColorCode[5] = D2Hex(iB % 16);
    ColorCode[6] = '\0';
    printf("%s\n", ColorCode);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1206 <main+0xe6>
movl   $0x80,-0x14(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xeac(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x18(%rbp)
movl   $0xff,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <D2Hex@plt>
mov    %al,-0x23(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1040 <D2Hex@plt>
mov    %al,-0x22(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <D2Hex@plt>
mov    %al,-0x21(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1040 <D2Hex@plt>
mov    %al,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <D2Hex@plt>
mov    %al,-0x1f(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1040 <D2Hex@plt>
mov    %al,-0x1e(%rbp)
movb   $0x0,-0x1d(%rbp)
lea    -0x23(%rbp),%rsi
lea    0xe15(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
xorpd  %xmm0,%xmm0
mov    $0xfffffffc,%r12d
lea    0xed3(%rip),%r14
lea    0x1(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xe9c(%rip),%xmm0
cvttsd2si %xmm0,%ebx
mov    $0x8,%edi
call   1040 <D2Hex@plt>
mov    %al,0x1(%rsp)
xor    %edi,%edi
call   1040 <D2Hex@plt>
mov    %al,0x2(%rsp)
lea    0xf(%rbx),%ebp
test   %ebx,%ebx
cmovns %ebx,%ebp
mov    %ebp,%edi
sar    $0x4,%edi
call   1040 <D2Hex@plt>
mov    %al,0x3(%rsp)
and    $0xfffffff0,%ebp
sub    %ebp,%ebx
mov    %ebx,%edi
call   1040 <D2Hex@plt>
mov    %al,0x4(%rsp)
mov    $0xf,%edi
call   1040 <D2Hex@plt>
mov    %al,0x5(%rsp)
mov    $0xf,%edi
call   1040 <D2Hex@plt>
mov    %al,0x6(%rsp)
movb   $0x0,0x7(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xe27(%rip),%xmm0
add    $0x4,%r12d
cmp    $0x60,%r12d
jb     1150 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [7 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
br label %9
9: ; preds = %44, %0
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 100
br i1 %11, label %12, label %47
12: ; preds = %9
store i32 128, i32* %5
%13 = load i32, i32* %2
%14 = sitofp i32 %13 to double
%15 = fmul double %14, 2.560000e+00
%16 = fptosi double %15 to i32
store i32 %16, i32* %6
store i32 255, i32* %7
%17 = load i32, i32* %5
%18 = sdiv i32 %17, 16
%19 = call signext i8 @D2Hex(i32 %18)
%20 = getelementptr inbounds [7 x i8], [7 x i8]* %8, i64 0, i64 0
store i8 %19, i8* %20
%21 = load i32, i32* %5
%22 = srem i32 %21, 16
%23 = call signext i8 @D2Hex(i32 %22)
%24 = getelementptr inbounds [7 x i8], [7 x i8]* %8, i64 0, i64 1
store i8 %23, i8* %24
%25 = load i32, i32* %6
%26 = sdiv i32 %25, 16
%27 = call signext i8 @D2Hex(i32 %26)
%28 = getelementptr inbounds [7 x i8], [7 x i8]* %8, i64 0, i64 2
store i8 %27, i8* %28
%29 = load i32, i32* %6
%30 = srem i32 %29, 16
%31 = call signext i8 @D2Hex(i32 %30)
%32 = getelementptr inbounds [7 x i8], [7 x i8]* %8, i64 0, i64 3
store i8 %31, i8* %32
%33 = load i32, i32* %7
%34 = sdiv i32 %33, 16
%35 = call signext i8 @D2Hex(i32 %34)
%36 = getelementptr inbounds [7 x i8], [7 x i8]* %8, i64 0, i64 4
store i8 %35, i8* %36
%37 = load i32, i32* %7
%38 = srem i32 %37, 16
%39 = call signext i8 @D2Hex(i32 %38)
%40 = getelementptr inbounds [7 x i8], [7 x i8]* %8, i64 0, i64 5
store i8 %39, i8* %40
%41 = getelementptr inbounds [7 x i8], [7 x i8]* %8, i64 0, i64 6
store i8 0, i8* %41
%42 = getelementptr inbounds [7 x i8], [7 x i8]* %8, i64 0, i64 0
%43 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %42)
br label %44
44: ; preds = %12
%45 = load i32, i32* %2
%46 = add nsw i32 %45, 4
store i32 %46, i32* %2
br label %9
47: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 1
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 2
%5 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 3
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 4
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 5
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 6
br label %9
9: ; preds = %0, %9
%10 = phi i32 [ 0, %0 ], [ %23, %9 ]
%11 = sitofp i32 %10 to double
%12 = fmul double %11, 2.560000e+00
%13 = fptosi double %12 to i32
%14 = call signext i8 @D2Hex(i32 8)
store i8 %14, i8* %2
%15 = call signext i8 @D2Hex(i32 0)
store i8 %15, i8* %3
%16 = sdiv i32 %13, 16
%17 = call signext i8 @D2Hex(i32 %16)
store i8 %17, i8* %4
%18 = srem i32 %13, 16
%19 = call signext i8 @D2Hex(i32 %18)
store i8 %19, i8* %5
%20 = call signext i8 @D2Hex(i32 15)
store i8 %20, i8* %6
%21 = call signext i8 @D2Hex(i32 15)
store i8 %21, i8* %7
store i8 0, i8* %8
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%23 = add nuw nsw i32 %10, 4
%24 = icmp ult i32 %10, 96
br i1 %24, label %9, label %25
25: ; preds = %9
ret i32 0
}