#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*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ imprimeTamString(int, char **);
char *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ stdin;
size_t strcspn(char *, char *);
int main() {
  int numStrings;
  printf("Deseja entrar com quantas strings? ");
  scanf("%d", &numStrings);
  scanf("%*c");
  char *strings[numStrings];
  for (int i = 0; i < numStrings; i++) {
    printf("String %d = ", i + 1);
    strings[i] = malloc(127 + 1);
    fgets(strings[i], 127, stdin);
    strings[i][strcspn(strings[i], "\n")] = 0;
  }
  imprimeTamString(numStrings, strings);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x29(%rbp)
call   1030 <printf@plt>
mov    -0x29(%rbp),%al
lea    0xe9a(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1080 <scanf@plt>
mov    -0x29(%rbp),%al
lea    0xe8a(%rip),%rdi
call   1080 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1261 <main+0x101>
mov    -0x1c(%rbp),%esi
add    $0x1,%esi
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x80,%edi
call   1070 <malloc@plt>
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    0x2dd0(%rip),%rax
mov    (%rax),%edx
mov    $0x7f,%esi
call   1050 <fgets@plt>
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
mov    %rcx,-0x38(%rbp)
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdf5(%rip),%rsi
call   1040 <strcspn@plt>
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
movb   $0x0,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11d0 <main+0x70>
mov    -0x28(%rbp),%rsi
mov    -0x8(%rbp),%edi
call   1060 <imprimeTamString@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xe88(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe9e(%rip),%rdi
lea    -0x2c(%rbp),%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
lea    0xe8f(%rip),%rdi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    %rsp,%rbx
mov    -0x2c(%rbp),%eax
mov    %rsp,%r12
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
mov    -0x2c(%rbp),%edi
test   %edi,%edi
jle    122b <main+0xcb>
mov    %rbx,-0x38(%rbp)
lea    0xe6c(%rip),%r15
xor    %r13d,%r13d
nop
lea    0x1(%r13),%r14
lea    0xe50(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x80,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
mov    %rax,(%r12,%r13,8)
mov    0x2deb(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x7f,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strcspn@plt>
movb   $0x0,(%rbx,%rax,1)
movslq -0x2c(%rbp),%rdi
mov    %r14,%r13
cmp    %rdi,%r14
jl     11d0 <main+0x70>
mov    -0x38(%rbp),%rbx
mov    %r12,%rsi
call   1060 <imprimeTamString@plt>
mov    %rbx,%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Deseja entrar com quantas strings? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%*c\00"
@.str.3 = [13 x i8] c"String %d = \00"
@stdin = global i32 0
@.str.4 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %3
%12 = alloca i8*, i64 %10
store i64 %10, i64* %4
store i32 0, i32* %5
br label %13
13: ; preds = %41, %0
%14 = load i32, i32* %5
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %44
17: ; preds = %13
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %19)
%21 = call i8* @malloc(i32 128)
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8*, i8** %12, i64 %23
store i8* %21, i8** %24
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8*, i8** %12, i64 %26
%28 = load i8*, i8** %27
%29 = load i32, i32* @stdin
%30 = call i32 @fgets(i8* %28, i32 127, i32 %29)
%31 = load i32, i32* %5
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8*, i8** %12, i64 %32
%34 = load i8*, i8** %33
%35 = load i32, i32* %5
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8*, i8** %12, i64 %36
%38 = load i8*, i8** %37
%39 = call i64 @strcspn(i8* %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%40 = getelementptr inbounds i8, i8* %34, i64 %39
store i8 0, i8* %40
br label %41
41: ; preds = %17
%42 = load i32, i32* %5
%43 = add nsw i32 %42, 1
store i32 %43, i32* %5
br label %13
44: ; preds = %13
%45 = load i32, i32* %2
%46 = call i32 @imprimeTamString(i32 %45, i8** %12)
%47 = load i8*, i8** %3
%48 = load i32, i32* %1
ret i32 %48
}

LLVM IR (-O2):
@.str = [36 x i8] c"Deseja entrar com quantas strings? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%*c\00"
@.str.3 = [13 x i8] c"String %d = \00"
@stdin = global i32 0
@.str.4 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* %1
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
%9 = alloca i8*, i64 %7
%10 = load i32, i32* %1
%11 = icmp sgt i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %15, %0
%13 = phi i32 [ %10, %0 ], [ %26, %15 ]
%14 = call i32 @imprimeTamString(i32 %13, i8** %9)
ret i32 0
15: ; preds = %0, %15
%16 = phi i64 [ %17, %15 ], [ 0, %0 ]
%17 = add nuw nsw i64 %16, 1
%18 = trunc i64 %17 to i32
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %18)
%20 = call dereferenceable_or_null(128) i8* @malloc(i32 128)
%21 = getelementptr inbounds i8*, i8** %9, i64 %16
store i8* %20, i8** %21
%22 = load i32, i32* @stdin
%23 = call i32 @fgets(i8* %20, i32 127, i32 %22)
%24 = call i64 @strcspn(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%25 = getelementptr inbounds i8, i8* %20, i64 %24
store i8 0, i8* %25
%26 = load i32, i32* %1
%27 = sext i32 %26 to i64
%28 = icmp slt i64 %17, %27
br i1 %28, label %15, label %12
}