// File: /workspace/github_cpp_makefile_star2_O2/halfflat[P]tinyopt/test/googletest/googletest/src/gtest.cc
// Function: void testing::internal::ParseGoogleTestFlagsOnlyImpl<char>(int*, char**)
void ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) {
  std::string flagfile_value;
  for (int i = 1; i < *argc; i++) {
    const std::string arg_string = StreamableToString(argv[i]);
    const char* const arg = arg_string.c_str();

    using internal::ParseFlag;

    bool remove_flag = false;
    if (ParseGoogleTestFlag(arg)) {
      remove_flag = true;
#if GTEST_USE_OWN_FLAGFILE_FLAG_ && GTEST_HAS_FILE_SYSTEM
    } else if (ParseFlag(arg, "flagfile", &flagfile_value)) {
      GTEST_FLAG_SET(flagfile, flagfile_value);
      LoadFlagsFromFile(flagfile_value);
      remove_flag = true;
#endif  // GTEST_USE_OWN_FLAGFILE_FLAG_ && GTEST_HAS_FILE_SYSTEM
    } else if (arg_string == "--help" || HasGoogleTestFlagPrefix(arg)) {
      // Both help flag and unrecognized Google Test flags (excluding
      // internal ones) trigger help display.
      g_help_flag = true;
    }

    if (remove_flag) {
      // Shift the remainder of the argv list left by one.  Note
      // that argv has (*argc + 1) elements, the last one always being
      // NULL.  The following loop moves the trailing NULL element as
      // well.
      for (int j = i; j != *argc; j++) {
        argv[j] = argv[j + 1];
      }

      // Decrements the argument count.
      (*argc)--;

      // We also need to decrement the iterator as we just removed
      // an element.
      i--;
    }
  }

  if (g_help_flag) {
    // We print the help here instead of in RUN_ALL_TESTS(), as the
    // latter may not be called at all if the user is using Google
    // Test with another testing framework.
    PrintColorEncoded(kColorEncodedHelpMessage);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movq %rdi, %r14
movb $0x0, (%rax)
pushq $0x1
popq %r12
leaq 0x28(%rsp), %r15
cmpl (%r14), %r12d
jge 0x4f2b5
movslq %r12d, %r13
leaq (%rbx,%r13,8), %rsi
movq %r15, %rdi
callq 0x556b5
movq 0x28(%rsp), %rbp
movq %rbp, %rdi
callq 0x4b798
testb %al, %al
jne 0x4f25f
movq %rbp, %rdi
leaq 0xc4bc(%rip), %rsi      # 0x5b6f2
leaq 0x8(%rsp), %rdx
callq 0x4bc55
testb %al, %al
je 0x4f28d
leaq 0x35745(%rip), %rdi     # 0x84990
leaq 0x8(%rsp), %rsi
callq 0xd2e0
leaq 0x8(%rsp), %rdi
callq 0x4bc84
movslq (%r14), %rax
cmpq %r13, %rax
je 0x4f275
movq 0x8(%rbx,%r13,8), %rcx
movq %rcx, (%rbx,%r13,8)
incq %r13
jmp 0x4f262
decl %eax
movl %eax, (%r14)
decl %r12d
movq %r15, %rdi
callq 0xdbe8
incl %r12d
jmp 0x4f203
movq %r15, %rdi
leaq 0xe517(%rip), %rsi      # 0x5d7ae
callq 0x24f71
testb %al, %al
jne 0x4f2ac
movq %rbp, %rdi
callq 0x4bdaf
testb %al, %al
je 0x4f27d
movb $0x1, 0x3562e(%rip)     # 0x848e1
jmp 0x4f27d
cmpb $0x0, 0x35625(%rip)     # 0x848e1
je 0x4f2c3
callq 0x4be2b
leaq 0x8(%rsp), %rdi
callq 0xdbe8
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4f2de
movq %rax, %rbx
jmp 0x4f2f0
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xdbe8
leaq 0x8(%rsp), %rdi
callq 0xdbe8
movq %rbx, %rdi
callq 0xdaa0