#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 color_label(int);
int /*<<< orphan*/ printf(char *, ...);
void print_conflicts(char *conflicts, int num_colors) {
  printf(" ");
  for (int i = 0; i < num_colors; ++i) {
    printf(" %c", color_label(i));
  }
  printf("\n");
  for (int i = 0; i < num_colors; ++i) {
    printf("%c", color_label(i));
    for (int j = 0; j < num_colors; ++j) {
      if (conflicts[i + j * num_colors]) {
        printf(" @");
      } else {
        printf("  ");
      }
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<print_conflicts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1176 <print_conflicts+0x56>
mov    -0x10(%rbp),%edi
call   1040 <color_label@plt>
mov    %eax,%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1144 <print_conflicts+0x24>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    122f <print_conflicts+0x10f>
mov    -0x14(%rbp),%edi
call   1040 <color_label@plt>
mov    %eax,%esi
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1213 <print_conflicts+0xf3>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     11f2 <print_conflicts+0xd2>
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1200 <print_conflicts+0xe0>
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1205 <print_conflicts+0xe5>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11b6 <print_conflicts+0x96>
lea    0xdea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    118b <print_conflicts+0x6b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_conflicts>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    $0x20,%edi
call   1030 <putchar@plt>
test   %ebx,%ebx
jle    120d <print_conflicts+0xdd>
lea    0xea7(%rip),%r15
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1050 <color_label@plt>
mov    %r15,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1160 <print_conflicts+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %ebx,%ebx
jle    11fe <print_conflicts+0xce>
mov    %ebx,%ebx
lea    0xe76(%rip),%r13
lea    0xe6c(%rip),%r12
xor    %r15d,%r15d
jmp    11bb <print_conflicts+0x8b>
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15
mov    (%rsp),%r14
add    $0x1,%r14
cmp    %rbx,%r15
je     11fe <print_conflicts+0xce>
mov    %r15d,%edi
call   1050 <color_label@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    %rbx,%rbp
mov    %r14,(%rsp)
jmp    11f0 <print_conflicts+0xc0>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1040 <printf@plt>
add    %rbx,%r14
add    $0xffffffffffffffff,%rbp
je     11a0 <print_conflicts+0x70>
cmpb   $0x0,(%r14)
mov    %r13,%rdi
je     11e0 <print_conflicts+0xb0>
mov    %r12,%rdi
jmp    11e0 <print_conflicts+0xb0>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c" %c\00"
@.str.4 = [3 x i8] c" @\00"
@.str.5 = [3 x i8] c" \00"
define void @print_conflicts(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @putchar(i32 32)
%4 = icmp sgt i32 %1, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = tail call i32 @putchar(i32 10)
br label %18
7: ; preds = %12
%8 = tail call i32 @putchar(i32 10)
br i1 %4, label %9, label %18
9: ; preds = %7
%10 = zext i32 %1 to i64
%11 = zext i32 %1 to i64
br label %19
12: ; preds = %2, %12
%13 = phi i32 [ %16, %12 ], [ 0, %2 ]
%14 = tail call i32 @color_label(i32 %13)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = add nuw nsw i32 %13, 1
%17 = icmp eq i32 %16, %1
br i1 %17, label %7, label %12
18: ; preds = %24, %5, %7
ret void
19: ; preds = %24, %9
%20 = phi i64 [ 0, %9 ], [ %26, %24 ]
%21 = trunc i64 %20 to i32
%22 = tail call i32 @color_label(i32 %21)
%23 = tail call i32 @putchar(i32 %22)
br label %28
24: ; preds = %28
%25 = tail call i32 @putchar(i32 10)
%26 = add nuw nsw i64 %20, 1
%27 = icmp eq i64 %26, %11
br i1 %27, label %18, label %19
28: ; preds = %19, %28
%29 = phi i64 [ 0, %19 ], [ %37, %28 ]
%30 = mul nsw i64 %29, %10
%31 = add nuw nsw i64 %30, %20
%32 = getelementptr inbounds i8, i8* %0, i64 %31
%33 = load i8, i8* %32
%34 = icmp eq i8 %33, 0
%35 = select i1 %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0)
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %35)
%37 = add nuw nsw i64 %29, 1
%38 = icmp eq i64 %37, %11
br i1 %38, label %24, label %28
}