#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 *);
unsigned int translate_area(unsigned int);
print_area(unsigned int opt_area) {
  unsigned int input_area;
  int x, y, i;
  input_area = translate_area(opt_area);
  for (y = 0; y < 4; y++) {
    for (x = 0; x < 6; x++) {
      if ((input_area >> (y * 6 + x)) & 0x1) {
        printf("O");
      } else {
        printf(".");
      }
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<print_area>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <translate_area@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    11ba <print_area+0x9a>
movl   $0x0,-0x10(%rbp)
cmpl   $0x6,-0x10(%rbp)
jge    11a0 <print_area+0x80>
mov    -0xc(%rbp),%eax
imul   $0x6,-0x14(%rbp),%ecx
add    -0x10(%rbp),%ecx
shr    %cl,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1181 <print_area+0x61>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
jmp    118d <print_area+0x6d>
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
jmp    1192 <print_area+0x72>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114e <print_area+0x2e>
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <print_area+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_area>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
call   1040 <translate_area@plt>
mov    %eax,%r14d
mov    $0x1,%ebx
mov    $0x2e,%r15d
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rbx),%eax
movzbl %al,%r12d
bt     %r12d,%r14d
mov    $0x4f,%edi
cmovae %r15d,%edi
call   1030 <putchar@plt>
bt     %ebx,%r14d
mov    $0x4f,%edi
cmovae %r15d,%edi
call   1030 <putchar@plt>
mov    %r14d,%ebp
mov    %r12d,%ecx
shr    %cl,%ebp
test   $0x4,%bpl
mov    $0x4f,%edi
cmove  %r15d,%edi
call   1030 <putchar@plt>
test   $0x8,%bpl
mov    $0x4f,%edi
cmove  %r15d,%edi
call   1030 <putchar@plt>
test   $0x10,%bpl
mov    $0x4f,%edi
cmove  %r15d,%edi
call   1030 <putchar@plt>
test   $0x20,%bpl
mov    $0x4f,%edi
cmove  %r15d,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x6,%ebx
cmp    $0x19,%ebx
jne    1140 <print_area+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @print_area(i32 %0) {
%2 = tail call i32 @translate_area(i32 %0)
br label %3
3: ; preds = %1, %3
%4 = phi i32 [ 0, %1 ], [ %38, %3 ]
%5 = mul nuw nsw i32 %4, 6
%6 = shl nuw i32 1, %5
%7 = and i32 %6, %2
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 46, i32 79
%10 = tail call i32 @putchar(i32 %9)
%11 = or i32 %5, 1
%12 = shl nuw i32 1, %11
%13 = and i32 %12, %2
%14 = icmp eq i32 %13, 0
%15 = select i1 %14, i32 46, i32 79
%16 = tail call i32 @putchar(i32 %15)
%17 = shl i32 4, %5
%18 = and i32 %17, %2
%19 = icmp eq i32 %18, 0
%20 = select i1 %19, i32 46, i32 79
%21 = tail call i32 @putchar(i32 %20)
%22 = shl i32 8, %5
%23 = and i32 %22, %2
%24 = icmp eq i32 %23, 0
%25 = select i1 %24, i32 46, i32 79
%26 = tail call i32 @putchar(i32 %25)
%27 = shl i32 16, %5
%28 = and i32 %27, %2
%29 = icmp eq i32 %28, 0
%30 = select i1 %29, i32 46, i32 79
%31 = tail call i32 @putchar(i32 %30)
%32 = shl i32 32, %5
%33 = and i32 %32, %2
%34 = icmp eq i32 %33, 0
%35 = select i1 %34, i32 46, i32 79
%36 = tail call i32 @putchar(i32 %35)
%37 = tail call i32 @putchar(i32 10)
%38 = add nuw nsw i32 %4, 1
%39 = icmp eq i32 %38, 4
br i1 %39, label %40, label %3
40: ; preds = %3
ret i32 undef
}