// File: /workspace/github_cpp_makefile_star2_O1/afborchert[P]fmt/test_suite.cpp
// Function: bool general_testcase<char>(bool, bool, int&, bool, int, char const*)
bool general_testcase(bool implementation_defined,
      bool with_offset, int& offset,
      bool to_string, int string_len,
      const CharT* format, Values&&... values) {
   ++testcases;
   std::basic_ostringstream<CharT> os;
   errno = 0;
   int off1 = 0; int off2 = 0;
   int count1 = 0;
   if (to_string) {
      CharT* buf = new CharT[string_len + 8];
      std::fill_n(buf, string_len + 8, 42);
      count1 = fmt::snprintf(buf, string_len, format, std::forward<Values>(values)...);
      if (count1 > 0) {
	 int i = 0;
	 while (i < string_len) {
	    if (!buf[i]) break;
	    ++i;
	 }
	 if (i < string_len) {
	    for (i = string_len; i < string_len + 8; ++i) {
	       if (buf[i] != 42) {
		  buffer_overrun(format, string_len, i);
		  print_values(1, values...);
		  return false;
	       }
	    }
	    os << buf;
	 }
      }
      delete[] buf;
   } else {
      count1 = fmt::printf(os, format, std::forward<Values>(values)...);
   }
   if (with_offset) off1 = offset;
   int err1 = errno;
   errno = 0;
   int count2 = sprint(nullptr, 0, format, std::forward<Values>(values)...); 
   if (with_offset) off2 = offset;
   int err2 = errno;
   if (count1 < 0 || count2 < 0) {
      if (count1 != count2) {
	 count_mismatch(implementation_defined, format, count1, count2);
	 print_values(1, values...);
	 if (implementation_defined) ++warnings;
	 return false;
      }
      if (err1 != err2) {
	 errno_mismatch(implementation_defined, format, err1, err2);
	 print_values(1, values...);
	 if (implementation_defined) ++warnings;
	 return false;
      }
      ++successful;
      return true;
   }

   /* compare the resulting strings */
   int buflen, len;
   if (to_string) {
      buflen = string_len + 1; len = string_len;
   } else {
      buflen = len = count2 + 1;
   }
   CharT* buf = new CharT[buflen] {};
   sprint(buf, len, format, values...);
   std::basic_string<CharT> osstr(os.str());
   bool ok = compare(buf, osstr.c_str()) == 0;
   if (!ok) {
      diff_analysis(implementation_defined, format, count1, count2,
	 osstr.c_str(), buf);
      if (implementation_defined) ++warnings;
   }
   delete[] buf;
   if (with_offset && off1 != off2) {
      offset_mismatch(format, off1, off2);
      ok = false;
   }
   if (!ok) print_values(1, values...);
   if (ok) ++successful;
   return ok;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x378, %rsp            # imm = 0x378
movq %r9, 0x8(%rsp)
movl %r8d, %r15d
movl %ecx, %r14d
movq %rdx, 0x18(%rsp)
movl %esi, 0x14(%rsp)
movl %edi, 0x10(%rsp)
incl 0x42053(%rip)           # 0x5432c
leaq 0x200(%rsp), %rdi
callq 0x6420
callq 0x6060
movq %rax, %r13
movl $0x0, (%rax)
testl %r14d, %r14d
movl %r14d, 0x24(%rsp)
je 0x12364
leal 0x8(%r15), %ebp
movslq %ebp, %rdi
callq 0x6040
movq %rax, %rbx
cmpl $-0x7, %r15d
jl 0x12322
movl %ebp, %edx
movq %rbx, %rdi
movl $0x2a, %esi
callq 0x61d0
movslq %r15d, %rsi
movq %rbx, %rdi
movq 0x8(%rsp), %rdx
callq 0x126f6
movl %eax, %r12d
testl %eax, %eax
setle %al
testl %r15d, %r15d
setle %cl
orb %al, %cl
jne 0x12456
movl %r15d, %eax
xorl %ecx, %ecx
cmpb $0x0, (%rbx,%rcx)
je 0x12420
incq %rcx
cmpq %rcx, %rax
jne 0x1234d
jmp 0x12456
leaq 0xa0(%rsp), %rdi
leaq 0x200(%rsp), %rsi
callq 0xd41e
leaq 0x38(%rsp), %rbx
leaq 0xa0(%rsp), %r14
movq 0x8(%rsp), %r12
testq %r12, %r12
je 0x123d5
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0xd62d
cmpw $0x0, 0x68(%rsp)
sete %bpl
andb 0x38(%rsp), %bpl
je 0x123c8
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
subq %rsi, %rdx
movq %r14, %rdi
callq 0x6400
movq 0x50(%rsp), %r12
testb %bpl, %bpl
jne 0x1238b
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jmp 0x123dd
movl 0xf0(%rsp), %r12d
leaq 0x40c24(%rip), %rax     # 0x53008
leaq 0xf8(%rsp), %rbx
movq %rax, -0x58(%rbx)
leaq 0x40c39(%rip), %rax     # 0x53030
movq %rax, (%rbx)
movq 0x41b9f(%rip), %rax     # 0x53fa0
addq $0x10, %rax
movq %rax, -0x50(%rbx)
leaq 0xe0(%rsp), %rdi
callq 0x6460
movq %rbx, %rdi
callq 0x6100
jmp 0x1245e
movq %rbx, %rcx
addq %rax, %rcx
movl %r15d, %eax
cmpb $0x2a, (%rcx)
jne 0x1261c
incl %eax
incq %rcx
cmpl %eax, %ebp
jg 0x12429
movq %rbx, %rdi
callq 0x6170
leaq 0x200(%rsp), %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x63a0
movq %rbx, %rdi
callq 0x63f0
xorl %ecx, %ecx
movl $0x0, %eax
cmpb $0x0, 0x14(%rsp)
je 0x12473
movq 0x18(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x20(%rsp)
movl (%r13), %ebp
movq $0x0, 0x28(%rsp)
movl %ecx, (%r13)
xorl %edi, %edi
xorl %esi, %esi
movq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x64f0
movl %eax, %ebx
cmpb $0x0, 0x14(%rsp)
je 0x124ad
movq 0x18(%rsp), %rax
movl (%rax), %eax
movq %rax, 0x28(%rsp)
movl %ebx, %eax
orl %r12d, %eax
js 0x125c7
movl %r12d, 0x18(%rsp)
leal 0x1(%r15), %eax
movl %ebx, %r14d
incl %r14d
movq %r15, %r12
movl 0x24(%rsp), %r15d
testb %r15b, %r15b
cmovel %r14d, %eax
movslq %eax, %rbp
movq %rbp, %rdi
callq 0x6040
movq %rax, %r13
testb %r15b, %r15b
cmovnel %r12d, %r14d
movq %rax, %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0x61d0
movslq %r14d, %rsi
movq %r13, %rdi
movq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x64f0
leaq 0x208(%rsp), %rsi
leaq 0xa0(%rsp), %rdi
callq 0x64e0
movq 0xa0(%rsp), %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x6440
testl %eax, %eax
sete %r15b
movl 0x18(%rsp), %edx
je 0x12564
movl 0x10(%rsp), %r14d
movzbl %r14b, %edi
movq 0x8(%rsp), %rsi
movl %ebx, %ecx
movq %rbp, %r8
movq %r13, %r9
callq 0x6736
testb %r14b, %r14b
je 0x12564
incl 0x41dcc(%rip)           # 0x54330
movq %r13, %rdi
callq 0x63f0
movq 0x28(%rsp), %rdx
movl 0x20(%rsp), %esi
cmpl %edx, %esi
setne %al
movl 0x14(%rsp), %ecx
andb %al, %cl
cmpb $0x1, %cl
jne 0x12592
movq 0x8(%rsp), %rdi
callq 0x6a9e
xorl %r15d, %r15d
testb %r15b, %r15b
je 0x1259d
incl 0x41d8b(%rip)           # 0x54328
leaq 0xb0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x12652
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x6340
jmp 0x12652
cmpl %ebx, %r12d
jne 0x125df
movl (%r13), %ecx
cmpl %ecx, %ebp
jne 0x125fd
incl 0x41d4e(%rip)           # 0x54328
movb $0x1, %r15b
jmp 0x12652
movl 0x10(%rsp), %ebp
movzbl %bpl, %edi
movq 0x8(%rsp), %rsi
movl %r12d, %edx
movl %ebx, %ecx
callq 0x6912
testb %bpl, %bpl
jne 0x12614
jmp 0x1264f
movl 0x10(%rsp), %ebx
movzbl %bl, %edi
movq 0x8(%rsp), %rsi
movl %ebp, %edx
callq 0x69d8
testb %bl, %bl
je 0x1264f
incl 0x41d16(%rip)           # 0x54330
jmp 0x1264f
leaq 0xa0(%rsp), %rdx
movq 0x8(%rsp), %rcx
movq %rcx, (%rdx)
leaq 0x38(%rsp), %rcx
movl %r15d, (%rcx)
leaq 0x34(%rsp), %r8
movl %eax, (%r8)
movq 0x4198d(%rip), %rdi     # 0x53fd0
leaq 0x31cc9(%rip), %rsi     # 0x44313
callq 0x10d15
xorl %r15d, %r15d
movq 0x4195f(%rip), %rsi     # 0x53fb8
leaq 0x200(%rsp), %rdi
callq 0x61c0
leaq 0x270(%rsp), %rdi
callq 0x6100
movl %r15d, %eax
addq $0x378, %rsp            # imm = 0x378
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x126b8
jmp 0x126b8
jmp 0x126b8
jmp 0x126b8
jmp 0x126b8
movq %rax, %rbx
leaq 0xb0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x126cd
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x6340
jmp 0x126cd
movq %rax, %rbx
jmp 0x126cd
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xdcd2
movq 0x418e4(%rip), %rsi     # 0x53fb8
leaq 0x200(%rsp), %rdi
callq 0x61c0
leaq 0x270(%rsp), %rdi
callq 0x6100
movq %rbx, %rdi
callq 0x6580