#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 **);
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][127 + 1];
  for (int i = 0; i < numStrings; i++) {
    printf("String %d = ", i + 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    0xe9a(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x29(%rbp)
call   1030 <printf@plt>
mov    -0x29(%rbp),%al
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x29(%rbp),%al
lea    0xe9a(%rip),%rdi
call   1070 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rdx
shl    $0x7,%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    1243 <main+0xf3>
mov    -0x1c(%rbp),%esi
add    $0x1,%esi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rdi
movslq -0x1c(%rbp),%rax
shl    $0x7,%rax
add    %rax,%rdi
mov    0x2df7(%rip),%rax
mov    (%rax),%edx
mov    $0x7f,%esi
call   1050 <fgets@plt>
mov    -0x28(%rbp),%rdi
movslq -0x1c(%rbp),%rcx
shl    $0x7,%rcx
mov    %rdi,%rax
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
movslq -0x1c(%rbp),%rax
shl    $0x7,%rax
add    %rax,%rdi
lea    0xe13(%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    11bb <main+0x6b>
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    0xe98(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeae(%rip),%rdi
lea    -0x2c(%rbp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0xe9f(%rip),%rdi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    %rsp,%rbx
mov    -0x2c(%rbp),%eax
mov    %rsp,%rsi
shl    $0x7,%rax
sub    %rax,%rsi
mov    %rsi,%rsp
mov    -0x2c(%rbp),%edi
test   %edi,%edi
jle    1215 <main+0xc5>
mov    %rbx,-0x40(%rbp)
lea    0xe77(%rip),%r15
mov    0x2e2d(%rip),%r14
lea    0xe76(%rip),%r12
mov    %rsi,-0x38(%rbp)
mov    %rsi,%rbx
xor    %r13d,%r13d
nopl   0x0(%rax)
add    $0x1,%r13
mov    %r15,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%r14),%edx
mov    %rbx,%rdi
mov    $0x7f,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <strcspn@plt>
movb   $0x0,(%rbx,%rax,1)
movslq -0x2c(%rbp),%rdi
sub    $0xffffffffffffff80,%rbx
cmp    %rdi,%r13
jl     11d0 <main+0x80>
mov    -0x40(%rbp),%rbx
mov    -0x38(%rbp),%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 [128 x i8], i64 %10
store i64 %10, i64* %4
store i32 0, i32* %5
br label %13
13: ; preds = %36, %0
%14 = load i32, i32* %5
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %39
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 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [128 x i8], [128 x i8]* %12, i64 %22
%24 = getelementptr inbounds [128 x i8], [128 x i8]* %23, i64 0, i64 0
%25 = load i32, i32* @stdin
%26 = call i32 @fgets(i8* %24, i32 127, i32 %25)
%27 = load i32, i32* %5
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [128 x i8], [128 x i8]* %12, i64 %28
%30 = load i32, i32* %5
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [128 x i8], [128 x i8]* %12, i64 %31
%33 = getelementptr inbounds [128 x i8], [128 x i8]* %32, i64 0, i64 0
%34 = call i64 @strcspn(i8* %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%35 = getelementptr inbounds [128 x i8], [128 x i8]* %29, i64 0, i64 %34
store i8 0, i8* %35
br label %36
36: ; preds = %17
%37 = load i32, i32* %5
%38 = add nsw i32 %37, 1
store i32 %38, i32* %5
br label %13
39: ; preds = %13
%40 = load i32, i32* %2
%41 = bitcast [128 x i8]* %12 to i8**
%42 = call i32 @imprimeTamString(i32 %40, i8** %41)
%43 = load i8*, i8** %3
%44 = load i32, i32* %1
ret i32 %44
}

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 [128 x i8], i64 %7
%10 = load i32, i32* %1
%11 = icmp sgt i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %16, %0
%13 = phi i32 [ %10, %0 ], [ %26, %16 ]
%14 = bitcast [128 x i8]* %9 to i8**
%15 = call i32 @imprimeTamString(i32 %13, i8** %14)
ret i32 0
16: ; preds = %0, %16
%17 = phi i64 [ %18, %16 ], [ 0, %0 ]
%18 = add nuw nsw i64 %17, 1
%19 = trunc i64 %18 to i32
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %19)
%21 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 %17, i64 0
%22 = load i32, i32* @stdin
%23 = call i32 @fgets(i8* %21, i32 127, i32 %22)
%24 = call i64 @strcspn(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%25 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 %17, i64 %24
store i8 0, i8* %25
%26 = load i32, i32* %1
%27 = sext i32 %26 to i64
%28 = icmp slt i64 %18, %27
br i1 %28, label %16, label %12
}