// File: /workspace/github_cpp_makefile_star2_O3/mouda[P]LTE_random_access-simulate/parse.cpp
// Function: lineParsing(int, char**)
void lineParsing (int argc, char** argv) {
  if (argc == 1) {
    showHelp();
    exit(0);
  }
  else {

    for (int i = 1; i < argc; i++) {
      if (!strcmp(argv[i], "-help")) {
        showHelp();
        exit(0);
      }
      else if (!strcmp(argv[i], "-end")) {
        lte::EndNum = atoi(argv[++i]);
	cerr << "EndNum = \t" << lte::EndNum << endl;
      }
      else if (!strcmp(argv[i], "-rand")) {
        lte::RandomBackoffIndex = atoi(argv[++i]);
	cerr << "Random Backoff Index = \t" << lte::RandomBackoffIndex << endl;
      }
      else if (!strcmp(argv[i], "-type")) {
        if (!strcmp(argv[++i], "uniform")) {
          lte::traffic_type = uniform_start;
	  cerr << "traffic type = \t" << "uniform\n";
	}
        else if (!strcmp(argv[i], "beta")) {
          lte::traffic_type = beta_start;
	  cerr << "traffic type = \t" << "beta\n";
	}
        else {
          cerr << "false traffic type " << argv[i] << endl;
          exit(1);
        }
      } 
      else if (!strcmp(argv[i], "-max")) {
	lte::MAX = atoi(argv[++i]);
	cerr << "limit of retransmition = \t" << lte::MAX << endl;
      }
      else if (!strcmp(argv[i], "-pre")) {
	double part = atoi(argv[++i]);
	if ((part >= 1) && (part <= 54)) {
	    lte::preambleNum = part;
	    cerr << "Num. of preamble for machine = \t" 
              << lte::preambleNum <<endl;
	}
      }
      else {
        cerr << "false argument " << argv[i] << endl;
        exit(1);
      }
    }

  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x1, %edi
je 0x3ce3
jle 0x3cd4
movq %rsi, %rbx
movl %edi, %ebp
movl $0x1, %r14d
movq 0x3f54f(%rip), %r12     # 0x42ff0
movslq %r14d, %r15
movq (%rbx,%r15,8), %r13
movq %r13, %rdi
leaq 0x2f60e(%rip), %rsi     # 0x330c0
callq 0x3340
testl %eax, %eax
je 0x3ce3
movq %r13, %rdi
leaq 0x2f5fd(%rip), %rsi     # 0x330c6
callq 0x3340
testl %eax, %eax
je 0x3b6a
movq %r13, %rdi
leaq 0x2f5f6(%rip), %rsi     # 0x330d6
callq 0x3340
testl %eax, %eax
je 0x3b96
movq %r13, %rdi
leaq 0x2f5fe(%rip), %rsi     # 0x330f5
callq 0x3340
testl %eax, %eax
je 0x3bc2
movq %r13, %rdi
leaq 0x2f62e(%rip), %rsi     # 0x3313c
callq 0x3340
testl %eax, %eax
je 0x3c2e
movq %r13, %rdi
leaq 0x2f637(%rip), %rsi     # 0x3315c
callq 0x3340
testl %eax, %eax
jne 0x3cef
leal 0x1(%r15), %r14d
movq 0x8(%rbx,%r15,8), %rdi
callq 0x3390
leal -0x1(%rax), %ecx
cmpl $0x35, %ecx
ja 0x3c8f
leaq 0x3f705(%rip), %r15     # 0x43258
movl %eax, (%r15)
movl $0x20, %edx
movq %r12, %rdi
leaq 0x2f5fc(%rip), %rsi     # 0x33161
jmp 0x3c55
leal 0x1(%r15), %r14d
movq 0x8(%rbx,%r15,8), %rdi
callq 0x3390
leaq 0x3f6dd(%rip), %r15     # 0x4325c
movl %eax, (%r15)
movl $0xa, %edx
movq %r12, %rdi
leaq 0x2f53a(%rip), %rsi     # 0x330cb
jmp 0x3c55
leal 0x1(%r15), %r14d
movq 0x8(%rbx,%r15,8), %rdi
callq 0x3390
leaq 0x3f6bd(%rip), %r15     # 0x43268
movl %eax, (%r15)
movl $0x18, %edx
movq %r12, %rdi
leaq 0x2f51f(%rip), %rsi     # 0x330dc
jmp 0x3c55
leal 0x1(%r15), %r14d
movq 0x8(%rbx,%r15,8), %r13
movq %r13, %rdi
leaq 0x2f526(%rip), %rsi     # 0x330fb
callq 0x3340
testl %eax, %eax
je 0x3c9d
movq %r13, %rdi
leaq 0x2f531(%rip), %rsi     # 0x3311d
callq 0x3340
testl %eax, %eax
jne 0x3cff
leaq 0x3f674(%rip), %rax     # 0x43274
movl $0x3, (%rax)
movl $0x10, %edx
movq %r12, %rdi
leaq 0x2f4ee(%rip), %rsi     # 0x33103
callq 0x32d0
movl $0x5, %edx
movq %r12, %rdi
leaq 0x2f4f9(%rip), %rsi     # 0x33122
jmp 0x3ccd
leal 0x1(%r15), %r14d
movq 0x8(%rbx,%r15,8), %rdi
callq 0x3390
leaq 0x3f621(%rip), %r15     # 0x43264
movl %eax, (%r15)
movl $0x1a, %edx
movq %r12, %rdi
leaq 0x2f4ec(%rip), %rsi     # 0x33141
callq 0x32d0
movl (%r15), %esi
movq %r12, %rdi
callq 0x3400
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq %r13, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31a0
incl %r14d
cmpl %ebp, %r14d
jl 0x3aa1
jmp 0x3cd4
leaq 0x3f5d0(%rip), %rax     # 0x43274
movl $0x2, (%rax)
movl $0x10, %edx
movq %r12, %rdi
leaq 0x2f44a(%rip), %rsi     # 0x33103
callq 0x32d0
movl $0x8, %edx
movq %r12, %rdi
leaq 0x2f447(%rip), %rsi     # 0x33114
callq 0x32d0
jmp 0x3c8f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3980
xorl %edi, %edi
callq 0x3300
movq 0x3f2fa(%rip), %rdi     # 0x42ff0
leaq 0x2f485(%rip), %rsi     # 0x33182
jmp 0x3d10
incq %r15
movq 0x3f2e7(%rip), %rdi     # 0x42ff0
leaq 0x2f418(%rip), %rsi     # 0x33128
callq 0x3290
movq (%rbx,%r15,8), %rsi
movq %rax, %rdi
callq 0x3290
movq %rax, %rdi
callq 0x3130
movl $0x1, %edi
callq 0x3300
nop