#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*/ printf(char *, char);
void colorline(int *upcol, char c1, int *downcol, char c2, int start, int fin) {
  int k;
  char c;
  for (k = start; k <= fin; k++) {
    c = ' ';
    if (upcol[k] != 0)
      c = c1;
    if (downcol[25 - k] != 0)
      c = c2;
    printf("   %c", c);
  }
}


x86 assembly (clang, -O0):
<colorline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %cl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jg     119e <colorline+0x8e>
movb   $0x20,-0x29(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1161 <colorline+0x51>
mov    -0x9(%rbp),%al
mov    %al,-0x29(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x19,%ecx
sub    -0x28(%rbp),%ecx
movslq %ecx,%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1180 <colorline+0x70>
mov    -0x19(%rbp),%al
mov    %al,-0x29(%rbp)
lea    0xe79(%rip),%rdi
movsbl -0x29(%rbp),%esi
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1139 <colorline+0x29>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<colorline>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    %r9d,%r8d
jle    112f <colorline+0x1f>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r9d,%r15d
movslq %r8d,%rax
mov    $0x19,%ebp
sub    %rax,%rbp
lea    (%rdx,%rbp,4),%r13
lea    (%rdi,%rax,4),%r12
sub    %r8d,%r15d
add    $0x1,%r15d
xor    %ebx,%ebx
movzbl %sil,%eax
mov    %eax,0x4(%rsp)
movzbl %cl,%ebp
lea    0xea0(%rip),%r14
jmp    1190 <colorline+0x80>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpl   $0x0,0x0(%r13)
cmovne %ebp,%eax
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xfffffffffffffffc,%r13
add    $0x1,%rbx
cmp    %ebx,%r15d
je     1120 <colorline+0x10>
cmpl   $0x0,(%r12,%rbx,4)
mov    $0x20,%eax
je     1170 <colorline+0x60>
mov    0x4(%rsp),%eax
jmp    1170 <colorline+0x60>

LLVM IR (-O0):
@.str = [6 x i8] c" %c\00"
define void @colorline(i32* %0, i8 signext %1, i32* %2, i8 signext %3, i32 %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i8
%9 = alloca i32*
%10 = alloca i8
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i8
store i32* %0, i32** %7
store i8 %1, i8* %8
store i32* %2, i32** %9
store i8 %3, i8* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%15 = load i32, i32* %11
store i32 %15, i32* %13
br label %16
16: ; preds = %42, %6
%17 = load i32, i32* %13
%18 = load i32, i32* %12
%19 = icmp sle i32 %17, %18
br i1 %19, label %20, label %45
20: ; preds = %16
store i8 32, i8* %14
%21 = load i32*, i32** %7
%22 = load i32, i32* %13
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
%25 = load i32, i32* %24
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %20
%28 = load i8, i8* %8
store i8 %28, i8* %14
br label %29
29: ; preds = %27, %20
%30 = load i32*, i32** %9
%31 = load i32, i32* %13
%32 = sub nsw i32 25, %31
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i32, i32* %30, i64 %33
%35 = load i32, i32* %34
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %29
%38 = load i8, i8* %10
store i8 %38, i8* %14
br label %39
39: ; preds = %37, %29
%40 = load i8, i8* %14
%41 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %40)
br label %42
42: ; preds = %39
%43 = load i32, i32* %13
%44 = add nsw i32 %43, 1
store i32 %44, i32* %13
br label %16
45: ; preds = %16
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c" %c\00"
define void @colorline(i32* nocapture %0, i8 signext %1, i32* nocapture %2, i8 signext %3, i32 %4, i32 %5) {
%7 = icmp sgt i32 %4, %5
br i1 %7, label %26, label %8
8: ; preds = %6
%9 = sext i32 %4 to i64
%10 = add i32 %5, 1
br label %11
11: ; preds = %8, %11
%12 = phi i64 [ %9, %8 ], [ %23, %11 ]
%13 = getelementptr inbounds i32, i32* %0, i64 %12
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 0
%16 = select i1 %15, i8 32, i8 %1
%17 = sub nsw i64 25, %12
%18 = getelementptr inbounds i32, i32* %2, i64 %17
%19 = load i32, i32* %18
%20 = icmp eq i32 %19, 0
%21 = select i1 %20, i8 %16, i8 %3
%22 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %21)
%23 = add nsw i64 %12, 1
%24 = trunc i64 %23 to i32
%25 = icmp eq i32 %10, %24
br i1 %25, label %26, label %11
26: ; preds = %11, %6
ret void
}