#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*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int strlen(char *);
int main() {
  char input[100][100];
  int i;
  int count, longest = 0, longest_index = 0;
  for (i = 0; i < 100 && input[i - 1][0] != '*'; i++) {
    printf("\nInserisci nome (dio porco): ");
    gets(input[i]);
  }
  count = i - 2;
  printf("\nNomi inseriti: %d", count);
  for (i = 0; i < count; i++) {
    if (strlen(input[i]) > longest) {
      longest = (int)strlen(input[i]);
      longest_index = i;
    }
  }
  printf("\nNome più lungo inserito (dio cane): ");
  puts(input[longest_index]);
  printf("[debug]: alfabeto italiano (dio cane)");
  for (i = 65; i < 90; i++) {
    printf("%c", (char)i);
  }
  for (i = 0; i < count; i++) {
    printf("%d. ", i);
    puts(input[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2740,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x272c(%rbp)
movl   $0x0,-0x2730(%rbp)
movl   $0x0,-0x2724(%rbp)
xor    %eax,%eax
cmpl   $0x64,-0x2724(%rbp)
mov    %al,-0x2731(%rbp)
jge    11ae <main+0x6e>
mov    -0x2724(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0x2720(%rbp),%rax
imul   $0x64,%rcx,%rcx
add    %rcx,%rax
movsbl (%rax),%eax
cmp    $0x2a,%eax
setne  %al
mov    %al,-0x2731(%rbp)
mov    -0x2731(%rbp),%al
test   $0x1,%al
jne    11c1 <main+0x81>
jmp    11fd <main+0xbd>
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movslq -0x2724(%rbp),%rax
lea    -0x2720(%rbp),%rdi
imul   $0x64,%rax,%rax
add    %rax,%rdi
call   1060 <gets@plt>
mov    -0x2724(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2724(%rbp)
jmp    1170 <main+0x30>
mov    -0x2724(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x2728(%rbp)
mov    -0x2728(%rbp),%esi
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x2724(%rbp)
mov    -0x2724(%rbp),%eax
cmp    -0x2728(%rbp),%eax
jge    12a7 <main+0x167>
movslq -0x2724(%rbp),%rax
lea    -0x2720(%rbp),%rdi
imul   $0x64,%rax,%rax
add    %rax,%rdi
call   1040 <strlen@plt>
cmp    -0x272c(%rbp),%eax
jle    128e <main+0x14e>
movslq -0x2724(%rbp),%rax
lea    -0x2720(%rbp),%rdi
imul   $0x64,%rax,%rax
add    %rax,%rdi
call   1040 <strlen@plt>
mov    %eax,-0x272c(%rbp)
mov    -0x2724(%rbp),%eax
mov    %eax,-0x2730(%rbp)
jmp    1293 <main+0x153>
mov    -0x2724(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2724(%rbp)
jmp    122a <main+0xea>
lea    0xd83(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movslq -0x2730(%rbp),%rax
lea    -0x2720(%rbp),%rdi
imul   $0x64,%rax,%rax
add    %rax,%rdi
call   1030 <puts@plt>
lea    0xd82(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x41,-0x2724(%rbp)
cmpl   $0x5a,-0x2724(%rbp)
jge    131f <main+0x1df>
mov    -0x2724(%rbp),%eax
movsbl %al,%esi
lea    0xd7a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x2724(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2724(%rbp)
jmp    12e7 <main+0x1a7>
movl   $0x0,-0x2724(%rbp)
mov    -0x2724(%rbp),%eax
cmp    -0x2728(%rbp),%eax
jge    137d <main+0x23d>
mov    -0x2724(%rbp),%esi
lea    0xd39(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movslq -0x2724(%rbp),%rax
lea    -0x2720(%rbp),%rdi
imul   $0x64,%rax,%rax
add    %rax,%rdi
call   1030 <puts@plt>
mov    -0x2724(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2724(%rbp)
jmp    1329 <main+0x1e9>
xor    %eax,%eax
add    $0x2740,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x2710,%rsp
mov    %rsp,%rbx
lea    0xe97(%rip),%r14
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
cmpb   $0x2a,-0x64(%rbx)
je     11b1 <main+0x61>
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1070 <gets@plt>
add    $0xffffffffffffffff,%rbp
add    $0x64,%rbx
cmp    $0xffffffffffffff9c,%rbp
jne    1170 <main+0x20>
lea    0xe81(%rip),%rdi
mov    $0x62,%r14d
mov    $0x62,%esi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    11d8 <main+0x88>
mov    %ebp,%ebx
neg    %ebx
mov    $0xfffffffffffffffe,%r14
sub    %rbp,%r14
lea    0xe58(%rip),%rdi
xor    %r15d,%r15d
mov    %r14d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0x3,%ebx
jl     121e <main+0xce>
mov    %r14d,%r14d
xor    %ebp,%ebp
mov    %rsp,%rbx
xor    %r15d,%r15d
xor    %r12d,%r12d
jmp    11fd <main+0xad>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbp
add    $0x64,%rbx
cmp    %rbp,%r14
je     121a <main+0xca>
mov    %rbx,%rdi
call   1050 <strlen@plt>
cmp    %r12d,%eax
jle    11f0 <main+0xa0>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %eax,%r12d
mov    %ebp,%r15d
jmp    11f0 <main+0xa0>
mov    $0x1,%bl
jmp    1220 <main+0xd0>
xor    %ebx,%ebx
lea    0xe0a(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movslq %r15d,%rax
imul   $0x64,%rax,%rax
lea    (%rsp,%rax,1),%rdi
call   1040 <puts@plt>
lea    0xe13(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x41,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    $0x43,%edi
call   1030 <putchar@plt>
mov    $0x44,%edi
call   1030 <putchar@plt>
mov    $0x45,%edi
call   1030 <putchar@plt>
mov    $0x46,%edi
call   1030 <putchar@plt>
mov    $0x47,%edi
call   1030 <putchar@plt>
mov    $0x48,%edi
call   1030 <putchar@plt>
mov    $0x49,%edi
call   1030 <putchar@plt>
mov    $0x4a,%edi
call   1030 <putchar@plt>
mov    $0x4b,%edi
call   1030 <putchar@plt>
mov    $0x4c,%edi
call   1030 <putchar@plt>
mov    $0x4d,%edi
call   1030 <putchar@plt>
mov    $0x4e,%edi
call   1030 <putchar@plt>
mov    $0x4f,%edi
call   1030 <putchar@plt>
mov    $0x50,%edi
call   1030 <putchar@plt>
mov    $0x51,%edi
call   1030 <putchar@plt>
mov    $0x52,%edi
call   1030 <putchar@plt>
mov    $0x53,%edi
call   1030 <putchar@plt>
mov    $0x54,%edi
call   1030 <putchar@plt>
mov    $0x55,%edi
call   1030 <putchar@plt>
mov    $0x56,%edi
call   1030 <putchar@plt>
mov    $0x57,%edi
call   1030 <putchar@plt>
mov    $0x58,%edi
call   1030 <putchar@plt>
mov    $0x59,%edi
call   1030 <putchar@plt>
test   %bl,%bl
je     1381 <main+0x231>
mov    %r14d,%r15d
mov    %rsp,%rbx
lea    0xd27(%rip),%r14
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
add    $0x1,%rbp
add    $0x64,%rbx
cmp    %rbp,%r15
jne    1360 <main+0x210>
xor    %eax,%eax
add    $0x2710,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"\0AInserisci nome (dio porco): \00"
@.str.1 = [19 x i8] c"\0ANomi inseriti: %d\00"
@.str.2 = [39 x i8] c"\0ANome pi\C3\B9 lungo inserito (dio cane): \00"
@.str.3 = [38 x i8] c"[debug]: alfabeto italiano (dio cane)\00"
@.str.4 = [3 x i8] c"%c\00"
@.str.5 = [5 x i8] c"%d. \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x [100 x i8]]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %3
br label %7
7: ; preds = %28, %0
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 100
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %2, i64 0, i64 %13
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i64 0, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 42
br label %19
19: ; preds = %10, %7
%20 = phi i1 [ false, %7 ], [ %18, %10 ]
br i1 %20, label %21, label %31
21: ; preds = %19
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %2, i64 0, i64 %24
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %25, i64 0, i64 0
%27 = call i32 @gets(i8* %26)
br label %28
28: ; preds = %21
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %7
31: ; preds = %19
%32 = load i32, i32* %3
%33 = sub nsw i32 %32, 2
store i32 %33, i32* %4
%34 = load i32, i32* %4
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %34)
store i32 0, i32* %3
br label %36
36: ; preds = %56, %31
%37 = load i32, i32* %3
%38 = load i32, i32* %4
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %59
40: ; preds = %36
%41 = load i32, i32* %3
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %2, i64 0, i64 %42
%44 = getelementptr inbounds [100 x i8], [100 x i8]* %43, i64 0, i64 0
%45 = call i32 @strlen(i8* %44)
%46 = load i32, i32* %5
%47 = icmp sgt i32 %45, %46
br i1 %47, label %48, label %55
48: ; preds = %40
%49 = load i32, i32* %3
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %2, i64 0, i64 %50
%52 = getelementptr inbounds [100 x i8], [100 x i8]* %51, i64 0, i64 0
%53 = call i32 @strlen(i8* %52)
store i32 %53, i32* %5
%54 = load i32, i32* %3
store i32 %54, i32* %6
br label %55
55: ; preds = %48, %40
br label %56
56: ; preds = %55
%57 = load i32, i32* %3
%58 = add nsw i32 %57, 1
store i32 %58, i32* %3
br label %36
59: ; preds = %36
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%61 = load i32, i32* %6
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %2, i64 0, i64 %62
%64 = getelementptr inbounds [100 x i8], [100 x i8]* %63, i64 0, i64 0
%65 = call i32 @puts(i8* %64)
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
store i32 65, i32* %3
br label %67
67: ; preds = %75, %59
%68 = load i32, i32* %3
%69 = icmp slt i32 %68, 90
br i1 %69, label %70, label %78
70: ; preds = %67
%71 = load i32, i32* %3
%72 = trunc i32 %71 to i8
%73 = sext i8 %72 to i32
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %73)
br label %75
75: ; preds = %70
%76 = load i32, i32* %3
%77 = add nsw i32 %76, 1
store i32 %77, i32* %3
br label %67
78: ; preds = %67
store i32 0, i32* %3
br label %79
79: ; preds = %91, %78
%80 = load i32, i32* %3
%81 = load i32, i32* %4
%82 = icmp slt i32 %80, %81
br i1 %82, label %83, label %94
83: ; preds = %79
%84 = load i32, i32* %3
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %84)
%86 = load i32, i32* %3
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %2, i64 0, i64 %87
%89 = getelementptr inbounds [100 x i8], [100 x i8]* %88, i64 0, i64 0
%90 = call i32 @puts(i8* %89)
br label %91
91: ; preds = %83
%92 = load i32, i32* %3
%93 = add nsw i32 %92, 1
store i32 %93, i32* %3
br label %79
94: ; preds = %79
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"\0AInserisci nome (dio porco): \00"
@.str.1 = [19 x i8] c"\0ANomi inseriti: %d\00"
@.str.2 = [39 x i8] c"\0ANome pi\C3\B9 lungo inserito (dio cane): \00"
@.str.3 = [38 x i8] c"[debug]: alfabeto italiano (dio cane)\00"
@.str.5 = [5 x i8] c"%d. \00"
define i32 @main() {
%1 = alloca [100 x [100 x i8]]
%2 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %1, i64 0, i64 0, i64 0
br label %3
3: ; preds = %0, %9
%4 = phi i64 [ 0, %0 ], [ %13, %9 ]
%5 = add nsw i64 %4, -1
%6 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %1, i64 0, i64 %5, i64 0
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 42
br i1 %8, label %17, label %9
9: ; preds = %3
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%11 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %1, i64 0, i64 %4, i64 0
%12 = call i32 @gets(i8* %11)
%13 = add nuw nsw i64 %4, 1
%14 = icmp eq i64 %13, 100
br i1 %14, label %15, label %3
15: ; preds = %9
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 98)
br label %22
17: ; preds = %3
%18 = trunc i64 %4 to i32
%19 = add nsw i32 %18, -2
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = icmp sgt i32 %18, 2
br i1 %21, label %22, label %40
22: ; preds = %15, %17
%23 = phi i32 [ 98, %15 ], [ %19, %17 ]
%24 = zext i32 %23 to i64
br label %25
25: ; preds = %22, %35
%26 = phi i64 [ 0, %22 ], [ %38, %35 ]
%27 = phi i32 [ 0, %22 ], [ %37, %35 ]
%28 = phi i32 [ 0, %22 ], [ %36, %35 ]
%29 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %1, i64 0, i64 %26, i64 0
%30 = call i32 @strlen(i8* %29)
%31 = icmp sgt i32 %30, %28
br i1 %31, label %32, label %35
32: ; preds = %25
%33 = call i32 @strlen(i8* %29)
%34 = trunc i64 %26 to i32
br label %35
35: ; preds = %25, %32
%36 = phi i32 [ %33, %32 ], [ %28, %25 ]
%37 = phi i32 [ %34, %32 ], [ %27, %25 ]
%38 = add nuw nsw i64 %26, 1
%39 = icmp eq i64 %38, %24
br i1 %39, label %40, label %25
40: ; preds = %35, %17
%41 = phi i1 [ false, %17 ], [ true, %35 ]
%42 = phi i32 [ %19, %17 ], [ %23, %35 ]
%43 = phi i32 [ 0, %17 ], [ %37, %35 ]
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%45 = sext i32 %43 to i64
%46 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %1, i64 0, i64 %45, i64 0
%47 = call i32 @puts(i8* %46)
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%49 = call i32 @putchar(i32 65)
%50 = call i32 @putchar(i32 66)
%51 = call i32 @putchar(i32 67)
%52 = call i32 @putchar(i32 68)
%53 = call i32 @putchar(i32 69)
%54 = call i32 @putchar(i32 70)
%55 = call i32 @putchar(i32 71)
%56 = call i32 @putchar(i32 72)
%57 = call i32 @putchar(i32 73)
%58 = call i32 @putchar(i32 74)
%59 = call i32 @putchar(i32 75)
%60 = call i32 @putchar(i32 76)
%61 = call i32 @putchar(i32 77)
%62 = call i32 @putchar(i32 78)
%63 = call i32 @putchar(i32 79)
%64 = call i32 @putchar(i32 80)
%65 = call i32 @putchar(i32 81)
%66 = call i32 @putchar(i32 82)
%67 = call i32 @putchar(i32 83)
%68 = call i32 @putchar(i32 84)
%69 = call i32 @putchar(i32 85)
%70 = call i32 @putchar(i32 86)
%71 = call i32 @putchar(i32 87)
%72 = call i32 @putchar(i32 88)
%73 = call i32 @putchar(i32 89)
br i1 %41, label %74, label %84
74: ; preds = %40
%75 = zext i32 %42 to i64
br label %76
76: ; preds = %74, %76
%77 = phi i64 [ 0, %74 ], [ %82, %76 ]
%78 = trunc i64 %77 to i32
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %78)
%80 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %1, i64 0, i64 %77, i64 0
%81 = call i32 @puts(i8* %80)
%82 = add nuw nsw i64 %77, 1
%83 = icmp eq i64 %82, %75
br i1 %83, label %84, label %76
84: ; preds = %76, %40
ret i32 0
}