#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*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, char *);
void pegar_char(int *n) {
  int i;
  char letra;
  int mai = 0, min = 0;
  int aux = *(n);
  for (i = 0; i < aux * 2; i++) {
    scanf("%c", &letra);
    if (letra <= 'z' && letra >= 'a') {
      min++;
    } else if (letra <= 'Z' && letra >= 'A') {
      mai++;
    }
  }
  printf("%d %d\n", mai, min);
}


x86 assembly (clang, -O0):
<pegar_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    11ce <pegar_char+0xae>
lea    0xe9e(%rip),%rdi
lea    -0xd(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0xd(%rbp),%eax
cmp    $0x7a,%eax
jg     1193 <pegar_char+0x73>
movsbl -0xd(%rbp),%eax
cmp    $0x61,%eax
jl     1193 <pegar_char+0x73>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11bb <pegar_char+0x9b>
movsbl -0xd(%rbp),%eax
cmp    $0x5a,%eax
jg     11b6 <pegar_char+0x96>
movsbl -0xd(%rbp),%eax
cmp    $0x41,%eax
jl     11b6 <pegar_char+0x96>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11bb <pegar_char+0x9b>
jmp    11c0 <pegar_char+0xa0>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114a <pegar_char+0x2a>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pegar_char>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    (%rdi),%eax
test   %eax,%eax
jle    118f <pegar_char+0x6f>
add    %eax,%eax
cmp    $0x2,%eax
mov    $0x1,%ebx
cmovge %eax,%ebx
xor    %r12d,%r12d
lea    0xeb7(%rip),%r14
lea    0xf(%rsp),%r15
xor    %ebp,%ebp
jmp    116c <pegar_char+0x4c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0xbf,%al
cmp    $0x1a,%al
adc    $0x0,%ebp
add    $0xffffffff,%ebx
je     1194 <pegar_char+0x74>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
movzbl 0xf(%rsp),%eax
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     1160 <pegar_char+0x40>
add    $0x1,%r12d
add    $0xffffffff,%ebx
jne    116c <pegar_char+0x4c>
jmp    1194 <pegar_char+0x74>
xor    %ebp,%ebp
xor    %r12d,%r12d
lea    0xe68(%rip),%rdi
mov    %ebp,%esi
mov    %r12d,%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define void @pegar_char(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %5
store i32 0, i32* %6
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
store i32 %9, i32* %7
store i32 0, i32* %3
br label %10
10: ; preds = %40, %1
%11 = load i32, i32* %3
%12 = load i32, i32* %7
%13 = mul nsw i32 %12, 2
%14 = icmp slt i32 %11, %13
br i1 %14, label %15, label %43
15: ; preds = %10
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%17 = load i8, i8* %4
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 122
br i1 %19, label %20, label %27
20: ; preds = %15
%21 = load i8, i8* %4
%22 = sext i8 %21 to i32
%23 = icmp sge i32 %22, 97
br i1 %23, label %24, label %27
24: ; preds = %20
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
store i32 %26, i32* %6
br label %39
27: ; preds = %20, %15
%28 = load i8, i8* %4
%29 = sext i8 %28 to i32
%30 = icmp sle i32 %29, 90
br i1 %30, label %31, label %38
31: ; preds = %27
%32 = load i8, i8* %4
%33 = sext i8 %32 to i32
%34 = icmp sge i32 %33, 65
br i1 %34, label %35, label %38
35: ; preds = %31
%36 = load i32, i32* %5
%37 = add nsw i32 %36, 1
store i32 %37, i32* %5
br label %38
38: ; preds = %35, %31, %27
br label %39
39: ; preds = %38, %24
br label %40
40: ; preds = %39
%41 = load i32, i32* %3
%42 = add nsw i32 %41, 1
store i32 %42, i32* %3
br label %10
43: ; preds = %10
%44 = load i32, i32* %5
%45 = load i32, i32* %6
%46 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %44, i32 %45)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define void @pegar_char(i32* nocapture %0) {
%2 = alloca i8
%3 = load i32, i32* %0
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %28
5: ; preds = %1
%6 = shl nuw i32 %3, 1
%7 = call i32 @llvm.smax.i32(i32 %6, i32 1)
br label %8
8: ; preds = %5, %23
%9 = phi i32 [ %26, %23 ], [ 0, %5 ]
%10 = phi i32 [ %25, %23 ], [ 0, %5 ]
%11 = phi i32 [ %24, %23 ], [ 0, %5 ]
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%13 = load i8, i8* %2
%14 = add i8 %13, -97
%15 = icmp ult i8 %14, 26
br i1 %15, label %16, label %18
16: ; preds = %8
%17 = add nsw i32 %10, 1
br label %23
18: ; preds = %8
%19 = add i8 %13, -65
%20 = icmp ult i8 %19, 26
%21 = zext i1 %20 to i32
%22 = add nsw i32 %11, %21
br label %23
23: ; preds = %18, %16
%24 = phi i32 [ %11, %16 ], [ %22, %18 ]
%25 = phi i32 [ %17, %16 ], [ %10, %18 ]
%26 = add nuw nsw i32 %9, 1
%27 = icmp eq i32 %26, %7
br i1 %27, label %28, label %8
28: ; preds = %23, %1
%29 = phi i32 [ 0, %1 ], [ %24, %23 ]
%30 = phi i32 [ 0, %1 ], [ %25, %23 ]
%31 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %29, i32 %30)
ret void
}