#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 *, ...);
scalar_t__ strcmp(char *, char *);
void imprimir_autores(int numero_trozos, char *comando_troceado[]) {
  int i, nombres = 0, login = 0;
  for (i = 1; i < numero_trozos; i++) {
    if (strcmp("-l", comando_troceado[i]) == 0) {
      login = 1;
    } else if (strcmp("-n", comando_troceado[i]) == 0) {
      nombres = 1;
    } else if (strcmp("-h", comando_troceado[i]) == 0) {
      printf("Imprime los autores de este shell\n");
      printf("Uso: autores [-l|-n]\n");
      return;
    } else {
      printf("Parametro %s desconocido\n", comando_troceado[i]);
      return;
    }
  }
  if (!nombres && !login) {
    nombres = 1;
    login = 1;
  }
  if (nombres) {
    printf("Martin Alvarez Castillo");
  }
  if (nombres && login) {
    printf(" - ");
  }
  if (login) {
    printf("m.castillo@udc.es");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<imprimir_autores>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1226 <imprimir_autores+0x106>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe9d(%rip),%rdi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    117e <imprimir_autores+0x5e>
movl   $0x1,-0x1c(%rbp)
jmp    1213 <imprimir_autores+0xf3>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe72(%rip),%rdi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11ac <imprimir_autores+0x8c>
movl   $0x1,-0x18(%rbp)
jmp    120e <imprimir_autores+0xee>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe47(%rip),%rdi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11ef <imprimir_autores+0xcf>
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a8 <imprimir_autores+0x188>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a8 <imprimir_autores+0x188>
jmp    1213 <imprimir_autores+0xf3>
jmp    1218 <imprimir_autores+0xf8>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <imprimir_autores+0x24>
cmpl   $0x0,-0x18(%rbp)
jne    1248 <imprimir_autores+0x128>
cmpl   $0x0,-0x1c(%rbp)
jne    1248 <imprimir_autores+0x128>
movl   $0x1,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1260 <imprimir_autores+0x140>
lea    0xe03(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x18(%rbp)
je     1282 <imprimir_autores+0x162>
cmpl   $0x0,-0x1c(%rbp)
je     1282 <imprimir_autores+0x162>
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x1c(%rbp)
je     129a <imprimir_autores+0x17a>
lea    0xde5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimir_autores>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %r12d,%r12d
mov    $0x0,%ebp
cmp    $0x2,%edi
jl     11fc <imprimir_autores+0xbc>
mov    %rsi,%r13
mov    %edi,%r15d
xor    %r12d,%r12d
mov    $0x1,%ebx
lea    0xe8f(%rip),%r14
xor    %ebp,%ebp
jmp    118f <imprimir_autores+0x4f>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x1,%r12d
add    $0x1,%rbx
cmp    %rbx,%r15
je     11f3 <imprimir_autores+0xb3>
mov    0x0(%r13,%rbx,8),%rsi
mov    %r14,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1180 <imprimir_autores+0x40>
mov    0x0(%r13,%rbx,8),%rsi
lea    0xe56(%rip),%rdi
call   1060 <strcmp@plt>
mov    $0x1,%ebp
test   %rax,%rax
je     1186 <imprimir_autores+0x46>
mov    0x0(%r13,%rbx,8),%rsi
lea    0xe3e(%rip),%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1247 <imprimir_autores+0x107>
mov    0x0(%r13,%rbx,8),%rsi
lea    0xe2b(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <printf@plt>
test   %ebp,%ebp
jne    11fc <imprimir_autores+0xbc>
test   %r12d,%r12d
jne    1221 <imprimir_autores+0xe1>
lea    0xe20(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebp,%ebp
je     1213 <imprimir_autores+0xd3>
test   %r12d,%r12d
je     122f <imprimir_autores+0xef>
lea    0xe21(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe17(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>
lea    0xe03(%rip),%rdi
call   1040 <puts@plt>
lea    0xe19(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"-l\00"
@.str.1 = [3 x i8] c"-n\00"
@.str.2 = [3 x i8] c"-h\00"
@.str.3 = [35 x i8] c"Imprime los autores de este shell\0A\00"
@.str.4 = [22 x i8] c"Uso: autores [-l|-n]\0A\00"
@.str.5 = [26 x i8] c"Parametro %s desconocido\0A\00"
@.str.6 = [24 x i8] c"Martin Alvarez Castillo\00"
@.str.7 = [4 x i8] c" - \00"
@.str.8 = [18 x i8] c"m.castillo@udc.es\00"
@.str.9 = [2 x i8] c"\0A\00"
define void @imprimir_autores(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 0, i32* %6
store i32 0, i32* %7
store i32 1, i32* %5
br label %8
8: ; preds = %50, %2
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %53
12: ; preds = %8
%13 = load i8**, i8*** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %12
store i32 1, i32* %7
br label %49
21: ; preds = %12
%22 = load i8**, i8*** %4
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %22, i64 %24
%26 = load i8*, i8** %25
%27 = call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %26)
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %21
store i32 1, i32* %6
br label %48
30: ; preds = %21
%31 = load i8**, i8*** %4
%32 = load i32, i32* %5
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8*, i8** %31, i64 %33
%35 = load i8*, i8** %34
%36 = call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %35)
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %30
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %80
41: ; preds = %30
%42 = load i8**, i8*** %4
%43 = load i32, i32* %5
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8*, i8** %42, i64 %44
%46 = load i8*, i8** %45
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %46)
br label %80
48: ; preds = %29
br label %49
49: ; preds = %48, %20
br label %50
50: ; preds = %49
%51 = load i32, i32* %5
%52 = add nsw i32 %51, 1
store i32 %52, i32* %5
br label %8
53: ; preds = %8
%54 = load i32, i32* %6
%55 = icmp ne i32 %54, 0
br i1 %55, label %60, label %56
56: ; preds = %53
%57 = load i32, i32* %7
%58 = icmp ne i32 %57, 0
br i1 %58, label %60, label %59
59: ; preds = %56
store i32 1, i32* %6
store i32 1, i32* %7
br label %60
60: ; preds = %59, %56, %53
%61 = load i32, i32* %6
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %60
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
br label %65
65: ; preds = %63, %60
%66 = load i32, i32* %6
%67 = icmp ne i32 %66, 0
br i1 %67, label %68, label %73
68: ; preds = %65
%69 = load i32, i32* %7
%70 = icmp ne i32 %69, 0
br i1 %70, label %71, label %73
71: ; preds = %68
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %73
73: ; preds = %71, %68, %65
%74 = load i32, i32* %7
%75 = icmp ne i32 %74, 0
br i1 %75, label %76, label %78
76: ; preds = %73
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
br label %78
78: ; preds = %76, %73
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %80
80: ; preds = %78, %41, %38
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"-l\00"
@.str.1 = [3 x i8] c"-n\00"
@.str.2 = [3 x i8] c"-h\00"
@.str.5 = [26 x i8] c"Parametro %s desconocido\0A\00"
@.str.6 = [24 x i8] c"Martin Alvarez Castillo\00"
@.str.7 = [4 x i8] c" - \00"
@.str.8 = [18 x i8] c"m.castillo@udc.es\00"
@str = [34 x i8] c"Imprime los autores de este shell\00"
@str.10 = [21 x i8] c"Uso: autores [-l|-n]\00"
define void @imprimir_autores(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %37
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %28
%7 = phi i64 [ 1, %4 ], [ %31, %28 ]
%8 = phi i32 [ 0, %4 ], [ %30, %28 ]
%9 = phi i32 [ 0, %4 ], [ %29, %28 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %7
%11 = load i8*, i8** %10
%12 = tail call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %28, label %14
14: ; preds = %6
%15 = load i8*, i8** %10
%16 = tail call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %28, label %18
18: ; preds = %14
%19 = load i8*, i8** %10
%20 = tail call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %19)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %18
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.10, i64 0, i64 0))
br label %50
25: ; preds = %18
%26 = load i8*, i8** %10
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %26)
br label %50
28: ; preds = %14, %6
%29 = phi i32 [ %9, %6 ], [ 1, %14 ]
%30 = phi i32 [ 1, %6 ], [ %8, %14 ]
%31 = add nuw nsw i64 %7, 1
%32 = icmp eq i64 %31, %5
br i1 %32, label %33, label %6
33: ; preds = %28
%34 = icmp ne i32 %30, 0
%35 = icmp eq i32 %29, 0
%36 = select i1 %35, i1 %34, i1 false
br i1 %36, label %46, label %37
37: ; preds = %2, %33
%38 = phi i32 [ %30, %33 ], [ 0, %2 ]
%39 = phi i32 [ %29, %33 ], [ 0, %2 ]
%40 = icmp ne i32 %39, 0
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%42 = icmp eq i32 %38, 0
%43 = select i1 %40, i1 %42, i1 false
br i1 %43, label %48, label %44
44: ; preds = %37
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %46
46: ; preds = %33, %44
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
br label %48
48: ; preds = %37, %46
%49 = tail call i32 @putchar(i32 10)
br label %50
50: ; preds = %48, %25, %22
ret void
}