#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, int, int, int, int);
scalar_t__ scanf(char *, int *, ...);
int main() {
  int n, m, i = 1, man = 0, woman = 0;
  char a, c;
  while (scanf("%d", &m) != EOF) {
    while (1) {
      scanf("%d %c%c", &n, &a, &c);
      if (n == m && a == 'M') {
        man++;
      } else if (n == m && a == 'F') {
        woman++;
      }
      if (c == '\n') {
        break;
      }
    }
    if (i == 1) {
      printf("Caso %d:\nPares Iguais: %d\nF: %d\nM: %d\n", i, (man + woman),
             woman, man);
    } else {
      printf("\nCaso %d:\nPares Iguais: %d\nF: %d\nM: %d\n", i, (man + woman),
             woman, man);
    }
    i++;
    man = 0;
    woman = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xeb5(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    0x2e8b(%rip),%rcx
cmp    (%rcx),%rax
je     124d <main+0x12d>
jmp    116b <main+0x4b>
lea    0xe91(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x19(%rbp),%rdx
lea    -0x1a(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    11ac <main+0x8c>
movsbl -0x19(%rbp),%eax
cmp    $0x4d,%eax
jne    11ac <main+0x8c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11d3 <main+0xb3>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    11ce <main+0xae>
movsbl -0x19(%rbp),%eax
cmp    $0x46,%eax
jne    11ce <main+0xae>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11d3 <main+0xb3>
movsbl -0x1a(%rbp),%eax
cmp    $0xa,%eax
jne    11e5 <main+0xc5>
jmp    11ea <main+0xca>
jmp    116b <main+0x4b>
cmpl   $0x1,-0x10(%rbp)
jne    1215 <main+0xf5>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
add    -0x18(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xe01(%rip),%rdi
call   1030 <printf@plt>
jmp    1231 <main+0x111>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
add    -0x18(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xddf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
jmp    1144 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecb(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x2ea0(%rip),%rcx
cmp    (%rcx),%rax
jne    115e <main+0x3e>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movl   $0x1,0xc(%rsp)
lea    0xe96(%rip),%r15
lea    0x14(%rsp),%r12
lea    0xb(%rsp),%rbx
lea    0xa(%rsp),%rbp
jmp    11c0 <main+0xa0>
xchg   %ax,%ax
lea    0xe84(%rip),%rdi
mov    0xc(%rsp),%esi
mov    %r14d,%ecx
mov    %r13d,%r8d
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
add    $0x1,%eax
mov    %eax,0xc(%rsp)
lea    0xe58(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x2e2d(%rip),%rcx
cmp    (%rcx),%rax
je     114d <main+0x2d>
xor    %r13d,%r13d
xor    %r14d,%r14d
jmp    11ea <main+0xca>
nopl   0x0(%rax,%rax,1)
cmp    %ecx,%eax
sete   %al
cmp    $0x46,%dl
sete   %cl
and    %al,%cl
movzbl %cl,%eax
add    %eax,%r14d
cmpb   $0xa,0xa(%rsp)
je     121e <main+0xfe>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    %rbp,%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
mov    0x10(%rsp),%ecx
movzbl 0xb(%rsp),%edx
cmp    %ecx,%eax
jne    11d0 <main+0xb0>
cmp    $0x4d,%dl
jne    11d0 <main+0xb0>
add    $0x1,%r13d
cmpb   $0xa,0xa(%rsp)
jne    11ea <main+0xca>
lea    (%r14,%r13,1),%edx
cmpl   $0x1,0xc(%rsp)
jne    1180 <main+0x60>
lea    0xdd8(%rip),%rdi
mov    $0x1,%esi
jmp    118b <main+0x6b>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [8 x i8] c"%d %c%c\00"
@.str.2 = [39 x i8] c"Caso %d:\0APares Iguais: %d\0AF: %d\0AM: %d\0A\00"
@.str.3 = [40 x i8] c"\0ACaso %d:\0APares Iguais: %d\0AF: %d\0AM: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8
store i32 0, i32* %1
store i32 1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %9
9: ; preds = %63, %0
%10 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%11 = load i64, i64* @EOF
%12 = icmp ne i64 %10, %11
br i1 %12, label %13, label %66
13: ; preds = %9
br label %14
14: ; preds = %13, %43
%15 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32* %2, i8* %7, i8* %8)
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %26
19: ; preds = %14
%20 = load i8, i8* %7
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 77
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %38
26: ; preds = %19, %14
%27 = load i32, i32* %2
%28 = load i32, i32* %3
%29 = icmp eq i32 %27, %28
br i1 %29, label %30, label %37
30: ; preds = %26
%31 = load i8, i8* %7
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 70
br i1 %33, label %34, label %37
34: ; preds = %30
%35 = load i32, i32* %6
%36 = add nsw i32 %35, 1
store i32 %36, i32* %6
br label %37
37: ; preds = %34, %30, %26
br label %38
38: ; preds = %37, %23
%39 = load i8, i8* %8
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 10
br i1 %41, label %42, label %43
42: ; preds = %38
br label %44
43: ; preds = %38
br label %14
44: ; preds = %42
%45 = load i32, i32* %4
%46 = icmp eq i32 %45, 1
br i1 %46, label %47, label %55
47: ; preds = %44
%48 = load i32, i32* %4
%49 = load i32, i32* %5
%50 = load i32, i32* %6
%51 = add nsw i32 %49, %50
%52 = load i32, i32* %6
%53 = load i32, i32* %5
%54 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %48, i32 %51, i32 %52, i32 %53)
br label %63
55: ; preds = %44
%56 = load i32, i32* %4
%57 = load i32, i32* %5
%58 = load i32, i32* %6
%59 = add nsw i32 %57, %58
%60 = load i32, i32* %6
%61 = load i32, i32* %5
%62 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i32 %56, i32 %59, i32 %60, i32 %61)
br label %63
63: ; preds = %55, %47
%64 = load i32, i32* %4
%65 = add nsw i32 %64, 1
store i32 %65, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %9
66: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [8 x i8] c"%d %c%c\00"
@.str.2 = [39 x i8] c"Caso %d:\0APares Iguais: %d\0AF: %d\0AM: %d\0A\00"
@.str.3 = [40 x i8] c"\0ACaso %d:\0APares Iguais: %d\0AF: %d\0AM: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %46, label %10
10: ; preds = %0, %41
%11 = phi i32 [ %42, %41 ], [ 1, %0 ]
br label %12
12: ; preds = %10, %29
%13 = phi i32 [ %30, %29 ], [ 0, %10 ]
%14 = phi i32 [ %31, %29 ], [ 0, %10 ]
%15 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32* %1, i8* %3, i8* %4)
%16 = load i32, i32* %1
%17 = load i32, i32* %2
%18 = icmp eq i32 %16, %17
%19 = load i8, i8* %3
%20 = icmp eq i8 %19, 77
%21 = select i1 %18, i1 %20, i1 false
br i1 %21, label %22, label %24
22: ; preds = %12
%23 = add nsw i32 %13, 1
br label %29
24: ; preds = %12
%25 = icmp eq i8 %19, 70
%26 = select i1 %18, i1 %25, i1 false
%27 = zext i1 %26 to i32
%28 = add nsw i32 %14, %27
br label %29
29: ; preds = %24, %22
%30 = phi i32 [ %23, %22 ], [ %13, %24 ]
%31 = phi i32 [ %14, %22 ], [ %28, %24 ]
%32 = load i8, i8* %4
%33 = icmp eq i8 %32, 10
br i1 %33, label %34, label %12
34: ; preds = %29
%35 = icmp eq i32 %11, 1
%36 = add nsw i32 %31, %30
br i1 %35, label %37, label %39
37: ; preds = %34
%38 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 %36, i32 %31, i32 %30)
br label %41
39: ; preds = %34
%40 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i32 %11, i32 %36, i32 %31, i32 %30)
br label %41
41: ; preds = %39, %37
%42 = add nuw nsw i32 %11, 1
%43 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%44 = load i64, i64* @EOF
%45 = icmp eq i64 %43, %44
br i1 %45, label %46, label %10
46: ; preds = %41, %0
ret i32 0
}