#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*/ insert(char **, char *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int n, i, good = 0, bad = 0;
  char flag[2];
  char names[100][21];
  char name[21];
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%s %s", flag, name);
    insert(names, name, i + 1);
    if (flag[0] == '+') {
      good++;
    } else {
      bad++;
    }
  }
  for (i = 0; i < n; i++) {
    printf("%s\n", names[i]);
  }
  printf("Se comportaram: %d | Nao se comportaram: %d\n", good, bad);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x870,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xea9(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11de <main+0xae>
lea    -0x16(%rbp),%rsi
lea    -0x870(%rbp),%rdx
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    -0x850(%rbp),%rdi
lea    -0x870(%rbp),%rsi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
call   1050 <insert@plt>
movsbl -0x16(%rbp),%eax
cmp    $0x2b,%eax
jne    11c2 <main+0x92>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11cb <main+0x9b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11d0 <main+0xa0>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1169 <main+0x39>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    121f <main+0xef>
movslq -0xc(%rbp),%rax
lea    -0x850(%rbp),%rsi
imul   $0x15,%rax,%rax
add    %rax,%rsi
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11e5 <main+0xb5>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xde1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x870,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x868,%rsp
lea    0xea8(%rip),%rdi
xor    %r14d,%r14d
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
mov    $0x0,%r12d
jle    11fa <main+0xba>
lea    0xe(%rsp),%rbp
lea    0x10(%rsp),%r13
lea    0x30(%rsp),%rbx
xor    %r14d,%r14d
xor    %r12d,%r12d
xor    %r15d,%r15d
lea    0xe6c(%rip),%rdi
mov    %rbp,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
add    $0x1,%r15d
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r15d,%edx
call   1060 <insert@plt>
xor    %eax,%eax
xor    %ecx,%ecx
cmpb   $0x2b,0xe(%rsp)
setne  %al
sete   %cl
add    %ecx,%r12d
add    %eax,%r14d
mov    0x8(%rsp),%eax
cmp    %eax,%r15d
jl     1190 <main+0x50>
test   %eax,%eax
jle    11fa <main+0xba>
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x1,%rbp
movslq 0x8(%rsp),%rax
add    $0x15,%rbx
cmp    %rax,%rbp
jl     11e0 <main+0xa0>
lea    0xe08(%rip),%rdi
mov    %r12d,%esi
mov    %r14d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x868,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%s %s\00"
@.str.2 = [4 x i8] c"%s\0A\00"
@.str.3 = [45 x i8] c"Se comportaram: %d | Nao se comportaram: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [2 x i8]
%7 = alloca [100 x [21 x i8]]
%8 = alloca [21 x i8]
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %5
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %3
br label %10
10: ; preds = %35, %0
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %38
14: ; preds = %10
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%16 = getelementptr inbounds [21 x i8], [21 x i8]* %8, i64 0, i64 0
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %15, i8* %16)
%18 = getelementptr inbounds [100 x [21 x i8]], [100 x [21 x i8]]* %7, i64 0, i64 0
%19 = bitcast [21 x i8]* %18 to i8**
%20 = getelementptr inbounds [21 x i8], [21 x i8]* %8, i64 0, i64 0
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
%23 = call i32 @insert(i8** %19, i8* %20, i32 %22)
%24 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 43
br i1 %27, label %28, label %31
28: ; preds = %14
%29 = load i32, i32* %4
%30 = add nsw i32 %29, 1
store i32 %30, i32* %4
br label %34
31: ; preds = %14
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
br label %34
34: ; preds = %31, %28
br label %35
35: ; preds = %34
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 1
store i32 %37, i32* %3
br label %10
38: ; preds = %10
store i32 0, i32* %3
br label %39
39: ; preds = %49, %38
%40 = load i32, i32* %3
%41 = load i32, i32* %2
%42 = icmp slt i32 %40, %41
br i1 %42, label %43, label %52
43: ; preds = %39
%44 = load i32, i32* %3
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [100 x [21 x i8]], [100 x [21 x i8]]* %7, i64 0, i64 %45
%47 = getelementptr inbounds [21 x i8], [21 x i8]* %46, i64 0, i64 0
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %47)
br label %49
49: ; preds = %43
%50 = load i32, i32* %3
%51 = add nsw i32 %50, 1
store i32 %51, i32* %3
br label %39
52: ; preds = %39
%53 = load i32, i32* %4
%54 = load i32, i32* %5
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i32 %53, i32 %54)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%s %s\00"
@.str.3 = [45 x i8] c"Se comportaram: %d | Nao se comportaram: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i8]
%3 = alloca [100 x [21 x i8]]
%4 = alloca [21 x i8]
%5 = bitcast i32* %1 to i8*
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [100 x [21 x i8]], [100 x [21 x i8]]* %3, i64 0, i64 0, i64 0
%8 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 0
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %40
12: ; preds = %0
%13 = bitcast [100 x [21 x i8]]* %3 to i8**
br label %16
14: ; preds = %16
%15 = icmp sgt i32 %30, 0
br i1 %15, label %32, label %40
16: ; preds = %12, %16
%17 = phi i32 [ 0, %12 ], [ %29, %16 ]
%18 = phi i32 [ 0, %12 ], [ %26, %16 ]
%19 = phi i32 [ 0, %12 ], [ %21, %16 ]
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %6, i8* %8)
%21 = add nuw nsw i32 %19, 1
%22 = call i32 @insert(i8** %13, i8* %8, i32 %21)
%23 = load i8, i8* %6
%24 = icmp eq i8 %23, 43
%25 = zext i1 %24 to i32
%26 = add nuw nsw i32 %18, %25
%27 = xor i1 %24, true
%28 = zext i1 %27 to i32
%29 = add nuw nsw i32 %17, %28
%30 = load i32, i32* %1
%31 = icmp slt i32 %21, %30
br i1 %31, label %16, label %14
32: ; preds = %14, %32
%33 = phi i64 [ %36, %32 ], [ 0, %14 ]
%34 = getelementptr inbounds [100 x [21 x i8]], [100 x [21 x i8]]* %3, i64 0, i64 %33, i64 0
%35 = call i32 @puts(i8* %34)
%36 = add nuw nsw i64 %33, 1
%37 = load i32, i32* %1
%38 = sext i32 %37 to i64
%39 = icmp slt i64 %36, %38
br i1 %39, label %32, label %40
40: ; preds = %32, %0, %14
%41 = phi i32 [ %29, %14 ], [ 0, %0 ], [ %29, %32 ]
%42 = phi i32 [ %26, %14 ], [ 0, %0 ], [ %26, %32 ]
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i32 %42, i32 %41)
ret i32 0
}