// File: 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
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x10b60
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
jge 0xabd6a
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
leaq (%rax,%rcx,8), %rsi
leaq -0x58(%rbp), %rdi
callq 0xc7d50
jmp 0xabc29
leaq -0x58(%rbp), %rdi
callq 0x102c0
movq %rax, -0x70(%rbp)
movb $0x0, -0x71(%rbp)
movq -0x70(%rbp), %rdi
callq 0xa1b10
movb %al, -0x79(%rbp)
jmp 0xabc48
movb -0x79(%rbp), %al
testb $0x1, %al
jne 0xabc51
jmp 0xabc85
movb $0x1, -0x71(%rbp)
jmp 0xabd00
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xabd95
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x10fc8
jmp 0xabd95
movq -0x70(%rbp), %rdi
leaq 0x22422(%rip), %rsi     # 0xce0b2
leaq -0x30(%rbp), %rdx
callq 0xa22f0
movb %al, -0x7a(%rbp)
jmp 0xabc9e
movb -0x7a(%rbp), %al
testb $0x1, %al
jne 0xabca7
jmp 0xabcca
leaq 0x6bed2(%rip), %rdi     # 0x117b80
leaq -0x30(%rbp), %rsi
callq 0x10070
jmp 0xabcb9
leaq -0x30(%rbp), %rdi
callq 0xa2340
jmp 0xabcc4
movb $0x1, -0x71(%rbp)
jmp 0xabcfe
leaq -0x58(%rbp), %rdi
leaq 0x24573(%rip), %rsi     # 0xd0248
callq 0x4dd00
testb $0x1, %al
jne 0xabcf5
movq -0x70(%rbp), %rdi
callq 0xa2530
movb %al, -0x7b(%rbp)
jmp 0xabcec
movb -0x7b(%rbp), %al
testb $0x1, %al
jne 0xabcf5
jmp 0xabcfc
movb $0x1, 0x6bdd5(%rip)     # 0x117ad1
jmp 0xabcfe
jmp 0xabd00
testb $0x1, -0x71(%rbp)
je 0xabd53
movl -0x34(%rbp), %eax
movl %eax, -0x78(%rbp)
movl -0x78(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
je 0xabd3f
movq -0x10(%rbp), %rax
movl -0x78(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movslq -0x78(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0xabd0c
movq -0x8(%rbp), %rax
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
movl -0x34(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x34(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x10fc8
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xabc03
testb $0x1, 0x6bd60(%rip)     # 0x117ad1
je 0xabd83
leaq 0x21036(%rip), %rdi     # 0xccdb0
callq 0xa25e0
jmp 0xabd81
jmp 0xabd83
leaq -0x30(%rbp), %rdi
callq 0x10fc8
addq $0x80, %rsp
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x10fc8
movq -0x60(%rbp), %rdi
callq 0x10e00
nopw (%rax,%rax)