#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*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getchar();
int /*<<< orphan*/ printf(char *);
void read_cards(int num_in_rank[], int num_in_suit[]) {
  bool card_exists[13][4];
  int ch, rank_ch, suit_ch;
  int rank, suit;
  bool bad_card;
  int cards_read = 0;
  for (rank = 0; rank < 13; rank += 1) {
    num_in_rank[rank] = 0;
    for (suit = 0; suit < 4; suit += 1) {
      card_exists[rank][suit] = false;
    }
  }
  for (suit = 0; suit < 4; suit += 1) {
    num_in_suit[suit] = 0;
  }
  while (cards_read < 5) {
    bad_card = false;
    printf("Enter a card: ");
    rank_ch = getchar();
    switch (rank_ch) {
    case '0':
      exit(EXIT_SUCCESS);
    case '2':
      rank = 0;
      break;
    case '3':
      rank = 1;
      break;
    case '4':
      rank = 2;
      break;
    case '5':
      rank = 3;
      break;
    case '6':
      rank = 4;
      break;
    case '7':
      rank = 5;
      break;
    case '8':
      rank = 6;
      break;
    case '9':
      rank = 7;
      break;
    case 't':
    case 'T':
      rank = 8;
      break;
    case 'j':
    case 'J':
      rank = 9;
      break;
    case 'q':
    case 'Q':
      rank = 10;
      break;
    case 'k':
    case 'K':
      rank = 11;
      break;
    case 'a':
    case 'A':
      rank = 12;
      break;
    default:
      bad_card = true;
    }
    suit_ch = getchar();
    switch (suit_ch) {
    case 'c':
    case 'C':
      suit = 0;
      break;
    case 'd':
    case 'D':
      suit = 1;
      break;
    case 'h':
    case 'H':
      suit = 2;
      break;
    case 's':
    case 'S':
      suit = 3;
      break;
    default:
      bad_card = true;
    }
    while ((ch = getchar()) != '\n') {
      if (ch != ' ') {
        bad_card = true;
      }
    }
    if (bad_card) {
      printf("Bad card; ignored.\n");
    } else if (card_exists[rank][suit]) {
      printf("Duplicate card; ignored.\n");
    } else {
      num_in_rank[rank] += 1;
      num_in_suit[suit] += 1;
      card_exists[rank][suit] = true;
      cards_read += 1;
    }
  }
}


x86 assembly (clang, -O0):
<read_cards>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0xfc(%rbp)
movl   $0x0,-0xf0(%rbp)
cmpl   $0xd,-0xf0(%rbp)
jge    11dd <read_cards+0xad>
mov    -0x8(%rbp),%rax
movslq -0xf0(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
movl   $0x0,-0xf4(%rbp)
cmpl   $0x4,-0xf4(%rbp)
jge    11c4 <read_cards+0x94>
movslq -0xf0(%rbp),%rcx
lea    -0xe0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0xf4(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xf4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf4(%rbp)
jmp    1180 <read_cards+0x50>
jmp    11c9 <read_cards+0x99>
mov    -0xf0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf0(%rbp)
jmp    1157 <read_cards+0x27>
movl   $0x0,-0xf4(%rbp)
cmpl   $0x4,-0xf4(%rbp)
jge    121a <read_cards+0xea>
mov    -0x10(%rbp),%rax
movslq -0xf4(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xf4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf4(%rbp)
jmp    11e7 <read_cards+0xb7>
jmp    121f <read_cards+0xef>
cmpl   $0x5,-0xfc(%rbp)
jge    14d1 <read_cards+0x3a1>
movl   $0x0,-0xf8(%rbp)
lea    0xf9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,-0xe8(%rbp)
mov    -0xe8(%rbp),%eax
add    $0xffffffd0,%eax
mov    %eax,%ecx
mov    %rcx,-0x108(%rbp)
sub    $0x44,%eax
ja     1352 <read_cards+0x222>
mov    -0x108(%rbp),%rax
lea    0xd88(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2d58(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
movl   $0x0,-0xf0(%rbp)
jmp    135c <read_cards+0x22c>
movl   $0x1,-0xf0(%rbp)
jmp    135c <read_cards+0x22c>
movl   $0x2,-0xf0(%rbp)
jmp    135c <read_cards+0x22c>
movl   $0x3,-0xf0(%rbp)
jmp    135c <read_cards+0x22c>
movl   $0x4,-0xf0(%rbp)
jmp    135c <read_cards+0x22c>
movl   $0x5,-0xf0(%rbp)
jmp    135c <read_cards+0x22c>
movl   $0x6,-0xf0(%rbp)
jmp    135c <read_cards+0x22c>
movl   $0x7,-0xf0(%rbp)
jmp    135c <read_cards+0x22c>
movl   $0x8,-0xf0(%rbp)
jmp    135c <read_cards+0x22c>
movl   $0x9,-0xf0(%rbp)
jmp    135c <read_cards+0x22c>
movl   $0xa,-0xf0(%rbp)
jmp    135c <read_cards+0x22c>
movl   $0xb,-0xf0(%rbp)
jmp    135c <read_cards+0x22c>
movl   $0xc,-0xf0(%rbp)
jmp    135c <read_cards+0x22c>
movl   $0x1,-0xf8(%rbp)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,-0xec(%rbp)
mov    -0xec(%rbp),%eax
add    $0xffffffbd,%eax
mov    %eax,%ecx
mov    %rcx,-0x110(%rbp)
sub    $0x30,%eax
ja     13d7 <read_cards+0x2a7>
mov    -0x110(%rbp),%rax
lea    0xd82(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0xf4(%rbp)
jmp    13e1 <read_cards+0x2b1>
movl   $0x1,-0xf4(%rbp)
jmp    13e1 <read_cards+0x2b1>
movl   $0x2,-0xf4(%rbp)
jmp    13e1 <read_cards+0x2b1>
movl   $0x3,-0xf4(%rbp)
jmp    13e1 <read_cards+0x2b1>
movl   $0x1,-0xf8(%rbp)
jmp    13e6 <read_cards+0x2b6>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xe4(%rbp)
cmp    $0xa,%eax
je     1418 <read_cards+0x2e8>
cmpl   $0x20,-0xe4(%rbp)
je     1413 <read_cards+0x2e3>
movl   $0x1,-0xf8(%rbp)
jmp    13e6 <read_cards+0x2b6>
cmpl   $0x0,-0xf8(%rbp)
je     1436 <read_cards+0x306>
lea    0xdbb(%rip),%rdi
call   1030 <printf@plt>
jmp    14cc <read_cards+0x39c>
movslq -0xf0(%rbp),%rcx
lea    -0xe0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0xf4(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     146d <read_cards+0x33d>
lea    0xd98(%rip),%rdi
call   1030 <printf@plt>
jmp    14c7 <read_cards+0x397>
mov    -0x8(%rbp),%rax
movslq -0xf0(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
movslq -0xf4(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
movslq -0xf0(%rbp),%rcx
lea    -0xe0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0xf4(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0xfc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfc(%rbp)
jmp    14cc <read_cards+0x39c>
jmp    121f <read_cards+0xef>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_cards>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
mov    %rdi,(%rsp)
movl   $0x0,0x30(%rdi)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
mov    %rsi,0x8(%rsp)
movups %xmm0,(%rsi)
mov    $0xd,%r15d
mov    $0x4,%r13d
xor    %r14d,%r14d
jmp    11f6 <read_cards+0xb6>
cs nopw 0x0(%rax,%rax,1)
lea    0x1019(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x5,%r14d
jge    1368 <read_cards+0x228>
mov    %r15d,%r12d
mov    %r13d,%ebx
lea    0xfd5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
add    $0xffffffd0,%eax
cmp    $0x44,%eax
ja     1254 <read_cards+0x114>
lea    0xde2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
xor    %r15d,%r15d
xor    %ebp,%ebp
jmp    *%rax
mov    $0xc,%r15d
jmp    12a0 <read_cards+0x160>
mov    $0x9,%r15d
jmp    12a0 <read_cards+0x160>
mov    $0xb,%r15d
jmp    12a0 <read_cards+0x160>
mov    $0xa,%r15d
jmp    12a0 <read_cards+0x160>
mov    $0x8,%r15d
jmp    12a0 <read_cards+0x160>
mov    $0x1,%ebp
mov    %r12d,%r15d
jmp    12a2 <read_cards+0x162>
mov    $0x1,%r15d
jmp    12a0 <read_cards+0x160>
mov    $0x2,%r15d
jmp    12a0 <read_cards+0x160>
mov    $0x3,%r15d
jmp    12a0 <read_cards+0x160>
mov    $0x4,%r15d
jmp    12a0 <read_cards+0x160>
mov    $0x5,%r15d
jmp    12a0 <read_cards+0x160>
mov    $0x6,%r15d
jmp    12a0 <read_cards+0x160>
mov    $0x7,%r15d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %ebp,%ebp
xor    %r13d,%r13d
xor    %eax,%eax
call   1050 <getchar@plt>
add    $0xffffffbd,%eax
cmp    $0x30,%eax
ja     12e8 <read_cards+0x1a8>
lea    0xe59(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x1,%r13d
jmp    1300 <read_cards+0x1c0>
nopl   0x0(%rax)
mov    $0x2,%r13d
jmp    1300 <read_cards+0x1c0>
nopl   0x0(%rax,%rax,1)
mov    $0x3,%r13d
jmp    1300 <read_cards+0x1c0>
mov    $0x1,%ebp
mov    %ebx,%r13d
jmp    1300 <read_cards+0x1c0>
mov    $0x1,%ebp
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x20,%eax
je     1300 <read_cards+0x1c0>
cmp    $0xa,%eax
jne    12f2 <read_cards+0x1b2>
test   %ebp,%ebp
jne    11e0 <read_cards+0xa0>
mov    %r15d,%eax
mov    %r13d,%ecx
mov    %rax,%rdx
shl    $0x4,%rdx
add    %rsp,%rdx
add    $0x10,%rdx
cmpl   $0x0,(%rdx,%rcx,4)
je     133f <read_cards+0x1ff>
lea    0xead(%rip),%rdi
jmp    11e7 <read_cards+0xa7>
mov    (%rsp),%rsi
addl   $0x1,(%rsi,%rax,4)
mov    0x8(%rsp),%rax
addl   $0x1,(%rax,%rcx,4)
lea    (%rdx,%rcx,4),%rax
movl   $0x1,(%rax)
add    $0x1,%r14d
cmp    $0x5,%r14d
jl     11f6 <read_cards+0xb6>
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c5f(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Enter a card: \00"
@EXIT_SUCCESS = global i32 0
@.str.1 = [20 x i8] c"Bad card; ignored.\0A\00"
@.str.2 = [26 x i8] c"Duplicate card; ignored.\0A\00"
define void @read_cards(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [13 x [4 x i32]]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %12
store i32 0, i32* %9
br label %13
13: ; preds = %35, %2
%14 = load i32, i32* %9
%15 = icmp slt i32 %14, 13
br i1 %15, label %16, label %38
16: ; preds = %13
%17 = load i32*, i32** %3
%18 = load i32, i32* %9
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
store i32 0, i32* %20
store i32 0, i32* %10
br label %21
21: ; preds = %31, %16
%22 = load i32, i32* %10
%23 = icmp slt i32 %22, 4
br i1 %23, label %24, label %34
24: ; preds = %21
%25 = load i32, i32* %9
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [13 x [4 x i32]], [13 x [4 x i32]]* %5, i64 0, i64 %26
%28 = load i32, i32* %10
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [4 x i32], [4 x i32]* %27, i64 0, i64 %29
store i32 0, i32* %30
br label %31
31: ; preds = %24
%32 = load i32, i32* %10
%33 = add nsw i32 %32, 1
store i32 %33, i32* %10
br label %21
34: ; preds = %21
br label %35
35: ; preds = %34
%36 = load i32, i32* %9
%37 = add nsw i32 %36, 1
store i32 %37, i32* %9
br label %13
38: ; preds = %13
store i32 0, i32* %10
br label %39
39: ; preds = %47, %38
%40 = load i32, i32* %10
%41 = icmp slt i32 %40, 4
br i1 %41, label %42, label %50
42: ; preds = %39
%43 = load i32*, i32** %4
%44 = load i32, i32* %10
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i32, i32* %43, i64 %45
store i32 0, i32* %46
br label %47
47: ; preds = %42
%48 = load i32, i32* %10
%49 = add nsw i32 %48, 1
store i32 %49, i32* %10
br label %39
50: ; preds = %39
br label %51
51: ; preds = %130, %50
%52 = load i32, i32* %12
%53 = icmp slt i32 %52, 5
br i1 %53, label %54, label %131
54: ; preds = %51
store i32 0, i32* %11
%55 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%56 = call i32 (...) @getchar()
store i32 %56, i32* %7
%57 = load i32, i32* %7
switch i32 %57, label %74 [
i32 48, label %58
i32 50, label %61
i32 51, label %62
i32 52, label %63
i32 53, label %64
i32 54, label %65
i32 55, label %66
i32 56, label %67
i32 57, label %68
i32 116, label %69
i32 84, label %69
i32 106, label %70
i32 74, label %70
i32 113, label %71
i32 81, label %71
i32 107, label %72
i32 75, label %72
i32 97, label %73
i32 65, label %73
]
58: ; preds = %54
%59 = load i32, i32* @EXIT_SUCCESS
%60 = call i32 @exit(i32 %59)
unreachable
61: ; preds = %54
store i32 0, i32* %9
br label %75
62: ; preds = %54
store i32 1, i32* %9
br label %75
63: ; preds = %54
store i32 2, i32* %9
br label %75
64: ; preds = %54
store i32 3, i32* %9
br label %75
65: ; preds = %54
store i32 4, i32* %9
br label %75
66: ; preds = %54
store i32 5, i32* %9
br label %75
67: ; preds = %54
store i32 6, i32* %9
br label %75
68: ; preds = %54
store i32 7, i32* %9
br label %75
69: ; preds = %54, %54
store i32 8, i32* %9
br label %75
70: ; preds = %54, %54
store i32 9, i32* %9
br label %75
71: ; preds = %54, %54
store i32 10, i32* %9
br label %75
72: ; preds = %54, %54
store i32 11, i32* %9
br label %75
73: ; preds = %54, %54
store i32 12, i32* %9
br label %75
74: ; preds = %54
store i32 1, i32* %11
br label %75
75: ; preds = %74, %73, %72, %71, %70, %69, %68, %67, %66, %65, %64, %63, %62, %61
%76 = call i32 (...) @getchar()
store i32 %76, i32* %8
%77 = load i32, i32* %8
switch i32 %77, label %82 [
i32 99, label %78
i32 67, label %78
i32 100, label %79
i32 68, label %79
i32 104, label %80
i32 72, label %80
i32 115, label %81
i32 83, label %81
]
78: ; preds = %75, %75
store i32 0, i32* %10
br label %83
79: ; preds = %75, %75
store i32 1, i32* %10
br label %83
80: ; preds = %75, %75
store i32 2, i32* %10
br label %83
81: ; preds = %75, %75
store i32 3, i32* %10
br label %83
82: ; preds = %75
store i32 1, i32* %11
br label %83
83: ; preds = %82, %81, %80, %79, %78
br label %84
84: ; preds = %91, %83
%85 = call i32 (...) @getchar()
store i32 %85, i32* %6
%86 = icmp ne i32 %85, 10
br i1 %86, label %87, label %92
87: ; preds = %84
%88 = load i32, i32* %6
%89 = icmp ne i32 %88, 32
br i1 %89, label %90, label %91
90: ; preds = %87
store i32 1, i32* %11
br label %91
91: ; preds = %90, %87
br label %84
92: ; preds = %84
%93 = load i32, i32* %11
%94 = icmp ne i32 %93, 0
br i1 %94, label %95, label %97
95: ; preds = %92
%96 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %130
97: ; preds = %92
%98 = load i32, i32* %9
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds [13 x [4 x i32]], [13 x [4 x i32]]* %5, i64 0, i64 %99
%101 = load i32, i32* %10
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [4 x i32], [4 x i32]* %100, i64 0, i64 %102
%104 = load i32, i32* %103
%105 = icmp ne i32 %104, 0
br i1 %105, label %106, label %108
106: ; preds = %97
%107 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
br label %129
108: ; preds = %97
%109 = load i32*, i32** %3
%110 = load i32, i32* %9
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds i32, i32* %109, i64 %111
%113 = load i32, i32* %112
%114 = add nsw i32 %113, 1
store i32 %114, i32* %112
%115 = load i32*, i32** %4
%116 = load i32, i32* %10
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds i32, i32* %115, i64 %117
%119 = load i32, i32* %118
%120 = add nsw i32 %119, 1
store i32 %120, i32* %118
%121 = load i32, i32* %9
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds [13 x [4 x i32]], [13 x [4 x i32]]* %5, i64 0, i64 %122
%124 = load i32, i32* %10
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds [4 x i32], [4 x i32]* %123, i64 0, i64 %125
store i32 1, i32* %126
%127 = load i32, i32* %12
%128 = add nsw i32 %127, 1
store i32 %128, i32* %12
br label %129
129: ; preds = %108, %106
br label %130
130: ; preds = %129, %95
br label %51
131: ; preds = %51
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Enter a card: \00"
@EXIT_SUCCESS = global i32 0
@str = [25 x i8] c"Duplicate card; ignored.\00"
@str.3 = [19 x i8] c"Bad card; ignored.\00"
define void @read_cards(i32* nocapture %0, i32* nocapture %1) {
%3 = bitcast i32* %0 to i8*
%4 = bitcast i32* %1 to i8*
%5 = alloca [13 x [4 x i32]]
%6 = bitcast [13 x [4 x i32]]* %5 to i8*
br label %7
7: ; preds = %2, %64
%8 = phi i32 [ %65, %64 ], [ 0, %2 ]
%9 = phi i32 [ %38, %64 ], [ 4, %2 ]
%10 = phi i32 [ %30, %64 ], [ 13, %2 ]
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%12 = tail call i32 (...) @getchar()
switch i32 %12, label %28 [
i32 48, label %13
i32 50, label %29
i32 51, label %16
i32 52, label %17
i32 53, label %18
i32 54, label %19
i32 55, label %20
i32 56, label %21
i32 57, label %22
i32 116, label %23
i32 84, label %23
i32 106, label %24
i32 74, label %24
i32 113, label %25
i32 81, label %25
i32 107, label %26
i32 75, label %26
i32 97, label %27
i32 65, label %27
]
13: ; preds = %7
%14 = load i32, i32* @EXIT_SUCCESS
%15 = tail call i32 @exit(i32 %14)
unreachable
16: ; preds = %7
br label %29
17: ; preds = %7
br label %29
18: ; preds = %7
br label %29
19: ; preds = %7
br label %29
20: ; preds = %7
br label %29
21: ; preds = %7
br label %29
22: ; preds = %7
br label %29
23: ; preds = %7, %7
br label %29
24: ; preds = %7, %7
br label %29
25: ; preds = %7, %7
br label %29
26: ; preds = %7, %7
br label %29
27: ; preds = %7, %7
br label %29
28: ; preds = %7
br label %29
29: ; preds = %7, %28, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16
%30 = phi i32 [ %10, %28 ], [ 12, %27 ], [ 11, %26 ], [ 10, %25 ], [ 9, %24 ], [ 8, %23 ], [ 7, %22 ], [ 6, %21 ], [ 5, %20 ], [ 4, %19 ], [ 3, %18 ], [ 2, %17 ], [ 1, %16 ], [ 0, %7 ]
%31 = phi i32 [ 1, %28 ], [ 0, %27 ], [ 0, %26 ], [ 0, %25 ], [ 0, %24 ], [ 0, %23 ], [ 0, %22 ], [ 0, %21 ], [ 0, %20 ], [ 0, %19 ], [ 0, %18 ], [ 0, %17 ], [ 0, %16 ], [ 0, %7 ]
%32 = tail call i32 (...) @getchar()
switch i32 %32, label %36 [
i32 99, label %37
i32 67, label %37
i32 100, label %33
i32 68, label %33
i32 104, label %34
i32 72, label %34
i32 115, label %35
i32 83, label %35
]
33: ; preds = %29, %29
br label %37
34: ; preds = %29, %29
br label %37
35: ; preds = %29, %29
br label %37
36: ; preds = %29
br label %37
37: ; preds = %29, %29, %36, %35, %34, %33
%38 = phi i32 [ %9, %36 ], [ 3, %35 ], [ 2, %34 ], [ 1, %33 ], [ 0, %29 ], [ 0, %29 ]
%39 = phi i32 [ 1, %36 ], [ %31, %35 ], [ %31, %34 ], [ %31, %33 ], [ %31, %29 ], [ %31, %29 ]
br label %40
40: ; preds = %42, %37
%41 = phi i32 [ %39, %37 ], [ 1, %42 ]
br label %42
42: ; preds = %40, %42
%43 = tail call i32 (...) @getchar()
switch i32 %43, label %40 [
i32 10, label %44
i32 32, label %42
]
44: ; preds = %42
%45 = icmp eq i32 %41, 0
br i1 %45, label %48, label %46
46: ; preds = %44
%47 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.3, i64 0, i64 0))
br label %64
48: ; preds = %44
%49 = zext i32 %30 to i64
%50 = zext i32 %38 to i64
%51 = getelementptr inbounds [13 x [4 x i32]], [13 x [4 x i32]]* %5, i64 0, i64 %49, i64 %50
%52 = load i32, i32* %51
%53 = icmp eq i32 %52, 0
br i1 %53, label %56, label %54
54: ; preds = %48
%55 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %64
56: ; preds = %48
%57 = getelementptr inbounds i32, i32* %0, i64 %49
%58 = load i32, i32* %57
%59 = add nsw i32 %58, 1
store i32 %59, i32* %57
%60 = getelementptr inbounds i32, i32* %1, i64 %50
%61 = load i32, i32* %60
%62 = add nsw i32 %61, 1
store i32 %62, i32* %60
store i32 1, i32* %51
%63 = add nsw i32 %8, 1
br label %64
64: ; preds = %54, %56, %46
%65 = phi i32 [ %8, %46 ], [ %8, %54 ], [ %63, %56 ]
%66 = icmp slt i32 %65, 5
br i1 %66, label %7, label %67
67: ; preds = %64
ret void
}