#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*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fread(char *, int, int, int /*<<< orphan*/ *);
int fscanf(int /*<<< orphan*/ *, char *, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main(int argc, char **argv) {
  FILE *f;
  char *c, *d;
  if (argc < 2)
    return 1;
  f = fopen(argv[1], "rt");
  if (!f)
    return 1;
  c = (char *)malloc(100);
  d = (char *)malloc(101);
  while (1 == fscanf(f, "%s", c)) {
    int lo;
    lo = strlen(c);
    if (c[lo - 1] == '/' || c[lo - 1] == '@')
      continue;
    if (c[lo - 1] == '*')
      c[lo - 1] = '\0';
    printf("------------------------------\n");
    FILE *f1 = fopen(c, "r");
    if (!f1) {
      strcpy(d, "No se abre");
    } else {
      int i = fread(d, 1, 100, f1);
      d[i] = '\0';
      fclose(f1);
    }
    printf("%s: %s\n", c, d);
  }
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11ac <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1326 <main+0x1a6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe45(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11db <main+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    1326 <main+0x1a6>
mov    $0x64,%edi
call   1090 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    $0x65,%edi
call   1090 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xdfd(%rip),%rsi
call   1080 <fscanf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
jne    1316 <main+0x196>
mov    -0x20(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
je     125a <main+0xda>
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x40,%eax
jne    125f <main+0xdf>
jmp    11f7 <main+0x77>
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2a,%eax
jne    128a <main+0x10a>
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
lea    0xd75(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x20(%rbp),%rdi
lea    0xd83(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    12cc <main+0x14c>
mov    -0x28(%rbp),%rdi
lea    0xd66(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12fb <main+0x17b>
mov    -0x28(%rbp),%rdi
mov    -0x38(%rbp),%rcx
mov    $0x1,%esi
mov    $0x64,%edx
call   1040 <fread@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x38(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    0xd29(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    11f7 <main+0x77>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x1,%ebx
cmp    $0x2,%edi
jl     12c1 <main+0x131>
mov    0x8(%rsi),%rdi
lea    0xe4c(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     12c1 <main+0x131>
mov    %rax,%r14
mov    $0x64,%edi
call   10a0 <malloc@plt>
mov    %rax,%rbx
mov    $0x65,%edi
call   10a0 <malloc@plt>
mov    %rax,%r15
lea    0xe1d(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
call   1090 <fscanf@plt>
cmp    $0x1,%eax
jne    12b7 <main+0x127>
lea    0xe02(%rip),%r12
lea    0xe0b(%rip),%r13
jmp    127a <main+0xea>
nopw   0x0(%rax,%rax,1)
lea    0xe04(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
lea    0xde0(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     12a6 <main+0x116>
mov    %rax,%rbp
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x64,%edx
mov    %rax,%rcx
call   1050 <fread@plt>
cltq
movb   $0x0,(%r15,%rax,1)
mov    %rbp,%rdi
call   1060 <fclose@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1090 <fscanf@plt>
cmp    $0x1,%eax
jne    12b7 <main+0x127>
mov    %rbx,%rdi
call   1070 <strlen@plt>
cltq
movzbl -0x1(%rax,%rbx,1),%ecx
cmp    $0x40,%cl
je     1267 <main+0xd7>
cmp    $0x2f,%cl
je     1267 <main+0xd7>
cmp    $0x2a,%cl
jne    1210 <main+0x80>
movb   $0x0,-0x1(%rbx,%rax,1)
jmp    1210 <main+0x80>
mov    %r15,%rdi
lea    0xd58(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1257 <main+0xc7>
mov    %r14,%rdi
call   1060 <fclose@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rt\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [32 x i8] c"------------------------------\0A\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [11 x i8] c"No se abre\00"
@.str.5 = [8 x i8] c"%s: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 2
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 1, i32* %3
br label %95
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32* @fopen(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %19, i32** %6
%20 = load i32*, i32** %6
%21 = icmp ne i32* %20, null
br i1 %21, label %23, label %22
22: ; preds = %15
store i32 1, i32* %3
br label %95
23: ; preds = %15
%24 = call i64 @malloc(i32 100)
%25 = inttoptr i64 %24 to i8*
store i8* %25, i8** %7
%26 = call i64 @malloc(i32 101)
%27 = inttoptr i64 %26 to i8*
store i8* %27, i8** %8
br label %28
28: ; preds = %88, %53, %23
%29 = load i32*, i32** %6
%30 = load i8*, i8** %7
%31 = call i32 @fscanf(i32* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %30)
%32 = icmp eq i32 1, %31
br i1 %32, label %33, label %92
33: ; preds = %28
%34 = load i8*, i8** %7
%35 = call i32 @strlen(i8* %34)
store i32 %35, i32* %9
%36 = load i8*, i8** %7
%37 = load i32, i32* %9
%38 = sub nsw i32 %37, 1
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8, i8* %36, i64 %39
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = icmp eq i32 %42, 47
br i1 %43, label %53, label %44
44: ; preds = %33
%45 = load i8*, i8** %7
%46 = load i32, i32* %9
%47 = sub nsw i32 %46, 1
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i8, i8* %45, i64 %48
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = icmp eq i32 %51, 64
br i1 %52, label %53, label %54
53: ; preds = %44, %33
br label %28
54: ; preds = %44
%55 = load i8*, i8** %7
%56 = load i32, i32* %9
%57 = sub nsw i32 %56, 1
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i8, i8* %55, i64 %58
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = icmp eq i32 %61, 42
br i1 %62, label %63, label %69
63: ; preds = %54
%64 = load i8*, i8** %7
%65 = load i32, i32* %9
%66 = sub nsw i32 %65, 1
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i8, i8* %64, i64 %67
store i8 0, i8* %68
br label %69
69: ; preds = %63, %54
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%71 = load i8*, i8** %7
%72 = call i32* @fopen(i8* %71, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %72, i32** %10
%73 = load i32*, i32** %10
%74 = icmp ne i32* %73, null
br i1 %74, label %78, label %75
75: ; preds = %69
%76 = load i8*, i8** %8
%77 = call i32 @strcpy(i8* %76, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
br label %88
78: ; preds = %69
%79 = load i8*, i8** %8
%80 = load i32*, i32** %10
%81 = call i32 @fread(i8* %79, i32 1, i32 100, i32* %80)
store i32 %81, i32* %11
%82 = load i8*, i8** %8
%83 = load i32, i32* %11
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i8, i8* %82, i64 %84
store i8 0, i8* %85
%86 = load i32*, i32** %10
%87 = call i32 @fclose(i32* %86)
br label %88
88: ; preds = %78, %75
%89 = load i8*, i8** %7
%90 = load i8*, i8** %8
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %89, i8* %90)
br label %28
92: ; preds = %28
%93 = load i32*, i32** %6
%94 = call i32 @fclose(i32* %93)
store i32 0, i32* %3
br label %95
95: ; preds = %92, %22, %14
%96 = load i32, i32* %3
ret i32 %96
}

LLVM IR (-O2):
@.str = [3 x i8] c"rt\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [11 x i8] c"No se abre\00"
@.str.5 = [8 x i8] c"%s: %s\0A\00"
@str = [31 x i8] c"------------------------------\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %41, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32* @fopen(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32* %7, null
br i1 %8, label %41, label %9
9: ; preds = %4
%10 = tail call i64 @malloc(i32 100)
%11 = inttoptr i64 %10 to i8*
%12 = tail call i64 @malloc(i32 101)
%13 = inttoptr i64 %12 to i8*
%14 = tail call i32 @fscanf(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %39
16: ; preds = %9, %36
%17 = tail call i32 @strlen(i8* %11)
%18 = add nsw i32 %17, -1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %11, i64 %19
%21 = load i8, i8* %20
switch i8 %21, label %23 [
i8 47, label %36
i8 64, label %36
i8 42, label %22
]
22: ; preds = %16
store i8 0, i8* %20
br label %23
23: ; preds = %16, %22
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%25 = tail call i32* @fopen(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%26 = icmp eq i32* %25, null
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = tail call i32 @strcpy(i8* %13, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
br label %34
29: ; preds = %23
%30 = tail call i32 @fread(i8* %13, i32 1, i32 100, i32* %25)
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %13, i64 %31
store i8 0, i8* %32
%33 = tail call i32 @fclose(i32* %25)
br label %34
34: ; preds = %29, %27
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %11, i8* %13)
br label %36
36: ; preds = %16, %16, %34
%37 = tail call i32 @fscanf(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%38 = icmp eq i32 %37, 1
br i1 %38, label %16, label %39
39: ; preds = %36, %9
%40 = tail call i32 @fclose(i32* %7)
br label %41
41: ; preds = %4, %2, %39
%42 = phi i32 [ 0, %39 ], [ 1, %2 ], [ 1, %4 ]
ret i32 %42
}