#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 *, ...);
void Print(int plate[]) {
  printf("Plate: |");
  char item = ' ';
  for (int i = 0; i < 5; i++) {
    switch (plate[i]) {
    case 0:
      item = ' ';
      break;
    case 1:
      item = 'A';
      break;
    case 2:
      item = 'O';
      break;
    default:
      break;
    }
    printf("%c|", item);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<Print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x20,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    11bc <Print+0xac>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
test   %eax,%eax
je     117c <Print+0x6c>
jmp    115a <Print+0x4a>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
je     1185 <Print+0x75>
jmp    116b <Print+0x5b>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
je     118e <Print+0x7e>
jmp    1197 <Print+0x87>
movb   $0x20,-0x9(%rbp)
jmp    119c <Print+0x8c>
movb   $0x41,-0x9(%rbp)
jmp    119c <Print+0x8c>
movb   $0x4f,-0x9(%rbp)
jmp    119c <Print+0x8c>
jmp    119c <Print+0x8c>
movsbl -0x9(%rbp),%esi
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1135 <Print+0x25>
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Print>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%r15
lea    0xece(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r15),%eax
cmp    $0x1,%eax
mov    $0x41,%ecx
mov    $0x20,%edx
cmove  %ecx,%edx
cmp    $0x2,%eax
mov    $0x4f,%ebp
cmovne %edx,%ebp
lea    0xeab(%rip),%r14
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%r15),%eax
lea    0x0(,%rax,8),%ecx
mov    $0x4f4120,%r12d
mov    $0x4f4120,%ebx
shr    %cl,%ebx
cmp    $0x3,%eax
cmovae %ebp,%ebx
movzbl %bl,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%r15),%eax
lea    0x0(,%rax,8),%ecx
mov    $0x4f4120,%ebp
shr    %cl,%ebp
cmp    $0x3,%eax
cmovae %ebx,%ebp
movzbl %bpl,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%r15),%eax
lea    0x0(,%rax,8),%ecx
mov    $0x4f4120,%ebx
shr    %cl,%ebx
cmp    $0x3,%eax
cmovae %ebp,%ebx
movzbl %bl,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%r15),%eax
lea    0x0(,%rax,8),%ecx
shr    %cl,%r12d
cmp    $0x3,%eax
cmovae %ebx,%r12d
movzbl %r12b,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Plate: |\00"
@.str.1 = [4 x i8] c"%c|\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @Print(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
%4 = alloca i32
store i32* %0, i32** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i8 32, i8* %3
store i32 0, i32* %4
br label %6
6: ; preds = %23, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 5
br i1 %8, label %9, label %26
9: ; preds = %6
%10 = load i32*, i32** %2
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32, i32* %13
switch i32 %14, label %18 [
i32 0, label %15
i32 1, label %16
i32 2, label %17
]
15: ; preds = %9
store i8 32, i8* %3
br label %19
16: ; preds = %9
store i8 65, i8* %3
br label %19
17: ; preds = %9
store i8 79, i8* %3
br label %19
18: ; preds = %9
br label %19
19: ; preds = %18, %17, %16, %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %19
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %6
26: ; preds = %6
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"Plate: |\00"
@.str.1 = [4 x i8] c"%c|\00"
define void @Print(i32* nocapture %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, 1
%5 = select i1 %4, i8 65, i8 32
%6 = icmp eq i32 %3, 2
%7 = select i1 %6, i8 79, i8 %5
%8 = zext i8 %7 to i32
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds i32, i32* %0, i64 1
%11 = load i32, i32* %10
%12 = icmp ult i32 %11, 3
%13 = trunc i32 %11 to i24
%14 = shl i24 %13, 3
%15 = lshr i24 5194016, %14
%16 = trunc i24 %15 to i8
%17 = select i1 %12, i8 %16, i8 %7
%18 = zext i8 %17 to i32
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = getelementptr inbounds i32, i32* %0, i64 2
%21 = load i32, i32* %20
%22 = icmp ult i32 %21, 3
%23 = trunc i32 %21 to i24
%24 = shl i24 %23, 3
%25 = lshr i24 5194016, %24
%26 = trunc i24 %25 to i8
%27 = select i1 %22, i8 %26, i8 %17
%28 = zext i8 %27 to i32
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %28)
%30 = getelementptr inbounds i32, i32* %0, i64 3
%31 = load i32, i32* %30
%32 = icmp ult i32 %31, 3
%33 = trunc i32 %31 to i24
%34 = shl i24 %33, 3
%35 = lshr i24 5194016, %34
%36 = trunc i24 %35 to i8
%37 = select i1 %32, i8 %36, i8 %27
%38 = zext i8 %37 to i32
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %38)
%40 = getelementptr inbounds i32, i32* %0, i64 4
%41 = load i32, i32* %40
%42 = icmp ult i32 %41, 3
%43 = trunc i32 %41 to i24
%44 = shl i24 %43, 3
%45 = lshr i24 5194016, %44
%46 = trunc i24 %45 to i8
%47 = select i1 %42, i8 %46, i8 %37
%48 = zext i8 %47 to i32
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %48)
%50 = tail call i32 @putchar(i32 10)
ret void
}