// File: WeihuaZhu[P]hpc_prog2/./gtest/gtest-all.cc
// Function: testing::internal::XmlUnitTestResultPrinter::OnTestIterationEnd(testing::UnitTest const&, int)
void XmlUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
                                                  int /*iteration*/) {
  FILE* xmlout = NULL;
  FilePath output_file(output_file_);
  FilePath output_dir(output_file.RemoveFileName());

  if (output_dir.CreateDirectoriesRecursively()) {
    xmlout = posix::FOpen(output_file_.c_str(), "w");
  }
  if (xmlout == NULL) {
    // TODO(wan): report the reason of the failure.
    //
    // We don't do it for now as:
    //
    //   1. There is no urgent need for it.
    //   2. It's a bit involved to make the errno variable thread-safe on
    //      all three operating systems (Linux, Windows, and Mac OS).
    //   3. To interpret the meaning of errno in a thread-safe way,
    //      we need the strerror_r() function, which is not available on
    //      Windows.
    fprintf(stderr,
            "Unable to open file \"%s\"\n",
            output_file_.c_str());
    fflush(stderr);
    exit(EXIT_FAILURE);
  }
  std::stringstream stream;
  PrintXmlUnitTest(&stream, unit_test);
  fprintf(xmlout, "%s", StringStreamToString(&stream).c_str());
  fclose(xmlout);
}

// Assembly:
subq $0x268, %rsp            # imm = 0x268
movq %rdi, 0x260(%rsp)
movq %rsi, 0x258(%rsp)
movl %edx, 0x254(%rsp)
movq 0x260(%rsp), %rsi
movq %rsi, 0x40(%rsp)
movq $0x0, 0x248(%rsp)
addq $0x8, %rsi
leaq 0x228(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x32bc0
movq 0x48(%rsp), %rsi
leaq 0x208(%rsp), %rdi
callq 0x22280
jmp 0x22091
leaq 0x208(%rsp), %rdi
callq 0x223f0
movb %al, 0x3f(%rsp)
jmp 0x220a4
movb 0x3f(%rsp), %al
testb $0x1, %al
jne 0x220ae
jmp 0x22113
movq 0x40(%rsp), %rdi
addq $0x8, %rdi
callq 0xe370
movq %rax, %rdi
leaq 0x2b172(%rip), %rsi     # 0x4d238
callq 0x36da0
movq %rax, 0x30(%rsp)
jmp 0x220d2
movq 0x30(%rsp), %rax
movq %rax, 0x248(%rsp)
jmp 0x22113
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
jmp 0x22262
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
jmp 0x22255
cmpq $0x0, 0x248(%rsp)
jne 0x2216f
movq 0x40(%rsp), %rdi
movq 0x42e96(%rip), %rax     # 0x64fc0
movq %rax, 0x28(%rsp)
movq (%rax), %rax
movq %rax, 0x20(%rsp)
addq $0x8, %rdi
callq 0xe370
movq 0x20(%rsp), %rdi
movq %rax, %rdx
leaq 0x2b0eb(%rip), %rsi     # 0x4d23a
xorl %eax, %eax
callq 0xf070
movq 0x28(%rsp), %rax
movq (%rax), %rdi
callq 0xecc0
jmp 0x22165
movl $0x1, %edi
callq 0xed40
leaq 0x70(%rsp), %rdi
callq 0xe680
jmp 0x2217b
xorl %eax, %eax
leaq 0x70(%rsp), %rcx
cmpq $0x0, %rcx
movq %rax, 0x18(%rsp)
je 0x2219b
leaq 0x70(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movq 0x258(%rsp), %rsi
callq 0x22510
jmp 0x221af
movq 0x248(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x50(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x19700
jmp 0x221cd
leaq 0x50(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xe370
movq 0x10(%rsp), %rdi
movq %rax, %rdx
leaq 0x2b544(%rip), %rsi     # 0x4d72f
xorl %eax, %eax
callq 0xf070
movq 0x8(%rsp), %rdi
callq 0xf698
movq 0x248(%rsp), %rdi
callq 0xea10
jmp 0x2220b
leaq 0x70(%rsp), %rdi
callq 0xe710
leaq 0x208(%rsp), %rdi
callq 0x32c20
leaq 0x228(%rsp), %rdi
callq 0x32c20
addq $0x268, %rsp            # imm = 0x268
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
leaq 0x70(%rsp), %rdi
callq 0xe710
leaq 0x208(%rsp), %rdi
callq 0x32c20
leaq 0x228(%rsp), %rdi
callq 0x32c20
movq 0x200(%rsp), %rdi
callq 0xf410
nopl (%rax)