#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 */
typedef int /*<<< orphan*/ nome;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int strlen(char *);
int main() {
  char nome[10];
  fgets(nome, sizeof(nome), stdin);
  int i;
  if (nome[0] == 'a' || nome[0] == 'A') {
    for (i = 0; i < strlen(nome); i++)
      printf("%c", nome[i]);
  } else {
    printf("Nao comeca com a ou A\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
mov    $0xa,%esi
call   1050 <fgets@plt>
movsbl -0xe(%rbp),%eax
cmp    $0x61,%eax
je     1170 <main+0x40>
movsbl -0xe(%rbp),%eax
cmp    $0x41,%eax
jne    11bd <main+0x8d>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
lea    -0xe(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    11b8 <main+0x88>
movslq -0x14(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%esi
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1177 <main+0x47>
jmp    11cb <main+0x9b>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    0x2e9a(%rip),%rax
mov    (%rax),%edx
lea    0xe(%rsp),%rdi
mov    $0xa,%esi
call   1060 <fgets@plt>
mov    0xe(%rsp),%al
and    $0xdf,%al
cmp    $0x41,%al
jne    119f <main+0x5f>
lea    0xe(%rsp),%rdi
call   1050 <strlen@plt>
test   %eax,%eax
jle    11ab <main+0x6b>
xor    %ebx,%ebx
lea    0xe(%rsp),%r14
xchg   %ax,%ax
movsbl 0xe(%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
mov    %r14,%rdi
call   1050 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1180 <main+0x40>
jmp    11ab <main+0x6b>
lea    0xe5a(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [3 x i8] c"%c\00"
@.str.1 = [23 x i8] c"Nao comeca com a ou A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 10, i32 %5)
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 97
br i1 %10, label %16, label %11
11: ; preds = %0
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 65
br i1 %15, label %16, label %33
16: ; preds = %11, %0
store i32 0, i32* %3
br label %17
17: ; preds = %29, %16
%18 = load i32, i32* %3
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%20 = call i32 @strlen(i8* %19)
%21 = icmp slt i32 %18, %20
br i1 %21, label %22, label %32
22: ; preds = %17
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %27)
br label %29
29: ; preds = %22
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %17
32: ; preds = %17
br label %35
33: ; preds = %11
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %35
35: ; preds = %33, %32
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@str = [22 x i8] c"Nao comeca com a ou A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 10, i32 %3)
%5 = load i8, i8* %2
%6 = and i8 %5, -33
%7 = icmp eq i8 %6, 65
br i1 %7, label %8, label %21
8: ; preds = %0
%9 = call i32 @strlen(i8* %2)
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %23
11: ; preds = %8, %11
%12 = phi i64 [ %17, %11 ], [ 0, %8 ]
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = call i32 @putchar(i32 %15)
%17 = add nuw nsw i64 %12, 1
%18 = call i32 @strlen(i8* %2)
%19 = sext i32 %18 to i64
%20 = icmp slt i64 %17, %19
br i1 %20, label %11, label %23
21: ; preds = %0
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
br label %23
23: ; preds = %11, %8, %21
ret i32 0
}