// File: /workspace/github_cpp_makefile_star2_O2/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 0x3b34
movq %rsi, %rbx
movl %edi, %ebp
pushq $0x1
popq %r12
leaq 0x2c799(%rip), %r15     # 0x300c6
cmpl %ebp, %r12d
jge 0x3b25
movslq %r12d, %r14
movq (%rbx,%r14,8), %r13
movq %r13, %rdi
leaq 0x2c779(%rip), %rsi     # 0x300c0
callq 0x3310
testl %eax, %eax
je 0x3b34
movq %r13, %rdi
movq %r15, %rsi
callq 0x3310
testl %eax, %eax
je 0x39f9
movq %r13, %rdi
leaq 0x2c765(%rip), %rsi     # 0x300d6
callq 0x3310
testl %eax, %eax
je 0x3a23
movq %r13, %rdi
leaq 0x2c76d(%rip), %rsi     # 0x300f5
callq 0x3310
testl %eax, %eax
je 0x3a4d
movq %r13, %rdi
leaq 0x2c79d(%rip), %rsi     # 0x3013c
callq 0x3310
testl %eax, %eax
je 0x3aaf
movq %r13, %rdi
leaq 0x2c7a6(%rip), %rsi     # 0x3015c
callq 0x3310
testl %eax, %eax
jne 0x3b40
incl %r12d
movq 0x8(%rbx,%r14,8), %rdi
callq 0x3350
leal -0x1(%rax), %ecx
cmpl $0x35, %ecx
ja 0x3aec
leaq 0x3d865(%rip), %r14     # 0x41248
movl %eax, (%r14)
movq 0x3d603(%rip), %rdi     # 0x40ff0
leaq 0x2c76d(%rip), %rsi     # 0x30161
jmp 0x3ad4
incl %r12d
movq 0x8(%rbx,%r14,8), %rdi
callq 0x3350
leaq 0x3d83f(%rip), %r14     # 0x4124c
movl %eax, (%r14)
movq 0x3d5d9(%rip), %rdi     # 0x40ff0
leaq 0x2c6ad(%rip), %rsi     # 0x300cb
jmp 0x3ad4
incl %r12d
movq 0x8(%rbx,%r14,8), %rdi
callq 0x3350
leaq 0x3d821(%rip), %r14     # 0x41258
movl %eax, (%r14)
movq 0x3d5af(%rip), %rdi     # 0x40ff0
leaq 0x2c694(%rip), %rsi     # 0x300dc
jmp 0x3ad4
incl %r12d
movq 0x8(%rbx,%r14,8), %r13
movq %r13, %rdi
leaq 0x2c69c(%rip), %rsi     # 0x300fb
callq 0x3310
testl %eax, %eax
je 0x3af4
movq %r13, %rdi
leaq 0x2c6a7(%rip), %rsi     # 0x3011d
callq 0x3310
testl %eax, %eax
jne 0x3b50
leaq 0x3d7da(%rip), %rax     # 0x41264
movl $0x3, (%rax)
movq 0x3d559(%rip), %rdi     # 0x40ff0
leaq 0x2c665(%rip), %rsi     # 0x30103
callq 0x3260
movq %rax, %rdi
leaq 0x2c675(%rip), %rsi     # 0x30122
jmp 0x3b1e
incl %r12d
movq 0x8(%rbx,%r14,8), %rdi
callq 0x3350
leaq 0x3d791(%rip), %r14     # 0x41254
movl %eax, (%r14)
movq 0x3d523(%rip), %rdi     # 0x40ff0
leaq 0x2c66d(%rip), %rsi     # 0x30141
callq 0x3260
movl (%r14), %esi
movq %rax, %rdi
callq 0x33c0
movq %rax, %rdi
callq 0x3120
incl %r12d
jmp 0x392d
leaq 0x3d769(%rip), %rax     # 0x41264
movl $0x2, (%rax)
movq 0x3d4e8(%rip), %rdi     # 0x40ff0
leaq 0x2c5f4(%rip), %rsi     # 0x30103
callq 0x3260
movq %rax, %rdi
leaq 0x2c5f6(%rip), %rsi     # 0x30114
callq 0x3260
jmp 0x3aec
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x38a4
xorl %edi, %edi
callq 0x32c0
movq 0x3d4a9(%rip), %rdi     # 0x40ff0
leaq 0x2c634(%rip), %rsi     # 0x30182
jmp 0x3b61
incq %r14
movq 0x3d496(%rip), %rdi     # 0x40ff0
leaq 0x2c5c7(%rip), %rsi     # 0x30128
callq 0x3260
movq (%rbx,%r14,8), %rsi
movq %rax, %rdi
callq 0x3260
movq %rax, %rdi
callq 0x3120
pushq $0x1
popq %rdi
callq 0x32c0
nop