#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int main(int argc, const char *argv[]) {
  char names[5][20] = {0};
  char theStr[100] = {0};
  printf("===== Exercise 19 =====\n");
  printf(
      "1. Stores 5 names up to 20 characteres each in an arrays of names.\n");
  printf("2. Returns each value inside the matrix as a number.\n");
  printf("Enter a name in each line without spaces.\n");
  for (int i = 0; i < 5; i++) {
    printf("(%i)", i + 1);
    scanf("%s", &*names[i]);
  }
  for (int i = 0; i < 5; i++) {
    strcat(theStr, names[i]);
  }
  printf("--> RESULT MATRIX(1): with Names \n");
  for (int i = 0; i < 5; i++) {
    for (int j = 0; j < 20; j++) {
      if (!names[i][j]) {
        printf("%c", '0');
      }
      printf("%c ", names[i][j]);
    }
    printf("\n");
  }
  printf("\n");
  printf("--> RESULT MATRIX(2): with Numbers \n");
  for (int i = 0; i < 5; i++) {
    for (int j = 0; j < 20; j++) {
      printf("%d", names[i][j]);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
lea    -0xf0(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xf4(%rbp)
cmpl   $0x5,-0xf4(%rbp)
jge    1214 <main+0xd4>
mov    -0xf4(%rbp),%esi
add    $0x1,%esi
lea    0xee3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0xf4(%rbp),%rax
lea    -0x80(%rbp),%rsi
imul   $0x14,%rax,%rax
add    %rax,%rsi
lea    0xec8(%rip),%rdi
call   1050 <scanf@plt>
mov    -0xf4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf4(%rbp)
jmp    11be <main+0x7e>
movl   $0x0,-0xf8(%rbp)
cmpl   $0x5,-0xf8(%rbp)
jge    125d <main+0x11d>
lea    -0xf0(%rbp),%rdi
movslq -0xf8(%rbp),%rax
lea    -0x80(%rbp),%rsi
imul   $0x14,%rax,%rax
add    %rax,%rsi
call   1060 <strcat@plt>
mov    -0xf8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf8(%rbp)
jmp    121e <main+0xde>
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xfc(%rbp)
cmpl   $0x5,-0xfc(%rbp)
jge    1330 <main+0x1f0>
movl   $0x0,-0x100(%rbp)
cmpl   $0x14,-0x100(%rbp)
jge    130e <main+0x1ce>
movslq -0xfc(%rbp),%rcx
lea    -0x80(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x100(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
jne    12cf <main+0x18f>
lea    0xe26(%rip),%rdi
mov    $0x30,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0xfc(%rbp),%rcx
lea    -0x80(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x100(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x100(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x100(%rbp)
jmp    128c <main+0x14c>
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xfc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfc(%rbp)
jmp    1275 <main+0x135>
lea    0xdb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x104(%rbp)
cmpl   $0x5,-0x104(%rbp)
jge    13db <main+0x29b>
movl   $0x0,-0x108(%rbp)
cmpl   $0x14,-0x108(%rbp)
jge    13b9 <main+0x279>
movslq -0x104(%rbp),%rcx
lea    -0x80(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x108(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xd77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x108(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x108(%rbp)
jmp    136d <main+0x22d>
lea    0xd27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x104(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x104(%rbp)
jmp    1356 <main+0x216>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
lea    0x50(%rsp),%rbp
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movl   $0x0,0xd0(%rsp)
lea    0xe42(%rip),%rdi
call   1040 <puts@plt>
lea    0xe4e(%rip),%rdi
call   1040 <puts@plt>
lea    0xe85(%rip),%rdi
call   1040 <puts@plt>
lea    0xeae(%rip),%rdi
call   1040 <puts@plt>
lea    0xe03(%rip),%r12
mov    %r12,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdf2(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %r12,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x14(%rsp),%r13
mov    %rbx,%rdi
mov    %r13,%rsi
call   1060 <scanf@plt>
mov    %r12,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x28(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
mov    %r12,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x3c(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
mov    %r12,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1060 <scanf@plt>
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
mov    %rsp,%rsi
call   1070 <strcat@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1070 <strcat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <strcat@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1070 <strcat@plt>
lea    0xdf1(%rip),%rdi
call   1040 <puts@plt>
lea    0xd24(%rip),%rbx
xor    %ebp,%ebp
jmp    1307 <main+0x1b7>
nopl   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    $0x14,%rbp
je     131f <main+0x1cf>
movzbl (%rsp,%rbp,1),%eax
test   %al,%al
jne    12f0 <main+0x1a0>
mov    $0x30,%edi
call   1030 <putchar@plt>
movzbl (%rsp,%rbp,1),%eax
jmp    12f0 <main+0x1a0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xcd8(%rip),%rbx
xor    %ebp,%ebp
jmp    1357 <main+0x207>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    $0x14,%rbp
je     1371 <main+0x221>
movzbl 0x14(%rsp,%rbp,1),%eax
test   %al,%al
jne    1340 <main+0x1f0>
mov    $0x30,%edi
call   1030 <putchar@plt>
movzbl 0x14(%rsp,%rbp,1),%eax
jmp    1340 <main+0x1f0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xc86(%rip),%rbx
xor    %ebp,%ebp
jmp    13a7 <main+0x257>
cs nopw 0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    $0x14,%rbp
je     13c1 <main+0x271>
movzbl 0x28(%rsp,%rbp,1),%eax
test   %al,%al
jne    1390 <main+0x240>
mov    $0x30,%edi
call   1030 <putchar@plt>
movzbl 0x28(%rsp,%rbp,1),%eax
jmp    1390 <main+0x240>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xc36(%rip),%rbx
xor    %ebp,%ebp
jmp    13f7 <main+0x2a7>
cs nopw 0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    $0x14,%rbp
je     1411 <main+0x2c1>
movzbl 0x3c(%rsp,%rbp,1),%eax
test   %al,%al
jne    13e0 <main+0x290>
mov    $0x30,%edi
call   1030 <putchar@plt>
movzbl 0x3c(%rsp,%rbp,1),%eax
jmp    13e0 <main+0x290>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xbe6(%rip),%rbx
xor    %ebp,%ebp
jmp    1447 <main+0x2f7>
cs nopw 0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    $0x14,%rbp
je     1461 <main+0x311>
movzbl 0x50(%rsp,%rbp,1),%eax
test   %al,%al
jne    1430 <main+0x2e0>
mov    $0x30,%edi
call   1030 <putchar@plt>
movzbl 0x50(%rsp,%rbp,1),%eax
jmp    1430 <main+0x2e0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xc6f(%rip),%rdi
call   1040 <puts@plt>
mov    $0x13,%ebp
lea    0xb7f(%rip),%rbx
nopl   (%rax)
movsbl -0x13(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl -0x12(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl -0x11(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl -0x10(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl -0xf(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl -0xe(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl -0xd(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl -0xc(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl -0xb(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl -0xa(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl -0x9(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl -0x8(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl -0x7(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl -0x6(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl -0x5(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl -0x4(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl -0x3(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl -0x2(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl -0x1(%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl (%rsp,%rbp,1),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x14,%rbp
cmp    $0x77,%rbp
jne    1490 <main+0x340>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"===== Exercise 19 =====\0A\00"
@.str.1 = [68 x i8] c"1. Stores 5 names up to 20 characteres each in an arrays of names.\0A\00"
@.str.2 = [54 x i8] c"2. Returns each value inside the matrix as a number.\0A\00"
@.str.3 = [43 x i8] c"Enter a name in each line without spaces.\0A\00"
@.str.4 = [5 x i8] c"(%i)\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [35 x i8] c"--> RESULT MATRIX(1): with Names \0A\00"
@.str.7 = [3 x i8] c"%c\00"
@.str.8 = [4 x i8] c"%c \00"
@.str.9 = [2 x i8] c"\0A\00"
@.str.10 = [37 x i8] c"--> RESULT MATRIX(2): with Numbers \0A\00"
@.str.11 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x [20 x i8]]
%7 = alloca [100 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = bitcast [5 x [20 x i8]]* %6 to i8*
%15 = bitcast [100 x i8]* %7 to i8*
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %8
br label %20
20: ; preds = %32, %2
%21 = load i32, i32* %8
%22 = icmp slt i32 %21, 5
br i1 %22, label %23, label %35
23: ; preds = %20
%24 = load i32, i32* %8
%25 = add nsw i32 %24, 1
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %25)
%27 = load i32, i32* %8
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %6, i64 0, i64 %28
%30 = getelementptr inbounds [20 x i8], [20 x i8]* %29, i64 0, i64 0
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %30)
br label %32
32: ; preds = %23
%33 = load i32, i32* %8
%34 = add nsw i32 %33, 1
store i32 %34, i32* %8
br label %20
35: ; preds = %20
store i32 0, i32* %9
br label %36
36: ; preds = %46, %35
%37 = load i32, i32* %9
%38 = icmp slt i32 %37, 5
br i1 %38, label %39, label %49
39: ; preds = %36
%40 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%41 = load i32, i32* %9
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %6, i64 0, i64 %42
%44 = getelementptr inbounds [20 x i8], [20 x i8]* %43, i64 0, i64 0
%45 = call i32 @strcat(i8* %40, i8* %44)
br label %46
46: ; preds = %39
%47 = load i32, i32* %9
%48 = add nsw i32 %47, 1
store i32 %48, i32* %9
br label %36
49: ; preds = %36
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %10
br label %51
51: ; preds = %84, %49
%52 = load i32, i32* %10
%53 = icmp slt i32 %52, 5
br i1 %53, label %54, label %87
54: ; preds = %51
store i32 0, i32* %11
br label %55
55: ; preds = %79, %54
%56 = load i32, i32* %11
%57 = icmp slt i32 %56, 20
br i1 %57, label %58, label %82
58: ; preds = %55
%59 = load i32, i32* %10
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %6, i64 0, i64 %60
%62 = load i32, i32* %11
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [20 x i8], [20 x i8]* %61, i64 0, i64 %63
%65 = load i8, i8* %64
%66 = icmp ne i8 %65, 0
br i1 %66, label %69, label %67
67: ; preds = %58
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32 48)
br label %69
69: ; preds = %67, %58
%70 = load i32, i32* %10
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %6, i64 0, i64 %71
%73 = load i32, i32* %11
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [20 x i8], [20 x i8]* %72, i64 0, i64 %74
%76 = load i8, i8* %75
%77 = sext i8 %76 to i32
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %77)
br label %79
79: ; preds = %69
%80 = load i32, i32* %11
%81 = add nsw i32 %80, 1
store i32 %81, i32* %11
br label %55
82: ; preds = %55
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %84
84: ; preds = %82
%85 = load i32, i32* %10
%86 = add nsw i32 %85, 1
store i32 %86, i32* %10
br label %51
87: ; preds = %51
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %12
br label %90
90: ; preds = %112, %87
%91 = load i32, i32* %12
%92 = icmp slt i32 %91, 5
br i1 %92, label %93, label %115
93: ; preds = %90
store i32 0, i32* %13
br label %94
94: ; preds = %107, %93
%95 = load i32, i32* %13
%96 = icmp slt i32 %95, 20
br i1 %96, label %97, label %110
97: ; preds = %94
%98 = load i32, i32* %12
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %6, i64 0, i64 %99
%101 = load i32, i32* %13
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [20 x i8], [20 x i8]* %100, i64 0, i64 %102
%104 = load i8, i8* %103
%105 = sext i8 %104 to i32
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %105)
br label %107
107: ; preds = %97
%108 = load i32, i32* %13
%109 = add nsw i32 %108, 1
store i32 %109, i32* %13
br label %94
110: ; preds = %94
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %112
112: ; preds = %110
%113 = load i32, i32* %12
%114 = add nsw i32 %113, 1
store i32 %114, i32* %12
br label %90
115: ; preds = %90
ret i32 0
}

LLVM IR (-O2):
@.str.4 = [5 x i8] c"(%i)\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.8 = [4 x i8] c"%c \00"
@.str.11 = [3 x i8] c"%d\00"
@str = [24 x i8] c"===== Exercise 19 =====\00"
@str.12 = [67 x i8] c"1. Stores 5 names up to 20 characteres each in an arrays of names.\00"
@str.13 = [53 x i8] c"2. Returns each value inside the matrix as a number.\00"
@str.14 = [42 x i8] c"Enter a name in each line without spaces.\00"
@str.15 = [34 x i8] c"--> RESULT MATRIX(1): with Names \00"
@str.16 = [36 x i8] c"--> RESULT MATRIX(2): with Numbers \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x [20 x i8]]
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str.12, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.13, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.14, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 1)
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %5)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 2)
%14 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 1, i64 0
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %14)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 3)
%17 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 2, i64 0
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %17)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 4)
%20 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 3, i64 0
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %20)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 5)
%23 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 4, i64 0
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %23)
%25 = call i32 @strcat(i8* %6, i8* %5)
%26 = call i32 @strcat(i8* %6, i8* %14)
%27 = call i32 @strcat(i8* %6, i8* %17)
%28 = call i32 @strcat(i8* %6, i8* %20)
%29 = call i32 @strcat(i8* %6, i8* %23)
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.15, i64 0, i64 0))
br label %99
31: ; preds = %107
%32 = call i32 @putchar(i32 10)
br label %33
33: ; preds = %41, %31
%34 = phi i64 [ 0, %31 ], [ %45, %41 ]
%35 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 1, i64 %34
%36 = load i8, i8* %35
%37 = icmp eq i8 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %33
%39 = call i32 @putchar(i32 48)
%40 = load i8, i8* %35
br label %41
41: ; preds = %38, %33
%42 = phi i8 [ %40, %38 ], [ %36, %33 ]
%43 = sext i8 %42 to i32
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %43)
%45 = add nuw nsw i64 %34, 1
%46 = icmp eq i64 %45, 20
br i1 %46, label %47, label %33
47: ; preds = %41
%48 = call i32 @putchar(i32 10)
br label %49
49: ; preds = %57, %47
%50 = phi i64 [ 0, %47 ], [ %61, %57 ]
%51 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 2, i64 %50
%52 = load i8, i8* %51
%53 = icmp eq i8 %52, 0
br i1 %53, label %54, label %57
54: ; preds = %49
%55 = call i32 @putchar(i32 48)
%56 = load i8, i8* %51
br label %57
57: ; preds = %54, %49
%58 = phi i8 [ %56, %54 ], [ %52, %49 ]
%59 = sext i8 %58 to i32
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %59)
%61 = add nuw nsw i64 %50, 1
%62 = icmp eq i64 %61, 20
br i1 %62, label %63, label %49
63: ; preds = %57
%64 = call i32 @putchar(i32 10)
br label %65
65: ; preds = %73, %63
%66 = phi i64 [ 0, %63 ], [ %77, %73 ]
%67 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 3, i64 %66
%68 = load i8, i8* %67
%69 = icmp eq i8 %68, 0
br i1 %69, label %70, label %73
70: ; preds = %65
%71 = call i32 @putchar(i32 48)
%72 = load i8, i8* %67
br label %73
73: ; preds = %70, %65
%74 = phi i8 [ %72, %70 ], [ %68, %65 ]
%75 = sext i8 %74 to i32
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %75)
%77 = add nuw nsw i64 %66, 1
%78 = icmp eq i64 %77, 20
br i1 %78, label %79, label %65
79: ; preds = %73
%80 = call i32 @putchar(i32 10)
br label %81
81: ; preds = %89, %79
%82 = phi i64 [ 0, %79 ], [ %93, %89 ]
%83 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 4, i64 %82
%84 = load i8, i8* %83
%85 = icmp eq i8 %84, 0
br i1 %85, label %86, label %89
86: ; preds = %81
%87 = call i32 @putchar(i32 48)
%88 = load i8, i8* %83
br label %89
89: ; preds = %86, %81
%90 = phi i8 [ %88, %86 ], [ %84, %81 ]
%91 = sext i8 %90 to i32
%92 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %91)
%93 = add nuw nsw i64 %82, 1
%94 = icmp eq i64 %93, 20
br i1 %94, label %95, label %81
95: ; preds = %89
%96 = call i32 @putchar(i32 10)
%97 = call i32 @putchar(i32 10)
%98 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.16, i64 0, i64 0))
br label %113
99: ; preds = %2, %107
%100 = phi i64 [ 0, %2 ], [ %111, %107 ]
%101 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 0, i64 %100
%102 = load i8, i8* %101
%103 = icmp eq i8 %102, 0
br i1 %103, label %104, label %107
104: ; preds = %99
%105 = call i32 @putchar(i32 48)
%106 = load i8, i8* %101
br label %107
107: ; preds = %104, %99
%108 = phi i8 [ %106, %104 ], [ %102, %99 ]
%109 = sext i8 %108 to i32
%110 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %109)
%111 = add nuw nsw i64 %100, 1
%112 = icmp eq i64 %111, 20
br i1 %112, label %31, label %99
113: ; preds = %95, %113
%114 = phi i64 [ 0, %95 ], [ %196, %113 ]
%115 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 %114, i64 0
%116 = load i8, i8* %115
%117 = sext i8 %116 to i32
%118 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %117)
%119 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 %114, i64 1
%120 = load i8, i8* %119
%121 = sext i8 %120 to i32
%122 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %121)
%123 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 %114, i64 2
%124 = load i8, i8* %123
%125 = sext i8 %124 to i32
%126 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %125)
%127 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 %114, i64 3
%128 = load i8, i8* %127
%129 = sext i8 %128 to i32
%130 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %129)
%131 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 %114, i64 4
%132 = load i8, i8* %131
%133 = sext i8 %132 to i32
%134 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %133)
%135 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 %114, i64 5
%136 = load i8, i8* %135
%137 = sext i8 %136 to i32
%138 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %137)
%139 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 %114, i64 6
%140 = load i8, i8* %139
%141 = sext i8 %140 to i32
%142 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %141)
%143 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 %114, i64 7
%144 = load i8, i8* %143
%145 = sext i8 %144 to i32
%146 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %145)
%147 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 %114, i64 8
%148 = load i8, i8* %147
%149 = sext i8 %148 to i32
%150 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %149)
%151 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 %114, i64 9
%152 = load i8, i8* %151
%153 = sext i8 %152 to i32
%154 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %153)
%155 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 %114, i64 10
%156 = load i8, i8* %155
%157 = sext i8 %156 to i32
%158 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %157)
%159 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 %114, i64 11
%160 = load i8, i8* %159
%161 = sext i8 %160 to i32
%162 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %161)
%163 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 %114, i64 12
%164 = load i8, i8* %163
%165 = sext i8 %164 to i32
%166 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %165)
%167 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 %114, i64 13
%168 = load i8, i8* %167
%169 = sext i8 %168 to i32
%170 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %169)
%171 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 %114, i64 14
%172 = load i8, i8* %171
%173 = sext i8 %172 to i32
%174 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %173)
%175 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 %114, i64 15
%176 = load i8, i8* %175
%177 = sext i8 %176 to i32
%178 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %177)
%179 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 %114, i64 16
%180 = load i8, i8* %179
%181 = sext i8 %180 to i32
%182 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %181)
%183 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 %114, i64 17
%184 = load i8, i8* %183
%185 = sext i8 %184 to i32
%186 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %185)
%187 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 %114, i64 18
%188 = load i8, i8* %187
%189 = sext i8 %188 to i32
%190 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %189)
%191 = getelementptr inbounds [5 x [20 x i8]], [5 x [20 x i8]]* %3, i64 0, i64 %114, i64 19
%192 = load i8, i8* %191
%193 = sext i8 %192 to i32
%194 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %193)
%195 = call i32 @putchar(i32 10)
%196 = add nuw nsw i64 %114, 1
%197 = icmp eq i64 %196, 5
br i1 %197, label %198, label %113
198: ; preds = %113
ret i32 0
}