#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 */
struct option {
  char *member_0;
  int member_1;
  char member_3;
  int /*<<< orphan*/ *member_2;
};

/* Variables and functions */
int EXIT_SUCCESS;
int atoi(char *);
int /*<<< orphan*/ exit(int);
int getopt_long(int, char **, char const *const, struct option const *,
                int /*<<< orphan*/ *);
int /*<<< orphan*/ imprime_uso();
char *optarg;
int optind;
int /*<<< orphan*/ procesarArchivo(char const *, int, int, int, int, char *);
int main(int argc, char *argv[]) {
  int index;
  int primeraLinea, incremento, cantidadVaciasJuntas;
  int siguiente_opcion;
  char *ultimoParametro = NULL;
  char *archivo = NULL;
  const char *separador = NULL;
  int numerarVacias = 1;
  incremento = 1;
  primeraLinea = 1;
  const char *const op_cortas = "hs:v:i:tl:";
  const struct option op_largas[] = {{"help", 0, NULL, 'h'},
                                     {"number-separator", 2, NULL, 's'},
                                     {"starting-line-number", 2, NULL, 'v'},
                                     {"line-increment", 2, NULL, 'i'},
                                     {"non-empty", 2, NULL, 't'},
                                     {"join-blank-lines", 2, NULL, 'l'},
                                     {NULL, 0, NULL, 0}};
  while (1) {
    siguiente_opcion = getopt_long(argc, argv, op_cortas, op_largas, NULL);
    if (siguiente_opcion == -1)
      break;
    switch (siguiente_opcion) {
    case 'h':
      imprime_uso();
      exit(EXIT_SUCCESS);
    case 's':
      separador = optarg;
      break;
    case 'v':
      primeraLinea = atoi(optarg);
      break;
    case 'i':
      incremento = atoi(optarg);
      break;
    case 't':
      numerarVacias = 0;
      break;
    case 'l':
      cantidadVaciasJuntas = atoi(optarg);
      break;
    case '?':
      imprime_uso();
      exit(1);
    case -1:
      break;
    default:
      exit(1);
    }
  }
  index = optind;
  if (index == argc) {
    archivo = NULL;
    procesarArchivo(separador, primeraLinea, incremento, numerarVacias,
                    cantidadVaciasJuntas, argv[index]);
  } else {
    for (index = optind; index < argc; index++) {
      procesarArchivo(separador, primeraLinea, incremento, numerarVacias,
                      cantidadVaciasJuntas, argv[index]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
movl   $0x1,-0x44(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x1,-0x18(%rbp)
lea    0xe53(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    -0x100(%rbp),%rdi
lea    0x2ba1(%rip),%rsi
mov    $0xa8,%edx
call   1060 <memcpy@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x100(%rbp),%rcx
lea    0xe22(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r8d
call   1040 <getopt_long@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
jne    11fa <main+0x9a>
jmp    133b <main+0x1db>
mov    -0x24(%rbp),%eax
mov    %eax,-0x104(%rbp)
sub    $0xffffffff,%eax
je     1327 <main+0x1c7>
jmp    1211 <main+0xb1>
mov    -0x104(%rbp),%eax
sub    $0x3f,%eax
je     1316 <main+0x1b6>
jmp    1225 <main+0xc5>
mov    -0x104(%rbp),%eax
sub    $0x68,%eax
je     129d <main+0x13d>
jmp    1239 <main+0xd9>
mov    -0x104(%rbp),%eax
sub    $0x69,%eax
je     12dc <main+0x17c>
jmp    124d <main+0xed>
mov    -0x104(%rbp),%eax
sub    $0x6c,%eax
je     12ff <main+0x19f>
jmp    1261 <main+0x101>
mov    -0x104(%rbp),%eax
sub    $0x73,%eax
je     12b2 <main+0x152>
jmp    1275 <main+0x115>
mov    -0x104(%rbp),%eax
sub    $0x74,%eax
je     12f3 <main+0x193>
jmp    1289 <main+0x129>
mov    -0x104(%rbp),%eax
sub    $0x76,%eax
je     12c5 <main+0x165>
jmp    132c <main+0x1cc>
mov    $0x0,%al
call   1030 <imprime_uso@plt>
mov    0x2d25(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    0x2d3f(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
jmp    1336 <main+0x1d6>
mov    0x2d2c(%rip),%rax
mov    (%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x18(%rbp)
jmp    1336 <main+0x1d6>
mov    0x2d15(%rip),%rax
mov    (%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x1c(%rbp)
jmp    1336 <main+0x1d6>
movl   $0x0,-0x44(%rbp)
jmp    1336 <main+0x1d6>
mov    0x2cf2(%rip),%rax
mov    (%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x20(%rbp)
jmp    1336 <main+0x1d6>
mov    $0x0,%al
call   1030 <imprime_uso@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
jmp    1336 <main+0x1d6>
mov    $0x1,%edi
call   1080 <exit@plt>
jmp    11c9 <main+0x69>
mov    0x2c9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1382 <main+0x222>
movq   $0x0,-0x38(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x44(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%r9
mov    (%rax,%r9,8),%r9
call   1050 <procesarArchivo@plt>
jmp    13cf <main+0x26f>
mov    0x2c57(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    13ca <main+0x26a>
mov    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x44(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%r9
mov    (%rax,%r9,8),%r9
call   1050 <procesarArchivo@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    138e <main+0x22e>
jmp    13cf <main+0x26f>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %rsi,%r15
mov    %edi,%r13d
lea    0x2be2(%rip),%rsi
lea    0x20(%rsp),%rbp
mov    $0xa8,%edx
mov    %rbp,%rdi
call   1060 <memcpy@plt>
movl   $0x1,0x10(%rsp)
xor    %eax,%eax
mov    %rax,0x18(%rsp)
lea    0xf3a(%rip),%r12
mov    $0x1,%eax
mov    $0x1,%r14d
mov    %eax,0xc(%rsp)
mov    %r14d,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebx,%r14d
xor    %ebx,%ebx
mov    %r13d,%edi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %rbp,%rcx
xor    %r8d,%r8d
call   1040 <getopt_long@plt>
cmp    $0x74,%eax
je     11c0 <main+0x60>
lea    -0x3f(%rax),%ecx
cmp    $0x37,%ecx
ja     1264 <main+0x104>
lea    0xe13(%rip),%rdx
movslq (%rdx,%rcx,4),%rax
add    %rdx,%rax
jmp    *%rax
mov    0x2dfb(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x18(%rsp)
jmp    11b5 <main+0x55>
nopw   0x0(%rax,%rax,1)
mov    0x2de1(%rip),%rax
mov    (%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,0x10(%rsp)
mov    0xc(%rsp),%eax
jmp    11b1 <main+0x51>
nopl   0x0(%rax)
mov    0x2dc1(%rip),%rax
mov    (%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,0x14(%rsp)
mov    0xc(%rsp),%eax
jmp    11b1 <main+0x51>
nopl   0x0(%rax)
mov    0x2da1(%rip),%rax
mov    (%rax),%rdi
call   1070 <atoi@plt>
jmp    11b1 <main+0x51>
cmp    $0xffffffff,%eax
jne    12ff <main+0x19f>
mov    0x2d6c(%rip),%rax
movslq (%rax),%rax
cmp    %r13d,%eax
mov    0x10(%rsp),%edx
mov    0x14(%rsp),%r8d
jne    129f <main+0x13f>
movslq %r13d,%rax
mov    (%r15,%rax,8),%r9
mov    0x18(%rsp),%rdi
mov    0xc(%rsp),%esi
mov    %r14d,%ecx
call   1050 <procesarArchivo@plt>
jmp    12e4 <main+0x184>
cmp    %r13d,%eax
mov    0x18(%rsp),%rbp
mov    0xc(%rsp),%r12d
jge    12e4 <main+0x184>
lea    (%r15,%rax,8),%r15
sub    %eax,%r13d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%r9
mov    %rbp,%rdi
mov    %r12d,%esi
mov    0x10(%rsp),%edx
mov    %r14d,%ecx
mov    0x14(%rsp),%r8d
call   1050 <procesarArchivo@plt>
add    $0x1,%rbx
cmp    %ebx,%r13d
jne    12c0 <main+0x160>
xor    %eax,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   1030 <imprime_uso@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
xor    %eax,%eax
call   1030 <imprime_uso@plt>
mov    0x2cb9(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

LLVM IR (-O0):
%struct.option = type { i8*, i32, i8, i32* }
@.str = [11 x i8] c"hs:v:i:tl:\00"
@.str.1 = [5 x i8] c"help\00"
@.str.2 = [17 x i8] c"number-separator\00"
@.str.3 = [21 x i8] c"starting-line-number\00"
@.str.4 = [15 x i8] c"line-increment\00"
@.str.5 = [10 x i8] c"non-empty\00"
@.str.6 = [17 x i8] c"join-blank-lines\00"
@__const.main.op_largas = [7 x %struct.option] [%struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i32 0, i8 0, i32* inttoptr (i64 104 to i32*) }, %struct.option { i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i32 0, i32 0), i32 2, i8 0, i32* inttoptr (i64 115 to i32*) }, %struct.option { i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i32 0, i32 0), i32 2, i8 0, i32* inttoptr (i64 118 to i32*) }, %struct.option { i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i32 0, i32 0), i32 2, i8 0, i32* inttoptr (i64 105 to i32*) }, %struct.option { i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i32 0, i32 0), i32 2, i8 0, i32* inttoptr (i64 116 to i32*) }, %struct.option { i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i32 0, i32 0), i32 2, i8 0, i32* inttoptr (i64 108 to i32*) }, %struct.option zeroinitializer]
@EXIT_SUCCESS = global i32 0
@optarg = global i8* null
@optind = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i8*
%16 = alloca [7 x %struct.option]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %11
store i8* null, i8** %12
store i8* null, i8** %13
store i32 1, i32* %14
store i32 1, i32* %8
store i32 1, i32* %7
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %15
%17 = bitcast [7 x %struct.option]* %16 to i8*
br label %18
18: ; preds = %2, %50
%19 = load i32, i32* %4
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %16, i64 0, i64 0
%22 = call i32 @getopt_long(i32 %19, i8** %20, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), %struct.option* %21, i32* null)
store i32 %22, i32* %10
%23 = load i32, i32* %10
%24 = icmp eq i32 %23, -1
br i1 %24, label %25, label %26
25: ; preds = %18
br label %51
26: ; preds = %18
%27 = load i32, i32* %10
switch i32 %27, label %48 [
i32 104, label %28
i32 115, label %32
i32 118, label %34
i32 105, label %37
i32 116, label %40
i32 108, label %41
i32 63, label %44
i32 -1, label %47
]
28: ; preds = %26
%29 = call i32 (...) @imprime_uso()
%30 = load i32, i32* @EXIT_SUCCESS
%31 = call i32 @exit(i32 %30)
unreachable
32: ; preds = %26
%33 = load i8*, i8** @optarg
store i8* %33, i8** %13
br label %50
34: ; preds = %26
%35 = load i8*, i8** @optarg
%36 = call i32 @atoi(i8* %35)
store i32 %36, i32* %7
br label %50
37: ; preds = %26
%38 = load i8*, i8** @optarg
%39 = call i32 @atoi(i8* %38)
store i32 %39, i32* %8
br label %50
40: ; preds = %26
store i32 0, i32* %14
br label %50
41: ; preds = %26
%42 = load i8*, i8** @optarg
%43 = call i32 @atoi(i8* %42)
store i32 %43, i32* %9
br label %50
44: ; preds = %26
%45 = call i32 (...) @imprime_uso()
%46 = call i32 @exit(i32 1)
unreachable
47: ; preds = %26
br label %50
48: ; preds = %26
%49 = call i32 @exit(i32 1)
unreachable
50: ; preds = %47, %41, %40, %37, %34, %32
br label %18
51: ; preds = %25
%52 = load i32, i32* @optind
store i32 %52, i32* %6
%53 = load i32, i32* %6
%54 = load i32, i32* %4
%55 = icmp eq i32 %53, %54
br i1 %55, label %56, label %68
56: ; preds = %51
store i8* null, i8** %12
%57 = load i8*, i8** %13
%58 = load i32, i32* %7
%59 = load i32, i32* %8
%60 = load i32, i32* %14
%61 = load i32, i32* %9
%62 = load i8**, i8*** %5
%63 = load i32, i32* %6
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i8*, i8** %62, i64 %64
%66 = load i8*, i8** %65
%67 = call i32 @procesarArchivo(i8* %57, i32 %58, i32 %59, i32 %60, i32 %61, i8* %66)
br label %90
68: ; preds = %51
%69 = load i32, i32* @optind
store i32 %69, i32* %6
br label %70
70: ; preds = %86, %68
%71 = load i32, i32* %6
%72 = load i32, i32* %4
%73 = icmp slt i32 %71, %72
br i1 %73, label %74, label %89
74: ; preds = %70
%75 = load i8*, i8** %13
%76 = load i32, i32* %7
%77 = load i32, i32* %8
%78 = load i32, i32* %14
%79 = load i32, i32* %9
%80 = load i8**, i8*** %5
%81 = load i32, i32* %6
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds i8*, i8** %80, i64 %82
%84 = load i8*, i8** %83
%85 = call i32 @procesarArchivo(i8* %75, i32 %76, i32 %77, i32 %78, i32 %79, i8* %84)
br label %86
86: ; preds = %74
%87 = load i32, i32* %6
%88 = add nsw i32 %87, 1
store i32 %88, i32* %6
br label %70
89: ; preds = %70
br label %90
90: ; preds = %89, %56
ret i32 0
}

LLVM IR (-O2):
%struct.option = type { i8*, i32, i8, i32* }
@.str = [11 x i8] c"hs:v:i:tl:\00"
@.str.1 = [5 x i8] c"help\00"
@.str.2 = [17 x i8] c"number-separator\00"
@.str.3 = [21 x i8] c"starting-line-number\00"
@.str.4 = [15 x i8] c"line-increment\00"
@.str.5 = [10 x i8] c"non-empty\00"
@.str.6 = [17 x i8] c"join-blank-lines\00"
@__const.main.op_largas = [7 x %struct.option] [%struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i32 0, i8 0, i32* inttoptr (i64 104 to i32*) }, %struct.option { i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i32 0, i32 0), i32 2, i8 0, i32* inttoptr (i64 115 to i32*) }, %struct.option { i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i32 0, i32 0), i32 2, i8 0, i32* inttoptr (i64 118 to i32*) }, %struct.option { i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i32 0, i32 0), i32 2, i8 0, i32* inttoptr (i64 105 to i32*) }, %struct.option { i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i32 0, i32 0), i32 2, i8 0, i32* inttoptr (i64 116 to i32*) }, %struct.option { i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i32 0, i32 0), i32 2, i8 0, i32* inttoptr (i64 108 to i32*) }, %struct.option zeroinitializer]
@EXIT_SUCCESS = global i32 0
@optarg = global i8* null
@optind = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [7 x %struct.option]
%4 = bitcast [7 x %struct.option]* %3 to i8*
%5 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 0
br label %6
6: ; preds = %39, %2
%7 = phi i32 [ %41, %39 ], [ undef, %2 ]
%8 = phi i32 [ %13, %39 ], [ 1, %2 ]
%9 = phi i32 [ %18, %39 ], [ 1, %2 ]
%10 = phi i8* [ %22, %39 ], [ null, %2 ]
%11 = phi i32 [ %25, %39 ], [ 1, %2 ]
br label %12
12: ; preds = %6, %36
%13 = phi i32 [ %8, %6 ], [ %38, %36 ]
%14 = phi i32 [ %9, %6 ], [ %18, %36 ]
%15 = phi i8* [ %10, %6 ], [ %22, %36 ]
%16 = phi i32 [ %11, %6 ], [ %25, %36 ]
br label %17
17: ; preds = %12, %33
%18 = phi i32 [ %14, %12 ], [ %35, %33 ]
%19 = phi i8* [ %15, %12 ], [ %22, %33 ]
%20 = phi i32 [ %16, %12 ], [ %25, %33 ]
br label %21
21: ; preds = %17, %31
%22 = phi i8* [ %19, %17 ], [ %32, %31 ]
%23 = phi i32 [ %20, %17 ], [ %25, %31 ]
br label %24
24: ; preds = %21, %24
%25 = phi i32 [ 0, %24 ], [ %23, %21 ]
%26 = call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %struct.option* %5, i32* null)
switch i32 %26, label %45 [
i32 -1, label %47
i32 104, label %27
i32 115, label %31
i32 118, label %33
i32 105, label %36
i32 116, label %24
i32 108, label %39
i32 63, label %42
]
27: ; preds = %24
%28 = call i32 (...) @imprime_uso()
%29 = load i32, i32* @EXIT_SUCCESS
%30 = call i32 @exit(i32 %29)
unreachable
31: ; preds = %24
%32 = load i8*, i8** @optarg
br label %21
33: ; preds = %24
%34 = load i8*, i8** @optarg
%35 = call i32 @atoi(i8* %34)
br label %17
36: ; preds = %24
%37 = load i8*, i8** @optarg
%38 = call i32 @atoi(i8* %37)
br label %12
39: ; preds = %24
%40 = load i8*, i8** @optarg
%41 = call i32 @atoi(i8* %40)
br label %6
42: ; preds = %24
%43 = call i32 (...) @imprime_uso()
%44 = call i32 @exit(i32 1)
unreachable
45: ; preds = %24
%46 = call i32 @exit(i32 1)
unreachable
47: ; preds = %24
%48 = load i32, i32* @optind
%49 = icmp eq i32 %48, %0
br i1 %49, label %54, label %50
50: ; preds = %47
%51 = icmp slt i32 %48, %0
br i1 %51, label %52, label %67
52: ; preds = %50
%53 = sext i32 %48 to i64
br label %59
54: ; preds = %47
%55 = sext i32 %0 to i64
%56 = getelementptr inbounds i8*, i8** %1, i64 %55
%57 = load i8*, i8** %56
%58 = call i32 @procesarArchivo(i8* %22, i32 %18, i32 %13, i32 %25, i32 %7, i8* %57)
br label %67
59: ; preds = %52, %59
%60 = phi i64 [ %53, %52 ], [ %64, %59 ]
%61 = getelementptr inbounds i8*, i8** %1, i64 %60
%62 = load i8*, i8** %61
%63 = call i32 @procesarArchivo(i8* %22, i32 %18, i32 %13, i32 %25, i32 %7, i8* %62)
%64 = add nsw i64 %60, 1
%65 = trunc i64 %64 to i32
%66 = icmp eq i32 %65, %0
br i1 %66, label %67, label %59
67: ; preds = %59, %50, %54
ret i32 0
}