#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 *get_color(unsigned int);
unsigned int get_grp(unsigned int, unsigned int);
unsigned int get_num(unsigned int, unsigned int);
int /*<<< orphan*/ printf(char *, char *, unsigned int);
void print_cell(unsigned row, unsigned col) {
  unsigned num = get_num(row, col);
  unsigned grp = get_grp(row, col);
  printf("%s%c", get_color(grp), num ? num + '0' : ' ');
}


x86 assembly (clang, -O0):
<print_cell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <get_num@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1060 <get_grp@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1050 <get_color@plt>
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     118e <print_cell+0x4e>
mov    -0xc(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x1c(%rbp)
jmp    119b <print_cell+0x5b>
mov    $0x20,%eax
mov    %eax,-0x1c(%rbp)
jmp    119b <print_cell+0x5b>
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
lea    0xe57(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_cell>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <get_num@plt>
mov    %eax,%r14d
mov    %ebp,%edi
mov    %ebx,%esi
call   1060 <get_grp@plt>
mov    %eax,%edi
call   1050 <get_color@plt>
lea    0x30(%r14),%ecx
test   %r14d,%r14d
mov    $0x20,%edx
cmovne %ecx,%edx
lea    0xe8a(%rip),%rdi
mov    %rax,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s%c\00"
define void @print_cell(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @get_num(i32 %7, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @get_grp(i32 %10, i32 %11)
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = call i8* @get_color(i32 %13)
%15 = load i32, i32* %5
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = load i32, i32* %5
%19 = add i32 %18, 48
br label %21
20: ; preds = %2
br label %21
21: ; preds = %20, %17
%22 = phi i32 [ %19, %17 ], [ 32, %20 ]
%23 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %14, i32 %22)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%c\00"
define void @print_cell(i32 %0, i32 %1) {
%3 = tail call i32 @get_num(i32 %0, i32 %1)
%4 = tail call i32 @get_grp(i32 %0, i32 %1)
%5 = tail call i8* @get_color(i32 %4)
%6 = icmp eq i32 %3, 0
%7 = add i32 %3, 48
%8 = select i1 %6, i32 32, i32 %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %8)
ret void
}