#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*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int strlen(char *);
void main() {
  printf("Este programa foi feito por Jessica Cristina Cacau Patricio.\n\n");
  char nome[50];
  int tam;
  printf("Digite seu nome completo:\n");
  gets(nome);
  tam = strlen(nome);
  while (tam) {
    if (tam == strlen(nome))
      printf("\n");
    printf("%c", nome[tam - 1]);
    if (tam == 1)
      printf("\n");
    tam--;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xef2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
je     11de <main+0xae>
mov    -0x44(%rbp),%eax
mov    %eax,-0x48(%rbp)
lea    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%eax
cmp    %ecx,%eax
jne    119d <main+0x6d>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x44(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x40(%rbp,%rax,1),%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x1,-0x44(%rbp)
jne    11d0 <main+0xa0>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x44(%rbp)
jmp    1169 <main+0x39>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x40,%rsp
lea    0xeb1(%rip),%rdi
call   1040 <puts@plt>
lea    0xee3(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
test   %eax,%eax
je     11c6 <main+0x86>
mov    %eax,%ebp
movslq %eax,%rbx
add    $0xffffffffffffffff,%rbx
mov    %rsp,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
call   1050 <strlen@plt>
cmp    %eax,%ebp
jne    11a6 <main+0x66>
mov    $0xa,%edi
call   1030 <putchar@plt>
movsbl (%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
sub    $0x1,%rbx
jb     11bc <main+0x7c>
add    $0xffffffff,%ebp
jne    1190 <main+0x50>
jmp    11c6 <main+0x86>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [63 x i8] c"Este programa foi feito por Jessica Cristina Cacau Patricio.\0A\0A\00"
@.str.1 = [27 x i8] c"Digite seu nome completo:\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [3 x i8] c"%c\00"
define void @main() {
%1 = alloca [50 x i8]
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %2
br label %9
9: ; preds = %31, %0
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %34
12: ; preds = %9
%13 = load i32, i32* %2
%14 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%15 = call i32 @strlen(i8* %14)
%16 = icmp eq i32 %13, %15
br i1 %16, label %17, label %19
17: ; preds = %12
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %19
19: ; preds = %17, %12
%20 = load i32, i32* %2
%21 = sub nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %25)
%27 = load i32, i32* %2
%28 = icmp eq i32 %27, 1
br i1 %28, label %29, label %31
29: ; preds = %19
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %31
31: ; preds = %29, %19
%32 = load i32, i32* %2
%33 = add nsw i32 %32, -1
store i32 %33, i32* %2
br label %9
34: ; preds = %9
ret void
}

LLVM IR (-O2):
@str = [62 x i8] c"Este programa foi feito por Jessica Cristina Cacau Patricio.\0A\00"
@str.4 = [26 x i8] c"Digite seu nome completo:\00"
define void @main() {
%1 = alloca [50 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.4, i64 0, i64 0))
%5 = call i32 @gets(i8* %3)
%6 = call i32 @strlen(i8* %3)
%7 = icmp eq i32 %6, 0
br i1 %7, label %29, label %8
8: ; preds = %0
%9 = sext i32 %6 to i64
br label %10
10: ; preds = %8, %26
%11 = phi i64 [ %9, %8 ], [ %18, %26 ]
%12 = call i32 @strlen(i8* %3)
%13 = trunc i64 %11 to i32
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = call i32 @putchar(i32 10)
br label %17
17: ; preds = %15, %10
%18 = add nsw i64 %11, -1
%19 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = call i32 @putchar(i32 %21)
%23 = icmp eq i64 %11, 1
br i1 %23, label %24, label %26
24: ; preds = %17
%25 = call i32 @putchar(i32 10)
br label %29
26: ; preds = %17
%27 = trunc i64 %18 to i32
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %10
29: ; preds = %26, %24, %0
ret void
}