#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*/ EINVAL;
int atoi(char *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
char *malloc(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int parsing(int argc, char *argv[], int *nwork, int *nchronon, char **dumpfile,
            char **wator_file, char *maschera) {
  int i, ret = 1;
  *nwork = 10;
  *nchronon = 5;
  *dumpfile = NULL;
  *wator_file = NULL;
  *maschera = 0;
  i = 1;
  while (i < argc && ret) {
    if (!strcmp(argv[i], "-n")) {
      if (i < argc - 1) {
        *nwork = atoi(argv[i + 1]);
        i++;
      } else {
        fprintf(stderr, "[WATOR] l'opzione -n richiede un argomento intero\n");
        ret = 0;
        errno = EINVAL;
      }
    } else if (!strcmp(argv[i], "-v")) {
      if (i < argc - 1) {
        *nchronon = atoi(argv[i + 1]);
        i++;
      } else {
        fprintf(stderr, "[WATOR] l'opzione -v richiede un argomento intero\n");
        ret = 0;
        errno = EINVAL;
      }
    } else if (!strcmp(argv[i], "-f")) {
      if (i < argc - 1) {
        *dumpfile = malloc(sizeof(char) * strlen(argv[i]) + 1);
        strcpy(*dumpfile, argv[i + 1]);
        i++;
      } else {
        fprintf(stderr,
                "[WATOR] l'opzione -f richiede un file come argomento\n");
        ret = 0;
        errno = EINVAL;
      }
    } else if (!strcmp(argv[i], "-c")) {
      *maschera |= 32;
    } else if (!strcmp(argv[i], "-D")) {
      *maschera |= 1;
    } else if (!strcmp(argv[i], "-W")) {
      *maschera |= 2;
    } else if (!strcmp(argv[i], "-C")) {
      *maschera |= 4;
    } else if (!strcmp(argv[i], "-V")) {
      *maschera |= 8;
    } else if (!strcmp(argv[i], "-M")) {
      *maschera |= 16;
    } else if (!strcmp(argv[i], "-A")) {
      *maschera |= 1 | 2 | 4 | 8 | 16;
    } else {
      if (*wator_file == NULL) {
        *wator_file = malloc(sizeof(char) * strlen(argv[i]) + 1);
        strcpy(*wator_file, argv[i]);
      } else {
        fprintf(stderr, "[WATOR] puoi specificare al massimo un file\n");
        ret = 0;
        errno = EINVAL;
      }
    }
    i++;
  }
  if (*nwork <= 0 || *nchronon <= 0 || !*wator_file) {
    ret = 0;
    errno = EINVAL;
  }
  if (*maschera & 32) {
    *maschera = 32;
  }
  return ret;
}


x86 assembly (clang, -O0):
<parsing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x1,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movl   $0xa,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x28(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x30(%rbp),%rax
movq   $0x0,(%rax)
mov    0x10(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%ecx
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0x39(%rbp)
jge    11dd <parsing+0x7d>
cmpl   $0x0,-0x38(%rbp)
setne  %al
mov    %al,-0x39(%rbp)
mov    -0x39(%rbp),%al
test   $0x1,%al
jne    11ed <parsing+0x8d>
jmp    15ee <parsing+0x48e>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe00(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    127e <parsing+0x11e>
mov    -0x34(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    124b <parsing+0xeb>
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1080 <atoi@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1279 <parsing+0x119>
mov    0x2d8e(%rip),%rax
mov    (%rax),%edi
lea    0xda8(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x0,-0x38(%rbp)
mov    0x2d62(%rip),%rax
mov    (%rax),%ecx
mov    0x2d61(%rip),%rax
mov    %ecx,(%rax)
jmp    15e0 <parsing+0x480>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xda5(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    130f <parsing+0x1af>
mov    -0x34(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12dc <parsing+0x17c>
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1080 <atoi@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    130a <parsing+0x1aa>
mov    0x2cfd(%rip),%rax
mov    (%rax),%edi
lea    0xd4d(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x0,-0x38(%rbp)
mov    0x2cd1(%rip),%rax
mov    (%rax),%ecx
mov    0x2cd0(%rip),%rax
mov    %ecx,(%rax)
jmp    15db <parsing+0x47b>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd4a(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    13cb <parsing+0x26b>
mov    -0x34(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1398 <parsing+0x238>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <strlen@plt>
cltq
shl    $0x0,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <strcpy@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    13c6 <parsing+0x266>
mov    0x2c41(%rip),%rax
mov    (%rax),%edi
lea    0xcc7(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x0,-0x38(%rbp)
mov    0x2c15(%rip),%rax
mov    (%rax),%ecx
mov    0x2c14(%rip),%rax
mov    %ecx,(%rax)
jmp    15d6 <parsing+0x476>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xcc7(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    13fd <parsing+0x29d>
mov    0x10(%rbp),%rax
movsbl (%rax),%ecx
or     $0x20,%ecx
mov    %cl,(%rax)
jmp    15d1 <parsing+0x471>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc98(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    142f <parsing+0x2cf>
mov    0x10(%rbp),%rax
movsbl (%rax),%ecx
or     $0x1,%ecx
mov    %cl,(%rax)
jmp    15cc <parsing+0x46c>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc69(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1461 <parsing+0x301>
mov    0x10(%rbp),%rax
movsbl (%rax),%ecx
or     $0x2,%ecx
mov    %cl,(%rax)
jmp    15c7 <parsing+0x467>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc3a(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1493 <parsing+0x333>
mov    0x10(%rbp),%rax
movsbl (%rax),%ecx
or     $0x4,%ecx
mov    %cl,(%rax)
jmp    15c2 <parsing+0x462>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc0b(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    14c5 <parsing+0x365>
mov    0x10(%rbp),%rax
movsbl (%rax),%ecx
or     $0x8,%ecx
mov    %cl,(%rax)
jmp    15bd <parsing+0x45d>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xbdc(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    14f7 <parsing+0x397>
mov    0x10(%rbp),%rax
movsbl (%rax),%ecx
or     $0x10,%ecx
mov    %cl,(%rax)
jmp    15b8 <parsing+0x458>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xbad(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1529 <parsing+0x3c9>
mov    0x10(%rbp),%rax
movsbl (%rax),%ecx
or     $0x1f,%ecx
mov    %cl,(%rax)
jmp    15b3 <parsing+0x453>
mov    -0x30(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1580 <parsing+0x420>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <strlen@plt>
cltq
shl    $0x0,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x30(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <strcpy@plt>
jmp    15ae <parsing+0x44e>
mov    0x2a59(%rip),%rax
mov    (%rax),%edi
lea    0xb2a(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x0,-0x38(%rbp)
mov    0x2a2d(%rip),%rax
mov    (%rax),%ecx
mov    0x2a2c(%rip),%rax
mov    %ecx,(%rax)
jmp    15b3 <parsing+0x453>
jmp    15b8 <parsing+0x458>
jmp    15bd <parsing+0x45d>
jmp    15c2 <parsing+0x462>
jmp    15c7 <parsing+0x467>
jmp    15cc <parsing+0x46c>
jmp    15d1 <parsing+0x471>
jmp    15d6 <parsing+0x476>
jmp    15db <parsing+0x47b>
jmp    15e0 <parsing+0x480>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11c2 <parsing+0x62>
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jle    1616 <parsing+0x4b6>
mov    -0x20(%rbp),%rax
cmpl   $0x0,(%rax)
jle    1616 <parsing+0x4b6>
mov    -0x30(%rbp),%rax
cmpq   $0x0,(%rax)
jne    162f <parsing+0x4cf>
movl   $0x0,-0x38(%rbp)
mov    0x29ac(%rip),%rax
mov    (%rax),%ecx
mov    0x29ab(%rip),%rax
mov    %ecx,(%rax)
mov    0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     1649 <parsing+0x4e9>
mov    0x10(%rbp),%rax
movb   $0x20,(%rax)
mov    -0x38(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parsing>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,%r14
mov    %rdx,%rbx
mov    0x60(%rsp),%rbp
movl   $0xa,(%rdx)
mov    %rcx,0x18(%rsp)
movl   $0x5,(%rcx)
mov    %r8,0x20(%rsp)
movq   $0x0,(%r8)
movq   $0x0,(%r9)
movb   $0x0,0x0(%rbp)
mov    $0x1,%eax
cmp    $0x2,%edi
jl     13db <parsing+0x27b>
mov    %rsi,%r15
mov    %r14,0x10(%rsp)
lea    -0x1(%rdi),%eax
mov    %eax,0xc(%rsp)
mov    $0x1,%r14d
jmp    11e0 <parsing+0x80>
mov    0x60(%rsp),%rax
orb    $0x20,(%rax)
xchg   %ax,%ax
mov    %rbp,%rdi
add    $0x1,%r14d
cmp    %edi,%r14d
jge    13cc <parsing+0x26c>
mov    %rdi,%rbp
movslq %r14d,%r13
mov    (%r15,%r13,8),%r12
mov    %r12,%rdi
lea    0xe0c(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1300 <parsing+0x1a0>
mov    %r12,%rdi
lea    0xe2b(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1320 <parsing+0x1c0>
mov    %r12,%rdi
lea    0xe4a(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1345 <parsing+0x1e5>
mov    %r12,%rdi
lea    0xe6c(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     11c6 <parsing+0x66>
mov    %r12,%rdi
lea    0xe5c(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     137e <parsing+0x21e>
mov    %r12,%rdi
lea    0xe48(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     138b <parsing+0x22b>
mov    %r12,%rdi
lea    0xe34(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1398 <parsing+0x238>
mov    %r12,%rdi
lea    0xe20(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     13a5 <parsing+0x245>
mov    %r12,%rdi
lea    0xe0c(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     13b2 <parsing+0x252>
mov    %r12,%rdi
lea    0xdf8(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     13bf <parsing+0x25f>
mov    0x10(%rsp),%rax
cmpq   $0x0,(%rax)
jne    146f <parsing+0x30f>
mov    %r12,%rdi
mov    %rax,%r12
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1070 <malloc@plt>
mov    %rax,(%r12)
mov    (%r15,%r13,8),%rsi
jmp    1371 <parsing+0x211>
nopl   0x0(%rax,%rax,1)
cmp    0xc(%rsp),%r14d
jge    1409 <parsing+0x2a9>
add    $0x1,%r14d
mov    0x8(%r15,%r13,8),%rdi
call   1080 <atoi@plt>
mov    %eax,(%rbx)
jmp    11d0 <parsing+0x70>
cmp    0xc(%rsp),%r14d
jge    1412 <parsing+0x2b2>
add    $0x1,%r14d
mov    0x8(%r15,%r13,8),%rdi
call   1080 <atoi@plt>
mov    0x18(%rsp),%rcx
mov    %eax,(%rcx)
jmp    11d0 <parsing+0x70>
cmp    0xc(%rsp),%r14d
jge    141b <parsing+0x2bb>
mov    %r12,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1070 <malloc@plt>
mov    0x20(%rsp),%rcx
mov    %rax,(%rcx)
add    $0x1,%r14d
mov    0x8(%r15,%r13,8),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
jmp    11d0 <parsing+0x70>
mov    0x60(%rsp),%rax
orb    $0x1,(%rax)
jmp    11d0 <parsing+0x70>
mov    0x60(%rsp),%rax
orb    $0x2,(%rax)
jmp    11d0 <parsing+0x70>
mov    0x60(%rsp),%rax
orb    $0x4,(%rax)
jmp    11d0 <parsing+0x70>
mov    0x60(%rsp),%rax
orb    $0x8,(%rax)
jmp    11d0 <parsing+0x70>
mov    0x60(%rsp),%rax
orb    $0x10,(%rax)
jmp    11d0 <parsing+0x70>
mov    0x60(%rsp),%rax
orb    $0x1f,(%rax)
jmp    11d0 <parsing+0x70>
mov    $0x1,%eax
mov    0x60(%rsp),%rbp
mov    0x10(%rsp),%r14
cmpl   $0x0,(%rbx)
jle    1453 <parsing+0x2f3>
mov    0x18(%rsp),%rcx
cmpl   $0x0,(%rcx)
jle    1453 <parsing+0x2f3>
cmpq   $0x0,(%r14)
je     1453 <parsing+0x2f3>
testb  $0x20,0x0(%rbp)
je     13fa <parsing+0x29a>
movb   $0x20,0x0(%rbp)
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xbf3(%rip),%rsi
jmp    1422 <parsing+0x2c2>
lea    0xc20(%rip),%rsi
jmp    1422 <parsing+0x2c2>
lea    0xc4d(%rip),%rsi
mov    0x60(%rsp),%rbp
mov    0x10(%rsp),%r14
mov    0x2bad(%rip),%rax
mov    (%rax),%edi
call   1060 <fprintf@plt>
mov    0x2b8f(%rip),%rax
mov    (%rax),%eax
mov    0x2b8e(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
cmpl   $0x0,(%rbx)
jg     13e0 <parsing+0x280>
mov    0x2b76(%rip),%rax
mov    (%rax),%eax
mov    0x2b75(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
testb  $0x20,0x0(%rbp)
jne    13f6 <parsing+0x296>
jmp    13fa <parsing+0x29a>
mov    0x60(%rsp),%rbp
mov    %rax,%r14
lea    0xc3c(%rip),%rsi
jmp    142c <parsing+0x2cc>

LLVM IR (-O0):
@.str = [3 x i8] c"-n\00"
@stderr = global i32 0
@.str.1 = [51 x i8] c"[WATOR] l'opzione -n richiede un argomento intero\0A\00"
@EINVAL = global i32 0
@errno = global i32 0
@.str.2 = [3 x i8] c"-v\00"
@.str.3 = [51 x i8] c"[WATOR] l'opzione -v richiede un argomento intero\0A\00"
@.str.4 = [3 x i8] c"-f\00"
@.str.5 = [54 x i8] c"[WATOR] l'opzione -f richiede un file come argomento\0A\00"
@.str.6 = [3 x i8] c"-c\00"
@.str.7 = [3 x i8] c"-D\00"
@.str.8 = [3 x i8] c"-W\00"
@.str.9 = [3 x i8] c"-C\00"
@.str.10 = [3 x i8] c"-V\00"
@.str.11 = [3 x i8] c"-M\00"
@.str.12 = [3 x i8] c"-A\00"
@.str.13 = [45 x i8] c"[WATOR] puoi specificare al massimo un file\0A\00"
define i32 @parsing(i32 %0, i8** %1, i32* %2, i32* %3, i8** %4, i8** %5, i8* %6) {
%8 = alloca i32
%9 = alloca i8**
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i8**
%13 = alloca i8**
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i32
store i32 %0, i32* %8
store i8** %1, i8*** %9
store i32* %2, i32** %10
store i32* %3, i32** %11
store i8** %4, i8*** %12
store i8** %5, i8*** %13
store i8* %6, i8** %14
store i32 1, i32* %16
%17 = load i32*, i32** %10
store i32 10, i32* %17
%18 = load i32*, i32** %11
store i32 5, i32* %18
%19 = load i8**, i8*** %12
store i8* null, i8** %19
%20 = load i8**, i8*** %13
store i8* null, i8** %20
%21 = load i8*, i8** %14
store i8 0, i8* %21
store i32 1, i32* %15
br label %22
22: ; preds = %268, %7
%23 = load i32, i32* %15
%24 = load i32, i32* %8
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %29
26: ; preds = %22
%27 = load i32, i32* %16
%28 = icmp ne i32 %27, 0
br label %29
29: ; preds = %26, %22
%30 = phi i1 [ false, %22 ], [ %28, %26 ]
br i1 %30, label %31, label %271
31: ; preds = %29
%32 = load i8**, i8*** %9
%33 = load i32, i32* %15
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8*, i8** %32, i64 %34
%36 = load i8*, i8** %35
%37 = call i32 @strcmp(i8* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%38 = icmp ne i32 %37, 0
br i1 %38, label %60, label %39
39: ; preds = %31
%40 = load i32, i32* %15
%41 = load i32, i32* %8
%42 = sub nsw i32 %41, 1
%43 = icmp slt i32 %40, %42
br i1 %43, label %44, label %55
44: ; preds = %39
%45 = load i8**, i8*** %9
%46 = load i32, i32* %15
%47 = add nsw i32 %46, 1
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i8*, i8** %45, i64 %48
%50 = load i8*, i8** %49
%51 = call i32 @atoi(i8* %50)
%52 = load i32*, i32** %10
store i32 %51, i32* %52
%53 = load i32, i32* %15
%54 = add nsw i32 %53, 1
store i32 %54, i32* %15
br label %59
55: ; preds = %39
%56 = load i32, i32* @stderr
%57 = call i32 @fprintf(i32 %56, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %16
%58 = load i32, i32* @EINVAL
store i32 %58, i32* @errno
br label %59
59: ; preds = %55, %44
br label %268
60: ; preds = %31
%61 = load i8**, i8*** %9
%62 = load i32, i32* %15
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i8*, i8** %61, i64 %63
%65 = load i8*, i8** %64
%66 = call i32 @strcmp(i8* %65, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%67 = icmp ne i32 %66, 0
br i1 %67, label %89, label %68
68: ; preds = %60
%69 = load i32, i32* %15
%70 = load i32, i32* %8
%71 = sub nsw i32 %70, 1
%72 = icmp slt i32 %69, %71
br i1 %72, label %73, label %84
73: ; preds = %68
%74 = load i8**, i8*** %9
%75 = load i32, i32* %15
%76 = add nsw i32 %75, 1
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i8*, i8** %74, i64 %77
%79 = load i8*, i8** %78
%80 = call i32 @atoi(i8* %79)
%81 = load i32*, i32** %11
store i32 %80, i32* %81
%82 = load i32, i32* %15
%83 = add nsw i32 %82, 1
store i32 %83, i32* %15
br label %88
84: ; preds = %68
%85 = load i32, i32* @stderr
%86 = call i32 @fprintf(i32 %85, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %16
%87 = load i32, i32* @EINVAL
store i32 %87, i32* @errno
br label %88
88: ; preds = %84, %73
br label %267
89: ; preds = %60
%90 = load i8**, i8*** %9
%91 = load i32, i32* %15
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds i8*, i8** %90, i64 %92
%94 = load i8*, i8** %93
%95 = call i32 @strcmp(i8* %94, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%96 = icmp ne i32 %95, 0
br i1 %96, label %131, label %97
97: ; preds = %89
%98 = load i32, i32* %15
%99 = load i32, i32* %8
%100 = sub nsw i32 %99, 1
%101 = icmp slt i32 %98, %100
br i1 %101, label %102, label %126
102: ; preds = %97
%103 = load i8**, i8*** %9
%104 = load i32, i32* %15
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i8*, i8** %103, i64 %105
%107 = load i8*, i8** %106
%108 = call i32 @strlen(i8* %107)
%109 = sext i32 %108 to i64
%110 = mul i64 1, %109
%111 = add i64 %110, 1
%112 = trunc i64 %111 to i32
%113 = call i8* @malloc(i32 %112)
%114 = load i8**, i8*** %12
store i8* %113, i8** %114
%115 = load i8**, i8*** %12
%116 = load i8*, i8** %115
%117 = load i8**, i8*** %9
%118 = load i32, i32* %15
%119 = add nsw i32 %118, 1
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds i8*, i8** %117, i64 %120
%122 = load i8*, i8** %121
%123 = call i32 @strcpy(i8* %116, i8* %122)
%124 = load i32, i32* %15
%125 = add nsw i32 %124, 1
store i32 %125, i32* %15
br label %130
126: ; preds = %97
%127 = load i32, i32* @stderr
%128 = call i32 @fprintf(i32 %127, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %16
%129 = load i32, i32* @EINVAL
store i32 %129, i32* @errno
br label %130
130: ; preds = %126, %102
br label %266
131: ; preds = %89
%132 = load i8**, i8*** %9
%133 = load i32, i32* %15
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds i8*, i8** %132, i64 %134
%136 = load i8*, i8** %135
%137 = call i32 @strcmp(i8* %136, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%138 = icmp ne i32 %137, 0
br i1 %138, label %145, label %139
139: ; preds = %131
%140 = load i8*, i8** %14
%141 = load i8, i8* %140
%142 = sext i8 %141 to i32
%143 = or i32 %142, 32
%144 = trunc i32 %143 to i8
store i8 %144, i8* %140
br label %265
145: ; preds = %131
%146 = load i8**, i8*** %9
%147 = load i32, i32* %15
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds i8*, i8** %146, i64 %148
%150 = load i8*, i8** %149
%151 = call i32 @strcmp(i8* %150, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%152 = icmp ne i32 %151, 0
br i1 %152, label %159, label %153
153: ; preds = %145
%154 = load i8*, i8** %14
%155 = load i8, i8* %154
%156 = sext i8 %155 to i32
%157 = or i32 %156, 1
%158 = trunc i32 %157 to i8
store i8 %158, i8* %154
br label %264
159: ; preds = %145
%160 = load i8**, i8*** %9
%161 = load i32, i32* %15
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds i8*, i8** %160, i64 %162
%164 = load i8*, i8** %163
%165 = call i32 @strcmp(i8* %164, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%166 = icmp ne i32 %165, 0
br i1 %166, label %173, label %167
167: ; preds = %159
%168 = load i8*, i8** %14
%169 = load i8, i8* %168
%170 = sext i8 %169 to i32
%171 = or i32 %170, 2
%172 = trunc i32 %171 to i8
store i8 %172, i8* %168
br label %263
173: ; preds = %159
%174 = load i8**, i8*** %9
%175 = load i32, i32* %15
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds i8*, i8** %174, i64 %176
%178 = load i8*, i8** %177
%179 = call i32 @strcmp(i8* %178, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%180 = icmp ne i32 %179, 0
br i1 %180, label %187, label %181
181: ; preds = %173
%182 = load i8*, i8** %14
%183 = load i8, i8* %182
%184 = sext i8 %183 to i32
%185 = or i32 %184, 4
%186 = trunc i32 %185 to i8
store i8 %186, i8* %182
br label %262
187: ; preds = %173
%188 = load i8**, i8*** %9
%189 = load i32, i32* %15
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds i8*, i8** %188, i64 %190
%192 = load i8*, i8** %191
%193 = call i32 @strcmp(i8* %192, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%194 = icmp ne i32 %193, 0
br i1 %194, label %201, label %195
195: ; preds = %187
%196 = load i8*, i8** %14
%197 = load i8, i8* %196
%198 = sext i8 %197 to i32
%199 = or i32 %198, 8
%200 = trunc i32 %199 to i8
store i8 %200, i8* %196
br label %261
201: ; preds = %187
%202 = load i8**, i8*** %9
%203 = load i32, i32* %15
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds i8*, i8** %202, i64 %204
%206 = load i8*, i8** %205
%207 = call i32 @strcmp(i8* %206, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%208 = icmp ne i32 %207, 0
br i1 %208, label %215, label %209
209: ; preds = %201
%210 = load i8*, i8** %14
%211 = load i8, i8* %210
%212 = sext i8 %211 to i32
%213 = or i32 %212, 16
%214 = trunc i32 %213 to i8
store i8 %214, i8* %210
br label %260
215: ; preds = %201
%216 = load i8**, i8*** %9
%217 = load i32, i32* %15
%218 = sext i32 %217 to i64
%219 = getelementptr inbounds i8*, i8** %216, i64 %218
%220 = load i8*, i8** %219
%221 = call i32 @strcmp(i8* %220, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%222 = icmp ne i32 %221, 0
br i1 %222, label %229, label %223
223: ; preds = %215
%224 = load i8*, i8** %14
%225 = load i8, i8* %224
%226 = sext i8 %225 to i32
%227 = or i32 %226, 31
%228 = trunc i32 %227 to i8
store i8 %228, i8* %224
br label %259
229: ; preds = %215
%230 = load i8**, i8*** %13
%231 = load i8*, i8** %230
%232 = icmp eq i8* %231, null
br i1 %232, label %233, label %254
233: ; preds = %229
%234 = load i8**, i8*** %9
%235 = load i32, i32* %15
%236 = sext i32 %235 to i64
%237 = getelementptr inbounds i8*, i8** %234, i64 %236
%238 = load i8*, i8** %237
%239 = call i32 @strlen(i8* %238)
%240 = sext i32 %239 to i64
%241 = mul i64 1, %240
%242 = add i64 %241, 1
%243 = trunc i64 %242 to i32
%244 = call i8* @malloc(i32 %243)
%245 = load i8**, i8*** %13
store i8* %244, i8** %245
%246 = load i8**, i8*** %13
%247 = load i8*, i8** %246
%248 = load i8**, i8*** %9
%249 = load i32, i32* %15
%250 = sext i32 %249 to i64
%251 = getelementptr inbounds i8*, i8** %248, i64 %250
%252 = load i8*, i8** %251
%253 = call i32 @strcpy(i8* %247, i8* %252)
br label %258
254: ; preds = %229
%255 = load i32, i32* @stderr
%256 = call i32 @fprintf(i32 %255, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.13, i64 0, i64 0))
store i32 0, i32* %16
%257 = load i32, i32* @EINVAL
store i32 %257, i32* @errno
br label %258
258: ; preds = %254, %233
br label %259
259: ; preds = %258, %223
br label %260
260: ; preds = %259, %209
br label %261
261: ; preds = %260, %195
br label %262
262: ; preds = %261, %181
br label %263
263: ; preds = %262, %167
br label %264
264: ; preds = %263, %153
br label %265
265: ; preds = %264, %139
br label %266
266: ; preds = %265, %130
br label %267
267: ; preds = %266, %88
br label %268
268: ; preds = %267, %59
%269 = load i32, i32* %15
%270 = add nsw i32 %269, 1
store i32 %270, i32* %15
br label %22
271: ; preds = %29
%272 = load i32*, i32** %10
%273 = load i32, i32* %272
%274 = icmp sle i32 %273, 0
br i1 %274, label %283, label %275
275: ; preds = %271
%276 = load i32*, i32** %11
%277 = load i32, i32* %276
%278 = icmp sle i32 %277, 0
br i1 %278, label %283, label %279
279: ; preds = %275
%280 = load i8**, i8*** %13
%281 = load i8*, i8** %280
%282 = icmp ne i8* %281, null
br i1 %282, label %285, label %283
283: ; preds = %279, %275, %271
store i32 0, i32* %16
%284 = load i32, i32* @EINVAL
store i32 %284, i32* @errno
br label %285
285: ; preds = %283, %279
%286 = load i8*, i8** %14
%287 = load i8, i8* %286
%288 = sext i8 %287 to i32
%289 = and i32 %288, 32
%290 = icmp ne i32 %289, 0
br i1 %290, label %291, label %293
291: ; preds = %285
%292 = load i8*, i8** %14
store i8 32, i8* %292
br label %293
293: ; preds = %291, %285
%294 = load i32, i32* %16
ret i32 %294
}

LLVM IR (-O2):
@.str = [3 x i8] c"-n\00"
@stderr = global i32 0
@.str.1 = [51 x i8] c"[WATOR] l'opzione -n richiede un argomento intero\0A\00"
@EINVAL = global i32 0
@errno = global i32 0
@.str.2 = [3 x i8] c"-v\00"
@.str.3 = [51 x i8] c"[WATOR] l'opzione -v richiede un argomento intero\0A\00"
@.str.4 = [3 x i8] c"-f\00"
@.str.5 = [54 x i8] c"[WATOR] l'opzione -f richiede un file come argomento\0A\00"
@.str.6 = [3 x i8] c"-c\00"
@.str.7 = [3 x i8] c"-D\00"
@.str.8 = [3 x i8] c"-W\00"
@.str.9 = [3 x i8] c"-C\00"
@.str.10 = [3 x i8] c"-V\00"
@.str.11 = [3 x i8] c"-M\00"
@.str.12 = [3 x i8] c"-A\00"
@.str.13 = [45 x i8] c"[WATOR] puoi specificare al massimo un file\0A\00"
define i32 @parsing(i32 %0, i8** nocapture %1, i32* nocapture %2, i32* nocapture %3, i8** nocapture writeonly %4, i8** nocapture %5, i8* nocapture %6) {
store i32 10, i32* %2
store i32 5, i32* %3
store i8* null, i8** %4
store i8* null, i8** %5
store i8 0, i8* %6
%8 = icmp sgt i32 %0, 1
br i1 %8, label %9, label %111
9: ; preds = %7
%10 = add nsw i32 %0, -1
br label %11
11: ; preds = %9, %102
%12 = phi i32 [ 1, %9 ], [ %104, %102 ]
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %1, i64 %13
%15 = load i8*, i8** %14
%16 = tail call i32 @strcmp(i8* dereferenceable(1) %15, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %26
18: ; preds = %11
%19 = icmp slt i32 %12, %10
br i1 %19, label %20, label %106
20: ; preds = %18
%21 = add nsw i32 %12, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8*, i8** %1, i64 %22
%24 = load i8*, i8** %23
%25 = tail call i32 @atoi(i8* %24)
store i32 %25, i32* %2
br label %102
26: ; preds = %11
%27 = tail call i32 @strcmp(i8* dereferenceable(1) %15, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %37
29: ; preds = %26
%30 = icmp slt i32 %12, %10
br i1 %30, label %31, label %106
31: ; preds = %29
%32 = add nsw i32 %12, 1
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8*, i8** %1, i64 %33
%35 = load i8*, i8** %34
%36 = tail call i32 @atoi(i8* %35)
store i32 %36, i32* %3
br label %102
37: ; preds = %26
%38 = tail call i32 @strcmp(i8* dereferenceable(1) %15, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %51
40: ; preds = %37
%41 = icmp slt i32 %12, %10
br i1 %41, label %42, label %106
42: ; preds = %40
%43 = tail call i32 @strlen(i8* %15)
%44 = add i32 %43, 1
%45 = tail call i8* @malloc(i32 %44)
store i8* %45, i8** %4
%46 = add nsw i32 %12, 1
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i8*, i8** %1, i64 %47
%49 = load i8*, i8** %48
%50 = tail call i32 @strcpy(i8* %45, i8* %49)
br label %102
51: ; preds = %37
%52 = tail call i32 @strcmp(i8* dereferenceable(1) %15, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %57
54: ; preds = %51
%55 = load i8, i8* %6
%56 = or i8 %55, 32
store i8 %56, i8* %6
br label %102
57: ; preds = %51
%58 = tail call i32 @strcmp(i8* dereferenceable(1) %15, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %63
60: ; preds = %57
%61 = load i8, i8* %6
%62 = or i8 %61, 1
store i8 %62, i8* %6
br label %102
63: ; preds = %57
%64 = tail call i32 @strcmp(i8* dereferenceable(1) %15, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%65 = icmp eq i32 %64, 0
br i1 %65, label %66, label %69
66: ; preds = %63
%67 = load i8, i8* %6
%68 = or i8 %67, 2
store i8 %68, i8* %6
br label %102
69: ; preds = %63
%70 = tail call i32 @strcmp(i8* dereferenceable(1) %15, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%71 = icmp eq i32 %70, 0
br i1 %71, label %72, label %75
72: ; preds = %69
%73 = load i8, i8* %6
%74 = or i8 %73, 4
store i8 %74, i8* %6
br label %102
75: ; preds = %69
%76 = tail call i32 @strcmp(i8* dereferenceable(1) %15, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%77 = icmp eq i32 %76, 0
br i1 %77, label %78, label %81
78: ; preds = %75
%79 = load i8, i8* %6
%80 = or i8 %79, 8
store i8 %80, i8* %6
br label %102
81: ; preds = %75
%82 = tail call i32 @strcmp(i8* dereferenceable(1) %15, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%83 = icmp eq i32 %82, 0
br i1 %83, label %84, label %87
84: ; preds = %81
%85 = load i8, i8* %6
%86 = or i8 %85, 16
store i8 %86, i8* %6
br label %102
87: ; preds = %81
%88 = tail call i32 @strcmp(i8* dereferenceable(1) %15, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%89 = icmp eq i32 %88, 0
br i1 %89, label %90, label %93
90: ; preds = %87
%91 = load i8, i8* %6
%92 = or i8 %91, 31
store i8 %92, i8* %6
br label %102
93: ; preds = %87
%94 = load i8*, i8** %5
%95 = icmp eq i8* %94, null
br i1 %95, label %96, label %106
96: ; preds = %93
%97 = tail call i32 @strlen(i8* %15)
%98 = add i32 %97, 1
%99 = tail call i8* @malloc(i32 %98)
store i8* %99, i8** %5
%100 = load i8*, i8** %14
%101 = tail call i32 @strcpy(i8* %99, i8* %100)
br label %102
102: ; preds = %31, %54, %66, %78, %90, %96, %84, %72, %60, %42, %20
%103 = phi i32 [ %12, %96 ], [ %12, %90 ], [ %12, %84 ], [ %12, %78 ], [ %12, %72 ], [ %12, %66 ], [ %12, %60 ], [ %12, %54 ], [ %46, %42 ], [ %32, %31 ], [ %21, %20 ]
%104 = add nsw i32 %103, 1
%105 = icmp slt i32 %104, %0
br i1 %105, label %11, label %111
106: ; preds = %93, %40, %29, %18
%107 = phi i8* [ getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), %18 ], [ getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0), %29 ], [ getelementptr inbounds ([54 x i8], [54 x i8]* @.str.5, i64 0, i64 0), %40 ], [ getelementptr inbounds ([45 x i8], [45 x i8]* @.str.13, i64 0, i64 0), %93 ]
%108 = load i32, i32* @stderr
%109 = tail call i32 @fprintf(i32 %108, i8* %107)
%110 = load i32, i32* @EINVAL
store i32 %110, i32* @errno
br label %111
111: ; preds = %102, %106, %7
%112 = phi i32 [ 1, %7 ], [ 0, %106 ], [ 1, %102 ]
%113 = load i32, i32* %2
%114 = icmp slt i32 %113, 1
br i1 %114, label %121, label %115
115: ; preds = %111
%116 = load i32, i32* %3
%117 = icmp slt i32 %116, 1
br i1 %117, label %121, label %118
118: ; preds = %115
%119 = load i8*, i8** %5
%120 = icmp eq i8* %119, null
br i1 %120, label %121, label %123
121: ; preds = %118, %115, %111
%122 = load i32, i32* @EINVAL
store i32 %122, i32* @errno
br label %123
123: ; preds = %121, %118
%124 = phi i32 [ 0, %121 ], [ %112, %118 ]
%125 = load i8, i8* %6
%126 = and i8 %125, 32
%127 = icmp eq i8 %126, 0
br i1 %127, label %129, label %128
128: ; preds = %123
store i8 32, i8* %6
br label %129
129: ; preds = %128, %123
ret i32 %124
}