#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char strg[100][25];
  char temp[25];
  int i = 0;
  int j, k, l;
  int longTotal;
  int longTemp;
  FILE *p_file;
  int *p_lngTo;
  int *p_lngTe;
  p_lngTo = &longTotal;
  p_lngTe = &longTemp;
  *p_lngTo = 0;
  *p_lngTe = 0;
  p_file = fopen("/root/practica2/Entrada2e.txt", "r");
  if (!p_file) {
    return 1;
  }
  while (1) {
    if (feof(p_file)) {
      break;
    }
    fscanf(p_file, "%s", strg[i]);
    i++;
    longTotal++;
  }
  for (j = 0; j < longTotal; j++) {
    printf("%s ", strg[j]);
  }
  printf("\n");
  *p_lngTe = *p_lngTo;
  while (longTemp > 0) {
    for (k = 0; k < (longTemp - 1); k++) {
      if (strcmp(strg[k], strg[k + 1]) > 0) {
        strcpy(temp, strg[k + 1]);
        strcpy(strg[k + 1], strg[k]);
        strcpy(strg[k], temp);
      }
    }
    longTemp--;
  }
  for (l = 0; l < *p_lngTo; l++) {
    printf("%s ", strg[l]);
  }
  fclose(p_file);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x9f4(%rbp)
lea    -0xa04(%rbp),%rax
mov    %rax,-0xa18(%rbp)
lea    -0xa08(%rbp),%rax
mov    %rax,-0xa20(%rbp)
mov    -0xa18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0xa20(%rbp),%rax
movl   $0x0,(%rax)
lea    0xe37(%rip),%rdi
lea    0xe4e(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0xa10(%rbp)
cmpq   $0x0,-0xa10(%rbp)
jne    11f6 <main+0x86>
movl   $0x1,-0x4(%rbp)
jmp    144e <main+0x2de>
jmp    11fb <main+0x8b>
mov    -0xa10(%rbp),%rdi
call   1080 <feof@plt>
cmp    $0x0,%rax
je     1216 <main+0xa6>
jmp    1261 <main+0xf1>
mov    -0xa10(%rbp),%rdi
movslq -0x9f4(%rbp),%rax
lea    -0x9d0(%rbp),%rdx
imul   $0x19,%rax,%rax
add    %rax,%rdx
lea    0xde7(%rip),%rsi
call   1060 <fscanf@plt>
mov    -0x9f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9f4(%rbp)
mov    -0xa04(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa04(%rbp)
jmp    11fb <main+0x8b>
movl   $0x0,-0x9f8(%rbp)
mov    -0x9f8(%rbp),%eax
cmp    -0xa04(%rbp),%eax
jge    12b4 <main+0x144>
movslq -0x9f8(%rbp),%rax
lea    -0x9d0(%rbp),%rsi
imul   $0x19,%rax,%rax
add    %rax,%rsi
lea    0xd8a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x9f8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9f8(%rbp)
jmp    126b <main+0xfb>
lea    0xd6c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xa18(%rbp),%rax
mov    (%rax),%ecx
mov    -0xa20(%rbp),%rax
mov    %ecx,(%rax)
cmpl   $0x0,-0xa08(%rbp)
jle    13e5 <main+0x275>
movl   $0x0,-0x9fc(%rbp)
mov    -0x9fc(%rbp),%eax
mov    -0xa08(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    13d1 <main+0x261>
movslq -0x9fc(%rbp),%rax
lea    -0x9d0(%rbp),%rdi
imul   $0x19,%rax,%rax
add    %rax,%rdi
mov    -0x9fc(%rbp),%eax
add    $0x1,%eax
cltq
lea    -0x9d0(%rbp),%rsi
imul   $0x19,%rax,%rax
add    %rax,%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jle    13b8 <main+0x248>
lea    -0x9f0(%rbp),%rdi
mov    -0x9fc(%rbp),%eax
add    $0x1,%eax
cltq
lea    -0x9d0(%rbp),%rsi
imul   $0x19,%rax,%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
mov    -0x9fc(%rbp),%eax
add    $0x1,%eax
cltq
lea    -0x9d0(%rbp),%rdi
imul   $0x19,%rax,%rax
add    %rax,%rdi
movslq -0x9fc(%rbp),%rax
lea    -0x9d0(%rbp),%rsi
imul   $0x19,%rax,%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
movslq -0x9fc(%rbp),%rax
lea    -0x9d0(%rbp),%rdi
imul   $0x19,%rax,%rax
add    %rax,%rdi
lea    -0x9f0(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    13bd <main+0x24d>
mov    -0x9fc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9fc(%rbp)
jmp    12eb <main+0x17b>
mov    -0xa08(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xa08(%rbp)
jmp    12d4 <main+0x164>
movl   $0x0,-0xa00(%rbp)
mov    -0xa00(%rbp),%eax
mov    -0xa18(%rbp),%rcx
cmp    (%rcx),%eax
jge    143b <main+0x2cb>
movslq -0xa00(%rbp),%rax
lea    -0x9d0(%rbp),%rsi
imul   $0x19,%rax,%rax
add    %rax,%rsi
lea    0xc03(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xa00(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa00(%rbp)
jmp    13ef <main+0x27f>
mov    -0xa10(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa08,%rsp
lea    0xe68(%rip),%rdi
lea    0xe7f(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     11cf <main+0x4f>
mov    %rax,%r14
mov    %rax,%rdi
call   1090 <feof@plt>
test   %rax,%rax
je     11e6 <main+0x66>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
jmp    11d4 <main+0x54>
mov    $0x1,%eax
add    $0xa08,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x40(%rsp),%rbx
xor    %r13d,%r13d
lea    0xe2b(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1070 <fscanf@plt>
add    $0x1,%r13
mov    %r14,%rdi
call   1090 <feof@plt>
add    $0x19,%rbx
test   %rax,%rax
je     1200 <main+0x80>
test   %r13d,%r13d
je     11b9 <main+0x39>
mov    %r14,0x10(%rsp)
lea    -0x1(%r13),%r14
mov    %r13d,%ebp
lea    0x40(%rsp),%rbx
lea    0xde3(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x19,%rbx
add    $0xffffffffffffffff,%rbp
jne    1240 <main+0xc0>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r13d,%r13d
jle    12f0 <main+0x170>
mov    %r14d,%r14d
lea    0x20(%rsp),%r15
mov    %r13d,%eax
jmp    128f <main+0x10f>
nopw   0x0(%rax,%rax,1)
add    $0xffffffffffffffff,%r14
cmpl   $0x2,0x18(%rsp)
mov    0xc(%rsp),%eax
jb     12f0 <main+0x170>
cmp    $0x2,%eax
jb     12f0 <main+0x170>
mov    %rax,0x18(%rsp)
add    $0xffffffff,%eax
mov    %eax,0xc(%rsp)
mov    %r14,%rbp
lea    0x40(%rsp),%rbx
jmp    12b9 <main+0x139>
nopw   0x0(%rax,%rax,1)
mov    %r12,%rbx
add    $0xffffffffffffffff,%rbp
je     1280 <main+0x100>
lea    0x19(%rbx),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jle    12b0 <main+0x130>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <strcpy@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strcpy@plt>
jmp    12b0 <main+0x130>
test   %r13d,%r13d
mov    0x10(%rsp),%r14
je     11c3 <main+0x43>
mov    %r13d,%ebp
lea    0x40(%rsp),%rbx
lea    0xd16(%rip),%r15
nopl   (%rax)
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x19,%rbx
add    $0xffffffffffffffff,%rbp
jne    1310 <main+0x190>
jmp    11c3 <main+0x43>

LLVM IR (-O0):
@.str = [30 x i8] c"/root/practica2/Entrada2e.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [4 x i8] c"%s \00"
@.str.4 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x [25 x i8]]
%3 = alloca [25 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
store i32 0, i32* %1
store i32 0, i32* %4
store i32* %8, i32** %11
store i32* %9, i32** %12
%13 = load i32*, i32** %11
store i32 0, i32* %13
%14 = load i32*, i32** %12
store i32 0, i32* %14
%15 = call i32* @fopen(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %15, i32** %10
%16 = load i32*, i32** %10
%17 = icmp ne i32* %16, null
br i1 %17, label %19, label %18
18: ; preds = %0
store i32 1, i32* %1
br label %125
19: ; preds = %0
br label %20
20: ; preds = %19, %25
%21 = load i32*, i32** %10
%22 = call i64 @feof(i32* %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %20
br label %36
25: ; preds = %20
%26 = load i32*, i32** %10
%27 = load i32, i32* %4
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [100 x [25 x i8]], [100 x [25 x i8]]* %2, i64 0, i64 %28
%30 = getelementptr inbounds [25 x i8], [25 x i8]* %29, i64 0, i64 0
%31 = call i32 @fscanf(i32* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %30)
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
store i32 %33, i32* %4
%34 = load i32, i32* %8
%35 = add nsw i32 %34, 1
store i32 %35, i32* %8
br label %20
36: ; preds = %24
store i32 0, i32* %5
br label %37
37: ; preds = %47, %36
%38 = load i32, i32* %5
%39 = load i32, i32* %8
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %50
41: ; preds = %37
%42 = load i32, i32* %5
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [100 x [25 x i8]], [100 x [25 x i8]]* %2, i64 0, i64 %43
%45 = getelementptr inbounds [25 x i8], [25 x i8]* %44, i64 0, i64 0
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %45)
br label %47
47: ; preds = %41
%48 = load i32, i32* %5
%49 = add nsw i32 %48, 1
store i32 %49, i32* %5
br label %37
50: ; preds = %37
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%52 = load i32*, i32** %11
%53 = load i32, i32* %52
%54 = load i32*, i32** %12
store i32 %53, i32* %54
br label %55
55: ; preds = %104, %50
%56 = load i32, i32* %9
%57 = icmp sgt i32 %56, 0
br i1 %57, label %58, label %107
58: ; preds = %55
store i32 0, i32* %6
br label %59
59: ; preds = %101, %58
%60 = load i32, i32* %6
%61 = load i32, i32* %9
%62 = sub nsw i32 %61, 1
%63 = icmp slt i32 %60, %62
br i1 %63, label %64, label %104
64: ; preds = %59
%65 = load i32, i32* %6
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [100 x [25 x i8]], [100 x [25 x i8]]* %2, i64 0, i64 %66
%68 = getelementptr inbounds [25 x i8], [25 x i8]* %67, i64 0, i64 0
%69 = load i32, i32* %6
%70 = add nsw i32 %69, 1
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [100 x [25 x i8]], [100 x [25 x i8]]* %2, i64 0, i64 %71
%73 = getelementptr inbounds [25 x i8], [25 x i8]* %72, i64 0, i64 0
%74 = call i64 @strcmp(i8* %68, i8* %73)
%75 = icmp sgt i64 %74, 0
br i1 %75, label %76, label %100
76: ; preds = %64
%77 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%78 = load i32, i32* %6
%79 = add nsw i32 %78, 1
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [100 x [25 x i8]], [100 x [25 x i8]]* %2, i64 0, i64 %80
%82 = getelementptr inbounds [25 x i8], [25 x i8]* %81, i64 0, i64 0
%83 = call i32 @strcpy(i8* %77, i8* %82)
%84 = load i32, i32* %6
%85 = add nsw i32 %84, 1
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [100 x [25 x i8]], [100 x [25 x i8]]* %2, i64 0, i64 %86
%88 = getelementptr inbounds [25 x i8], [25 x i8]* %87, i64 0, i64 0
%89 = load i32, i32* %6
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [100 x [25 x i8]], [100 x [25 x i8]]* %2, i64 0, i64 %90
%92 = getelementptr inbounds [25 x i8], [25 x i8]* %91, i64 0, i64 0
%93 = call i32 @strcpy(i8* %88, i8* %92)
%94 = load i32, i32* %6
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds [100 x [25 x i8]], [100 x [25 x i8]]* %2, i64 0, i64 %95
%97 = getelementptr inbounds [25 x i8], [25 x i8]* %96, i64 0, i64 0
%98 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%99 = call i32 @strcpy(i8* %97, i8* %98)
br label %100
100: ; preds = %76, %64
br label %101
101: ; preds = %100
%102 = load i32, i32* %6
%103 = add nsw i32 %102, 1
store i32 %103, i32* %6
br label %59
104: ; preds = %59
%105 = load i32, i32* %9
%106 = add nsw i32 %105, -1
store i32 %106, i32* %9
br label %55
107: ; preds = %55
store i32 0, i32* %7
br label %108
108: ; preds = %119, %107
%109 = load i32, i32* %7
%110 = load i32*, i32** %11
%111 = load i32, i32* %110
%112 = icmp slt i32 %109, %111
br i1 %112, label %113, label %122
113: ; preds = %108
%114 = load i32, i32* %7
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds [100 x [25 x i8]], [100 x [25 x i8]]* %2, i64 0, i64 %115
%117 = getelementptr inbounds [25 x i8], [25 x i8]* %116, i64 0, i64 0
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %117)
br label %119
119: ; preds = %113
%120 = load i32, i32* %7
%121 = add nsw i32 %120, 1
store i32 %121, i32* %7
br label %108
122: ; preds = %108
%123 = load i32*, i32** %10
%124 = call i32 @fclose(i32* %123)
store i32 0, i32* %1
br label %125
125: ; preds = %122, %18
%126 = load i32, i32* %1
ret i32 %126
}

LLVM IR (-O2):
@.str = [30 x i8] c"/root/practica2/Entrada2e.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [4 x i8] c"%s \00"
define i32 @main() {
%1 = alloca [100 x [25 x i8]]
%2 = alloca [25 x i8]
%3 = getelementptr inbounds [100 x [25 x i8]], [100 x [25 x i8]]* %1, i64 0, i64 0, i64 0
%4 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %66, label %7
7: ; preds = %0
%8 = call i64 @feof(i32* %5)
%9 = icmp eq i64 %8, 0
br i1 %9, label %15, label %28
10: ; preds = %15
%11 = trunc i64 %19 to i32
%12 = icmp eq i32 %11, 0
br i1 %12, label %28, label %13
13: ; preds = %10
%14 = and i64 %19, 4294967295
br label %22
15: ; preds = %7, %15
%16 = phi i64 [ %19, %15 ], [ 0, %7 ]
%17 = getelementptr inbounds [100 x [25 x i8]], [100 x [25 x i8]]* %1, i64 0, i64 %16, i64 0
%18 = call i32 @fscanf(i32* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %17)
%19 = add nuw i64 %16, 1
%20 = call i64 @feof(i32* %5)
%21 = icmp eq i64 %20, 0
br i1 %21, label %15, label %10
22: ; preds = %13, %22
%23 = phi i64 [ 0, %13 ], [ %26, %22 ]
%24 = getelementptr inbounds [100 x [25 x i8]], [100 x [25 x i8]]* %1, i64 0, i64 %23, i64 0
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %24)
%26 = add nuw nsw i64 %23, 1
%27 = icmp eq i64 %26, %14
br i1 %27, label %30, label %22
28: ; preds = %7, %10
%29 = call i32 @putchar(i32 10)
br label %64
30: ; preds = %22
%31 = call i32 @putchar(i32 10)
%32 = icmp sgt i32 %11, 0
br i1 %32, label %33, label %42
33: ; preds = %30
%34 = and i64 %16, 4294967295
br label %37
35: ; preds = %56
%36 = add nsw i64 %38, -1
br i1 %41, label %37, label %42
37: ; preds = %33, %35
%38 = phi i64 [ %34, %33 ], [ %36, %35 ]
%39 = phi i32 [ %11, %33 ], [ %40, %35 ]
%40 = add nsw i32 %39, -1
%41 = icmp ugt i32 %39, 1
br i1 %41, label %45, label %42
42: ; preds = %35, %37, %30
br i1 %12, label %64, label %43
43: ; preds = %42
%44 = and i64 %19, 4294967295
br label %58
45: ; preds = %37, %56
%46 = phi i64 [ %48, %56 ], [ 0, %37 ]
%47 = getelementptr inbounds [100 x [25 x i8]], [100 x [25 x i8]]* %1, i64 0, i64 %46, i64 0
%48 = add nuw nsw i64 %46, 1
%49 = getelementptr inbounds [100 x [25 x i8]], [100 x [25 x i8]]* %1, i64 0, i64 %48, i64 0
%50 = call i64 @strcmp(i8* %47, i8* %49)
%51 = icmp sgt i64 %50, 0
br i1 %51, label %52, label %56
52: ; preds = %45
%53 = call i32 @strcpy(i8* %4, i8* %49)
%54 = call i32 @strcpy(i8* %49, i8* %47)
%55 = call i32 @strcpy(i8* %47, i8* %4)
br label %56
56: ; preds = %45, %52
%57 = icmp eq i64 %48, %38
br i1 %57, label %35, label %45
58: ; preds = %43, %58
%59 = phi i64 [ 0, %43 ], [ %62, %58 ]
%60 = getelementptr inbounds [100 x [25 x i8]], [100 x [25 x i8]]* %1, i64 0, i64 %59, i64 0
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %60)
%62 = add nuw nsw i64 %59, 1
%63 = icmp eq i64 %62, %44
br i1 %63, label %64, label %58
64: ; preds = %58, %28, %42
%65 = call i32 @fclose(i32* %5)
br label %66
66: ; preds = %0, %64
%67 = phi i32 [ 0, %64 ], [ 1, %0 ]
ret i32 %67
}