#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*/ Lista(char *, char *, char *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ geraCh(char *, char *);
char *malloc(int);
int /*<<< orphan*/ printS(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main(int argc, const char *argv[]) {
  char s[10000], *copia, ch[10000];
  copia = malloc(sizeof(char *) * strlen(s) + 1);
  printf("Informe uma string:\n");
  fgets(s, 10000, stdin);
  strcpy(copia, s);
  geraCh(copia, ch);
  printS(s);
  puts("");
  Lista(s, ch, copia);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4e40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x2720(%rbp),%rdi
call   1060 <strlen@plt>
cltq
shl    $0x3,%rax
add    $0x1,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x2728(%rbp)
lea    0xe2c(%rip),%rdi
call   1070 <printf@plt>
lea    -0x2720(%rbp),%rdi
mov    0x2e01(%rip),%rax
mov    (%rax),%edx
mov    $0x2710,%esi
call   1080 <fgets@plt>
mov    -0x2728(%rbp),%rdi
lea    -0x2720(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x2728(%rbp),%rdi
lea    -0x4e40(%rbp),%rsi
call   10b0 <geraCh@plt>
lea    -0x2720(%rbp),%rdi
call   1090 <printS@plt>
lea    0xde8(%rip),%rdi
call   1040 <puts@plt>
lea    -0x2720(%rbp),%rdi
lea    -0x4e40(%rbp),%rsi
mov    -0x2728(%rbp),%rdx
call   1050 <Lista@plt>
xor    %eax,%eax
add    $0x4e40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x4e20,%rsp
lea    0x2710(%rsp),%r14
mov    %r14,%rdi
call   1070 <strlen@plt>
lea    0x1(,%rax,8),%edi
call   10a0 <malloc@plt>
mov    %rax,%rbx
lea    0xe3e(%rip),%rdi
call   1050 <puts@plt>
mov    0x2e1a(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
mov    $0x2710,%esi
call   1080 <fgets@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %rsp,%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   10b0 <geraCh@plt>
mov    %r14,%rdi
call   1090 <printS@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1060 <Lista@plt>
xor    %eax,%eax
add    $0x4e20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Informe uma string:\0A\00"
@stdin = global i32 0
@.str.1 = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10000 x i8]
%7 = alloca i8*
%8 = alloca [10000 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = getelementptr inbounds [10000 x i8], [10000 x i8]* %6, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
%11 = sext i32 %10 to i64
%12 = mul i64 8, %11
%13 = add i64 %12, 1
%14 = trunc i64 %13 to i32
%15 = call i8* @malloc(i32 %14)
store i8* %15, i8** %7
%16 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%17 = getelementptr inbounds [10000 x i8], [10000 x i8]* %6, i64 0, i64 0
%18 = load i32, i32* @stdin
%19 = call i32 @fgets(i8* %17, i32 10000, i32 %18)
%20 = load i8*, i8** %7
%21 = getelementptr inbounds [10000 x i8], [10000 x i8]* %6, i64 0, i64 0
%22 = call i32 @strcpy(i8* %20, i8* %21)
%23 = load i8*, i8** %7
%24 = getelementptr inbounds [10000 x i8], [10000 x i8]* %8, i64 0, i64 0
%25 = call i32 @geraCh(i8* %23, i8* %24)
%26 = getelementptr inbounds [10000 x i8], [10000 x i8]* %6, i64 0, i64 0
%27 = call i32 @printS(i8* %26)
%28 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%29 = getelementptr inbounds [10000 x i8], [10000 x i8]* %6, i64 0, i64 0
%30 = getelementptr inbounds [10000 x i8], [10000 x i8]* %8, i64 0, i64 0
%31 = load i8*, i8** %7
%32 = call i32 @Lista(i8* %29, i8* %30, i8* %31)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@str = [20 x i8] c"Informe uma string:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10000 x i8]
%4 = alloca [10000 x i8]
%5 = getelementptr inbounds [10000 x i8], [10000 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [10000 x i8], [10000 x i8]* %4, i64 0, i64 0
%7 = call i32 @strlen(i8* %5)
%8 = shl i32 %7, 3
%9 = or i32 %8, 1
%10 = call i8* @malloc(i32 %9)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%12 = load i32, i32* @stdin
%13 = call i32 @fgets(i8* %5, i32 10000, i32 %12)
%14 = call i32 @strcpy(i8* %10, i8* %5)
%15 = call i32 @geraCh(i8* %10, i8* %6)
%16 = call i32 @printS(i8* %5)
%17 = call i32 @putchar(i32 10)
%18 = call i32 @Lista(i8* %5, i8* %6, i8* %10)
ret i32 0
}