#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 longitud_string(char *);
int /*<<< orphan*/ printf(char *, char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char str_1[100], str_2[100], str_3[100], str_4[100];
  scanf("%s", str_1);
  scanf("%s", str_2);
  scanf("%s", str_3);
  scanf("%s", str_4);
  char *str[] = {str_1, str_2, str_3, str_4};
  int j = 0;
  for (j = 0; j < 4; j++) {
    printf("longitud de %s : %d\n", str[j], longitud_string(str[j]));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1040 <scanf@plt>
lea    -0xe0(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x150(%rbp),%rsi
lea    0xe8d(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x1c0(%rbp),%rsi
lea    0xe7a(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x70(%rbp),%rax
mov    %rax,-0x1e0(%rbp)
lea    -0xe0(%rbp),%rax
mov    %rax,-0x1d8(%rbp)
lea    -0x150(%rbp),%rax
mov    %rax,-0x1d0(%rbp)
lea    -0x1c0(%rbp),%rax
mov    %rax,-0x1c8(%rbp)
movl   $0x0,-0x1e4(%rbp)
movl   $0x0,-0x1e4(%rbp)
cmpl   $0x4,-0x1e4(%rbp)
jge    1234 <main+0x104>
movslq -0x1e4(%rbp),%rax
mov    -0x1e0(%rbp,%rax,8),%rax
ff
mov    %rax,-0x1f0(%rbp)
movslq -0x1e4(%rbp),%rax
mov    -0x1e0(%rbp,%rax,8),%rdi
ff
call   1050 <longitud_string@plt>
mov    -0x1f0(%rbp),%rsi
mov    %eax,%edx
lea    0xde8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1e4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1e4(%rbp)
jmp    11d4 <main+0xa4>
xor    %eax,%eax
add    $0x1f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1c0,%rsp
lea    0xeb9(%rip),%rbx
lea    0x150(%rsp),%r13
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <scanf@plt>
lea    0xe0(%rsp),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
lea    0x70(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
mov    %r13,%rdi
call   1050 <longitud_string@plt>
lea    0xe69(%rip),%rbx
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %r12,%rdi
call   1050 <longitud_string@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %r15,%rdi
call   1050 <longitud_string@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %r14,%rdi
call   1050 <longitud_string@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1c0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [21 x i8] c"longitud de %s : %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = alloca [100 x i8]
%6 = alloca [4 x i8*]
%7 = alloca i32
store i32 0, i32* %1
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [4 x i8*], [4 x i8*]* %6, i64 0, i64 0
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
store i8* %17, i8** %16
%18 = getelementptr inbounds i8*, i8** %16, i64 1
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
store i8* %19, i8** %18
%20 = getelementptr inbounds i8*, i8** %18, i64 1
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
store i8* %21, i8** %20
%22 = getelementptr inbounds i8*, i8** %20, i64 1
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
store i8* %23, i8** %22
store i32 0, i32* %7
store i32 0, i32* %7
br label %24
24: ; preds = %38, %0
%25 = load i32, i32* %7
%26 = icmp slt i32 %25, 4
br i1 %26, label %27, label %41
27: ; preds = %24
%28 = load i32, i32* %7
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [4 x i8*], [4 x i8*]* %6, i64 0, i64 %29
%31 = load i8*, i8** %30
%32 = load i32, i32* %7
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [4 x i8*], [4 x i8*]* %6, i64 0, i64 %33
%35 = load i8*, i8** %34
%36 = call i32 @longitud_string(i8* %35)
%37 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %31, i32 %36)
br label %38
38: ; preds = %27
%39 = load i32, i32* %7
%40 = add nsw i32 %39, 1
store i32 %40, i32* %7
br label %24
41: ; preds = %24
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [21 x i8] c"longitud de %s : %d\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
%13 = call i32 @longitud_string(i8* %5)
%14 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32 %13)
%15 = call i32 @longitud_string(i8* %6)
%16 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %6, i32 %15)
%17 = call i32 @longitud_string(i8* %7)
%18 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %7, i32 %17)
%19 = call i32 @longitud_string(i8* %8)
%20 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %8, i32 %19)
ret i32 0
}