#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 getchar();
int /*<<< orphan*/ printf(char *);
bool 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':
      return false;
    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;
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<read_cards>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x10c(%rbp)
movl   $0x0,-0x100(%rbp)
cmpl   $0xd,-0x100(%rbp)
jge    11cd <read_cards+0xad>
mov    -0x10(%rbp),%rax
movslq -0x100(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
movl   $0x0,-0x104(%rbp)
cmpl   $0x4,-0x104(%rbp)
jge    11b4 <read_cards+0x94>
movslq -0x100(%rbp),%rcx
lea    -0xf0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x104(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x104(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x104(%rbp)
jmp    1170 <read_cards+0x50>
jmp    11b9 <read_cards+0x99>
mov    -0x100(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x100(%rbp)
jmp    1147 <read_cards+0x27>
movl   $0x0,-0x104(%rbp)
cmpl   $0x4,-0x104(%rbp)
jge    120a <read_cards+0xea>
mov    -0x18(%rbp),%rax
movslq -0x104(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x104(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x104(%rbp)
jmp    11d7 <read_cards+0xb7>
jmp    120f <read_cards+0xef>
cmpl   $0x5,-0x10c(%rbp)
jge    14bf <read_cards+0x39f>
movl   $0x0,-0x108(%rbp)
lea    0xfab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,-0xf8(%rbp)
mov    -0xf8(%rbp),%eax
add    $0xffffffd0,%eax
mov    %eax,%ecx
mov    %rcx,-0x118(%rbp)
sub    $0x44,%eax
ja     1340 <read_cards+0x220>
mov    -0x118(%rbp),%rax
lea    0xd98(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    14c6 <read_cards+0x3a6>
movl   $0x0,-0x100(%rbp)
jmp    134a <read_cards+0x22a>
movl   $0x1,-0x100(%rbp)
jmp    134a <read_cards+0x22a>
movl   $0x2,-0x100(%rbp)
jmp    134a <read_cards+0x22a>
movl   $0x3,-0x100(%rbp)
jmp    134a <read_cards+0x22a>
movl   $0x4,-0x100(%rbp)
jmp    134a <read_cards+0x22a>
movl   $0x5,-0x100(%rbp)
jmp    134a <read_cards+0x22a>
movl   $0x6,-0x100(%rbp)
jmp    134a <read_cards+0x22a>
movl   $0x7,-0x100(%rbp)
jmp    134a <read_cards+0x22a>
movl   $0x8,-0x100(%rbp)
jmp    134a <read_cards+0x22a>
movl   $0x9,-0x100(%rbp)
jmp    134a <read_cards+0x22a>
movl   $0xa,-0x100(%rbp)
jmp    134a <read_cards+0x22a>
movl   $0xb,-0x100(%rbp)
jmp    134a <read_cards+0x22a>
movl   $0xc,-0x100(%rbp)
jmp    134a <read_cards+0x22a>
movl   $0x1,-0x108(%rbp)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,-0xfc(%rbp)
mov    -0xfc(%rbp),%eax
add    $0xffffffbd,%eax
mov    %eax,%ecx
mov    %rcx,-0x120(%rbp)
sub    $0x30,%eax
ja     13c5 <read_cards+0x2a5>
mov    -0x120(%rbp),%rax
lea    0xd94(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x104(%rbp)
jmp    13cf <read_cards+0x2af>
movl   $0x1,-0x104(%rbp)
jmp    13cf <read_cards+0x2af>
movl   $0x2,-0x104(%rbp)
jmp    13cf <read_cards+0x2af>
movl   $0x3,-0x104(%rbp)
jmp    13cf <read_cards+0x2af>
movl   $0x1,-0x108(%rbp)
jmp    13d4 <read_cards+0x2b4>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xf4(%rbp)
cmp    $0xa,%eax
je     1406 <read_cards+0x2e6>
cmpl   $0x20,-0xf4(%rbp)
je     1401 <read_cards+0x2e1>
movl   $0x1,-0x108(%rbp)
jmp    13d4 <read_cards+0x2b4>
cmpl   $0x0,-0x108(%rbp)
je     1424 <read_cards+0x304>
lea    0xdcd(%rip),%rdi
call   1030 <printf@plt>
jmp    14ba <read_cards+0x39a>
movslq -0x100(%rbp),%rcx
lea    -0xf0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x104(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     145b <read_cards+0x33b>
lea    0xdaa(%rip),%rdi
call   1030 <printf@plt>
jmp    14b5 <read_cards+0x395>
mov    -0x10(%rbp),%rax
movslq -0x100(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
movslq -0x104(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
movslq -0x100(%rbp),%rcx
lea    -0xf0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x104(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x10c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10c(%rbp)
jmp    14ba <read_cards+0x39a>
jmp    120f <read_cards+0xef>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_cards>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
mov    %rdi,0x10(%rsp)
movl   $0x0,0x30(%rdi)
movaps %xmm0,0xe0(%rsp)
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)
mov    %rsi,0x18(%rsp)
movups %xmm0,(%rsi)
mov    $0xd,%r13d
mov    $0x4,%ebx
movl   $0x0,0xc(%rsp)
xor    %r14d,%r14d
jmp    11f6 <read_cards+0xc6>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x1019(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x5,%r14d
jge    1369 <read_cards+0x239>
mov    %r13d,%r12d
mov    %ebx,%ebp
lea    0xfd6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
add    $0xffffffd0,%eax
cmp    $0x44,%eax
ja     1254 <read_cards+0x124>
lea    0xde3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
xor    %r13d,%r13d
xor    %r15d,%r15d
jmp    *%rax
mov    $0xc,%r13d
jmp    12a0 <read_cards+0x170>
mov    $0x9,%r13d
jmp    12a0 <read_cards+0x170>
mov    $0xb,%r13d
jmp    12a0 <read_cards+0x170>
mov    $0xa,%r13d
jmp    12a0 <read_cards+0x170>
mov    $0x8,%r13d
jmp    12a0 <read_cards+0x170>
mov    $0x1,%r15d
mov    %r12d,%r13d
jmp    12a3 <read_cards+0x173>
mov    $0x1,%r13d
jmp    12a0 <read_cards+0x170>
mov    $0x2,%r13d
jmp    12a0 <read_cards+0x170>
mov    $0x3,%r13d
jmp    12a0 <read_cards+0x170>
mov    $0x4,%r13d
jmp    12a0 <read_cards+0x170>
mov    $0x5,%r13d
jmp    12a0 <read_cards+0x170>
mov    $0x6,%r13d
jmp    12a0 <read_cards+0x170>
mov    $0x7,%r13d
cs nopw 0x0(%rax,%rax,1)
nop
xor    %r15d,%r15d
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <getchar@plt>
add    $0xffffffbd,%eax
cmp    $0x30,%eax
ja     12e7 <read_cards+0x1b7>
lea    0xe59(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x1,%ebx
jmp    1300 <read_cards+0x1d0>
nopl   0x0(%rax,%rax,1)
mov    $0x2,%ebx
jmp    1300 <read_cards+0x1d0>
nopw   0x0(%rax,%rax,1)
mov    $0x3,%ebx
jmp    1300 <read_cards+0x1d0>
mov    $0x1,%r15d
mov    %ebp,%ebx
jmp    1300 <read_cards+0x1d0>
mov    $0x1,%r15d
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x20,%eax
je     1300 <read_cards+0x1d0>
cmp    $0xa,%eax
jne    12f1 <read_cards+0x1c1>
test   %r15d,%r15d
jne    11e0 <read_cards+0xb0>
mov    %r13d,%eax
mov    %ebx,%ecx
mov    %rax,%rdx
shl    $0x4,%rdx
add    %rsp,%rdx
add    $0x20,%rdx
cmpl   $0x0,(%rdx,%rcx,4)
je     133f <read_cards+0x20f>
lea    0xead(%rip),%rdi
jmp    11e7 <read_cards+0xb7>
mov    0x10(%rsp),%rsi
addl   $0x1,(%rsi,%rax,4)
mov    0x18(%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+0xc6>
movl   $0x1,0xc(%rsp)
mov    0xc(%rsp),%eax
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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