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


x86 assembly (clang, -O0):
<read_cards>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xd0(%rbp),%rdi
xor    %esi,%esi
mov    $0xc0,%edx
call   1040 <memset@plt>
movl   $0x0,-0xe4(%rbp)
movl   $0x0,-0xe8(%rbp)
cmpl   $0xd,-0xe8(%rbp)
jge    11ad <read_cards+0x6d>
mov    -0x8(%rbp),%rax
movslq -0xe8(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xe8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe8(%rbp)
jmp    117a <read_cards+0x3a>
movl   $0x0,-0xec(%rbp)
cmpl   $0x4,-0xec(%rbp)
jge    11ea <read_cards+0xaa>
mov    -0x10(%rbp),%rax
movslq -0xec(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xec(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xec(%rbp)
jmp    11b7 <read_cards+0x77>
jmp    11ef <read_cards+0xaf>
cmpl   $0x5,-0xe4(%rbp)
jge    14a6 <read_cards+0x366>
movl   $0x0,-0xe0(%rbp)
lea    0xfcb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %al,-0xd1(%rbp)
movsbl -0xd1(%rbp),%eax
add    $0xffffffd0,%eax
mov    %eax,%ecx
mov    %rcx,-0xf8(%rbp)
sub    $0x44,%eax
ja     132f <read_cards+0x1ef>
mov    -0xf8(%rbp),%rax
lea    0xdb7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf8e(%rip),%rdi
call   1030 <printf@plt>
mov    0x2d7b(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
movl   $0x0,-0xd8(%rbp)
jmp    1339 <read_cards+0x1f9>
movl   $0x1,-0xd8(%rbp)
jmp    1339 <read_cards+0x1f9>
movl   $0x2,-0xd8(%rbp)
jmp    1339 <read_cards+0x1f9>
movl   $0x3,-0xd8(%rbp)
jmp    1339 <read_cards+0x1f9>
movl   $0x4,-0xd8(%rbp)
jmp    1339 <read_cards+0x1f9>
movl   $0x5,-0xd8(%rbp)
jmp    1339 <read_cards+0x1f9>
movl   $0x6,-0xd8(%rbp)
jmp    1339 <read_cards+0x1f9>
movl   $0x7,-0xd8(%rbp)
jmp    1339 <read_cards+0x1f9>
movl   $0x8,-0xd8(%rbp)
jmp    1339 <read_cards+0x1f9>
movl   $0x9,-0xd8(%rbp)
jmp    1339 <read_cards+0x1f9>
movl   $0xa,-0xd8(%rbp)
jmp    1339 <read_cards+0x1f9>
movl   $0xb,-0xd8(%rbp)
jmp    1339 <read_cards+0x1f9>
movl   $0xc,-0xd8(%rbp)
jmp    1339 <read_cards+0x1f9>
movl   $0x1,-0xe0(%rbp)
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %al,-0xd2(%rbp)
movsbl -0xd2(%rbp),%eax
add    $0xffffffbd,%eax
mov    %eax,%ecx
mov    %rcx,-0x100(%rbp)
sub    $0x30,%eax
ja     13b0 <read_cards+0x270>
mov    -0x100(%rbp),%rax
lea    0xda4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0xdc(%rbp)
jmp    13b0 <read_cards+0x270>
movl   $0x1,-0xdc(%rbp)
jmp    13b0 <read_cards+0x270>
movl   $0x2,-0xdc(%rbp)
jmp    13b0 <read_cards+0x270>
movl   $0x3,-0xdc(%rbp)
jmp    13b5 <read_cards+0x275>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0xd3(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     13ed <read_cards+0x2ad>
movsbl -0xd3(%rbp),%eax
cmp    $0x20,%eax
je     13e8 <read_cards+0x2a8>
movl   $0x1,-0xe0(%rbp)
jmp    13b5 <read_cards+0x275>
cmpl   $0x0,-0xe0(%rbp)
je     140b <read_cards+0x2cb>
lea    0xdec(%rip),%rdi
call   1030 <printf@plt>
jmp    14a1 <read_cards+0x361>
movslq -0xd8(%rbp),%rcx
lea    -0xd0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0xdc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1442 <read_cards+0x302>
lea    0xdc8(%rip),%rdi
call   1030 <printf@plt>
jmp    149c <read_cards+0x35c>
mov    -0x8(%rbp),%rax
movslq -0xd8(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
movslq -0xdc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
movslq -0xd8(%rbp),%rcx
lea    -0xd0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0xdc(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0xe4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe4(%rbp)
jmp    14a1 <read_cards+0x361>
jmp    11ef <read_cards+0xaf>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_cards>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
xorps  %xmm0,%xmm0
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)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
mov    %rdi,(%rsp)
movl   $0x0,0x30(%rdi)
mov    %rsi,0x8(%rsp)
movups %xmm0,(%rsi)
lea    0xe3c(%rip),%r12
xor    %r14d,%r14d
jmp    11e6 <read_cards+0xa6>
nopl   0x0(%rax)
lea    0x1028(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x5,%r14d
jge    1346 <read_cards+0x206>
mov    %r13d,%ebp
lea    0xfe8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
movsbl %al,%eax
add    $0xffffffd0,%eax
cmp    $0x44,%eax
ja     123d <read_cards+0xfd>
movslq (%r12,%rax,4),%rax
add    %r12,%rax
xor    %r13d,%r13d
xor    %ebx,%ebx
jmp    *%rax
mov    $0xc,%r13d
jmp    1280 <read_cards+0x140>
mov    $0x9,%r13d
jmp    1280 <read_cards+0x140>
mov    $0xb,%r13d
jmp    1280 <read_cards+0x140>
mov    $0xa,%r13d
jmp    1280 <read_cards+0x140>
mov    $0x8,%r13d
jmp    1280 <read_cards+0x140>
mov    $0x1,%ebx
mov    %ebp,%r13d
jmp    1282 <read_cards+0x142>
mov    $0x1,%r13d
jmp    1280 <read_cards+0x140>
mov    $0x2,%r13d
jmp    1280 <read_cards+0x140>
mov    $0x3,%r13d
jmp    1280 <read_cards+0x140>
mov    $0x4,%r13d
jmp    1280 <read_cards+0x140>
mov    $0x5,%r13d
jmp    1280 <read_cards+0x140>
mov    $0x6,%r13d
jmp    1280 <read_cards+0x140>
mov    $0x7,%r13d
nopl   (%rax)
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <getchar@plt>
movsbl %al,%eax
add    $0xffffffbd,%eax
cmp    $0x30,%eax
ja     12e0 <read_cards+0x1a0>
lea    0xe79(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %r15d,%r15d
jmp    12e0 <read_cards+0x1a0>
nopl   0x0(%rax)
mov    $0x1,%r15d
jmp    12e0 <read_cards+0x1a0>
nopl   0x0(%rax,%rax,1)
mov    $0x2,%r15d
jmp    12e0 <read_cards+0x1a0>
nopl   0x0(%rax,%rax,1)
mov    $0x3,%r15d
jmp    12e0 <read_cards+0x1a0>
mov    $0x1,%ebx
nopl   (%rax)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x20,%al
je     12e0 <read_cards+0x1a0>
cmp    $0xa,%al
jne    12d8 <read_cards+0x198>
test   %ebx,%ebx
jne    11d0 <read_cards+0x90>
movslq %r13d,%rcx
movslq %r15d,%rax
mov    %rcx,%rdx
shl    $0x4,%rdx
add    %rsp,%rdx
add    $0x10,%rdx
cmpl   $0x0,(%rdx,%rax,4)
je     131d <read_cards+0x1dd>
lea    0xecf(%rip),%rdi
jmp    11d7 <read_cards+0x97>
mov    (%rsp),%rsi
addl   $0x1,(%rsi,%rcx,4)
mov    0x8(%rsp),%rcx
addl   $0x1,(%rcx,%rax,4)
lea    (%rdx,%rax,4),%rax
movl   $0x1,(%rax)
add    $0x1,%r14d
cmp    $0x5,%r14d
jl     11e6 <read_cards+0xa6>
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
mov    0x2c75(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

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

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