diff mbox

[edk2] Enable optimization for gcc x64 builds

Message ID 5458D914.1070608@redhat.com
State New
Headers show

Commit Message

Laszlo Ersek Nov. 4, 2014, 1:48 p.m. UTC
On 11/03/14 21:24, Scott Duplichan wrote:
> Laszlo Ersek [mailto:lersek@redhat.com] wrote:
> 
> ]On 10/29/14 05:59, Scott Duplichan wrote:
> ]> Optimization is not enabled for x64 builds using gcc 4.4-4.9. For IA32
> ]> builds, -Os (optimize for small code size) is used. Why is this? Apparently
> ]> it is because variable argument list handling fails when gcc X64 optimization
> ]> is enabled. The solution is an improvement to the patch of SVN rev 10440:
> ]> http://sourceforge.net/p/edk2/mailman/message/25121111/
> ]
> ]My reading of r10440 is different. As far as I understand,
> ]
> ]  (gcc-4.4, X64, stdarg builtins)
> ]
> ]is simply a broken a combination, regardless of optimization.
> 
> You are right about gcc X64 builds using the standard (native)
> stdarg builtins. Without the original r10440 patch, a test using
> Duet crashes early on. The exception handler dump has bogus values,
> probably due to the same stdarg problem.
> 
> My point was why can't -Os be used for the current gcc X64 build like
> it is for the IA32 build? Maybe r10440 is not relevant enough to even 
> be mentioned. What I found is adding -Os to the X64 Duet project
> causes the 'g' (GUID) format to malfunction. There may be other 
> formatting problems, but this one is most obvious in the log file:
> 
> X64 Duet boot log from gcc X64 build (standard, correct):
>                          WELCOME TO EFI WORLD!
> InstallProtocolInterface: D2B2B828-0826-48A7-B3DF-983C006024F0 1FDF9D58
> HOBLIST address in DXE = 0x1F3DA018
> Memory Allocation 0x00000004 0x1FD69000 - 0x1FD88FFF
> Memory Allocation 0x00000004 0x1F964000 - 0x1FD68FFF
> Memory Allocation 0x00000003 0x1FDB9000 - 0x1FE0FFFF
> FV Hob            0x1FE10000 - 0x1FFAFFFF
> InstallProtocolInterface: D8117CFE-94A6-11D4-9A3A-0090273FC14D 1FDF2AC0
> InstallProtocolInterface: 8F644FA9-E850-4DB1-9CE2-0B44698E8DA4 1F3D6A30
> InstallProtocolInterface: 09576E91-6D3F-11D2-8E39-00A0C969723B 1F3D7818
> 
> X64 Duet boot log from gcc X64 build (with -Os added):
>                          WELCOME TO EFI WORLD!
> InstallProtocolInterface: 00000000-30300000-332D3030-2D30303030 1FE6F8C0
> HOBLIST address in DXE = 0x1F461018
> Memory Allocation 0x00000004 0x1FDF0000 - 0x1FE0FFFF
> Memory Allocation 0x00000004 0x1F9EB000 - 0x1FDEFFFF
> Memory Allocation 0x00000003 0x1FE40000 - 0x1FE7FFFF
> FV Hob            0x1FE80000 - 0x1FFAFFFF
> InstallProtocolInterface: 1F9EAB08-46312000-342D3830-2D30303030 1FE69070
> InstallProtocolInterface: 00000001-30300200-332D3130-2D30303230 1F45DA30
> InstallProtocolInterface: 00000001-30308FA1-332D3130-2D31414630 1F45E818

Indeed I can reproduce this problem with OVMF (gcc-4.8, X64 target).

Here's what I did.

First, I tried to figure out what optimization or target-specific
setting incurred by -Os triggers the behavior. I used

  gcc -Q -O<X> --help=(target|optimizers|...)

and compared the results between X=0 and X=s (see the gcc manual for
what the above command does). I then tried to reproduce the bug by
manually specifying the -fZZZ flags reported by the above command.
Unfortunately, that doesn't reproduce the problem -- "-Os" does
something that is unavailable with *any other* command line flags. (In
other words, it's not possible to reproduce the behavior of -Os just by
replacing -Os with a bunch of -fZZZ and -mYYY flags.)

Second, I located the exact failure site. It is in
BasePrintLibSPrintMarker() -- the main formatter function --, in file
"MdePkg/Library/BasePrintLib/PrintLibInternal.c". The code in question
handles the 'g' case (GUID printing).

(I didn't use '-Os' globally; I only added

[BuildOptions]
  GCC:DEBUG_GCC48_X64_CC_FLAGS = -Os

to "MdePkg/Library/BasePrintLib/BasePrintLib.inf", and that's sufficient
to trigger the problem.)

This of course raises the question why other conversion specifiers work
okay in the same function.

Note that BasePrintLibSPrintMarker() is recursive, for at least the
conversion specifiers 't' (TIME*), 'g' (GUID*), 'r' (RETURN_STATUS):

BasePrintLibSPrint()
  BasePrintLibSPrintMarker()
    // called for 't', 'g', 'r':
    BasePrintLibSPrint()
      BasePrintLibSPrintMarker()

However, %r works just fine. (I didn't test %t.) This implies that the
recursion per se is not a problem.

Next, I *trimmed* the format string (and correspondingly, the argument
list) of the following call (invoked under 'g'):

          BasePrintLibSPrint (
            ValueBuffer,
            MAXIMUM_VALUE_CHARACTERS,
            0,
            "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
            GuidData1,
            GuidData2,
            GuidData3,
            TmpGuid->Data4[0],
            TmpGuid->Data4[1],
            TmpGuid->Data4[2],
            TmpGuid->Data4[3],
            TmpGuid->Data4[4],
            TmpGuid->Data4[5],
            TmpGuid->Data4[6],
            TmpGuid->Data4[7]
            );

Surprise, when I cut off the arguments starting with GuidData3 (ie. the
last argument that I preserve is GuidData2), then things just work, even
with -Os! But, if I pass GuidData3 too, then the output falls apart.


I'm attaching two files (two disassemblies produced with "objdump -S
.../PrintLibInternal.obj"). I can't exactly figure out what's wrong, but
it looks quite like a gcc bug to me.

Namely, as long as the last argument passed via the ellipsis (...) is
GuidData2 (six arguments in total), then the marker itself (ie. the
VaListMarker parameter of the BasePrintLibSPrintMarker() function, of
type VA_LIST (== CHAR8*)) is kept on the *stack*. And, the macro
application under 'g':

          TmpGuid = VA_ARG (VaListMarker, GUID *);

(
#define VA_ARG(Marker, TYPE)   (*(TYPE *) ((Marker += _INT_SIZE_OF
(TYPE)) - _INT_SIZE_OF (TYPE)))
)

gets translated to (see disas.good):

- 6b2:  48 8b 44 24 40          mov    0x40(%rsp),%rax
- 6b7:  4c 8b 28                mov    (%rax),%r13
- 6ba:  48 83 c0 08             add    $0x8,%rax
- 6be:  48 89 44 24 40          mov    %rax,0x40(%rsp)

ie.:
* read VaListMarker from the stack into %rax -- %rax now points at the
  vararg
* dereference %rax (for fetching the value of the pointer-to-GUID),
* increment the value of %rax (so that now it points to the next vararg)
* write back %rax to the stack (so that VaListMarker actually sees
  the increment)

and things work.

However, when GuidData3 is passed in addition (seven or more arguments),
then that triggers two things in gcc's -Os optimizer:

(a) The above VA_ARG() macro invocation gets translated to:

+ 670:  4d 8b 27                mov    (%r15),%r12
+ 673:  49 83 c7 08             add    $0x8,%r15

which means that VaListMarker is kept in a register only: %r15. See
disas.bad.

(This is consistent with the BasePrintLibSPrintMarker() function's
prologue, as it is *not* EFIAPI, hence the fifth parameter,
VaListMarker, arrives in %r8, and that's copied to %r15 in the prologue:

+   2:  4d 89 c7                mov    %r8,%r15
).

(b) Plus, the BasePrintLibSPrintMarker() --> BasePrintLibSPrint() -->
BasePrintLibSPrintMarker() call chain seems to be inlined / turned into
jumps (instead of calls).


These two in combination make me think that VaListMarker (kept only in
%r15) is clobbered in the course of the recursion.


The following patch works around the issue. It introduces a *volatile*
pointer to the BasePrintLibSPrint() function. Note, it's not the
pointed-to function that is volatile (that would make no sense); the
function pointer itself is volatile.

So, when we call the BasePrintLibSPrint() function through the pointer,
gcc can't avoid *reading* the function pointer, and that enforces a real
call instruction, and the recursive calls are not inlined / implemented
with jumps. (And VaListMarker is again kept on the stack, 0x90(%rsp)).

----------------
----------------

With this patch, GUIDs are printed okay with -Os.

(Of course it's not edk2 that needs to be fixed.)

Thanks
Laszlo

> If "-Os -mabi=ms" is used for the gcc X64 build, then the pre-r10440
> method (using the native stdarg builtins) works. But that is just hiding
> the problem.
> 
> The __builtin_ms_va_* macros for cross ABI use are not well documented
> as far as I can find. File cross-stdarg.h is about it. But they have been
> around for a long time, at least since gcc 4.4.
> 
> Thanks,
> scott 
> 
> 
> ]> The patch in this email only adds gcc X64 optimization for gcc versions 4.8
> ]> and newer.
> ]
> ]What happens if you add -Os for gcc-4.8+ (X64) without touching
> ]NO_BUILTIN_VA_FUNCS and the VA_* macros? Just curious.
> 
> See 'g' formatting problem above.
> 
> ]What implies any connection between lack of -Os and VA_*?
> 
> The fact that -Os is used throughout edk2, except for the one
> case where VA_* prevents it.
> 
> ]Thanks!
> ]Laszlo
> ]
> ]> This is because testing with older versions of gcc is a lot of
> ]> work. On the other hand, the patch could be a lot simpler if it were to
> ]> ignore gcc version. The patch is boot tested using Duet with gcc 4.8.2 and
> ]> gcc 4.9.1. For these two cases, the print formatting problem is resolved
> ]> by the patch.
> ]> 
> ]> Should we:
> ]> 1) Restrict the change to recent gcc versions where testing is easy
> ]>    (approach of included patch)
> ]> 2) Apply the change to all gcc versions, and let older versions go
> ]>    untested?
> ]> 3) Try to find/build the needed older gcc versions so that the patch
> ]>    can apply to all versions and be tested too
> ]> 
> ]> Thanks,
> ]> Scott
> 
> 
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
>
/home/lacos/src/upstream/edk2-git-svn/Build/OvmfX64/DEBUG_GCC48/X64/MdePkg/Library/BasePrintLib/BasePrintLib/OUTPUT/./PrintLibInternal.obj:     file format elf64-x86-64


Disassembly of section .text.BasePrintLibFillBuffer:

0000000000000000 <BasePrintLibFillBuffer>:
  IN  CHAR8   *EndBuffer,
  IN  INTN    Length,
  IN  UINTN   Character,
  IN  INTN    Increment
  )
{
   0:	48 89 f8             	mov    %rdi,%rax
  INTN  Index;
  
  for (Index = 0; Index < Length && Buffer < EndBuffer; Index++) {
    *Buffer = (CHAR8) Character;
    if (Increment != 1) {
      *(Buffer + 1) = (CHAR8)(Character >> 8);
   3:	48 89 cf             	mov    %rcx,%rdi
   6:	48 c1 ef 08          	shr    $0x8,%rdi
   a:	49 89 f9             	mov    %rdi,%r9
  IN  INTN    Increment
  )
{
  INTN  Index;
  
  for (Index = 0; Index < Length && Buffer < EndBuffer; Index++) {
   d:	31 ff                	xor    %edi,%edi
   f:	48 39 f0             	cmp    %rsi,%rax
  12:	73 19                	jae    2d <BasePrintLibFillBuffer+0x2d>
  14:	48 39 d7             	cmp    %rdx,%rdi
  17:	7d 14                	jge    2d <BasePrintLibFillBuffer+0x2d>
    *Buffer = (CHAR8) Character;
    if (Increment != 1) {
  19:	49 83 f8 01          	cmp    $0x1,%r8
  )
{
  INTN  Index;
  
  for (Index = 0; Index < Length && Buffer < EndBuffer; Index++) {
    *Buffer = (CHAR8) Character;
  1d:	88 08                	mov    %cl,(%rax)
    if (Increment != 1) {
  1f:	74 04                	je     25 <BasePrintLibFillBuffer+0x25>
      *(Buffer + 1) = (CHAR8)(Character >> 8);
  21:	44 88 48 01          	mov    %r9b,0x1(%rax)
    }
    Buffer += Increment;
  25:	4c 01 c0             	add    %r8,%rax
  IN  INTN    Increment
  )
{
  INTN  Index;
  
  for (Index = 0; Index < Length && Buffer < EndBuffer; Index++) {
  28:	48 ff c7             	inc    %rdi
  2b:	eb e2                	jmp    f <BasePrintLibFillBuffer+0xf>
    }
    Buffer += Increment;
  }

  return Buffer;
}
  2d:	c3                   	retq   

Disassembly of section .text.BasePrintLibValueToString:

0000000000000000 <BasePrintLibValueToString>:
BasePrintLibValueToString (
  IN OUT CHAR8  *Buffer, 
  IN INT64      Value, 
  IN UINTN      Radix
  )
{
   0:	55                   	push   %rbp
   1:	48 89 f0             	mov    %rsi,%rax
   4:	48 89 d5             	mov    %rdx,%rbp
   7:	53                   	push   %rbx
   8:	48 89 fb             	mov    %rdi,%rbx
   b:	48 83 ec 38          	sub    $0x38,%rsp
  UINT32  Remainder;

  //
  // Loop to convert one digit at a time in reverse order
  //
  *Buffer = 0;
   f:	c6 07 00             	movb   $0x0,(%rdi)
  do {
    Value = (INT64)DivU64x32Remainder ((UINT64)Value, (UINT32)Radix, &Remainder);
  12:	48 89 c1             	mov    %rax,%rcx
  15:	89 ea                	mov    %ebp,%edx
  17:	4c 8d 44 24 2c       	lea    0x2c(%rsp),%r8
  1c:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
  23:	00 00 00 
    *(++Buffer) = mHexStr[Remainder];
  26:	48 ff c3             	inc    %rbx
  //
  // Loop to convert one digit at a time in reverse order
  //
  *Buffer = 0;
  do {
    Value = (INT64)DivU64x32Remainder ((UINT64)Value, (UINT32)Radix, &Remainder);
  29:	ff d0                	callq  *%rax
    *(++Buffer) = mHexStr[Remainder];
  2b:	8b 54 24 2c          	mov    0x2c(%rsp),%edx
  2f:	48 b9 00 00 00 00 00 	movabs $0x0,%rcx
  36:	00 00 00 
  } while (Value != 0);
  39:	48 85 c0             	test   %rax,%rax
  // Loop to convert one digit at a time in reverse order
  //
  *Buffer = 0;
  do {
    Value = (INT64)DivU64x32Remainder ((UINT64)Value, (UINT32)Radix, &Remainder);
    *(++Buffer) = mHexStr[Remainder];
  3c:	8a 14 11             	mov    (%rcx,%rdx,1),%dl
  3f:	88 13                	mov    %dl,(%rbx)
  } while (Value != 0);
  41:	75 cf                	jne    12 <BasePrintLibValueToString+0x12>

  //
  // Return pointer of the end of filled buffer.
  //
  return Buffer;
}
  43:	48 83 c4 38          	add    $0x38,%rsp
  47:	48 89 d8             	mov    %rbx,%rax
  4a:	5b                   	pop    %rbx
  4b:	5d                   	pop    %rbp
  4c:	c3                   	retq   

Disassembly of section .text.BasePrintLibConvertValueToString:

0000000000000000 <BasePrintLibConvertValueToString>:
  IN UINTN       Flags,
  IN INT64       Value,
  IN UINTN       Width,
  IN UINTN       Increment
  )
{
   0:	41 57                	push   %r15
   2:	49 89 d7             	mov    %rdx,%r15
   5:	41 56                	push   %r14
  UINTN  Radix;

  //
  // Make sure Buffer is not NULL and Width < MAXIMUM
  //
  ASSERT (Buffer != NULL);
   7:	49 be 00 00 00 00 00 	movabs $0x0,%r14
   e:	00 00 00 
  IN UINTN       Flags,
  IN INT64       Value,
  IN UINTN       Width,
  IN UINTN       Increment
  )
{
  11:	41 55                	push   %r13
  13:	49 89 fd             	mov    %rdi,%r13
  16:	41 54                	push   %r12
  18:	49 89 cc             	mov    %rcx,%r12
  1b:	55                   	push   %rbp
  1c:	48 89 f5             	mov    %rsi,%rbp
  1f:	53                   	push   %rbx
  20:	4c 89 c3             	mov    %r8,%rbx
  23:	48 83 ec 78          	sub    $0x78,%rsp
  UINTN  Radix;

  //
  // Make sure Buffer is not NULL and Width < MAXIMUM
  //
  ASSERT (Buffer != NULL);
  27:	41 ff d6             	callq  *%r14
  2a:	84 c0                	test   %al,%al
  2c:	74 2a                	je     58 <BasePrintLibConvertValueToString+0x58>
  2e:	4d 85 ed             	test   %r13,%r13
  31:	75 25                	jne    58 <BasePrintLibConvertValueToString+0x58>
  33:	49 b8 00 00 00 00 00 	movabs $0x0,%r8
  3a:	00 00 00 
  3d:	ba c6 00 00 00       	mov    $0xc6,%edx
  42:	48 b9 00 00 00 00 00 	movabs $0x0,%rcx
  49:	00 00 00 
  4c:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
  53:	00 00 00 
  56:	ff d0                	callq  *%rax
  ASSERT (Width < MAXIMUM_VALUE_CHARACTERS);
  58:	41 ff d6             	callq  *%r14
  5b:	84 c0                	test   %al,%al
  5d:	74 2b                	je     8a <BasePrintLibConvertValueToString+0x8a>
  5f:	49 83 fc 25          	cmp    $0x25,%r12
  63:	76 25                	jbe    8a <BasePrintLibConvertValueToString+0x8a>
  65:	49 b8 00 00 00 00 00 	movabs $0x0,%r8
  6c:	00 00 00 
  6f:	ba c7 00 00 00       	mov    $0xc7,%edx
  74:	48 b9 00 00 00 00 00 	movabs $0x0,%rcx
  7b:	00 00 00 
  7e:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
  85:	00 00 00 
  88:	ff d0                	callq  *%rax
  //
  // Make sure Flags can only contain supported bits.
  //
  ASSERT ((Flags & ~(LEFT_JUSTIFY | COMMA_TYPE | PREFIX_ZERO | RADIX_HEX)) == 0);
  8a:	41 ff d6             	callq  *%r14
  8d:	84 c0                	test   %al,%al
  8f:	74 2e                	je     bf <BasePrintLibConvertValueToString+0xbf>
  91:	48 f7 c5 56 ff ff ff 	test   $0xffffffffffffff56,%rbp
  98:	74 25                	je     bf <BasePrintLibConvertValueToString+0xbf>
  9a:	49 b8 00 00 00 00 00 	movabs $0x0,%r8
  a1:	00 00 00 
  a4:	ba cb 00 00 00       	mov    $0xcb,%edx
  a9:	48 b9 00 00 00 00 00 	movabs $0x0,%rcx
  b0:	00 00 00 
  b3:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
  ba:	00 00 00 
  bd:	ff d0                	callq  *%rax

  //
  // If both COMMA_TYPE and RADIX_HEX are set, then ASSERT ()
  //
  ASSERT (((Flags & COMMA_TYPE) == 0) || ((Flags & RADIX_HEX) == 0));
  bf:	41 ff d6             	callq  *%r14
  c2:	84 c0                	test   %al,%al
  c4:	74 35                	je     fb <BasePrintLibConvertValueToString+0xfb>
  c6:	48 89 e8             	mov    %rbp,%rax
  c9:	25 88 00 00 00       	and    $0x88,%eax
  ce:	48 3d 88 00 00 00    	cmp    $0x88,%rax
  d4:	75 25                	jne    fb <BasePrintLibConvertValueToString+0xfb>
  d6:	49 b8 00 00 00 00 00 	movabs $0x0,%r8
  dd:	00 00 00 
  e0:	ba d0 00 00 00       	mov    $0xd0,%edx
  e5:	48 b9 00 00 00 00 00 	movabs $0x0,%rcx
  ec:	00 00 00 
  ef:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
  f6:	00 00 00 
  f9:	ff d0                	callq  *%rax
  OriginalBuffer = Buffer;
  
  //
  // Width is 0 or COMMA_TYPE is set, PREFIX_ZERO is ignored.
  //
  if (Width == 0 || (Flags & COMMA_TYPE) != 0) {
  fb:	4d 85 e4             	test   %r12,%r12
  fe:	74 06                	je     106 <BasePrintLibConvertValueToString+0x106>
 100:	40 f6 c5 08          	test   $0x8,%bpl
 104:	74 10                	je     116 <BasePrintLibConvertValueToString+0x116>
    Flags &= ~((UINTN) PREFIX_ZERO);
 106:	48 83 e5 df          	and    $0xffffffffffffffdf,%rbp
  }
  //
  // If Width is 0 then a width of  MAXIMUM_VALUE_CHARACTERS is assumed.
  //
  if (Width == 0) {
    Width = MAXIMUM_VALUE_CHARACTERS - 1;
 10a:	b8 25 00 00 00       	mov    $0x25,%eax
 10f:	4d 85 e4             	test   %r12,%r12
 112:	4c 0f 44 e0          	cmove  %rax,%r12
  }
  //
  // Set the tag for the end of the input Buffer.
  //
  EndBuffer = Buffer + Width * Increment;
 116:	4c 89 e0             	mov    %r12,%rax
 119:	4d 89 e9             	mov    %r13,%r9
 11c:	49 be 00 00 00 00 00 	movabs $0x0,%r14
 123:	00 00 00 
 126:	48 0f af c3          	imul   %rbx,%rax
 12a:	4c 01 e8             	add    %r13,%rax
  
  //
  // Convert decimal negative
  //
  if ((Value < 0) && ((Flags & RADIX_HEX) == 0)) {
 12d:	4d 85 ff             	test   %r15,%r15
    Width = MAXIMUM_VALUE_CHARACTERS - 1;
  }
  //
  // Set the tag for the end of the input Buffer.
  //
  EndBuffer = Buffer + Width * Increment;
 130:	48 89 44 24 20       	mov    %rax,0x20(%rsp)
  
  //
  // Convert decimal negative
  //
  if ((Value < 0) && ((Flags & RADIX_HEX) == 0)) {
 135:	79 25                	jns    15c <BasePrintLibConvertValueToString+0x15c>
 137:	40 f6 c5 80          	test   $0x80,%bpl
 13b:	75 1f                	jne    15c <BasePrintLibConvertValueToString+0x15c>
    Value = -Value;
    Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, '-', Increment);
 13d:	49 89 d8             	mov    %rbx,%r8
 140:	b9 2d 00 00 00       	mov    $0x2d,%ecx
 145:	ba 01 00 00 00       	mov    $0x1,%edx
 14a:	48 89 c6             	mov    %rax,%rsi
 14d:	4c 89 ef             	mov    %r13,%rdi
  
  //
  // Convert decimal negative
  //
  if ((Value < 0) && ((Flags & RADIX_HEX) == 0)) {
    Value = -Value;
 150:	49 f7 df             	neg    %r15
    Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, '-', Increment);
 153:	41 ff d6             	callq  *%r14
    Width--;
 156:	49 ff cc             	dec    %r12
  //
  // Convert decimal negative
  //
  if ((Value < 0) && ((Flags & RADIX_HEX) == 0)) {
    Value = -Value;
    Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, '-', Increment);
 159:	49 89 c1             	mov    %rax,%r9
  }
  
  //
  // Count the length of the value string.
  //
  Radix = ((Flags & RADIX_HEX) == 0)? 10 : 16;
 15c:	48 89 e8             	mov    %rbp,%rax
  ValueBufferPtr = BasePrintLibValueToString (ValueBuffer, Value, Radix);
 15f:	48 8d 4c 24 4a       	lea    0x4a(%rsp),%rcx
 164:	4c 89 4c 24 30       	mov    %r9,0x30(%rsp)
  }
  
  //
  // Count the length of the value string.
  //
  Radix = ((Flags & RADIX_HEX) == 0)? 10 : 16;
 169:	25 80 00 00 00       	and    $0x80,%eax
  ValueBufferPtr = BasePrintLibValueToString (ValueBuffer, Value, Radix);
 16e:	4c 89 fe             	mov    %r15,%rsi
  }
  
  //
  // Count the length of the value string.
  //
  Radix = ((Flags & RADIX_HEX) == 0)? 10 : 16;
 171:	48 83 f8 01          	cmp    $0x1,%rax
  ValueBufferPtr = BasePrintLibValueToString (ValueBuffer, Value, Radix);
 175:	48 89 cf             	mov    %rcx,%rdi
 178:	48 89 4c 24 28       	mov    %rcx,0x28(%rsp)
  }
  
  //
  // Count the length of the value string.
  //
  Radix = ((Flags & RADIX_HEX) == 0)? 10 : 16;
 17d:	48 19 d2             	sbb    %rdx,%rdx
  ValueBufferPtr = BasePrintLibValueToString (ValueBuffer, Value, Radix);
 180:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 187:	00 00 00 
  }
  
  //
  // Count the length of the value string.
  //
  Radix = ((Flags & RADIX_HEX) == 0)? 10 : 16;
 18a:	48 83 e2 fa          	and    $0xfffffffffffffffa,%rdx
 18e:	48 83 c2 10          	add    $0x10,%rdx
  ValueBufferPtr = BasePrintLibValueToString (ValueBuffer, Value, Radix);
 192:	ff d0                	callq  *%rax
  Count = ValueBufferPtr - ValueBuffer;
 194:	48 8b 4c 24 28       	mov    0x28(%rsp),%rcx
  
  //
  // Count the length of the value string.
  //
  Radix = ((Flags & RADIX_HEX) == 0)? 10 : 16;
  ValueBufferPtr = BasePrintLibValueToString (ValueBuffer, Value, Radix);
 199:	49 89 c7             	mov    %rax,%r15
  Count = ValueBufferPtr - ValueBuffer;
  
  //
  // Append Zero
  //
  if ((Flags & PREFIX_ZERO) != 0) {
 19c:	4c 8b 4c 24 30       	mov    0x30(%rsp),%r9
  //
  // Count the length of the value string.
  //
  Radix = ((Flags & RADIX_HEX) == 0)? 10 : 16;
  ValueBufferPtr = BasePrintLibValueToString (ValueBuffer, Value, Radix);
  Count = ValueBufferPtr - ValueBuffer;
 1a1:	48 29 c8             	sub    %rcx,%rax
  
  //
  // Append Zero
  //
  if ((Flags & PREFIX_ZERO) != 0) {
 1a4:	40 f6 c5 20          	test   $0x20,%bpl
  //
  // Count the length of the value string.
  //
  Radix = ((Flags & RADIX_HEX) == 0)? 10 : 16;
  ValueBufferPtr = BasePrintLibValueToString (ValueBuffer, Value, Radix);
  Count = ValueBufferPtr - ValueBuffer;
 1a8:	48 89 44 24 28       	mov    %rax,0x28(%rsp)
  
  //
  // Append Zero
  //
  if ((Flags & PREFIX_ZERO) != 0) {
 1ad:	74 1c                	je     1cb <BasePrintLibConvertValueToString+0x1cb>
    Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Width - Count, '0', Increment);
 1af:	4c 89 e2             	mov    %r12,%rdx
 1b2:	4c 89 cf             	mov    %r9,%rdi
 1b5:	49 89 d8             	mov    %rbx,%r8
 1b8:	48 29 c2             	sub    %rax,%rdx
 1bb:	b9 30 00 00 00       	mov    $0x30,%ecx
 1c0:	48 8b 74 24 20       	mov    0x20(%rsp),%rsi
 1c5:	41 ff d6             	callq  *%r14
 1c8:	49 89 c1             	mov    %rax,%r9
  }
  
  //
  // Print Comma type for every 3 characters
  //
  Digits = Count % 3;
 1cb:	48 8b 44 24 28       	mov    0x28(%rsp),%rax
 1d0:	41 bc 03 00 00 00    	mov    $0x3,%r12d
 1d6:	31 d2                	xor    %edx,%edx
 1d8:	49 f7 f4             	div    %r12
  if (Digits != 0) {
    Digits = 3 - Digits;
 1db:	49 29 d4             	sub    %rdx,%r12
 1de:	48 85 d2             	test   %rdx,%rdx
 1e1:	4c 0f 44 e2          	cmove  %rdx,%r12
  }
  for (Index = 0; Index < Count; Index++) {
    Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, *ValueBufferPtr--, Increment);
    if ((Flags & COMMA_TYPE) != 0) {
 1e5:	83 e5 08             	and    $0x8,%ebp
      Digits++;
      if (Digits == 3) {
        Digits = 0;
 1e8:	45 31 d2             	xor    %r10d,%r10d
  if (Digits != 0) {
    Digits = 3 - Digits;
  }
  for (Index = 0; Index < Count; Index++) {
    Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, *ValueBufferPtr--, Increment);
    if ((Flags & COMMA_TYPE) != 0) {
 1eb:	48 89 6c 24 30       	mov    %rbp,0x30(%rsp)
  //
  Digits = Count % 3;
  if (Digits != 0) {
    Digits = 3 - Digits;
  }
  for (Index = 0; Index < Count; Index++) {
 1f0:	4c 3b 54 24 28       	cmp    0x28(%rsp),%r10
 1f5:	74 78                	je     26f <BasePrintLibConvertValueToString+0x26f>
 1f7:	4c 89 d0             	mov    %r10,%rax
 1fa:	4c 89 54 24 38       	mov    %r10,0x38(%rsp)
    Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, *ValueBufferPtr--, Increment);
 1ff:	4c 89 cf             	mov    %r9,%rdi
 202:	48 f7 d8             	neg    %rax
 205:	49 89 d8             	mov    %rbx,%r8
 208:	ba 01 00 00 00       	mov    $0x1,%edx
 20d:	49 0f be 0c 07       	movsbq (%r15,%rax,1),%rcx
 212:	48 8b 74 24 20       	mov    0x20(%rsp),%rsi
 217:	41 ff d6             	callq  *%r14
    if ((Flags & COMMA_TYPE) != 0) {
 21a:	48 83 7c 24 30 00    	cmpq   $0x0,0x30(%rsp)
 220:	4c 8b 54 24 38       	mov    0x38(%rsp),%r10
  Digits = Count % 3;
  if (Digits != 0) {
    Digits = 3 - Digits;
  }
  for (Index = 0; Index < Count; Index++) {
    Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, *ValueBufferPtr--, Increment);
 225:	49 89 c1             	mov    %rax,%r9
 228:	49 8d 6a 01          	lea    0x1(%r10),%rbp
    if ((Flags & COMMA_TYPE) != 0) {
 22c:	74 3c                	je     26a <BasePrintLibConvertValueToString+0x26a>
      Digits++;
 22e:	49 ff c4             	inc    %r12
      if (Digits == 3) {
 231:	49 83 fc 03          	cmp    $0x3,%r12
 235:	75 33                	jne    26a <BasePrintLibConvertValueToString+0x26a>
        Digits = 0;
        if ((Index + 1) < Count) {
 237:	48 3b 6c 24 28       	cmp    0x28(%rsp),%rbp
 23c:	73 29                	jae    267 <BasePrintLibConvertValueToString+0x267>
          Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ',', Increment);
 23e:	48 89 c7             	mov    %rax,%rdi
 241:	49 89 d8             	mov    %rbx,%r8
 244:	b9 2c 00 00 00       	mov    $0x2c,%ecx
 249:	ba 01 00 00 00       	mov    $0x1,%edx
 24e:	48 8b 74 24 20       	mov    0x20(%rsp),%rsi
 253:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 25a:	00 00 00 
  for (Index = 0; Index < Count; Index++) {
    Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, *ValueBufferPtr--, Increment);
    if ((Flags & COMMA_TYPE) != 0) {
      Digits++;
      if (Digits == 3) {
        Digits = 0;
 25d:	45 30 e4             	xor    %r12b,%r12b
        if ((Index + 1) < Count) {
          Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ',', Increment);
 260:	ff d0                	callq  *%rax
 262:	49 89 c1             	mov    %rax,%r9
 265:	eb 03                	jmp    26a <BasePrintLibConvertValueToString+0x26a>
  for (Index = 0; Index < Count; Index++) {
    Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, *ValueBufferPtr--, Increment);
    if ((Flags & COMMA_TYPE) != 0) {
      Digits++;
      if (Digits == 3) {
        Digits = 0;
 267:	45 31 e4             	xor    %r12d,%r12d
  //
  Digits = Count % 3;
  if (Digits != 0) {
    Digits = 3 - Digits;
  }
  for (Index = 0; Index < Count; Index++) {
 26a:	49 89 ea             	mov    %rbp,%r10
 26d:	eb 81                	jmp    1f0 <BasePrintLibConvertValueToString+0x1f0>
  }
  
  //
  // Print Null-terminator
  //
  BasePrintLibFillBuffer (Buffer, EndBuffer + Increment, 1, 0, Increment);
 26f:	48 8b 74 24 20       	mov    0x20(%rsp),%rsi
 274:	49 89 d8             	mov    %rbx,%r8
 277:	4c 89 4c 24 20       	mov    %r9,0x20(%rsp)
 27c:	ba 01 00 00 00       	mov    $0x1,%edx
 281:	4c 89 cf             	mov    %r9,%rdi
 284:	31 c9                	xor    %ecx,%ecx
 286:	48 01 de             	add    %rbx,%rsi
 289:	41 ff d6             	callq  *%r14

  return ((Buffer - OriginalBuffer) / Increment);
 28c:	4c 8b 4c 24 20       	mov    0x20(%rsp),%r9
 291:	31 d2                	xor    %edx,%edx
}
 293:	48 83 c4 78          	add    $0x78,%rsp
  //
  // Print Null-terminator
  //
  BasePrintLibFillBuffer (Buffer, EndBuffer + Increment, 1, 0, Increment);

  return ((Buffer - OriginalBuffer) / Increment);
 297:	4c 89 c8             	mov    %r9,%rax
 29a:	4c 29 e8             	sub    %r13,%rax
 29d:	48 f7 f3             	div    %rbx
}
 2a0:	5b                   	pop    %rbx
 2a1:	5d                   	pop    %rbp
 2a2:	41 5c                	pop    %r12
 2a4:	41 5d                	pop    %r13
 2a6:	41 5e                	pop    %r14
 2a8:	41 5f                	pop    %r15
 2aa:	c3                   	retq   

Disassembly of section .text.BasePrintLibSPrint:

0000000000000000 <BasePrintLibSPrint>:
  IN  UINTN        BufferSize,
  IN  UINTN        Flags,
  IN  CONST CHAR8  *FormatString,
  ...
  )
{
   0:	57                   	push   %rdi
   1:	48 89 cf             	mov    %rcx,%rdi
  VA_LIST  Marker;
  UINTN    NumberOfPrinted;

  VA_START (Marker, FormatString);
  NumberOfPrinted = BasePrintLibSPrintMarker (StartOfBuffer, BufferSize, Flags, FormatString, Marker, NULL);
   4:	4c 89 c9             	mov    %r9,%rcx
  IN  UINTN        BufferSize,
  IN  UINTN        Flags,
  IN  CONST CHAR8  *FormatString,
  ...
  )
{
   7:	56                   	push   %rsi
   8:	48 89 d6             	mov    %rdx,%rsi
   b:	4c 89 c2             	mov    %r8,%rdx
   e:	50                   	push   %rax
  VA_LIST  Marker;
  UINTN    NumberOfPrinted;

  VA_START (Marker, FormatString);
  NumberOfPrinted = BasePrintLibSPrintMarker (StartOfBuffer, BufferSize, Flags, FormatString, Marker, NULL);
   f:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
  16:	00 00 00 
  IN  UINTN        BufferSize,
  IN  UINTN        Flags,
  IN  CONST CHAR8  *FormatString,
  ...
  )
{
  19:	4c 89 4c 24 38       	mov    %r9,0x38(%rsp)
  VA_LIST  Marker;
  UINTN    NumberOfPrinted;

  VA_START (Marker, FormatString);
  NumberOfPrinted = BasePrintLibSPrintMarker (StartOfBuffer, BufferSize, Flags, FormatString, Marker, NULL);
  1e:	4c 8d 44 24 40       	lea    0x40(%rsp),%r8
  23:	45 31 c9             	xor    %r9d,%r9d
  26:	ff d0                	callq  *%rax
  VA_END (Marker);
  return NumberOfPrinted;
}
  28:	5a                   	pop    %rdx
  29:	5e                   	pop    %rsi
  2a:	5f                   	pop    %rdi
  2b:	c3                   	retq   

Disassembly of section .text.BasePrintLibSPrintMarker:

0000000000000000 <BasePrintLibSPrintMarker>:
  IN  UINTN        Flags,
  IN  CONST CHAR8  *Format,
  IN  VA_LIST      VaListMarker,   OPTIONAL
  IN  BASE_LIST    BaseListMarker  OPTIONAL
  )
{
   0:	41 57                	push   %r15
   2:	49 89 cf             	mov    %rcx,%r15
   5:	41 56                	push   %r14
   7:	41 55                	push   %r13
   9:	41 54                	push   %r12
   b:	49 89 f4             	mov    %rsi,%r12
   e:	55                   	push   %rbp
   f:	4c 89 cd             	mov    %r9,%rbp
  12:	53                   	push   %rbx
  13:	48 89 d3             	mov    %rdx,%rbx
  16:	48 81 ec f8 00 00 00 	sub    $0xf8,%rsp
  // If you change this code be sure to match the 2 versions of this function.
  // Nearly identical logic is found in the BasePrintLib and 
  // DxePrintLibPrint2Protocol (both PrintLib instances).
  //

  if ((Flags & COUNT_ONLY_NO_PRINT) != 0) {
  1d:	f6 c6 20             	test   $0x20,%dh
  IN  UINTN        Flags,
  IN  CONST CHAR8  *Format,
  IN  VA_LIST      VaListMarker,   OPTIONAL
  IN  BASE_LIST    BaseListMarker  OPTIONAL
  )
{
  20:	48 89 7c 24 70       	mov    %rdi,0x70(%rsp)
  25:	4c 89 44 24 40       	mov    %r8,0x40(%rsp)
  // If you change this code be sure to match the 2 versions of this function.
  // Nearly identical logic is found in the BasePrintLib and 
  // DxePrintLibPrint2Protocol (both PrintLib instances).
  //

  if ((Flags & COUNT_ONLY_NO_PRINT) != 0) {
  2a:	74 13                	je     3f <BasePrintLibSPrintMarker+0x3f>
    if (BufferSize == 0) {
      Buffer = NULL;
  2c:	48 85 f6             	test   %rsi,%rsi
  2f:	b8 00 00 00 00       	mov    $0x0,%eax
  34:	48 0f 45 c7          	cmovne %rdi,%rax
  38:	48 89 44 24 70       	mov    %rax,0x70(%rsp)
  3d:	eb 48                	jmp    87 <BasePrintLibSPrintMarker+0x87>
  } else {
    //
    // We can run without a Buffer for counting only.
    //
    if (BufferSize == 0) {
      return 0;
  3f:	31 c0                	xor    %eax,%eax
    }
  } else {
    //
    // We can run without a Buffer for counting only.
    //
    if (BufferSize == 0) {
  41:	48 85 f6             	test   %rsi,%rsi
  44:	0f 84 a3 0f 00 00    	je     fed <BasePrintLibSPrintMarker+0xfed>
      return 0;
    }
    ASSERT (Buffer != NULL);
  4a:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
  51:	00 00 00 
  54:	ff d0                	callq  *%rax
  56:	84 c0                	test   %al,%al
  58:	74 2d                	je     87 <BasePrintLibSPrintMarker+0x87>
  5a:	48 83 7c 24 70 00    	cmpq   $0x0,0x70(%rsp)
  60:	75 25                	jne    87 <BasePrintLibSPrintMarker+0x87>
  62:	49 b8 00 00 00 00 00 	movabs $0x0,%r8
  69:	00 00 00 
  6c:	ba 6e 01 00 00       	mov    $0x16e,%edx
  71:	48 b9 00 00 00 00 00 	movabs $0x0,%rcx
  78:	00 00 00 
  7b:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
  82:	00 00 00 
  85:	ff d0                	callq  *%rax
  }

  if ((Flags & OUTPUT_UNICODE) != 0) {
  87:	48 89 d8             	mov    %rbx,%rax
  OriginalBuffer = NULL;

  //
  // Reserve space for the Null terminator.
  //
  if (Buffer != NULL) {
  8a:	48 8b 7c 24 70       	mov    0x70(%rsp),%rdi
      return 0;
    }
    ASSERT (Buffer != NULL);
  }

  if ((Flags & OUTPUT_UNICODE) != 0) {
  8f:	83 e0 40             	and    $0x40,%eax
    BytesPerOutputCharacter = 2;
  92:	48 83 f8 01          	cmp    $0x1,%rax
  96:	19 c0                	sbb    %eax,%eax
  98:	89 84 24 a8 00 00 00 	mov    %eax,0xa8(%rsp)
  9f:	83 84 24 a8 00 00 00 	addl   $0x2,0xa8(%rsp)
  a6:	02 
  OriginalBuffer = NULL;

  //
  // Reserve space for the Null terminator.
  //
  if (Buffer != NULL) {
  a7:	48 85 ff             	test   %rdi,%rdi
  aa:	74 18                	je     c4 <BasePrintLibSPrintMarker+0xc4>
    OriginalBuffer = Buffer;

    //
    // Set the tag for the end of the input Buffer.
    //
    EndBuffer = Buffer + BufferSize * BytesPerOutputCharacter;
  ac:	8b 84 24 a8 00 00 00 	mov    0xa8(%rsp),%eax

  //
  // Reserve space for the Null terminator.
  //
  if (Buffer != NULL) {
    BufferSize--;
  b3:	49 ff cc             	dec    %r12
    OriginalBuffer = Buffer;

    //
    // Set the tag for the end of the input Buffer.
    //
    EndBuffer = Buffer + BufferSize * BytesPerOutputCharacter;
  b6:	49 0f af c4          	imul   %r12,%rax
  ba:	48 01 f8             	add    %rdi,%rax
  bd:	48 89 44 24 50       	mov    %rax,0x50(%rsp)
  c2:	eb 09                	jmp    cd <BasePrintLibSPrintMarker+0xcd>
  } else {
    BytesPerOutputCharacter = 1;
  }

  LengthToReturn = 0;
  EndBuffer = NULL;
  c4:	48 c7 44 24 50 00 00 	movq   $0x0,0x50(%rsp)
  cb:	00 00 
    // Set the tag for the end of the input Buffer.
    //
    EndBuffer = Buffer + BufferSize * BytesPerOutputCharacter;
  }

  if ((Flags & FORMAT_UNICODE) != 0) {
  cd:	f6 c7 01             	test   $0x1,%bh
  d0:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
  d7:	00 00 00 
  da:	74 53                	je     12f <BasePrintLibSPrintMarker+0x12f>
    //
    // Make sure format string cannot contain more than PcdMaximumUnicodeStringLength
    // Unicode characters if PcdMaximumUnicodeStringLength is not zero. 
    //
    ASSERT (StrSize ((CHAR16 *) Format) != 0);
  dc:	ff d0                	callq  *%rax
  de:	84 c0                	test   %al,%al
  e0:	74 39                	je     11b <BasePrintLibSPrintMarker+0x11b>
  e2:	4c 89 f9             	mov    %r15,%rcx
  e5:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
  ec:	00 00 00 
  ef:	ff d0                	callq  *%rax
  f1:	48 85 c0             	test   %rax,%rax
  f4:	75 25                	jne    11b <BasePrintLibSPrintMarker+0x11b>
  f6:	49 b8 00 00 00 00 00 	movabs $0x0,%r8
  fd:	00 00 00 
 100:	ba 8d 01 00 00       	mov    $0x18d,%edx
 105:	48 b9 00 00 00 00 00 	movabs $0x0,%rcx
 10c:	00 00 00 
 10f:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 116:	00 00 00 
 119:	ff d0                	callq  *%rax
    BytesPerFormatCharacter = 2;
    FormatMask = 0xffff;
 11b:	48 c7 44 24 58 ff ff 	movq   $0xffff,0x58(%rsp)
 122:	00 00 
    //
    // Make sure format string cannot contain more than PcdMaximumUnicodeStringLength
    // Unicode characters if PcdMaximumUnicodeStringLength is not zero. 
    //
    ASSERT (StrSize ((CHAR16 *) Format) != 0);
    BytesPerFormatCharacter = 2;
 124:	48 c7 44 24 48 02 00 	movq   $0x2,0x48(%rsp)
 12b:	00 00 
 12d:	eb 51                	jmp    180 <BasePrintLibSPrintMarker+0x180>
  } else {
    //
    // Make sure format string cannot contain more than PcdMaximumAsciiStringLength
    // Ascii characters if PcdMaximumAsciiStringLength is not zero. 
    //
    ASSERT (AsciiStrSize (Format) != 0);
 12f:	ff d0                	callq  *%rax
 131:	84 c0                	test   %al,%al
 133:	74 39                	je     16e <BasePrintLibSPrintMarker+0x16e>
 135:	4c 89 f9             	mov    %r15,%rcx
 138:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 13f:	00 00 00 
 142:	ff d0                	callq  *%rax
 144:	48 85 c0             	test   %rax,%rax
 147:	75 25                	jne    16e <BasePrintLibSPrintMarker+0x16e>
 149:	49 b8 00 00 00 00 00 	movabs $0x0,%r8
 150:	00 00 00 
 153:	ba 95 01 00 00       	mov    $0x195,%edx
 158:	48 b9 00 00 00 00 00 	movabs $0x0,%rcx
 15f:	00 00 00 
 162:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 169:	00 00 00 
 16c:	ff d0                	callq  *%rax
    BytesPerFormatCharacter = 1;
    FormatMask = 0xff;
 16e:	48 c7 44 24 58 ff 00 	movq   $0xff,0x58(%rsp)
 175:	00 00 
    //
    // Make sure format string cannot contain more than PcdMaximumAsciiStringLength
    // Ascii characters if PcdMaximumAsciiStringLength is not zero. 
    //
    ASSERT (AsciiStrSize (Format) != 0);
    BytesPerFormatCharacter = 1;
 177:	48 c7 44 24 48 01 00 	movq   $0x1,0x48(%rsp)
 17e:	00 00 
  }

  //
  // Get the first character from the format string
  //
  FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 180:	41 0f be 47 01       	movsbl 0x1(%r15),%eax
 185:	41 0f b6 17          	movzbl (%r15),%edx
    BytesPerOutputCharacter = 2;
  } else {
    BytesPerOutputCharacter = 1;
  }

  LengthToReturn = 0;
 189:	48 c7 44 24 68 00 00 	movq   $0x0,0x68(%rsp)
 190:	00 00 
  }

  //
  // Get the first character from the format string
  //
  FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 192:	c1 e0 08             	shl    $0x8,%eax
 195:	09 d0                	or     %edx,%eax
 197:	48 98                	cltq   
 199:	48 23 44 24 58       	and    0x58(%rsp),%rax
 19e:	48 89 84 24 b0 00 00 	mov    %rax,0xb0(%rsp)
 1a5:	00 

  //
  // Loop until the end of the format string is reached or the output buffer is full
  //
  while (FormatCharacter != 0) {
 1a6:	48 8b 44 24 70       	mov    0x70(%rsp),%rax
 1ab:	48 89 44 24 38       	mov    %rax,0x38(%rsp)
 1b0:	48 8b 84 24 b0 00 00 	mov    0xb0(%rsp),%rax
 1b7:	00 
 1b8:	48 85 c0             	test   %rax,%rax
 1bb:	74 24                	je     1e1 <BasePrintLibSPrintMarker+0x1e1>
    if ((Buffer != NULL) && (Buffer >= EndBuffer)) {
 1bd:	48 8b 74 24 38       	mov    0x38(%rsp),%rsi
 1c2:	48 8b 7c 24 50       	mov    0x50(%rsp),%rdi
 1c7:	48 85 f6             	test   %rsi,%rsi
 1ca:	0f 95 84 24 90 00 00 	setne  0x90(%rsp)
 1d1:	00 
 1d2:	48 39 fe             	cmp    %rdi,%rsi
 1d5:	72 29                	jb     200 <BasePrintLibSPrintMarker+0x200>
 1d7:	80 bc 24 90 00 00 00 	cmpb   $0x0,0x90(%rsp)
 1de:	00 
 1df:	74 1f                	je     200 <BasePrintLibSPrintMarker+0x200>
    // Get the next character from the format string
    //
    FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
  }

  if ((Flags & COUNT_ONLY_NO_PRINT) != 0) {
 1e1:	f6 c7 20             	test   $0x20,%bh
 1e4:	8b ac 24 a8 00 00 00 	mov    0xa8(%rsp),%ebp
 1eb:	0f 84 f2 0c 00 00    	je     ee3 <BasePrintLibSPrintMarker+0xee3>
    return (LengthToReturn / BytesPerOutputCharacter);
 1f1:	48 8b 44 24 68       	mov    0x68(%rsp),%rax
 1f6:	31 d2                	xor    %edx,%edx
 1f8:	48 f7 f5             	div    %rbp
 1fb:	e9 ed 0d 00 00       	jmpq   fed <BasePrintLibSPrintMarker+0xfed>
      break;
    }
    //
    // Clear all the flag bits except those that may have been passed in
    //
    Flags &= (UINTN) (OUTPUT_UNICODE | FORMAT_UNICODE | COUNT_ONLY_NO_PRINT);
 200:	81 e3 40 21 00 00    	and    $0x2140,%ebx
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;

    switch (FormatCharacter) {
 206:	48 83 f8 0d          	cmp    $0xd,%rax
 20a:	0f 84 1f 07 00 00    	je     92f <BasePrintLibSPrintMarker+0x92f>
 210:	48 83 f8 25          	cmp    $0x25,%rax
 214:	74 0f                	je     225 <BasePrintLibSPrintMarker+0x225>
 216:	48 83 f8 0a          	cmp    $0xa,%rax
 21a:	0f 85 95 07 00 00    	jne    9b5 <BasePrintLibSPrintMarker+0x9b5>
 220:	e9 60 07 00 00       	jmpq   985 <BasePrintLibSPrintMarker+0x985>
 225:	48 c7 44 24 30 00 00 	movq   $0x0,0x30(%rsp)
 22c:	00 00 
 22e:	41 ba 01 00 00 00    	mov    $0x1,%r10d
 234:	48 c7 44 24 60 00 00 	movq   $0x0,0x60(%rsp)
 23b:	00 00 
    case '%':
      //
      // Parse Flags and Width
      //
      for (Done = FALSE; !Done; ) {
        Format += BytesPerFormatCharacter;
 23d:	4c 03 7c 24 48       	add    0x48(%rsp),%r15
        FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 242:	41 0f be 47 01       	movsbl 0x1(%r15),%eax
 247:	41 0f b6 17          	movzbl (%r15),%edx
 24b:	c1 e0 08             	shl    $0x8,%eax
 24e:	09 d0                	or     %edx,%eax
 250:	48 98                	cltq   
 252:	48 23 44 24 58       	and    0x58(%rsp),%rax
        switch (FormatCharacter) {
 257:	48 83 f8 2d          	cmp    $0x2d,%rax
 25b:	0f 84 23 01 00 00    	je     384 <BasePrintLibSPrintMarker+0x384>
 261:	77 37                	ja     29a <BasePrintLibSPrintMarker+0x29a>
 263:	48 83 f8 2a          	cmp    $0x2a,%rax
 267:	0f 84 44 01 00 00    	je     3b1 <BasePrintLibSPrintMarker+0x3b1>
 26d:	77 15                	ja     284 <BasePrintLibSPrintMarker+0x284>
 26f:	48 85 c0             	test   %rax,%rax
 272:	0f 84 f3 01 00 00    	je     46b <BasePrintLibSPrintMarker+0x46b>
 278:	48 83 f8 20          	cmp    $0x20,%rax
 27c:	0f 84 14 01 00 00    	je     396 <BasePrintLibSPrintMarker+0x396>
 282:	eb 50                	jmp    2d4 <BasePrintLibSPrintMarker+0x2d4>
 284:	48 83 f8 2b          	cmp    $0x2b,%rax
 288:	0f 84 ff 00 00 00    	je     38d <BasePrintLibSPrintMarker+0x38d>
 28e:	48 83 f8 2c          	cmp    $0x2c,%rax
 292:	0f 84 07 01 00 00    	je     39f <BasePrintLibSPrintMarker+0x39f>
 298:	eb 3a                	jmp    2d4 <BasePrintLibSPrintMarker+0x2d4>
 29a:	48 83 f8 39          	cmp    $0x39,%rax
 29e:	77 20                	ja     2c0 <BasePrintLibSPrintMarker+0x2c0>
 2a0:	48 83 f8 31          	cmp    $0x31,%rax
 2a4:	0f 83 64 01 00 00    	jae    40e <BasePrintLibSPrintMarker+0x40e>
 2aa:	48 83 f8 2e          	cmp    $0x2e,%rax
 2ae:	0f 84 c8 00 00 00    	je     37c <BasePrintLibSPrintMarker+0x37c>
 2b4:	48 83 f8 30          	cmp    $0x30,%rax
 2b8:	0f 84 42 01 00 00    	je     400 <BasePrintLibSPrintMarker+0x400>
 2be:	eb 14                	jmp    2d4 <BasePrintLibSPrintMarker+0x2d4>
 2c0:	48 83 f8 4c          	cmp    $0x4c,%rax
 2c4:	0f 84 de 00 00 00    	je     3a8 <BasePrintLibSPrintMarker+0x3a8>
 2ca:	48 83 f8 6c          	cmp    $0x6c,%rax
 2ce:	0f 84 d4 00 00 00    	je     3a8 <BasePrintLibSPrintMarker+0x3a8>
      } 

      //
      // Handle each argument type
      //
      switch (FormatCharacter) {
 2d4:	48 83 f8 64          	cmp    $0x64,%rax
 2d8:	48 89 84 24 b0 00 00 	mov    %rax,0xb0(%rsp)
 2df:	00 
 2e0:	0f 84 a5 01 00 00    	je     48b <BasePrintLibSPrintMarker+0x48b>
 2e6:	77 48                	ja     330 <BasePrintLibSPrintMarker+0x330>
 2e8:	48 83 f8 53          	cmp    $0x53,%rax
 2ec:	0f 84 1f 03 00 00    	je     611 <BasePrintLibSPrintMarker+0x611>
 2f2:	77 19                	ja     30d <BasePrintLibSPrintMarker+0x30d>
 2f4:	48 83 f8 0a          	cmp    $0xa,%rax
 2f8:	0f 84 de 05 00 00    	je     8dc <BasePrintLibSPrintMarker+0x8dc>
 2fe:	48 83 f8 0d          	cmp    $0xd,%rax
 302:	0f 84 87 05 00 00    	je     88f <BasePrintLibSPrintMarker+0x88f>
 308:	e9 06 06 00 00       	jmpq   913 <BasePrintLibSPrintMarker+0x913>
 30d:	48 83 f8 61          	cmp    $0x61,%rax
 311:	0f 84 fd 02 00 00    	je     614 <BasePrintLibSPrintMarker+0x614>
 317:	48 83 f8 63          	cmp    $0x63,%rax
 31b:	0f 84 3d 03 00 00    	je     65e <BasePrintLibSPrintMarker+0x65e>
 321:	48 83 f8 58          	cmp    $0x58,%rax
 325:	0f 84 59 01 00 00    	je     484 <BasePrintLibSPrintMarker+0x484>
 32b:	e9 e3 05 00 00       	jmpq   913 <BasePrintLibSPrintMarker+0x913>
 330:	48 83 f8 72          	cmp    $0x72,%rax
 334:	0f 84 95 04 00 00    	je     7cf <BasePrintLibSPrintMarker+0x7cf>
 33a:	77 21                	ja     35d <BasePrintLibSPrintMarker+0x35d>
 33c:	48 83 f8 67          	cmp    $0x67,%rax
 340:	0f 84 67 03 00 00    	je     6ad <BasePrintLibSPrintMarker+0x6ad>
 346:	48 83 f8 70          	cmp    $0x70,%rax
 34a:	0f 85 c3 05 00 00    	jne    913 <BasePrintLibSPrintMarker+0x913>
      case 'p':
        //
        // Flag space, +, 0, L & l are invalid for type p.
        //
        Flags &= ~((UINTN) (PREFIX_BLANK | PREFIX_SIGN | PREFIX_ZERO | LONG_TYPE));
 350:	48 83 e3 c9          	and    $0xffffffffffffffc9,%rbx
        if (sizeof (VOID *) > 4) {
          Flags |= LONG_TYPE;
 354:	48 83 cb 10          	or     $0x10,%rbx
 358:	e9 27 01 00 00       	jmpq   484 <BasePrintLibSPrintMarker+0x484>
      } 

      //
      // Handle each argument type
      //
      switch (FormatCharacter) {
 35d:	48 83 f8 74          	cmp    $0x74,%rax
 361:	0f 84 fa 03 00 00    	je     761 <BasePrintLibSPrintMarker+0x761>
 367:	0f 82 a4 02 00 00    	jb     611 <BasePrintLibSPrintMarker+0x611>
 36d:	48 83 f8 78          	cmp    $0x78,%rax
 371:	0f 84 11 01 00 00    	je     488 <BasePrintLibSPrintMarker+0x488>
 377:	e9 97 05 00 00       	jmpq   913 <BasePrintLibSPrintMarker+0x913>
      for (Done = FALSE; !Done; ) {
        Format += BytesPerFormatCharacter;
        FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
        switch (FormatCharacter) {
        case '.': 
          Flags |= PRECISION; 
 37c:	80 cf 08             	or     $0x8,%bh
          break;
 37f:	e9 b9 fe ff ff       	jmpq   23d <BasePrintLibSPrintMarker+0x23d>
        case '-': 
          Flags |= LEFT_JUSTIFY; 
 384:	48 83 cb 01          	or     $0x1,%rbx
          break;
 388:	e9 b0 fe ff ff       	jmpq   23d <BasePrintLibSPrintMarker+0x23d>
        case '+': 
          Flags |= PREFIX_SIGN;  
 38d:	48 83 cb 02          	or     $0x2,%rbx
          break;
 391:	e9 a7 fe ff ff       	jmpq   23d <BasePrintLibSPrintMarker+0x23d>
        case ' ': 
          Flags |= PREFIX_BLANK; 
 396:	48 83 cb 04          	or     $0x4,%rbx
          break;
 39a:	e9 9e fe ff ff       	jmpq   23d <BasePrintLibSPrintMarker+0x23d>
        case ',': 
          Flags |= COMMA_TYPE; 
 39f:	48 83 cb 08          	or     $0x8,%rbx
          break;
 3a3:	e9 95 fe ff ff       	jmpq   23d <BasePrintLibSPrintMarker+0x23d>
        case 'L':
        case 'l': 
          Flags |= LONG_TYPE;    
 3a8:	48 83 cb 10          	or     $0x10,%rbx
          break;
 3ac:	e9 8c fe ff ff       	jmpq   23d <BasePrintLibSPrintMarker+0x23d>
        case '*':
          if ((Flags & PRECISION) == 0) {
 3b1:	f6 c7 08             	test   $0x8,%bh
 3b4:	75 22                	jne    3d8 <BasePrintLibSPrintMarker+0x3d8>
            Flags |= PAD_TO_WIDTH;
 3b6:	80 cf 02             	or     $0x2,%bh
            if (BaseListMarker == NULL) {
 3b9:	48 85 ed             	test   %rbp,%rbp
 3bc:	75 0f                	jne    3cd <BasePrintLibSPrintMarker+0x3cd>
              Width = VA_ARG (VaListMarker, UINTN);
 3be:	48 8b 44 24 40       	mov    0x40(%rsp),%rax
 3c3:	48 8b 30             	mov    (%rax),%rsi
 3c6:	48 89 74 24 60       	mov    %rsi,0x60(%rsp)
 3cb:	eb 18                	jmp    3e5 <BasePrintLibSPrintMarker+0x3e5>
            } else {
              Width = BASE_ARG (BaseListMarker, UINTN);
 3cd:	48 8b 45 00          	mov    0x0(%rbp),%rax
 3d1:	48 89 44 24 60       	mov    %rax,0x60(%rsp)
 3d6:	eb 1f                	jmp    3f7 <BasePrintLibSPrintMarker+0x3f7>
            }
          } else {
            if (BaseListMarker == NULL) {
 3d8:	48 85 ed             	test   %rbp,%rbp
 3db:	75 16                	jne    3f3 <BasePrintLibSPrintMarker+0x3f3>
              Precision = VA_ARG (VaListMarker, UINTN);
 3dd:	48 8b 44 24 40       	mov    0x40(%rsp),%rax
 3e2:	4c 8b 10             	mov    (%rax),%r10
 3e5:	48 83 c0 08          	add    $0x8,%rax
 3e9:	48 89 44 24 40       	mov    %rax,0x40(%rsp)
 3ee:	e9 4a fe ff ff       	jmpq   23d <BasePrintLibSPrintMarker+0x23d>
            } else {
              Precision = BASE_ARG (BaseListMarker, UINTN);
 3f3:	4c 8b 55 00          	mov    0x0(%rbp),%r10
 3f7:	48 83 c5 08          	add    $0x8,%rbp
 3fb:	e9 3d fe ff ff       	jmpq   23d <BasePrintLibSPrintMarker+0x23d>
            }
          }
          break;
        case '0':
          if ((Flags & PRECISION) == 0) {
            Flags |= PREFIX_ZERO;
 400:	48 89 da             	mov    %rbx,%rdx
 403:	48 83 ca 20          	or     $0x20,%rdx
 407:	f6 c7 08             	test   $0x8,%bh
 40a:	48 0f 44 da          	cmove  %rdx,%rbx
        case '5':
        case '6':
        case '7':
        case '8':
        case '9':
          for (Count = 0; ((FormatCharacter >= '0') &&  (FormatCharacter <= '9')); ){
 40e:	48 c7 44 24 30 00 00 	movq   $0x0,0x30(%rsp)
 415:	00 00 
 417:	48 83 e8 30          	sub    $0x30,%rax
 41b:	48 83 f8 09          	cmp    $0x9,%rax
 41f:	77 2a                	ja     44b <BasePrintLibSPrintMarker+0x44b>
            Count = (Count * 10) + FormatCharacter - '0';
 421:	48 6b 54 24 30 0a    	imul   $0xa,0x30(%rsp),%rdx
            Format += BytesPerFormatCharacter;
 427:	4c 03 7c 24 48       	add    0x48(%rsp),%r15
        case '6':
        case '7':
        case '8':
        case '9':
          for (Count = 0; ((FormatCharacter >= '0') &&  (FormatCharacter <= '9')); ){
            Count = (Count * 10) + FormatCharacter - '0';
 42c:	48 01 d0             	add    %rdx,%rax
            Format += BytesPerFormatCharacter;
            FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 42f:	41 0f b6 17          	movzbl (%r15),%edx
        case '6':
        case '7':
        case '8':
        case '9':
          for (Count = 0; ((FormatCharacter >= '0') &&  (FormatCharacter <= '9')); ){
            Count = (Count * 10) + FormatCharacter - '0';
 433:	48 89 44 24 30       	mov    %rax,0x30(%rsp)
            Format += BytesPerFormatCharacter;
            FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 438:	41 0f be 47 01       	movsbl 0x1(%r15),%eax
 43d:	c1 e0 08             	shl    $0x8,%eax
 440:	09 d0                	or     %edx,%eax
 442:	48 98                	cltq   
 444:	48 23 44 24 58       	and    0x58(%rsp),%rax
 449:	eb cc                	jmp    417 <BasePrintLibSPrintMarker+0x417>
          }
          Format -= BytesPerFormatCharacter;
 44b:	4c 2b 7c 24 48       	sub    0x48(%rsp),%r15
          if ((Flags & PRECISION) == 0) {
 450:	f6 c7 08             	test   $0x8,%bh
 453:	0f 85 8a 0b 00 00    	jne    fe3 <BasePrintLibSPrintMarker+0xfe3>
 459:	48 8b 44 24 30       	mov    0x30(%rsp),%rax
            Flags |= PAD_TO_WIDTH;
 45e:	80 cf 02             	or     $0x2,%bh
 461:	48 89 44 24 60       	mov    %rax,0x60(%rsp)
 466:	e9 d2 fd ff ff       	jmpq   23d <BasePrintLibSPrintMarker+0x23d>
 46b:	48 c7 84 24 b0 00 00 	movq   $0x0,0xb0(%rsp)
 472:	00 00 00 00 00 
        case '\0':
          //
          // Make no output if Format string terminates unexpectedly when
          // looking up for flag, width, precision and type. 
          //
          Format   -= BytesPerFormatCharacter;
 477:	4c 2b 7c 24 48       	sub    0x48(%rsp),%r15
          Precision = 0;
 47c:	45 31 d2             	xor    %r10d,%r10d
 47f:	e9 8f 04 00 00       	jmpq   913 <BasePrintLibSPrintMarker+0x913>
        }
        //
        // break skipped on purpose
        //
      case 'X':
        Flags |= PREFIX_ZERO;
 484:	48 83 cb 20          	or     $0x20,%rbx
        //
        // break skipped on purpose
        //
      case 'x':
        Flags |= RADIX_HEX;
 488:	80 cb 80             	or     $0x80,%bl
        //
        // break skipped on purpose
        //
      case 'd':
        if ((Flags & LONG_TYPE) == 0) {
 48b:	48 89 d8             	mov    %rbx,%rax
      } 

      //
      // Handle each argument type
      //
      switch (FormatCharacter) {
 48e:	48 89 d9             	mov    %rbx,%rcx
        Flags |= RADIX_HEX;
        //
        // break skipped on purpose
        //
      case 'd':
        if ((Flags & LONG_TYPE) == 0) {
 491:	83 e0 10             	and    $0x10,%eax
 494:	75 15                	jne    4ab <BasePrintLibSPrintMarker+0x4ab>
          // Specification for formatted strings.  It is recommended that the Base Types be used 
          // everywhere, but in this one case, compliance with ANSI C is more important, and 
          // provides an implementation that is compatible with that largest possible set of CPU 
          // architectures.  This is why the type "int" is used in this one case.
          //
          if (BaseListMarker == NULL) {
 496:	48 85 ed             	test   %rbp,%rbp
 499:	75 0a                	jne    4a5 <BasePrintLibSPrintMarker+0x4a5>
            Value = VA_ARG (VaListMarker, int);
 49b:	48 8b 7c 24 40       	mov    0x40(%rsp),%rdi
 4a0:	48 63 1f             	movslq (%rdi),%rbx
 4a3:	eb 13                	jmp    4b8 <BasePrintLibSPrintMarker+0x4b8>
          } else {
            Value = BASE_ARG (BaseListMarker, int);
 4a5:	48 63 5d 00          	movslq 0x0(%rbp),%rbx
 4a9:	eb 1c                	jmp    4c7 <BasePrintLibSPrintMarker+0x4c7>
          }
        } else {
          if (BaseListMarker == NULL) {
 4ab:	48 85 ed             	test   %rbp,%rbp
 4ae:	75 13                	jne    4c3 <BasePrintLibSPrintMarker+0x4c3>
            Value = VA_ARG (VaListMarker, INT64);
 4b0:	48 8b 7c 24 40       	mov    0x40(%rsp),%rdi
 4b5:	48 8b 1f             	mov    (%rdi),%rbx
 4b8:	48 8d 77 08          	lea    0x8(%rdi),%rsi
 4bc:	48 89 74 24 40       	mov    %rsi,0x40(%rsp)
 4c1:	eb 08                	jmp    4cb <BasePrintLibSPrintMarker+0x4cb>
          } else {
            Value = BASE_ARG (BaseListMarker, INT64);
 4c3:	48 8b 5d 00          	mov    0x0(%rbp),%rbx
 4c7:	48 83 c5 08          	add    $0x8,%rbp
          }
        }
        if ((Flags & PREFIX_BLANK) != 0) {
 4cb:	48 89 ca             	mov    %rcx,%rdx
 4ce:	83 e2 04             	and    $0x4,%edx
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 4d1:	48 83 fa 01          	cmp    $0x1,%rdx
        }
        if ((Flags & PREFIX_BLANK) != 0) {
          Prefix = ' ';
        }
        if ((Flags & PREFIX_SIGN) != 0) {
          Prefix = '+';
 4d5:	b2 2b                	mov    $0x2b,%dl
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 4d7:	45 19 e4             	sbb    %r12d,%r12d
 4da:	41 f7 d4             	not    %r12d
 4dd:	41 83 e4 20          	and    $0x20,%r12d
        }
        if ((Flags & PREFIX_BLANK) != 0) {
          Prefix = ' ';
        }
        if ((Flags & PREFIX_SIGN) != 0) {
          Prefix = '+';
 4e1:	f6 c1 02             	test   $0x2,%cl
 4e4:	44 0f 45 e2          	cmovne %edx,%r12d
        }
        if ((Flags & COMMA_TYPE) != 0) {
          Comma = TRUE;
        }
        if ((Flags & RADIX_HEX) == 0) {
 4e8:	f6 c1 80             	test   $0x80,%cl
 4eb:	75 2d                	jne    51a <BasePrintLibSPrintMarker+0x51a>
          Prefix = ' ';
        }
        if ((Flags & PREFIX_SIGN) != 0) {
          Prefix = '+';
        }
        if ((Flags & COMMA_TYPE) != 0) {
 4ed:	49 89 c9             	mov    %rcx,%r9
 4f0:	49 c1 e9 03          	shr    $0x3,%r9
          Comma = TRUE;
        }
        if ((Flags & RADIX_HEX) == 0) {
          Radix = 10;
          if (Comma) {
 4f4:	41 80 e1 01          	and    $0x1,%r9b
 4f8:	74 0a                	je     504 <BasePrintLibSPrintMarker+0x504>
            Flags &= ~((UINTN) PREFIX_ZERO);
 4fa:	48 83 e1 df          	and    $0xffffffffffffffdf,%rcx
            Precision = 1;
 4fe:	41 ba 01 00 00 00    	mov    $0x1,%r10d
          }
          if (Value < 0) {
 504:	48 85 db             	test   %rbx,%rbx
        }
        if ((Flags & COMMA_TYPE) != 0) {
          Comma = TRUE;
        }
        if ((Flags & RADIX_HEX) == 0) {
          Radix = 10;
 507:	ba 0a 00 00 00       	mov    $0xa,%edx
          if (Comma) {
            Flags &= ~((UINTN) PREFIX_ZERO);
            Precision = 1;
          }
          if (Value < 0) {
 50c:	79 20                	jns    52e <BasePrintLibSPrintMarker+0x52e>
            Flags |= PREFIX_SIGN;
 50e:	48 83 c9 02          	or     $0x2,%rcx
            Prefix = '-';
            Value = -Value;
 512:	48 f7 db             	neg    %rbx
            Flags &= ~((UINTN) PREFIX_ZERO);
            Precision = 1;
          }
          if (Value < 0) {
            Flags |= PREFIX_SIGN;
            Prefix = '-';
 515:	41 b4 2d             	mov    $0x2d,%r12b
 518:	eb 14                	jmp    52e <BasePrintLibSPrintMarker+0x52e>
            Value = -Value;
          }
        } else {
          Radix = 16;
          Comma = FALSE;
          if ((Flags & LONG_TYPE) == 0 && Value < 0) {
 51a:	48 85 c0             	test   %rax,%rax
 51d:	75 07                	jne    526 <BasePrintLibSPrintMarker+0x526>
 51f:	48 85 db             	test   %rbx,%rbx
 522:	79 02                	jns    526 <BasePrintLibSPrintMarker+0x526>
            // Specification for formatted strings.  It is recommended that the Base Types be used 
            // everywhere, but in this one case, compliance with ANSI C is more important, and 
            // provides an implementation that is compatible with that largest possible set of CPU 
            // architectures.  This is why the type "unsigned int" is used in this one case.
            //
            Value = (unsigned int)Value;
 524:	89 db                	mov    %ebx,%ebx
            Flags |= PREFIX_SIGN;
            Prefix = '-';
            Value = -Value;
          }
        } else {
          Radix = 16;
 526:	ba 10 00 00 00       	mov    $0x10,%edx
          Comma = FALSE;
 52b:	45 31 c9             	xor    %r9d,%r9d
 52e:	44 89 8c 24 80 00 00 	mov    %r9d,0x80(%rsp)
 535:	00 
 536:	4c 89 54 24 78       	mov    %r10,0x78(%rsp)
          }
        }
        //
        // Convert Value to a reversed string
        //
        Count = BasePrintLibValueToString (ValueBuffer, Value, Radix) - ValueBuffer;
 53b:	48 89 de             	mov    %rbx,%rsi
 53e:	48 89 4c 24 30       	mov    %rcx,0x30(%rsp)
 543:	48 8d bc 24 ca 00 00 	lea    0xca(%rsp),%rdi
 54a:	00 
 54b:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 552:	00 00 00 
 555:	ff d0                	callq  *%rax
        if (Value == 0 && Precision == 0) {
 557:	4c 8b 54 24 78       	mov    0x78(%rsp),%r10
 55c:	48 8b 4c 24 30       	mov    0x30(%rsp),%rcx
 561:	44 8b 8c 24 80 00 00 	mov    0x80(%rsp),%r9d
 568:	00 
 569:	4d 85 d2             	test   %r10,%r10
 56c:	75 0e                	jne    57c <BasePrintLibSPrintMarker+0x57c>
 56e:	48 85 db             	test   %rbx,%rbx
          Count = 0;
 571:	48 c7 44 24 30 00 00 	movq   $0x0,0x30(%rsp)
 578:	00 00 
        }
        //
        // Convert Value to a reversed string
        //
        Count = BasePrintLibValueToString (ValueBuffer, Value, Radix) - ValueBuffer;
        if (Value == 0 && Precision == 0) {
 57a:	74 10                	je     58c <BasePrintLibSPrintMarker+0x58c>
          }
        }
        //
        // Convert Value to a reversed string
        //
        Count = BasePrintLibValueToString (ValueBuffer, Value, Radix) - ValueBuffer;
 57c:	48 8d b4 24 ca 00 00 	lea    0xca(%rsp),%rsi
 583:	00 
 584:	48 29 f0             	sub    %rsi,%rax
 587:	48 89 44 24 30       	mov    %rax,0x30(%rsp)
        if (Value == 0 && Precision == 0) {
          Count = 0;
        }
        ArgumentString = (CHAR8 *)ValueBuffer + Count;
 58c:	48 8b 44 24 30       	mov    0x30(%rsp),%rax
 591:	4c 8d ac 24 ca 00 00 	lea    0xca(%rsp),%r13
 598:	00 
        
        Digits = Count % 3;
 599:	be 03 00 00 00       	mov    $0x3,%esi
 59e:	31 d2                	xor    %edx,%edx
        if (Digits != 0) {
          Digits = 3 - Digits;
 5a0:	49 89 f6             	mov    %rsi,%r14
        //
        Count = BasePrintLibValueToString (ValueBuffer, Value, Radix) - ValueBuffer;
        if (Value == 0 && Precision == 0) {
          Count = 0;
        }
        ArgumentString = (CHAR8 *)ValueBuffer + Count;
 5a3:	49 01 c5             	add    %rax,%r13
        
        Digits = Count % 3;
 5a6:	48 f7 f6             	div    %rsi
        if (Digits != 0) {
          Digits = 3 - Digits;
 5a9:	49 29 d6             	sub    %rdx,%r14
 5ac:	48 85 d2             	test   %rdx,%rdx
 5af:	4c 0f 44 f2          	cmove  %rdx,%r14
        }
        if (Comma && Count != 0) {
 5b3:	48 83 7c 24 30 00    	cmpq   $0x0,0x30(%rsp)
 5b9:	74 17                	je     5d2 <BasePrintLibSPrintMarker+0x5d2>
 5bb:	45 84 c9             	test   %r9b,%r9b
 5be:	74 12                	je     5d2 <BasePrintLibSPrintMarker+0x5d2>
          Count += ((Count - 1) / 3);
 5c0:	48 8b 44 24 30       	mov    0x30(%rsp),%rax
 5c5:	31 d2                	xor    %edx,%edx
 5c7:	48 ff c8             	dec    %rax
 5ca:	48 f7 f6             	div    %rsi
 5cd:	48 01 44 24 30       	add    %rax,0x30(%rsp)
        }
        if (Prefix != 0) {
 5d2:	45 84 e4             	test   %r12b,%r12b
 5d5:	74 08                	je     5df <BasePrintLibSPrintMarker+0x5df>
          Count++;
 5d7:	48 ff 44 24 30       	incq   0x30(%rsp)
          Precision++;
 5dc:	49 ff c2             	inc    %r10
        }
        Flags |= ARGUMENT_REVERSED;
 5df:	48 89 cb             	mov    %rcx,%rbx
        ZeroPad = TRUE;
 5e2:	41 b3 01             	mov    $0x1,%r11b
        }
        if (Prefix != 0) {
          Count++;
          Precision++;
        }
        Flags |= ARGUMENT_REVERSED;
 5e5:	80 cf 10             	or     $0x10,%bh
        ZeroPad = TRUE;
        if ((Flags & PREFIX_ZERO) != 0) {
 5e8:	f6 c1 20             	test   $0x20,%cl
 5eb:	0f 84 6a 04 00 00    	je     a5b <BasePrintLibSPrintMarker+0xa5b>
          if ((Flags & LEFT_JUSTIFY) == 0) {
 5f1:	f6 c1 01             	test   $0x1,%cl
 5f4:	0f 85 61 04 00 00    	jne    a5b <BasePrintLibSPrintMarker+0xa5b>
            if ((Flags & PAD_TO_WIDTH) != 0) {
 5fa:	f6 c5 02             	test   $0x2,%ch
 5fd:	0f 84 58 04 00 00    	je     a5b <BasePrintLibSPrintMarker+0xa5b>
        if (Prefix != 0) {
          Count++;
          Precision++;
        }
        Flags |= ARGUMENT_REVERSED;
        ZeroPad = TRUE;
 603:	80 e5 08             	and    $0x8,%ch
 606:	4c 0f 44 54 24 60    	cmove  0x60(%rsp),%r10
 60c:	e9 4a 04 00 00       	jmpq   a5b <BasePrintLibSPrintMarker+0xa5b>
        }
        break;

      case 's':
      case 'S':
        Flags |= ARGUMENT_UNICODE;
 611:	80 cf 04             	or     $0x4,%bh
        //
        // break skipped on purpose
        //
      case 'a':
        if (BaseListMarker == NULL) {
 614:	48 85 ed             	test   %rbp,%rbp
 617:	75 13                	jne    62c <BasePrintLibSPrintMarker+0x62c>
          ArgumentString = VA_ARG (VaListMarker, CHAR8 *);
 619:	48 8b 44 24 40       	mov    0x40(%rsp),%rax
 61e:	4c 8b 28             	mov    (%rax),%r13
 621:	48 83 c0 08          	add    $0x8,%rax
 625:	48 89 44 24 40       	mov    %rax,0x40(%rsp)
 62a:	eb 08                	jmp    634 <BasePrintLibSPrintMarker+0x634>
        } else {
          ArgumentString = BASE_ARG (BaseListMarker, CHAR8 *);
 62c:	4c 8b 6d 00          	mov    0x0(%rbp),%r13
 630:	48 83 c5 08          	add    $0x8,%rbp
        }
        if (ArgumentString == NULL) {
 634:	4d 85 ed             	test   %r13,%r13
 637:	75 0d                	jne    646 <BasePrintLibSPrintMarker+0x646>
          Flags &= ~((UINTN) ARGUMENT_UNICODE);
 639:	80 e7 fb             	and    $0xfb,%bh
          ArgumentString = "<null string>";
 63c:	49 bd 00 00 00 00 00 	movabs $0x0,%r13
 643:	00 00 00 
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 646:	45 31 f6             	xor    %r14d,%r14d
 649:	45 31 c9             	xor    %r9d,%r9d
 64c:	45 31 db             	xor    %r11d,%r11d
 64f:	45 31 e4             	xor    %r12d,%r12d
 652:	f6 c7 08             	test   $0x8,%bh
 655:	4d 0f 44 d6          	cmove  %r14,%r10
 659:	e9 fd 03 00 00       	jmpq   a5b <BasePrintLibSPrintMarker+0xa5b>
          Precision = 0;
        }
        break;

      case 'c':
        if (BaseListMarker == NULL) {
 65e:	48 85 ed             	test   %rbp,%rbp
 661:	75 1e                	jne    681 <BasePrintLibSPrintMarker+0x681>
          Character = VA_ARG (VaListMarker, UINTN) & 0xffff;
 663:	48 8b 74 24 40       	mov    0x40(%rsp),%rsi
 668:	0f b7 06             	movzwl (%rsi),%eax
 66b:	48 89 84 24 b8 00 00 	mov    %rax,0xb8(%rsp)
 672:	00 
 673:	48 89 f0             	mov    %rsi,%rax
 676:	48 83 c0 08          	add    $0x8,%rax
 67a:	48 89 44 24 40       	mov    %rax,0x40(%rsp)
 67f:	eb 10                	jmp    691 <BasePrintLibSPrintMarker+0x691>
        } else {
          Character = BASE_ARG (BaseListMarker, UINTN) & 0xffff;
 681:	0f b7 45 00          	movzwl 0x0(%rbp),%eax
 685:	48 83 c5 08          	add    $0x8,%rbp
 689:	48 89 84 24 b8 00 00 	mov    %rax,0xb8(%rsp)
 690:	00 
        }
        ArgumentString = (CHAR8 *)&Character;
        Flags |= ARGUMENT_UNICODE;
 691:	80 cf 04             	or     $0x4,%bh
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 694:	45 31 f6             	xor    %r14d,%r14d
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
 697:	45 31 c9             	xor    %r9d,%r9d
    ZeroPad   = FALSE;
 69a:	45 31 db             	xor    %r11d,%r11d
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 69d:	45 31 e4             	xor    %r12d,%r12d
        if (BaseListMarker == NULL) {
          Character = VA_ARG (VaListMarker, UINTN) & 0xffff;
        } else {
          Character = BASE_ARG (BaseListMarker, UINTN) & 0xffff;
        }
        ArgumentString = (CHAR8 *)&Character;
 6a0:	4c 8d ac 24 b8 00 00 	lea    0xb8(%rsp),%r13
 6a7:	00 
        Flags |= ARGUMENT_UNICODE;
        break;
 6a8:	e9 ae 03 00 00       	jmpq   a5b <BasePrintLibSPrintMarker+0xa5b>

      case 'g':
        if (BaseListMarker == NULL) {
 6ad:	48 85 ed             	test   %rbp,%rbp
 6b0:	75 13                	jne    6c5 <BasePrintLibSPrintMarker+0x6c5>
          TmpGuid = VA_ARG (VaListMarker, GUID *);
 6b2:	48 8b 44 24 40       	mov    0x40(%rsp),%rax
 6b7:	4c 8b 28             	mov    (%rax),%r13
 6ba:	48 83 c0 08          	add    $0x8,%rax
 6be:	48 89 44 24 40       	mov    %rax,0x40(%rsp)
 6c3:	eb 08                	jmp    6cd <BasePrintLibSPrintMarker+0x6cd>
        } else {
          TmpGuid = BASE_ARG (BaseListMarker, GUID *);
 6c5:	4c 8b 6d 00          	mov    0x0(%rbp),%r13
 6c9:	48 83 c5 08          	add    $0x8,%rbp
        }
        if (TmpGuid == NULL) {
 6cd:	4d 85 ed             	test   %r13,%r13
 6d0:	0f 84 01 03 00 00    	je     9d7 <BasePrintLibSPrintMarker+0x9d7>
 6d6:	4c 89 94 24 80 00 00 	mov    %r10,0x80(%rsp)
 6dd:	00 
          ArgumentString = "<null guid>";
        } else {
          GuidData1 = ReadUnaligned32 (&(TmpGuid->Data1));
 6de:	4c 89 e9             	mov    %r13,%rcx
          GuidData2 = ReadUnaligned16 (&(TmpGuid->Data2));
 6e1:	49 be 00 00 00 00 00 	movabs $0x0,%r14
 6e8:	00 00 00 
          TmpGuid = BASE_ARG (BaseListMarker, GUID *);
        }
        if (TmpGuid == NULL) {
          ArgumentString = "<null guid>";
        } else {
          GuidData1 = ReadUnaligned32 (&(TmpGuid->Data1));
 6eb:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 6f2:	00 00 00 
 6f5:	ff d0                	callq  *%rax
          GuidData2 = ReadUnaligned16 (&(TmpGuid->Data2));
 6f7:	49 8d 4d 04          	lea    0x4(%r13),%rcx
          TmpGuid = BASE_ARG (BaseListMarker, GUID *);
        }
        if (TmpGuid == NULL) {
          ArgumentString = "<null guid>";
        } else {
          GuidData1 = ReadUnaligned32 (&(TmpGuid->Data1));
 6fb:	89 44 24 78          	mov    %eax,0x78(%rsp)
          GuidData2 = ReadUnaligned16 (&(TmpGuid->Data2));
 6ff:	41 ff d6             	callq  *%r14
          GuidData3 = ReadUnaligned16 (&(TmpGuid->Data3));
 702:	49 8d 4d 06          	lea    0x6(%r13),%rcx
        }
        if (TmpGuid == NULL) {
          ArgumentString = "<null guid>";
        } else {
          GuidData1 = ReadUnaligned32 (&(TmpGuid->Data1));
          GuidData2 = ReadUnaligned16 (&(TmpGuid->Data2));
 706:	44 0f b7 e0          	movzwl %ax,%r12d
            , TmpGuid->Data4[5]
            , TmpGuid->Data4[6]
            , TmpGuid->Data4[7]
#endif
            );
          ArgumentString = ValueBuffer;
 70a:	4c 8d ac 24 ca 00 00 	lea    0xca(%rsp),%r13
 711:	00 
        if (TmpGuid == NULL) {
          ArgumentString = "<null guid>";
        } else {
          GuidData1 = ReadUnaligned32 (&(TmpGuid->Data1));
          GuidData2 = ReadUnaligned16 (&(TmpGuid->Data2));
          GuidData3 = ReadUnaligned16 (&(TmpGuid->Data3));
 712:	41 ff d6             	callq  *%r14
          BasePrintLibSPrint (
 715:	8b 54 24 78          	mov    0x78(%rsp),%edx
 719:	44 89 64 24 28       	mov    %r12d,0x28(%rsp)
 71e:	49 b9 00 00 00 00 00 	movabs $0x0,%r9
 725:	00 00 00 
 728:	45 31 c0             	xor    %r8d,%r8d
 72b:	48 8d 8c 24 ca 00 00 	lea    0xca(%rsp),%rcx
 732:	00 
 733:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 73a:	00 00 00 
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 73d:	45 31 f6             	xor    %r14d,%r14d
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 740:	45 31 e4             	xor    %r12d,%r12d
          ArgumentString = "<null guid>";
        } else {
          GuidData1 = ReadUnaligned32 (&(TmpGuid->Data1));
          GuidData2 = ReadUnaligned16 (&(TmpGuid->Data2));
          GuidData3 = ReadUnaligned16 (&(TmpGuid->Data3));
          BasePrintLibSPrint (
 743:	89 54 24 20          	mov    %edx,0x20(%rsp)
 747:	ba 26 00 00 00       	mov    $0x26,%edx
 74c:	ff d0                	callq  *%rax
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
 74e:	45 31 c9             	xor    %r9d,%r9d
    ZeroPad   = FALSE;
 751:	45 31 db             	xor    %r11d,%r11d
 754:	4c 8b 94 24 80 00 00 	mov    0x80(%rsp),%r10
 75b:	00 
 75c:	e9 fa 02 00 00       	jmpq   a5b <BasePrintLibSPrintMarker+0xa5b>
          ArgumentString = ValueBuffer;
        }
        break;

      case 't':
        if (BaseListMarker == NULL) {
 761:	48 85 ed             	test   %rbp,%rbp
 764:	75 13                	jne    779 <BasePrintLibSPrintMarker+0x779>
          TmpTime = VA_ARG (VaListMarker, TIME *); 
 766:	48 8b 74 24 40       	mov    0x40(%rsp),%rsi
 76b:	48 8b 06             	mov    (%rsi),%rax
 76e:	48 83 c6 08          	add    $0x8,%rsi
 772:	48 89 74 24 40       	mov    %rsi,0x40(%rsp)
 777:	eb 08                	jmp    781 <BasePrintLibSPrintMarker+0x781>
        } else {
          TmpTime = BASE_ARG (BaseListMarker, TIME *); 
 779:	48 8b 45 00          	mov    0x0(%rbp),%rax
 77d:	48 83 c5 08          	add    $0x8,%rbp
        }
        if (TmpTime == NULL) {
 781:	48 85 c0             	test   %rax,%rax
 784:	0f 84 65 02 00 00    	je     9ef <BasePrintLibSPrintMarker+0x9ef>
 78a:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 791:	00 00 00 
 794:	4c 89 54 24 78       	mov    %r10,0x78(%rsp)
{
  VA_LIST  Marker;
  UINTN    NumberOfPrinted;

  VA_START (Marker, FormatString);
  NumberOfPrinted = BasePrintLibSPrintMarker (StartOfBuffer, BufferSize, Flags, FormatString, Marker, NULL);
 799:	45 31 c9             	xor    %r9d,%r9d
 79c:	48 89 84 24 c0 00 00 	mov    %rax,0xc0(%rsp)
 7a3:	00 
 7a4:	48 89 c1             	mov    %rax,%rcx
 7a7:	4c 8d 84 24 c8 00 00 	lea    0xc8(%rsp),%r8
 7ae:	00 
 7af:	31 d2                	xor    %edx,%edx
 7b1:	be 26 00 00 00       	mov    $0x26,%esi
 7b6:	48 8d bc 24 ca 00 00 	lea    0xca(%rsp),%rdi
 7bd:	00 
 7be:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 7c5:	00 00 00 
 7c8:	ff d0                	callq  *%rax
 7ca:	e9 a2 00 00 00       	jmpq   871 <BasePrintLibSPrintMarker+0x871>
          ArgumentString = ValueBuffer;
        }
        break;

      case 'r':
        if (BaseListMarker == NULL) {
 7cf:	48 85 ed             	test   %rbp,%rbp
 7d2:	75 13                	jne    7e7 <BasePrintLibSPrintMarker+0x7e7>
          Status = VA_ARG (VaListMarker, RETURN_STATUS);
 7d4:	48 8b 7c 24 40       	mov    0x40(%rsp),%rdi
 7d9:	48 8d 77 08          	lea    0x8(%rdi),%rsi
 7dd:	48 8b 07             	mov    (%rdi),%rax
 7e0:	48 89 74 24 40       	mov    %rsi,0x40(%rsp)
 7e5:	eb 08                	jmp    7ef <BasePrintLibSPrintMarker+0x7ef>
        } else {
          Status = BASE_ARG (BaseListMarker, RETURN_STATUS);
 7e7:	48 8b 45 00          	mov    0x0(%rbp),%rax
 7eb:	48 83 c5 08          	add    $0x8,%rbp
        }
        ArgumentString = ValueBuffer;
        if (RETURN_ERROR (Status)) {
 7ef:	48 85 c0             	test   %rax,%rax
 7f2:	79 28                	jns    81c <BasePrintLibSPrintMarker+0x81c>
          //
          // Clear error bit
          //
          Index = Status & ~MAX_BIT;
 7f4:	48 ba ff ff ff ff ff 	movabs $0x7fffffffffffffff,%rdx
 7fb:	ff ff 7f 
 7fe:	48 21 c2             	and    %rax,%rdx
          if (Index > 0 && Index <= ERROR_STATUS_NUMBER) {
 801:	48 8d 4a ff          	lea    -0x1(%rdx),%rcx
 805:	48 83 f9 20          	cmp    $0x20,%rcx
 809:	77 36                	ja     841 <BasePrintLibSPrintMarker+0x841>
            ArgumentString = mStatusString [Index + WARNING_STATUS_NUMBER];
 80b:	48 b9 00 00 00 00 00 	movabs $0x0,%rcx
 812:	00 00 00 
 815:	4c 8b 6c d1 28       	mov    0x28(%rcx,%rdx,8),%r13
 81a:	eb 14                	jmp    830 <BasePrintLibSPrintMarker+0x830>
          }
        } else {
          Index = Status;
          if (Index <= WARNING_STATUS_NUMBER) {
 81c:	48 83 f8 05          	cmp    $0x5,%rax
 820:	77 1f                	ja     841 <BasePrintLibSPrintMarker+0x841>
            ArgumentString = mStatusString [Index];
 822:	48 ba 00 00 00 00 00 	movabs $0x0,%rdx
 829:	00 00 00 
 82c:	4c 8b 2c c2          	mov    (%rdx,%rax,8),%r13
          }
        }
        if (ArgumentString == ValueBuffer) {
 830:	48 8d b4 24 ca 00 00 	lea    0xca(%rsp),%rsi
 837:	00 
 838:	49 39 f5             	cmp    %rsi,%r13
 83b:	0f 85 c6 01 00 00    	jne    a07 <BasePrintLibSPrintMarker+0xa07>
          BasePrintLibSPrint ((CHAR8 *) ValueBuffer, MAXIMUM_VALUE_CHARACTERS, 0, "%08X", Status);
 841:	48 89 44 24 20       	mov    %rax,0x20(%rsp)
 846:	4c 89 54 24 78       	mov    %r10,0x78(%rsp)
 84b:	49 b9 00 00 00 00 00 	movabs $0x0,%r9
 852:	00 00 00 
 855:	45 31 c0             	xor    %r8d,%r8d
 858:	ba 26 00 00 00       	mov    $0x26,%edx
 85d:	48 8d 8c 24 ca 00 00 	lea    0xca(%rsp),%rcx
 864:	00 
 865:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 86c:	00 00 00 
 86f:	ff d0                	callq  *%rax
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 871:	45 31 f6             	xor    %r14d,%r14d
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
 874:	45 31 c9             	xor    %r9d,%r9d
    ZeroPad   = FALSE;
 877:	45 31 db             	xor    %r11d,%r11d
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 87a:	45 31 e4             	xor    %r12d,%r12d
          if (Index <= WARNING_STATUS_NUMBER) {
            ArgumentString = mStatusString [Index];
          }
        }
        if (ArgumentString == ValueBuffer) {
          BasePrintLibSPrint ((CHAR8 *) ValueBuffer, MAXIMUM_VALUE_CHARACTERS, 0, "%08X", Status);
 87d:	4c 8d ac 24 ca 00 00 	lea    0xca(%rsp),%r13
 884:	00 
 885:	4c 8b 54 24 78       	mov    0x78(%rsp),%r10
 88a:	e9 cc 01 00 00       	jmpq   a5b <BasePrintLibSPrintMarker+0xa5b>
        }
        break;

      case '\r':
        Format += BytesPerFormatCharacter;
 88f:	48 8b 7c 24 48       	mov    0x48(%rsp),%rdi
 894:	49 01 ff             	add    %rdi,%r15
        FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 897:	41 0f be 47 01       	movsbl 0x1(%r15),%eax
 89c:	41 0f b6 17          	movzbl (%r15),%edx
 8a0:	c1 e0 08             	shl    $0x8,%eax
 8a3:	09 d0                	or     %edx,%eax
 8a5:	48 98                	cltq   
 8a7:	48 23 44 24 58       	and    0x58(%rsp),%rax
        if (FormatCharacter == '\n') {
 8ac:	48 83 f8 0a          	cmp    $0xa,%rax
        }
        break;

      case '\r':
        Format += BytesPerFormatCharacter;
        FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 8b0:	48 89 84 24 b0 00 00 	mov    %rax,0xb0(%rsp)
 8b7:	00 
        if (FormatCharacter == '\n') {
 8b8:	0f 84 57 01 00 00    	je     a15 <BasePrintLibSPrintMarker+0xa15>
        } else {
          //
          // Translate '\r' to '\r'
          //
          ArgumentString = "\r";
          Format   -= BytesPerFormatCharacter;
 8be:	49 29 ff             	sub    %rdi,%r15
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 8c1:	45 31 f6             	xor    %r14d,%r14d
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
 8c4:	45 31 c9             	xor    %r9d,%r9d
    ZeroPad   = FALSE;
 8c7:	45 31 db             	xor    %r11d,%r11d
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 8ca:	45 31 e4             	xor    %r12d,%r12d
          ArgumentString = "\r\n";
        } else {
          //
          // Translate '\r' to '\r'
          //
          ArgumentString = "\r";
 8cd:	49 bd 00 00 00 00 00 	movabs $0x0,%r13
 8d4:	00 00 00 
 8d7:	e9 7f 01 00 00       	jmpq   a5b <BasePrintLibSPrintMarker+0xa5b>
      case '\n':
        //
        // Translate '\n' to '\r\n' and '\n\r' to '\r\n'
        //
        ArgumentString = "\r\n";
        Format += BytesPerFormatCharacter;
 8dc:	48 8b 74 24 48       	mov    0x48(%rsp),%rsi
 8e1:	49 01 f7             	add    %rsi,%r15
        FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 8e4:	41 0f be 47 01       	movsbl 0x1(%r15),%eax
 8e9:	41 0f b6 17          	movzbl (%r15),%edx
 8ed:	c1 e0 08             	shl    $0x8,%eax
 8f0:	09 d0                	or     %edx,%eax
 8f2:	48 98                	cltq   
 8f4:	48 23 44 24 58       	and    0x58(%rsp),%rax
        if (FormatCharacter != '\r') {
 8f9:	48 83 f8 0d          	cmp    $0xd,%rax
        //
        // Translate '\n' to '\r\n' and '\n\r' to '\r\n'
        //
        ArgumentString = "\r\n";
        Format += BytesPerFormatCharacter;
        FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 8fd:	48 89 84 24 b0 00 00 	mov    %rax,0xb0(%rsp)
 904:	00 
        if (FormatCharacter != '\r') {
 905:	0f 84 0a 01 00 00    	je     a15 <BasePrintLibSPrintMarker+0xa15>
          Format   -= BytesPerFormatCharacter;
 90b:	49 29 f7             	sub    %rsi,%r15
 90e:	e9 02 01 00 00       	jmpq   a15 <BasePrintLibSPrintMarker+0xa15>
      default:
        //
        // if the type is '%' or unknown, then print it to the screen
        //
        ArgumentString = (CHAR8 *)&FormatCharacter;
        Flags |= ARGUMENT_UNICODE;
 913:	80 cf 04             	or     $0x4,%bh
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 916:	45 31 f6             	xor    %r14d,%r14d
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
 919:	45 31 c9             	xor    %r9d,%r9d
    ZeroPad   = FALSE;
 91c:	45 31 db             	xor    %r11d,%r11d
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 91f:	45 31 e4             	xor    %r12d,%r12d
      case '%':
      default:
        //
        // if the type is '%' or unknown, then print it to the screen
        //
        ArgumentString = (CHAR8 *)&FormatCharacter;
 922:	4c 8d ac 24 b0 00 00 	lea    0xb0(%rsp),%r13
 929:	00 
        Flags |= ARGUMENT_UNICODE;
        break;
 92a:	e9 2c 01 00 00       	jmpq   a5b <BasePrintLibSPrintMarker+0xa5b>
      }
      break;
 
    case '\r':
      Format += BytesPerFormatCharacter;
 92f:	48 8b 7c 24 48       	mov    0x48(%rsp),%rdi
 934:	49 01 ff             	add    %rdi,%r15
      FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 937:	41 0f be 47 01       	movsbl 0x1(%r15),%eax
 93c:	41 0f b6 17          	movzbl (%r15),%edx
 940:	c1 e0 08             	shl    $0x8,%eax
 943:	09 d0                	or     %edx,%eax
 945:	48 98                	cltq   
 947:	48 23 44 24 58       	and    0x58(%rsp),%rax
      if (FormatCharacter == '\n') {
 94c:	48 83 f8 0a          	cmp    $0xa,%rax
      }
      break;
 
    case '\r':
      Format += BytesPerFormatCharacter;
      FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 950:	48 89 84 24 b0 00 00 	mov    %rax,0xb0(%rsp)
 957:	00 
      if (FormatCharacter == '\n') {
 958:	0f 84 cf 00 00 00    	je     a2d <BasePrintLibSPrintMarker+0xa2d>
      } else {
        //
        // Translate '\r' to '\r'
        //
        ArgumentString = "\r";
        Format   -= BytesPerFormatCharacter;
 95e:	49 29 ff             	sub    %rdi,%r15
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 961:	45 31 f6             	xor    %r14d,%r14d
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
 964:	45 31 c9             	xor    %r9d,%r9d
    ZeroPad   = FALSE;
 967:	45 31 db             	xor    %r11d,%r11d
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 96a:	45 31 e4             	xor    %r12d,%r12d
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
 96d:	48 c7 44 24 30 00 00 	movq   $0x0,0x30(%rsp)
 974:	00 00 
        ArgumentString = "\r\n";
      } else {
        //
        // Translate '\r' to '\r'
        //
        ArgumentString = "\r";
 976:	49 bd 00 00 00 00 00 	movabs $0x0,%r13
 97d:	00 00 00 
 980:	e9 c7 00 00 00       	jmpq   a4c <BasePrintLibSPrintMarker+0xa4c>
    case '\n':
      //
      // Translate '\n' to '\r\n' and '\n\r' to '\r\n'
      //
      ArgumentString = "\r\n";
      Format += BytesPerFormatCharacter;
 985:	48 8b 74 24 48       	mov    0x48(%rsp),%rsi
 98a:	49 01 f7             	add    %rsi,%r15
      FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 98d:	41 0f be 47 01       	movsbl 0x1(%r15),%eax
 992:	41 0f b6 17          	movzbl (%r15),%edx
 996:	c1 e0 08             	shl    $0x8,%eax
 999:	09 d0                	or     %edx,%eax
 99b:	48 98                	cltq   
 99d:	48 23 44 24 58       	and    0x58(%rsp),%rax
      if (FormatCharacter != '\r') {
 9a2:	48 83 f8 0d          	cmp    $0xd,%rax
      //
      // Translate '\n' to '\r\n' and '\n\r' to '\r\n'
      //
      ArgumentString = "\r\n";
      Format += BytesPerFormatCharacter;
      FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 9a6:	48 89 84 24 b0 00 00 	mov    %rax,0xb0(%rsp)
 9ad:	00 
      if (FormatCharacter != '\r') {
 9ae:	74 7d                	je     a2d <BasePrintLibSPrintMarker+0xa2d>
        Format   -= BytesPerFormatCharacter;
 9b0:	49 29 f7             	sub    %rsi,%r15
 9b3:	eb 78                	jmp    a2d <BasePrintLibSPrintMarker+0xa2d>
      }
      break;

    default:
      ArgumentString = (CHAR8 *)&FormatCharacter;
      Flags |= ARGUMENT_UNICODE;
 9b5:	80 cf 04             	or     $0x4,%bh
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 9b8:	45 31 f6             	xor    %r14d,%r14d
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
 9bb:	45 31 c9             	xor    %r9d,%r9d
    ZeroPad   = FALSE;
 9be:	45 31 db             	xor    %r11d,%r11d
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 9c1:	45 31 e4             	xor    %r12d,%r12d
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
 9c4:	48 c7 44 24 30 00 00 	movq   $0x0,0x30(%rsp)
 9cb:	00 00 
        Format   -= BytesPerFormatCharacter;
      }
      break;

    default:
      ArgumentString = (CHAR8 *)&FormatCharacter;
 9cd:	4c 8d ac 24 b0 00 00 	lea    0xb0(%rsp),%r13
 9d4:	00 
 9d5:	eb 75                	jmp    a4c <BasePrintLibSPrintMarker+0xa4c>
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 9d7:	45 31 f6             	xor    %r14d,%r14d
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
 9da:	45 31 c9             	xor    %r9d,%r9d
    ZeroPad   = FALSE;
 9dd:	45 31 db             	xor    %r11d,%r11d
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 9e0:	45 31 e4             	xor    %r12d,%r12d
          TmpGuid = VA_ARG (VaListMarker, GUID *);
        } else {
          TmpGuid = BASE_ARG (BaseListMarker, GUID *);
        }
        if (TmpGuid == NULL) {
          ArgumentString = "<null guid>";
 9e3:	49 bd 00 00 00 00 00 	movabs $0x0,%r13
 9ea:	00 00 00 
 9ed:	eb 6c                	jmp    a5b <BasePrintLibSPrintMarker+0xa5b>
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 9ef:	45 31 f6             	xor    %r14d,%r14d
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
 9f2:	45 31 c9             	xor    %r9d,%r9d
    ZeroPad   = FALSE;
 9f5:	45 31 db             	xor    %r11d,%r11d
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 9f8:	45 31 e4             	xor    %r12d,%r12d
          TmpTime = VA_ARG (VaListMarker, TIME *); 
        } else {
          TmpTime = BASE_ARG (BaseListMarker, TIME *); 
        }
        if (TmpTime == NULL) {
          ArgumentString = "<null time>";
 9fb:	49 bd 00 00 00 00 00 	movabs $0x0,%r13
 a02:	00 00 00 
 a05:	eb 54                	jmp    a5b <BasePrintLibSPrintMarker+0xa5b>
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 a07:	45 31 f6             	xor    %r14d,%r14d
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
 a0a:	45 31 c9             	xor    %r9d,%r9d
    ZeroPad   = FALSE;
 a0d:	45 31 db             	xor    %r11d,%r11d
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 a10:	45 31 e4             	xor    %r12d,%r12d
 a13:	eb 46                	jmp    a5b <BasePrintLibSPrintMarker+0xa5b>
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 a15:	45 31 f6             	xor    %r14d,%r14d
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
 a18:	45 31 c9             	xor    %r9d,%r9d
    ZeroPad   = FALSE;
 a1b:	45 31 db             	xor    %r11d,%r11d
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 a1e:	45 31 e4             	xor    %r12d,%r12d

      case '\n':
        //
        // Translate '\n' to '\r\n' and '\n\r' to '\r\n'
        //
        ArgumentString = "\r\n";
 a21:	49 bd 00 00 00 00 00 	movabs $0x0,%r13
 a28:	00 00 00 
 a2b:	eb 2e                	jmp    a5b <BasePrintLibSPrintMarker+0xa5b>
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 a2d:	45 31 f6             	xor    %r14d,%r14d
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
 a30:	45 31 c9             	xor    %r9d,%r9d
    ZeroPad   = FALSE;
 a33:	45 31 db             	xor    %r11d,%r11d
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 a36:	45 31 e4             	xor    %r12d,%r12d
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
 a39:	48 c7 44 24 30 00 00 	movq   $0x0,0x30(%rsp)
 a40:	00 00 

    case '\n':
      //
      // Translate '\n' to '\r\n' and '\n\r' to '\r\n'
      //
      ArgumentString = "\r\n";
 a42:	49 bd 00 00 00 00 00 	movabs $0x0,%r13
 a49:	00 00 00 

    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
 a4c:	41 ba 01 00 00 00    	mov    $0x1,%r10d
    Flags &= (UINTN) (OUTPUT_UNICODE | FORMAT_UNICODE | COUNT_ONLY_NO_PRINT);

    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
 a52:	48 c7 44 24 60 00 00 	movq   $0x0,0x60(%rsp)
 a59:	00 00 
    }

    //
    // Retrieve the ArgumentString attriubutes
    //
    if ((Flags & ARGUMENT_UNICODE) != 0) {
 a5b:	48 89 d8             	mov    %rbx,%rax
 a5e:	25 00 04 00 00       	and    $0x400,%eax
      ArgumentMask = 0xffff;
      BytesPerArgumentCharacter = 2;
 a63:	48 83 f8 01          	cmp    $0x1,%rax
 a67:	48 19 f6             	sbb    %rsi,%rsi
 a6a:	48 89 74 24 78       	mov    %rsi,0x78(%rsp)
 a6f:	48 81 64 24 78 00 01 	andq   $0xffffffffffff0100,0x78(%rsp)
 a76:	ff ff 
 a78:	48 89 b4 24 80 00 00 	mov    %rsi,0x80(%rsp)
 a7f:	00 
 a80:	48 81 44 24 78 ff ff 	addq   $0xffff,0x78(%rsp)
 a87:	00 00 
 a89:	48 83 84 24 80 00 00 	addq   $0x2,0x80(%rsp)
 a90:	00 02 
    } else {
      ArgumentMask = 0xff;
      BytesPerArgumentCharacter = 1;
    }
    if ((Flags & ARGUMENT_REVERSED) != 0) {
 a92:	f6 c7 10             	test   $0x10,%bh
 a95:	75 17                	jne    aae <BasePrintLibSPrintMarker+0xaae>
    } else {
      //
      // Compute the number of characters in ArgumentString and store it in Count
      // ArgumentString is either null-terminated, or it contains Precision characters
      //
      for (Count = 0; Count < Precision || ((Flags & PRECISION) == 0); Count++) {
 a97:	48 89 de             	mov    %rbx,%rsi
 a9a:	4c 89 ea             	mov    %r13,%rdx
      BytesPerArgumentCharacter = 2;
    } else {
      ArgumentMask = 0xff;
      BytesPerArgumentCharacter = 1;
    }
    if ((Flags & ARGUMENT_REVERSED) != 0) {
 a9d:	48 c7 44 24 30 00 00 	movq   $0x0,0x30(%rsp)
 aa4:	00 00 
    } else {
      //
      // Compute the number of characters in ArgumentString and store it in Count
      // ArgumentString is either null-terminated, or it contains Precision characters
      //
      for (Count = 0; Count < Precision || ((Flags & PRECISION) == 0); Count++) {
 aa6:	81 e6 00 08 00 00    	and    $0x800,%esi
 aac:	eb 34                	jmp    ae2 <BasePrintLibSPrintMarker+0xae2>
    } else {
      ArgumentMask = 0xff;
      BytesPerArgumentCharacter = 1;
    }
    if ((Flags & ARGUMENT_REVERSED) != 0) {
      BytesPerArgumentCharacter = -BytesPerArgumentCharacter;
 aae:	48 f7 9c 24 80 00 00 	negq   0x80(%rsp)
 ab5:	00 
 ab6:	eb 33                	jmp    aeb <BasePrintLibSPrintMarker+0xaeb>
    } else {
      //
      // Compute the number of characters in ArgumentString and store it in Count
      // ArgumentString is either null-terminated, or it contains Precision characters
      //
      for (Count = 0; Count < Precision || ((Flags & PRECISION) == 0); Count++) {
 ab8:	48 85 f6             	test   %rsi,%rsi
 abb:	75 2e                	jne    aeb <BasePrintLibSPrintMarker+0xaeb>
 abd:	48 89 d1             	mov    %rdx,%rcx
 ac0:	48 03 94 24 80 00 00 	add    0x80(%rsp),%rdx
 ac7:	00 
        ArgumentCharacter = ((ArgumentString[Count * BytesPerArgumentCharacter] & 0xff) | ((ArgumentString[Count * BytesPerArgumentCharacter + 1]) << 8)) & ArgumentMask;
 ac8:	0f be 41 01          	movsbl 0x1(%rcx),%eax
 acc:	0f b6 09             	movzbl (%rcx),%ecx
 acf:	c1 e0 08             	shl    $0x8,%eax
 ad2:	09 c8                	or     %ecx,%eax
 ad4:	48 98                	cltq   
        if (ArgumentCharacter == 0) {
 ad6:	48 85 44 24 78       	test   %rax,0x78(%rsp)
 adb:	74 0e                	je     aeb <BasePrintLibSPrintMarker+0xaeb>
    } else {
      //
      // Compute the number of characters in ArgumentString and store it in Count
      // ArgumentString is either null-terminated, or it contains Precision characters
      //
      for (Count = 0; Count < Precision || ((Flags & PRECISION) == 0); Count++) {
 add:	48 ff 44 24 30       	incq   0x30(%rsp)
 ae2:	4c 39 54 24 30       	cmp    %r10,0x30(%rsp)
 ae7:	72 d4                	jb     abd <BasePrintLibSPrintMarker+0xabd>
 ae9:	eb cd                	jmp    ab8 <BasePrintLibSPrintMarker+0xab8>
 aeb:	48 8b 44 24 30       	mov    0x30(%rsp),%rax
 af0:	4c 39 d0             	cmp    %r10,%rax
 af3:	4c 0f 43 d0          	cmovae %rax,%r10
    }

    //
    // Pad before the string
    //
    if ((Flags & (PAD_TO_WIDTH | LEFT_JUSTIFY)) == (PAD_TO_WIDTH)) {
 af7:	48 89 d8             	mov    %rbx,%rax
 afa:	25 01 02 00 00       	and    $0x201,%eax
 aff:	4c 89 94 24 88 00 00 	mov    %r10,0x88(%rsp)
 b06:	00 
 b07:	48 3d 00 02 00 00    	cmp    $0x200,%rax
 b0d:	48 89 84 24 98 00 00 	mov    %rax,0x98(%rsp)
 b14:	00 
 b15:	75 76                	jne    b8d <BasePrintLibSPrintMarker+0xb8d>
      LengthToReturn += ((Width - Precision) * BytesPerOutputCharacter);
 b17:	48 8b 54 24 60       	mov    0x60(%rsp),%rdx
 b1c:	44 8b 84 24 a8 00 00 	mov    0xa8(%rsp),%r8d
 b23:	00 
 b24:	4c 29 d2             	sub    %r10,%rdx
 b27:	48 89 d0             	mov    %rdx,%rax
 b2a:	49 0f af c0          	imul   %r8,%rax
 b2e:	48 01 44 24 68       	add    %rax,0x68(%rsp)
      if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
 b33:	f6 c7 20             	test   $0x20,%bh
 b36:	75 55                	jne    b8d <BasePrintLibSPrintMarker+0xb8d>
 b38:	80 bc 24 90 00 00 00 	cmpb   $0x0,0x90(%rsp)
 b3f:	00 
 b40:	74 42                	je     b84 <BasePrintLibSPrintMarker+0xb84>
 b42:	44 89 8c 24 a0 00 00 	mov    %r9d,0xa0(%rsp)
 b49:	00 
 b4a:	44 89 9c 24 90 00 00 	mov    %r11d,0x90(%rsp)
 b51:	00 
        Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Width - Precision, ' ', BytesPerOutputCharacter);
 b52:	b9 20 00 00 00       	mov    $0x20,%ecx
 b57:	48 8b 74 24 50       	mov    0x50(%rsp),%rsi
 b5c:	48 8b 7c 24 38       	mov    0x38(%rsp),%rdi
 b61:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 b68:	00 00 00 
 b6b:	ff d0                	callq  *%rax
 b6d:	44 8b 9c 24 90 00 00 	mov    0x90(%rsp),%r11d
 b74:	00 
 b75:	48 89 44 24 38       	mov    %rax,0x38(%rsp)
 b7a:	44 8b 8c 24 a0 00 00 	mov    0xa0(%rsp),%r9d
 b81:	00 
 b82:	eb 09                	jmp    b8d <BasePrintLibSPrintMarker+0xb8d>
 b84:	48 c7 44 24 38 00 00 	movq   $0x0,0x38(%rsp)
 b8b:	00 00 
      }
    }

    if (ZeroPad) {
 b8d:	45 84 db             	test   %r11b,%r11b
 b90:	0f 84 b8 00 00 00    	je     c4e <BasePrintLibSPrintMarker+0xc4e>
      if (Prefix != 0) {
 b96:	45 84 e4             	test   %r12b,%r12b
 b99:	74 4b                	je     be6 <BasePrintLibSPrintMarker+0xbe6>
        LengthToReturn += (1 * BytesPerOutputCharacter);
 b9b:	44 8b 84 24 a8 00 00 	mov    0xa8(%rsp),%r8d
 ba2:	00 
 ba3:	4c 01 44 24 68       	add    %r8,0x68(%rsp)
        if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
 ba8:	f6 c7 20             	test   $0x20,%bh
 bab:	75 39                	jne    be6 <BasePrintLibSPrintMarker+0xbe6>
 bad:	48 8b 7c 24 38       	mov    0x38(%rsp),%rdi
 bb2:	48 85 ff             	test   %rdi,%rdi
 bb5:	74 2f                	je     be6 <BasePrintLibSPrintMarker+0xbe6>
 bb7:	44 89 8c 24 90 00 00 	mov    %r9d,0x90(%rsp)
 bbe:	00 
          Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, Prefix, BytesPerOutputCharacter);
 bbf:	49 0f be cc          	movsbq %r12b,%rcx
 bc3:	ba 01 00 00 00       	mov    $0x1,%edx
 bc8:	48 8b 74 24 50       	mov    0x50(%rsp),%rsi
 bcd:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 bd4:	00 00 00 
 bd7:	ff d0                	callq  *%rax
 bd9:	44 8b 8c 24 90 00 00 	mov    0x90(%rsp),%r9d
 be0:	00 
 be1:	48 89 44 24 38       	mov    %rax,0x38(%rsp)
        }
      }
      LengthToReturn += ((Precision - Count) * BytesPerOutputCharacter);
 be6:	48 8b 94 24 88 00 00 	mov    0x88(%rsp),%rdx
 bed:	00 
 bee:	48 2b 54 24 30       	sub    0x30(%rsp),%rdx
 bf3:	44 8b 84 24 a8 00 00 	mov    0xa8(%rsp),%r8d
 bfa:	00 
 bfb:	48 89 d0             	mov    %rdx,%rax
 bfe:	49 0f af c0          	imul   %r8,%rax
 c02:	48 01 44 24 68       	add    %rax,0x68(%rsp)
      if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
 c07:	f6 c7 20             	test   $0x20,%bh
 c0a:	0f 85 14 01 00 00    	jne    d24 <BasePrintLibSPrintMarker+0xd24>
 c10:	48 8b 7c 24 38       	mov    0x38(%rsp),%rdi
 c15:	48 85 ff             	test   %rdi,%rdi
 c18:	0f 84 06 01 00 00    	je     d24 <BasePrintLibSPrintMarker+0xd24>
 c1e:	44 89 8c 24 90 00 00 	mov    %r9d,0x90(%rsp)
 c25:	00 
        Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Precision - Count, '0', BytesPerOutputCharacter);
 c26:	b9 30 00 00 00       	mov    $0x30,%ecx
 c2b:	48 8b 74 24 50       	mov    0x50(%rsp),%rsi
 c30:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 c37:	00 00 00 
 c3a:	ff d0                	callq  *%rax
 c3c:	44 8b 8c 24 90 00 00 	mov    0x90(%rsp),%r9d
 c43:	00 
 c44:	48 89 44 24 38       	mov    %rax,0x38(%rsp)
 c49:	e9 d6 00 00 00       	jmpq   d24 <BasePrintLibSPrintMarker+0xd24>
      }
    } else {
      LengthToReturn += ((Precision - Count) * BytesPerOutputCharacter);
 c4e:	48 8b 94 24 88 00 00 	mov    0x88(%rsp),%rdx
 c55:	00 
 c56:	48 2b 54 24 30       	sub    0x30(%rsp),%rdx
 c5b:	44 8b 9c 24 a8 00 00 	mov    0xa8(%rsp),%r11d
 c62:	00 
 c63:	48 89 d0             	mov    %rdx,%rax
 c66:	49 0f af c3          	imul   %r11,%rax
 c6a:	48 01 44 24 68       	add    %rax,0x68(%rsp)
      if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
 c6f:	48 89 d8             	mov    %rbx,%rax
 c72:	25 00 20 00 00       	and    $0x2000,%eax
 c77:	48 89 84 24 90 00 00 	mov    %rax,0x90(%rsp)
 c7e:	00 
 c7f:	75 48                	jne    cc9 <BasePrintLibSPrintMarker+0xcc9>
 c81:	48 8b 7c 24 38       	mov    0x38(%rsp),%rdi
 c86:	48 85 ff             	test   %rdi,%rdi
 c89:	74 3e                	je     cc9 <BasePrintLibSPrintMarker+0xcc9>
 c8b:	44 89 8c 24 ac 00 00 	mov    %r9d,0xac(%rsp)
 c92:	00 
        Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Precision - Count, ' ', BytesPerOutputCharacter);
 c93:	4d 89 d8             	mov    %r11,%r8
 c96:	4c 89 9c 24 a0 00 00 	mov    %r11,0xa0(%rsp)
 c9d:	00 
 c9e:	b9 20 00 00 00       	mov    $0x20,%ecx
 ca3:	48 8b 74 24 50       	mov    0x50(%rsp),%rsi
 ca8:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 caf:	00 00 00 
 cb2:	ff d0                	callq  *%rax
 cb4:	44 8b 8c 24 ac 00 00 	mov    0xac(%rsp),%r9d
 cbb:	00 
 cbc:	4c 8b 9c 24 a0 00 00 	mov    0xa0(%rsp),%r11
 cc3:	00 
 cc4:	48 89 44 24 38       	mov    %rax,0x38(%rsp)
    }

    //
    // Output the Prefix character if it is present
    //
    Index = 0;
 cc9:	45 31 d2             	xor    %r10d,%r10d
    } else {
      LengthToReturn += ((Precision - Count) * BytesPerOutputCharacter);
      if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
        Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Precision - Count, ' ', BytesPerOutputCharacter);
      }
      if (Prefix != 0) {
 ccc:	45 84 e4             	test   %r12b,%r12b
 ccf:	74 61                	je     d32 <BasePrintLibSPrintMarker+0xd32>
        LengthToReturn += (1 * BytesPerOutputCharacter);
 cd1:	4c 01 5c 24 68       	add    %r11,0x68(%rsp)
        if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
 cd6:	48 83 bc 24 90 00 00 	cmpq   $0x0,0x90(%rsp)
 cdd:	00 00 
 cdf:	75 4b                	jne    d2c <BasePrintLibSPrintMarker+0xd2c>
 ce1:	48 8b 7c 24 38       	mov    0x38(%rsp),%rdi
 ce6:	48 85 ff             	test   %rdi,%rdi
 ce9:	74 41                	je     d2c <BasePrintLibSPrintMarker+0xd2c>
          Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, Prefix, BytesPerOutputCharacter);
 ceb:	44 8b 84 24 a8 00 00 	mov    0xa8(%rsp),%r8d
 cf2:	00 
 cf3:	44 89 8c 24 90 00 00 	mov    %r9d,0x90(%rsp)
 cfa:	00 
 cfb:	49 0f be cc          	movsbq %r12b,%rcx
 cff:	ba 01 00 00 00       	mov    $0x1,%edx
 d04:	48 8b 74 24 50       	mov    0x50(%rsp),%rsi
 d09:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 d10:	00 00 00 
 d13:	ff d0                	callq  *%rax
 d15:	44 8b 8c 24 90 00 00 	mov    0x90(%rsp),%r9d
 d1c:	00 
 d1d:	48 89 44 24 38       	mov    %rax,0x38(%rsp)
 d22:	eb 08                	jmp    d2c <BasePrintLibSPrintMarker+0xd2c>
    }

    //
    // Output the Prefix character if it is present
    //
    Index = 0;
 d24:	45 31 d2             	xor    %r10d,%r10d
    if (Prefix != 0) {
 d27:	45 84 e4             	test   %r12b,%r12b
 d2a:	74 06                	je     d32 <BasePrintLibSPrintMarker+0xd32>
      Index++;
 d2c:	41 ba 01 00 00 00    	mov    $0x1,%r10d
    //
    while (Index < Count) {
      ArgumentCharacter = ((*ArgumentString & 0xff) | (*(ArgumentString + 1) << 8)) & ArgumentMask;

      LengthToReturn += (1 * BytesPerOutputCharacter);
      if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
 d32:	49 89 dc             	mov    %rbx,%r12
 d35:	41 81 e4 00 20 00 00 	and    $0x2000,%r12d
    }

    //
    // Copy the string into the output buffer performing the required type conversions
    //
    while (Index < Count) {
 d3c:	4c 3b 54 24 30       	cmp    0x30(%rsp),%r10
 d41:	0f 83 1c 01 00 00    	jae    e63 <BasePrintLibSPrintMarker+0xe63>
      ArgumentCharacter = ((*ArgumentString & 0xff) | (*(ArgumentString + 1) << 8)) & ArgumentMask;

      LengthToReturn += (1 * BytesPerOutputCharacter);
 d47:	44 8b 9c 24 a8 00 00 	mov    0xa8(%rsp),%r11d
 d4e:	00 

    //
    // Copy the string into the output buffer performing the required type conversions
    //
    while (Index < Count) {
      ArgumentCharacter = ((*ArgumentString & 0xff) | (*(ArgumentString + 1) << 8)) & ArgumentMask;
 d4f:	41 0f b6 45 00       	movzbl 0x0(%r13),%eax

      LengthToReturn += (1 * BytesPerOutputCharacter);
 d54:	4c 01 5c 24 68       	add    %r11,0x68(%rsp)
      if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
 d59:	4d 85 e4             	test   %r12,%r12

    //
    // Copy the string into the output buffer performing the required type conversions
    //
    while (Index < Count) {
      ArgumentCharacter = ((*ArgumentString & 0xff) | (*(ArgumentString + 1) << 8)) & ArgumentMask;
 d5c:	41 0f be 4d 01       	movsbl 0x1(%r13),%ecx

      LengthToReturn += (1 * BytesPerOutputCharacter);
      if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
 d61:	75 65                	jne    dc8 <BasePrintLibSPrintMarker+0xdc8>
 d63:	48 8b 7c 24 38       	mov    0x38(%rsp),%rdi
 d68:	48 85 ff             	test   %rdi,%rdi
 d6b:	74 5b                	je     dc8 <BasePrintLibSPrintMarker+0xdc8>

    //
    // Copy the string into the output buffer performing the required type conversions
    //
    while (Index < Count) {
      ArgumentCharacter = ((*ArgumentString & 0xff) | (*(ArgumentString + 1) << 8)) & ArgumentMask;
 d6d:	c1 e1 08             	shl    $0x8,%ecx
 d70:	44 89 8c 24 ac 00 00 	mov    %r9d,0xac(%rsp)
 d77:	00 
 d78:	4c 89 94 24 a0 00 00 	mov    %r10,0xa0(%rsp)
 d7f:	00 
 d80:	09 c1                	or     %eax,%ecx

      LengthToReturn += (1 * BytesPerOutputCharacter);
      if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
        Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ArgumentCharacter, BytesPerOutputCharacter);
 d82:	4d 89 d8             	mov    %r11,%r8
 d85:	4c 89 9c 24 90 00 00 	mov    %r11,0x90(%rsp)
 d8c:	00 

    //
    // Copy the string into the output buffer performing the required type conversions
    //
    while (Index < Count) {
      ArgumentCharacter = ((*ArgumentString & 0xff) | (*(ArgumentString + 1) << 8)) & ArgumentMask;
 d8d:	48 63 c9             	movslq %ecx,%rcx
 d90:	48 23 4c 24 78       	and    0x78(%rsp),%rcx

      LengthToReturn += (1 * BytesPerOutputCharacter);
      if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
        Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ArgumentCharacter, BytesPerOutputCharacter);
 d95:	ba 01 00 00 00       	mov    $0x1,%edx
 d9a:	48 8b 74 24 50       	mov    0x50(%rsp),%rsi
 d9f:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 da6:	00 00 00 
 da9:	ff d0                	callq  *%rax
 dab:	44 8b 8c 24 ac 00 00 	mov    0xac(%rsp),%r9d
 db2:	00 
 db3:	4c 8b 94 24 a0 00 00 	mov    0xa0(%rsp),%r10
 dba:	00 
 dbb:	4c 8b 9c 24 90 00 00 	mov    0x90(%rsp),%r11
 dc2:	00 
 dc3:	48 89 44 24 38       	mov    %rax,0x38(%rsp)
      }
      ArgumentString    += BytesPerArgumentCharacter;
      Index++;
 dc8:	49 8d 42 01          	lea    0x1(%r10),%rax

      LengthToReturn += (1 * BytesPerOutputCharacter);
      if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
        Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ArgumentCharacter, BytesPerOutputCharacter);
      }
      ArgumentString    += BytesPerArgumentCharacter;
 dcc:	4c 03 ac 24 80 00 00 	add    0x80(%rsp),%r13
 dd3:	00 
      Index++;
      if (Comma) {
 dd4:	45 84 c9             	test   %r9b,%r9b
      LengthToReturn += (1 * BytesPerOutputCharacter);
      if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
        Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ArgumentCharacter, BytesPerOutputCharacter);
      }
      ArgumentString    += BytesPerArgumentCharacter;
      Index++;
 dd7:	48 89 84 24 90 00 00 	mov    %rax,0x90(%rsp)
 dde:	00 
      if (Comma) {
 ddf:	74 75                	je     e56 <BasePrintLibSPrintMarker+0xe56>
        Digits++;
 de1:	49 ff c6             	inc    %r14
        if (Digits == 3) {
 de4:	49 83 fe 03          	cmp    $0x3,%r14
 de8:	75 6c                	jne    e56 <BasePrintLibSPrintMarker+0xe56>
          Digits = 0;
          Index++;
 dea:	49 8d 42 02          	lea    0x2(%r10),%rax
      ArgumentString    += BytesPerArgumentCharacter;
      Index++;
      if (Comma) {
        Digits++;
        if (Digits == 3) {
          Digits = 0;
 dee:	45 30 f6             	xor    %r14b,%r14b
          Index++;
          if (Index < Count) {
 df1:	48 3b 44 24 30       	cmp    0x30(%rsp),%rax
      Index++;
      if (Comma) {
        Digits++;
        if (Digits == 3) {
          Digits = 0;
          Index++;
 df6:	48 89 84 24 90 00 00 	mov    %rax,0x90(%rsp)
 dfd:	00 
          if (Index < Count) {
 dfe:	73 56                	jae    e56 <BasePrintLibSPrintMarker+0xe56>
            LengthToReturn += (1 * BytesPerOutputCharacter);
 e00:	4c 01 5c 24 68       	add    %r11,0x68(%rsp)
            if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
 e05:	4d 85 e4             	test   %r12,%r12
 e08:	75 4c                	jne    e56 <BasePrintLibSPrintMarker+0xe56>
 e0a:	48 8b 7c 24 38       	mov    0x38(%rsp),%rdi
 e0f:	48 85 ff             	test   %rdi,%rdi
 e12:	74 3d                	je     e51 <BasePrintLibSPrintMarker+0xe51>
              Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ',', BytesPerOutputCharacter);
 e14:	44 8b 84 24 a8 00 00 	mov    0xa8(%rsp),%r8d
 e1b:	00 
 e1c:	44 89 8c 24 a0 00 00 	mov    %r9d,0xa0(%rsp)
 e23:	00 
 e24:	b9 2c 00 00 00       	mov    $0x2c,%ecx
 e29:	ba 01 00 00 00       	mov    $0x1,%edx
 e2e:	48 8b 74 24 50       	mov    0x50(%rsp),%rsi
 e33:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 e3a:	00 00 00 
      ArgumentString    += BytesPerArgumentCharacter;
      Index++;
      if (Comma) {
        Digits++;
        if (Digits == 3) {
          Digits = 0;
 e3d:	4d 89 e6             	mov    %r12,%r14
          Index++;
          if (Index < Count) {
            LengthToReturn += (1 * BytesPerOutputCharacter);
            if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
              Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ',', BytesPerOutputCharacter);
 e40:	ff d0                	callq  *%rax
 e42:	44 8b 8c 24 a0 00 00 	mov    0xa0(%rsp),%r9d
 e49:	00 
 e4a:	48 89 44 24 38       	mov    %rax,0x38(%rsp)
 e4f:	eb 05                	jmp    e56 <BasePrintLibSPrintMarker+0xe56>
      ArgumentString    += BytesPerArgumentCharacter;
      Index++;
      if (Comma) {
        Digits++;
        if (Digits == 3) {
          Digits = 0;
 e51:	4c 8b 74 24 38       	mov    0x38(%rsp),%r14
 e56:	4c 8b 94 24 90 00 00 	mov    0x90(%rsp),%r10
 e5d:	00 
 e5e:	e9 d9 fe ff ff       	jmpq   d3c <BasePrintLibSPrintMarker+0xd3c>
    }

    //
    // Pad after the string
    //
    if ((Flags & (PAD_TO_WIDTH | LEFT_JUSTIFY)) == (PAD_TO_WIDTH | LEFT_JUSTIFY)) {
 e63:	48 81 bc 24 98 00 00 	cmpq   $0x201,0x98(%rsp)
 e6a:	00 01 02 00 00 
 e6f:	75 4b                	jne    ebc <BasePrintLibSPrintMarker+0xebc>
      LengthToReturn += ((Width - Precision) * BytesPerOutputCharacter);
 e71:	48 8b 54 24 60       	mov    0x60(%rsp),%rdx
 e76:	48 2b 94 24 88 00 00 	sub    0x88(%rsp),%rdx
 e7d:	00 
 e7e:	44 8b 84 24 a8 00 00 	mov    0xa8(%rsp),%r8d
 e85:	00 
 e86:	48 89 d0             	mov    %rdx,%rax
 e89:	49 0f af c0          	imul   %r8,%rax
 e8d:	48 01 44 24 68       	add    %rax,0x68(%rsp)
      if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
 e92:	f6 c7 20             	test   $0x20,%bh
 e95:	75 25                	jne    ebc <BasePrintLibSPrintMarker+0xebc>
 e97:	48 8b 7c 24 38       	mov    0x38(%rsp),%rdi
 e9c:	48 85 ff             	test   %rdi,%rdi
 e9f:	74 1b                	je     ebc <BasePrintLibSPrintMarker+0xebc>
        Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Width - Precision, ' ', BytesPerOutputCharacter);
 ea1:	b9 20 00 00 00       	mov    $0x20,%ecx
 ea6:	48 8b 74 24 50       	mov    0x50(%rsp),%rsi
 eab:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 eb2:	00 00 00 
 eb5:	ff d0                	callq  *%rax
 eb7:	48 89 44 24 38       	mov    %rax,0x38(%rsp)
    }

    //
    // Get the next character from the format string
    //
    Format += BytesPerFormatCharacter;
 ebc:	4c 03 7c 24 48       	add    0x48(%rsp),%r15

    //
    // Get the next character from the format string
    //
    FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 ec1:	41 0f be 47 01       	movsbl 0x1(%r15),%eax
 ec6:	41 0f b6 17          	movzbl (%r15),%edx
 eca:	c1 e0 08             	shl    $0x8,%eax
 ecd:	09 d0                	or     %edx,%eax
 ecf:	48 98                	cltq   
 ed1:	48 23 44 24 58       	and    0x58(%rsp),%rax
 ed6:	48 89 84 24 b0 00 00 	mov    %rax,0xb0(%rsp)
 edd:	00 
 ede:	e9 cd f2 ff ff       	jmpq   1b0 <BasePrintLibSPrintMarker+0x1b0>

  if ((Flags & COUNT_ONLY_NO_PRINT) != 0) {
    return (LengthToReturn / BytesPerOutputCharacter);
  }

  ASSERT (Buffer != NULL);
 ee3:	49 bc 00 00 00 00 00 	movabs $0x0,%r12
 eea:	00 00 00 
 eed:	41 ff d4             	callq  *%r12
 ef0:	84 c0                	test   %al,%al
 ef2:	74 2d                	je     f21 <BasePrintLibSPrintMarker+0xf21>
 ef4:	48 83 7c 24 38 00    	cmpq   $0x0,0x38(%rsp)
 efa:	75 25                	jne    f21 <BasePrintLibSPrintMarker+0xf21>
 efc:	49 b8 00 00 00 00 00 	movabs $0x0,%r8
 f03:	00 00 00 
 f06:	ba c9 03 00 00       	mov    $0x3c9,%edx
 f0b:	48 b9 00 00 00 00 00 	movabs $0x0,%rcx
 f12:	00 00 00 
 f15:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 f1c:	00 00 00 
 f1f:	ff d0                	callq  *%rax
  //
  // Null terminate the Unicode or ASCII string
  //
  BasePrintLibFillBuffer (Buffer, EndBuffer + BytesPerOutputCharacter, 1, 0, BytesPerOutputCharacter);
 f21:	48 8b 74 24 50       	mov    0x50(%rsp),%rsi
 f26:	31 c9                	xor    %ecx,%ecx
 f28:	49 89 e8             	mov    %rbp,%r8
 f2b:	ba 01 00 00 00       	mov    $0x1,%edx
 f30:	48 8b 7c 24 38       	mov    0x38(%rsp),%rdi
 f35:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 f3c:	00 00 00 
 f3f:	48 01 ee             	add    %rbp,%rsi
 f42:	ff d0                	callq  *%rax
  //
  // Make sure output buffer cannot contain more than PcdMaximumUnicodeStringLength
  // Unicode characters if PcdMaximumUnicodeStringLength is not zero. 
  //
  ASSERT ((((Flags & OUTPUT_UNICODE) == 0)) || (StrSize ((CHAR16 *) OriginalBuffer) != 0));
 f44:	41 ff d4             	callq  *%r12
 f47:	84 c0                	test   %al,%al
 f49:	74 40                	je     f8b <BasePrintLibSPrintMarker+0xf8b>
 f4b:	f6 c3 40             	test   $0x40,%bl
 f4e:	74 3b                	je     f8b <BasePrintLibSPrintMarker+0xf8b>
 f50:	48 8b 4c 24 70       	mov    0x70(%rsp),%rcx
 f55:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 f5c:	00 00 00 
 f5f:	ff d0                	callq  *%rax
 f61:	48 85 c0             	test   %rax,%rax
 f64:	75 25                	jne    f8b <BasePrintLibSPrintMarker+0xf8b>
 f66:	49 b8 00 00 00 00 00 	movabs $0x0,%r8
 f6d:	00 00 00 
 f70:	ba d2 03 00 00       	mov    $0x3d2,%edx
 f75:	48 b9 00 00 00 00 00 	movabs $0x0,%rcx
 f7c:	00 00 00 
 f7f:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 f86:	00 00 00 
 f89:	ff d0                	callq  *%rax
  //
  // Make sure output buffer cannot contain more than PcdMaximumAsciiStringLength
  // ASCII characters if PcdMaximumAsciiStringLength is not zero. 
  //
  ASSERT ((((Flags & OUTPUT_UNICODE) != 0)) || (AsciiStrSize (OriginalBuffer) != 0));
 f8b:	41 ff d4             	callq  *%r12
 f8e:	84 c0                	test   %al,%al
 f90:	74 40                	je     fd2 <BasePrintLibSPrintMarker+0xfd2>
 f92:	80 e3 40             	and    $0x40,%bl
 f95:	75 3b                	jne    fd2 <BasePrintLibSPrintMarker+0xfd2>
 f97:	48 8b 4c 24 70       	mov    0x70(%rsp),%rcx
 f9c:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 fa3:	00 00 00 
 fa6:	ff d0                	callq  *%rax
 fa8:	48 85 c0             	test   %rax,%rax
 fab:	75 25                	jne    fd2 <BasePrintLibSPrintMarker+0xfd2>
 fad:	49 b8 00 00 00 00 00 	movabs $0x0,%r8
 fb4:	00 00 00 
 fb7:	ba d7 03 00 00       	mov    $0x3d7,%edx
 fbc:	48 b9 00 00 00 00 00 	movabs $0x0,%rcx
 fc3:	00 00 00 
 fc6:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 fcd:	00 00 00 
 fd0:	ff d0                	callq  *%rax

  return ((Buffer - OriginalBuffer) / BytesPerOutputCharacter);
 fd2:	48 8b 44 24 38       	mov    0x38(%rsp),%rax
 fd7:	48 2b 44 24 70       	sub    0x70(%rsp),%rax
 fdc:	48 99                	cqto   
 fde:	48 f7 fd             	idiv   %rbp
 fe1:	eb 0a                	jmp    fed <BasePrintLibSPrintMarker+0xfed>
 fe3:	4c 8b 54 24 30       	mov    0x30(%rsp),%r10
 fe8:	e9 50 f2 ff ff       	jmpq   23d <BasePrintLibSPrintMarker+0x23d>
}
 fed:	48 81 c4 f8 00 00 00 	add    $0xf8,%rsp
 ff4:	5b                   	pop    %rbx
 ff5:	5d                   	pop    %rbp
 ff6:	41 5c                	pop    %r12
 ff8:	41 5d                	pop    %r13
 ffa:	41 5e                	pop    %r14
 ffc:	41 5f                	pop    %r15
 ffe:	c3                   	retq
/home/lacos/src/upstream/edk2-git-svn/Build/OvmfX64/DEBUG_GCC48/X64/MdePkg/Library/BasePrintLib/BasePrintLib/OUTPUT/./PrintLibInternal.obj:     file format elf64-x86-64


Disassembly of section .text.BasePrintLibFillBuffer:

0000000000000000 <BasePrintLibFillBuffer>:
  IN  CHAR8   *EndBuffer,
  IN  INTN    Length,
  IN  UINTN   Character,
  IN  INTN    Increment
  )
{
   0:	48 89 f8             	mov    %rdi,%rax
  INTN  Index;
  
  for (Index = 0; Index < Length && Buffer < EndBuffer; Index++) {
    *Buffer = (CHAR8) Character;
    if (Increment != 1) {
      *(Buffer + 1) = (CHAR8)(Character >> 8);
   3:	48 89 cf             	mov    %rcx,%rdi
   6:	48 c1 ef 08          	shr    $0x8,%rdi
   a:	49 89 f9             	mov    %rdi,%r9
  IN  INTN    Increment
  )
{
  INTN  Index;
  
  for (Index = 0; Index < Length && Buffer < EndBuffer; Index++) {
   d:	31 ff                	xor    %edi,%edi
   f:	48 39 f0             	cmp    %rsi,%rax
  12:	73 19                	jae    2d <BasePrintLibFillBuffer+0x2d>
  14:	48 39 d7             	cmp    %rdx,%rdi
  17:	7d 14                	jge    2d <BasePrintLibFillBuffer+0x2d>
    *Buffer = (CHAR8) Character;
    if (Increment != 1) {
  19:	49 83 f8 01          	cmp    $0x1,%r8
  )
{
  INTN  Index;
  
  for (Index = 0; Index < Length && Buffer < EndBuffer; Index++) {
    *Buffer = (CHAR8) Character;
  1d:	88 08                	mov    %cl,(%rax)
    if (Increment != 1) {
  1f:	74 04                	je     25 <BasePrintLibFillBuffer+0x25>
      *(Buffer + 1) = (CHAR8)(Character >> 8);
  21:	44 88 48 01          	mov    %r9b,0x1(%rax)
    }
    Buffer += Increment;
  25:	4c 01 c0             	add    %r8,%rax
  IN  INTN    Increment
  )
{
  INTN  Index;
  
  for (Index = 0; Index < Length && Buffer < EndBuffer; Index++) {
  28:	48 ff c7             	inc    %rdi
  2b:	eb e2                	jmp    f <BasePrintLibFillBuffer+0xf>
    }
    Buffer += Increment;
  }

  return Buffer;
}
  2d:	c3                   	retq   

Disassembly of section .text.BasePrintLibValueToString:

0000000000000000 <BasePrintLibValueToString>:
BasePrintLibValueToString (
  IN OUT CHAR8  *Buffer, 
  IN INT64      Value, 
  IN UINTN      Radix
  )
{
   0:	55                   	push   %rbp
   1:	48 89 f0             	mov    %rsi,%rax
   4:	48 89 d5             	mov    %rdx,%rbp
   7:	53                   	push   %rbx
   8:	48 89 fb             	mov    %rdi,%rbx
   b:	48 83 ec 38          	sub    $0x38,%rsp
  UINT32  Remainder;

  //
  // Loop to convert one digit at a time in reverse order
  //
  *Buffer = 0;
   f:	c6 07 00             	movb   $0x0,(%rdi)
  do {
    Value = (INT64)DivU64x32Remainder ((UINT64)Value, (UINT32)Radix, &Remainder);
  12:	48 89 c1             	mov    %rax,%rcx
  15:	89 ea                	mov    %ebp,%edx
  17:	4c 8d 44 24 2c       	lea    0x2c(%rsp),%r8
  1c:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
  23:	00 00 00 
    *(++Buffer) = mHexStr[Remainder];
  26:	48 ff c3             	inc    %rbx
  //
  // Loop to convert one digit at a time in reverse order
  //
  *Buffer = 0;
  do {
    Value = (INT64)DivU64x32Remainder ((UINT64)Value, (UINT32)Radix, &Remainder);
  29:	ff d0                	callq  *%rax
    *(++Buffer) = mHexStr[Remainder];
  2b:	8b 54 24 2c          	mov    0x2c(%rsp),%edx
  2f:	48 b9 00 00 00 00 00 	movabs $0x0,%rcx
  36:	00 00 00 
  } while (Value != 0);
  39:	48 85 c0             	test   %rax,%rax
  // Loop to convert one digit at a time in reverse order
  //
  *Buffer = 0;
  do {
    Value = (INT64)DivU64x32Remainder ((UINT64)Value, (UINT32)Radix, &Remainder);
    *(++Buffer) = mHexStr[Remainder];
  3c:	8a 14 11             	mov    (%rcx,%rdx,1),%dl
  3f:	88 13                	mov    %dl,(%rbx)
  } while (Value != 0);
  41:	75 cf                	jne    12 <BasePrintLibValueToString+0x12>

  //
  // Return pointer of the end of filled buffer.
  //
  return Buffer;
}
  43:	48 83 c4 38          	add    $0x38,%rsp
  47:	48 89 d8             	mov    %rbx,%rax
  4a:	5b                   	pop    %rbx
  4b:	5d                   	pop    %rbp
  4c:	c3                   	retq   

Disassembly of section .text.BasePrintLibConvertValueToString:

0000000000000000 <BasePrintLibConvertValueToString>:
  IN UINTN       Flags,
  IN INT64       Value,
  IN UINTN       Width,
  IN UINTN       Increment
  )
{
   0:	41 57                	push   %r15
   2:	49 89 d7             	mov    %rdx,%r15
   5:	41 56                	push   %r14
  UINTN  Radix;

  //
  // Make sure Buffer is not NULL and Width < MAXIMUM
  //
  ASSERT (Buffer != NULL);
   7:	49 be 00 00 00 00 00 	movabs $0x0,%r14
   e:	00 00 00 
  IN UINTN       Flags,
  IN INT64       Value,
  IN UINTN       Width,
  IN UINTN       Increment
  )
{
  11:	41 55                	push   %r13
  13:	49 89 fd             	mov    %rdi,%r13
  16:	41 54                	push   %r12
  18:	49 89 cc             	mov    %rcx,%r12
  1b:	55                   	push   %rbp
  1c:	48 89 f5             	mov    %rsi,%rbp
  1f:	53                   	push   %rbx
  20:	4c 89 c3             	mov    %r8,%rbx
  23:	48 83 ec 78          	sub    $0x78,%rsp
  UINTN  Radix;

  //
  // Make sure Buffer is not NULL and Width < MAXIMUM
  //
  ASSERT (Buffer != NULL);
  27:	41 ff d6             	callq  *%r14
  2a:	84 c0                	test   %al,%al
  2c:	74 2a                	je     58 <BasePrintLibConvertValueToString+0x58>
  2e:	4d 85 ed             	test   %r13,%r13
  31:	75 25                	jne    58 <BasePrintLibConvertValueToString+0x58>
  33:	49 b8 00 00 00 00 00 	movabs $0x0,%r8
  3a:	00 00 00 
  3d:	ba c6 00 00 00       	mov    $0xc6,%edx
  42:	48 b9 00 00 00 00 00 	movabs $0x0,%rcx
  49:	00 00 00 
  4c:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
  53:	00 00 00 
  56:	ff d0                	callq  *%rax
  ASSERT (Width < MAXIMUM_VALUE_CHARACTERS);
  58:	41 ff d6             	callq  *%r14
  5b:	84 c0                	test   %al,%al
  5d:	74 2b                	je     8a <BasePrintLibConvertValueToString+0x8a>
  5f:	49 83 fc 25          	cmp    $0x25,%r12
  63:	76 25                	jbe    8a <BasePrintLibConvertValueToString+0x8a>
  65:	49 b8 00 00 00 00 00 	movabs $0x0,%r8
  6c:	00 00 00 
  6f:	ba c7 00 00 00       	mov    $0xc7,%edx
  74:	48 b9 00 00 00 00 00 	movabs $0x0,%rcx
  7b:	00 00 00 
  7e:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
  85:	00 00 00 
  88:	ff d0                	callq  *%rax
  //
  // Make sure Flags can only contain supported bits.
  //
  ASSERT ((Flags & ~(LEFT_JUSTIFY | COMMA_TYPE | PREFIX_ZERO | RADIX_HEX)) == 0);
  8a:	41 ff d6             	callq  *%r14
  8d:	84 c0                	test   %al,%al
  8f:	74 2e                	je     bf <BasePrintLibConvertValueToString+0xbf>
  91:	48 f7 c5 56 ff ff ff 	test   $0xffffffffffffff56,%rbp
  98:	74 25                	je     bf <BasePrintLibConvertValueToString+0xbf>
  9a:	49 b8 00 00 00 00 00 	movabs $0x0,%r8
  a1:	00 00 00 
  a4:	ba cb 00 00 00       	mov    $0xcb,%edx
  a9:	48 b9 00 00 00 00 00 	movabs $0x0,%rcx
  b0:	00 00 00 
  b3:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
  ba:	00 00 00 
  bd:	ff d0                	callq  *%rax

  //
  // If both COMMA_TYPE and RADIX_HEX are set, then ASSERT ()
  //
  ASSERT (((Flags & COMMA_TYPE) == 0) || ((Flags & RADIX_HEX) == 0));
  bf:	41 ff d6             	callq  *%r14
  c2:	84 c0                	test   %al,%al
  c4:	74 35                	je     fb <BasePrintLibConvertValueToString+0xfb>
  c6:	48 89 e8             	mov    %rbp,%rax
  c9:	25 88 00 00 00       	and    $0x88,%eax
  ce:	48 3d 88 00 00 00    	cmp    $0x88,%rax
  d4:	75 25                	jne    fb <BasePrintLibConvertValueToString+0xfb>
  d6:	49 b8 00 00 00 00 00 	movabs $0x0,%r8
  dd:	00 00 00 
  e0:	ba d0 00 00 00       	mov    $0xd0,%edx
  e5:	48 b9 00 00 00 00 00 	movabs $0x0,%rcx
  ec:	00 00 00 
  ef:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
  f6:	00 00 00 
  f9:	ff d0                	callq  *%rax
  OriginalBuffer = Buffer;
  
  //
  // Width is 0 or COMMA_TYPE is set, PREFIX_ZERO is ignored.
  //
  if (Width == 0 || (Flags & COMMA_TYPE) != 0) {
  fb:	4d 85 e4             	test   %r12,%r12
  fe:	74 06                	je     106 <BasePrintLibConvertValueToString+0x106>
 100:	40 f6 c5 08          	test   $0x8,%bpl
 104:	74 10                	je     116 <BasePrintLibConvertValueToString+0x116>
    Flags &= ~((UINTN) PREFIX_ZERO);
 106:	48 83 e5 df          	and    $0xffffffffffffffdf,%rbp
  }
  //
  // If Width is 0 then a width of  MAXIMUM_VALUE_CHARACTERS is assumed.
  //
  if (Width == 0) {
    Width = MAXIMUM_VALUE_CHARACTERS - 1;
 10a:	b8 25 00 00 00       	mov    $0x25,%eax
 10f:	4d 85 e4             	test   %r12,%r12
 112:	4c 0f 44 e0          	cmove  %rax,%r12
  }
  //
  // Set the tag for the end of the input Buffer.
  //
  EndBuffer = Buffer + Width * Increment;
 116:	4c 89 e0             	mov    %r12,%rax
 119:	4d 89 e9             	mov    %r13,%r9
 11c:	49 be 00 00 00 00 00 	movabs $0x0,%r14
 123:	00 00 00 
 126:	48 0f af c3          	imul   %rbx,%rax
 12a:	4c 01 e8             	add    %r13,%rax
  
  //
  // Convert decimal negative
  //
  if ((Value < 0) && ((Flags & RADIX_HEX) == 0)) {
 12d:	4d 85 ff             	test   %r15,%r15
    Width = MAXIMUM_VALUE_CHARACTERS - 1;
  }
  //
  // Set the tag for the end of the input Buffer.
  //
  EndBuffer = Buffer + Width * Increment;
 130:	48 89 44 24 20       	mov    %rax,0x20(%rsp)
  
  //
  // Convert decimal negative
  //
  if ((Value < 0) && ((Flags & RADIX_HEX) == 0)) {
 135:	79 25                	jns    15c <BasePrintLibConvertValueToString+0x15c>
 137:	40 f6 c5 80          	test   $0x80,%bpl
 13b:	75 1f                	jne    15c <BasePrintLibConvertValueToString+0x15c>
    Value = -Value;
    Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, '-', Increment);
 13d:	49 89 d8             	mov    %rbx,%r8
 140:	b9 2d 00 00 00       	mov    $0x2d,%ecx
 145:	ba 01 00 00 00       	mov    $0x1,%edx
 14a:	48 89 c6             	mov    %rax,%rsi
 14d:	4c 89 ef             	mov    %r13,%rdi
  
  //
  // Convert decimal negative
  //
  if ((Value < 0) && ((Flags & RADIX_HEX) == 0)) {
    Value = -Value;
 150:	49 f7 df             	neg    %r15
    Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, '-', Increment);
 153:	41 ff d6             	callq  *%r14
    Width--;
 156:	49 ff cc             	dec    %r12
  //
  // Convert decimal negative
  //
  if ((Value < 0) && ((Flags & RADIX_HEX) == 0)) {
    Value = -Value;
    Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, '-', Increment);
 159:	49 89 c1             	mov    %rax,%r9
  }
  
  //
  // Count the length of the value string.
  //
  Radix = ((Flags & RADIX_HEX) == 0)? 10 : 16;
 15c:	48 89 e8             	mov    %rbp,%rax
  ValueBufferPtr = BasePrintLibValueToString (ValueBuffer, Value, Radix);
 15f:	48 8d 4c 24 4a       	lea    0x4a(%rsp),%rcx
 164:	4c 89 4c 24 30       	mov    %r9,0x30(%rsp)
  }
  
  //
  // Count the length of the value string.
  //
  Radix = ((Flags & RADIX_HEX) == 0)? 10 : 16;
 169:	25 80 00 00 00       	and    $0x80,%eax
  ValueBufferPtr = BasePrintLibValueToString (ValueBuffer, Value, Radix);
 16e:	4c 89 fe             	mov    %r15,%rsi
  }
  
  //
  // Count the length of the value string.
  //
  Radix = ((Flags & RADIX_HEX) == 0)? 10 : 16;
 171:	48 83 f8 01          	cmp    $0x1,%rax
  ValueBufferPtr = BasePrintLibValueToString (ValueBuffer, Value, Radix);
 175:	48 89 cf             	mov    %rcx,%rdi
 178:	48 89 4c 24 28       	mov    %rcx,0x28(%rsp)
  }
  
  //
  // Count the length of the value string.
  //
  Radix = ((Flags & RADIX_HEX) == 0)? 10 : 16;
 17d:	48 19 d2             	sbb    %rdx,%rdx
  ValueBufferPtr = BasePrintLibValueToString (ValueBuffer, Value, Radix);
 180:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 187:	00 00 00 
  }
  
  //
  // Count the length of the value string.
  //
  Radix = ((Flags & RADIX_HEX) == 0)? 10 : 16;
 18a:	48 83 e2 fa          	and    $0xfffffffffffffffa,%rdx
 18e:	48 83 c2 10          	add    $0x10,%rdx
  ValueBufferPtr = BasePrintLibValueToString (ValueBuffer, Value, Radix);
 192:	ff d0                	callq  *%rax
  Count = ValueBufferPtr - ValueBuffer;
 194:	48 8b 4c 24 28       	mov    0x28(%rsp),%rcx
  
  //
  // Count the length of the value string.
  //
  Radix = ((Flags & RADIX_HEX) == 0)? 10 : 16;
  ValueBufferPtr = BasePrintLibValueToString (ValueBuffer, Value, Radix);
 199:	49 89 c7             	mov    %rax,%r15
  Count = ValueBufferPtr - ValueBuffer;
  
  //
  // Append Zero
  //
  if ((Flags & PREFIX_ZERO) != 0) {
 19c:	4c 8b 4c 24 30       	mov    0x30(%rsp),%r9
  //
  // Count the length of the value string.
  //
  Radix = ((Flags & RADIX_HEX) == 0)? 10 : 16;
  ValueBufferPtr = BasePrintLibValueToString (ValueBuffer, Value, Radix);
  Count = ValueBufferPtr - ValueBuffer;
 1a1:	48 29 c8             	sub    %rcx,%rax
  
  //
  // Append Zero
  //
  if ((Flags & PREFIX_ZERO) != 0) {
 1a4:	40 f6 c5 20          	test   $0x20,%bpl
  //
  // Count the length of the value string.
  //
  Radix = ((Flags & RADIX_HEX) == 0)? 10 : 16;
  ValueBufferPtr = BasePrintLibValueToString (ValueBuffer, Value, Radix);
  Count = ValueBufferPtr - ValueBuffer;
 1a8:	48 89 44 24 28       	mov    %rax,0x28(%rsp)
  
  //
  // Append Zero
  //
  if ((Flags & PREFIX_ZERO) != 0) {
 1ad:	74 1c                	je     1cb <BasePrintLibConvertValueToString+0x1cb>
    Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Width - Count, '0', Increment);
 1af:	4c 89 e2             	mov    %r12,%rdx
 1b2:	4c 89 cf             	mov    %r9,%rdi
 1b5:	49 89 d8             	mov    %rbx,%r8
 1b8:	48 29 c2             	sub    %rax,%rdx
 1bb:	b9 30 00 00 00       	mov    $0x30,%ecx
 1c0:	48 8b 74 24 20       	mov    0x20(%rsp),%rsi
 1c5:	41 ff d6             	callq  *%r14
 1c8:	49 89 c1             	mov    %rax,%r9
  }
  
  //
  // Print Comma type for every 3 characters
  //
  Digits = Count % 3;
 1cb:	48 8b 44 24 28       	mov    0x28(%rsp),%rax
 1d0:	41 bc 03 00 00 00    	mov    $0x3,%r12d
 1d6:	31 d2                	xor    %edx,%edx
 1d8:	49 f7 f4             	div    %r12
  if (Digits != 0) {
    Digits = 3 - Digits;
 1db:	49 29 d4             	sub    %rdx,%r12
 1de:	48 85 d2             	test   %rdx,%rdx
 1e1:	4c 0f 44 e2          	cmove  %rdx,%r12
  }
  for (Index = 0; Index < Count; Index++) {
    Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, *ValueBufferPtr--, Increment);
    if ((Flags & COMMA_TYPE) != 0) {
 1e5:	83 e5 08             	and    $0x8,%ebp
      Digits++;
      if (Digits == 3) {
        Digits = 0;
 1e8:	45 31 d2             	xor    %r10d,%r10d
  if (Digits != 0) {
    Digits = 3 - Digits;
  }
  for (Index = 0; Index < Count; Index++) {
    Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, *ValueBufferPtr--, Increment);
    if ((Flags & COMMA_TYPE) != 0) {
 1eb:	48 89 6c 24 30       	mov    %rbp,0x30(%rsp)
  //
  Digits = Count % 3;
  if (Digits != 0) {
    Digits = 3 - Digits;
  }
  for (Index = 0; Index < Count; Index++) {
 1f0:	4c 3b 54 24 28       	cmp    0x28(%rsp),%r10
 1f5:	74 78                	je     26f <BasePrintLibConvertValueToString+0x26f>
 1f7:	4c 89 d0             	mov    %r10,%rax
 1fa:	4c 89 54 24 38       	mov    %r10,0x38(%rsp)
    Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, *ValueBufferPtr--, Increment);
 1ff:	4c 89 cf             	mov    %r9,%rdi
 202:	48 f7 d8             	neg    %rax
 205:	49 89 d8             	mov    %rbx,%r8
 208:	ba 01 00 00 00       	mov    $0x1,%edx
 20d:	49 0f be 0c 07       	movsbq (%r15,%rax,1),%rcx
 212:	48 8b 74 24 20       	mov    0x20(%rsp),%rsi
 217:	41 ff d6             	callq  *%r14
    if ((Flags & COMMA_TYPE) != 0) {
 21a:	48 83 7c 24 30 00    	cmpq   $0x0,0x30(%rsp)
 220:	4c 8b 54 24 38       	mov    0x38(%rsp),%r10
  Digits = Count % 3;
  if (Digits != 0) {
    Digits = 3 - Digits;
  }
  for (Index = 0; Index < Count; Index++) {
    Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, *ValueBufferPtr--, Increment);
 225:	49 89 c1             	mov    %rax,%r9
 228:	49 8d 6a 01          	lea    0x1(%r10),%rbp
    if ((Flags & COMMA_TYPE) != 0) {
 22c:	74 3c                	je     26a <BasePrintLibConvertValueToString+0x26a>
      Digits++;
 22e:	49 ff c4             	inc    %r12
      if (Digits == 3) {
 231:	49 83 fc 03          	cmp    $0x3,%r12
 235:	75 33                	jne    26a <BasePrintLibConvertValueToString+0x26a>
        Digits = 0;
        if ((Index + 1) < Count) {
 237:	48 3b 6c 24 28       	cmp    0x28(%rsp),%rbp
 23c:	73 29                	jae    267 <BasePrintLibConvertValueToString+0x267>
          Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ',', Increment);
 23e:	48 89 c7             	mov    %rax,%rdi
 241:	49 89 d8             	mov    %rbx,%r8
 244:	b9 2c 00 00 00       	mov    $0x2c,%ecx
 249:	ba 01 00 00 00       	mov    $0x1,%edx
 24e:	48 8b 74 24 20       	mov    0x20(%rsp),%rsi
 253:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 25a:	00 00 00 
  for (Index = 0; Index < Count; Index++) {
    Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, *ValueBufferPtr--, Increment);
    if ((Flags & COMMA_TYPE) != 0) {
      Digits++;
      if (Digits == 3) {
        Digits = 0;
 25d:	45 30 e4             	xor    %r12b,%r12b
        if ((Index + 1) < Count) {
          Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ',', Increment);
 260:	ff d0                	callq  *%rax
 262:	49 89 c1             	mov    %rax,%r9
 265:	eb 03                	jmp    26a <BasePrintLibConvertValueToString+0x26a>
  for (Index = 0; Index < Count; Index++) {
    Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, *ValueBufferPtr--, Increment);
    if ((Flags & COMMA_TYPE) != 0) {
      Digits++;
      if (Digits == 3) {
        Digits = 0;
 267:	45 31 e4             	xor    %r12d,%r12d
  //
  Digits = Count % 3;
  if (Digits != 0) {
    Digits = 3 - Digits;
  }
  for (Index = 0; Index < Count; Index++) {
 26a:	49 89 ea             	mov    %rbp,%r10
 26d:	eb 81                	jmp    1f0 <BasePrintLibConvertValueToString+0x1f0>
  }
  
  //
  // Print Null-terminator
  //
  BasePrintLibFillBuffer (Buffer, EndBuffer + Increment, 1, 0, Increment);
 26f:	48 8b 74 24 20       	mov    0x20(%rsp),%rsi
 274:	49 89 d8             	mov    %rbx,%r8
 277:	4c 89 4c 24 20       	mov    %r9,0x20(%rsp)
 27c:	ba 01 00 00 00       	mov    $0x1,%edx
 281:	4c 89 cf             	mov    %r9,%rdi
 284:	31 c9                	xor    %ecx,%ecx
 286:	48 01 de             	add    %rbx,%rsi
 289:	41 ff d6             	callq  *%r14

  return ((Buffer - OriginalBuffer) / Increment);
 28c:	4c 8b 4c 24 20       	mov    0x20(%rsp),%r9
 291:	31 d2                	xor    %edx,%edx
}
 293:	48 83 c4 78          	add    $0x78,%rsp
  //
  // Print Null-terminator
  //
  BasePrintLibFillBuffer (Buffer, EndBuffer + Increment, 1, 0, Increment);

  return ((Buffer - OriginalBuffer) / Increment);
 297:	4c 89 c8             	mov    %r9,%rax
 29a:	4c 29 e8             	sub    %r13,%rax
 29d:	48 f7 f3             	div    %rbx
}
 2a0:	5b                   	pop    %rbx
 2a1:	5d                   	pop    %rbp
 2a2:	41 5c                	pop    %r12
 2a4:	41 5d                	pop    %r13
 2a6:	41 5e                	pop    %r14
 2a8:	41 5f                	pop    %r15
 2aa:	c3                   	retq   

Disassembly of section .text.BasePrintLibSPrint:

0000000000000000 <BasePrintLibSPrint>:
  IN  UINTN        BufferSize,
  IN  UINTN        Flags,
  IN  CONST CHAR8  *FormatString,
  ...
  )
{
   0:	57                   	push   %rdi
   1:	48 89 cf             	mov    %rcx,%rdi
  VA_LIST  Marker;
  UINTN    NumberOfPrinted;

  VA_START (Marker, FormatString);
  NumberOfPrinted = BasePrintLibSPrintMarker (StartOfBuffer, BufferSize, Flags, FormatString, Marker, NULL);
   4:	4c 89 c9             	mov    %r9,%rcx
  IN  UINTN        BufferSize,
  IN  UINTN        Flags,
  IN  CONST CHAR8  *FormatString,
  ...
  )
{
   7:	56                   	push   %rsi
   8:	48 89 d6             	mov    %rdx,%rsi
   b:	4c 89 c2             	mov    %r8,%rdx
   e:	50                   	push   %rax
  VA_LIST  Marker;
  UINTN    NumberOfPrinted;

  VA_START (Marker, FormatString);
  NumberOfPrinted = BasePrintLibSPrintMarker (StartOfBuffer, BufferSize, Flags, FormatString, Marker, NULL);
   f:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
  16:	00 00 00 
  IN  UINTN        BufferSize,
  IN  UINTN        Flags,
  IN  CONST CHAR8  *FormatString,
  ...
  )
{
  19:	4c 89 4c 24 38       	mov    %r9,0x38(%rsp)
  VA_LIST  Marker;
  UINTN    NumberOfPrinted;

  VA_START (Marker, FormatString);
  NumberOfPrinted = BasePrintLibSPrintMarker (StartOfBuffer, BufferSize, Flags, FormatString, Marker, NULL);
  1e:	4c 8d 44 24 40       	lea    0x40(%rsp),%r8
  23:	45 31 c9             	xor    %r9d,%r9d
  26:	ff d0                	callq  *%rax
  VA_END (Marker);
  return NumberOfPrinted;
}
  28:	5a                   	pop    %rdx
  29:	5e                   	pop    %rsi
  2a:	5f                   	pop    %rdi
  2b:	c3                   	retq   

Disassembly of section .text.BasePrintLibSPrintMarker:

0000000000000000 <BasePrintLibSPrintMarker>:
  IN  UINTN        Flags,
  IN  CONST CHAR8  *Format,
  IN  VA_LIST      VaListMarker,   OPTIONAL
  IN  BASE_LIST    BaseListMarker  OPTIONAL
  )
{
   0:	41 57                	push   %r15
   2:	4d 89 c7             	mov    %r8,%r15
   5:	41 56                	push   %r14
   7:	49 89 ce             	mov    %rcx,%r14
   a:	41 55                	push   %r13
   c:	41 54                	push   %r12
   e:	49 89 f4             	mov    %rsi,%r12
  11:	55                   	push   %rbp
  12:	4c 89 cd             	mov    %r9,%rbp
  15:	53                   	push   %rbx
  16:	48 89 d3             	mov    %rdx,%rbx
  19:	48 81 ec 08 01 00 00 	sub    $0x108,%rsp
  // If you change this code be sure to match the 2 versions of this function.
  // Nearly identical logic is found in the BasePrintLib and 
  // DxePrintLibPrint2Protocol (both PrintLib instances).
  //

  if ((Flags & COUNT_ONLY_NO_PRINT) != 0) {
  20:	f6 c6 20             	test   $0x20,%dh
  IN  UINTN        Flags,
  IN  CONST CHAR8  *Format,
  IN  VA_LIST      VaListMarker,   OPTIONAL
  IN  BASE_LIST    BaseListMarker  OPTIONAL
  )
{
  23:	48 89 7c 24 70       	mov    %rdi,0x70(%rsp)
  // If you change this code be sure to match the 2 versions of this function.
  // Nearly identical logic is found in the BasePrintLib and 
  // DxePrintLibPrint2Protocol (both PrintLib instances).
  //

  if ((Flags & COUNT_ONLY_NO_PRINT) != 0) {
  28:	74 13                	je     3d <BasePrintLibSPrintMarker+0x3d>
    if (BufferSize == 0) {
      Buffer = NULL;
  2a:	48 85 f6             	test   %rsi,%rsi
  2d:	b8 00 00 00 00       	mov    $0x0,%eax
  32:	48 0f 45 c7          	cmovne %rdi,%rax
  36:	48 89 44 24 70       	mov    %rax,0x70(%rsp)
  3b:	eb 48                	jmp    85 <BasePrintLibSPrintMarker+0x85>
  } else {
    //
    // We can run without a Buffer for counting only.
    //
    if (BufferSize == 0) {
      return 0;
  3d:	31 c0                	xor    %eax,%eax
    }
  } else {
    //
    // We can run without a Buffer for counting only.
    //
    if (BufferSize == 0) {
  3f:	48 85 f6             	test   %rsi,%rsi
  42:	0f 84 fb 0e 00 00    	je     f43 <BasePrintLibSPrintMarker+0xf43>
      return 0;
    }
    ASSERT (Buffer != NULL);
  48:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
  4f:	00 00 00 
  52:	ff d0                	callq  *%rax
  54:	84 c0                	test   %al,%al
  56:	74 2d                	je     85 <BasePrintLibSPrintMarker+0x85>
  58:	48 83 7c 24 70 00    	cmpq   $0x0,0x70(%rsp)
  5e:	75 25                	jne    85 <BasePrintLibSPrintMarker+0x85>
  60:	49 b8 00 00 00 00 00 	movabs $0x0,%r8
  67:	00 00 00 
  6a:	ba 6e 01 00 00       	mov    $0x16e,%edx
  6f:	48 b9 00 00 00 00 00 	movabs $0x0,%rcx
  76:	00 00 00 
  79:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
  80:	00 00 00 
  83:	ff d0                	callq  *%rax
  }

  if ((Flags & OUTPUT_UNICODE) != 0) {
  85:	48 89 d8             	mov    %rbx,%rax
  OriginalBuffer = NULL;

  //
  // Reserve space for the Null terminator.
  //
  if (Buffer != NULL) {
  88:	48 8b 7c 24 70       	mov    0x70(%rsp),%rdi
      return 0;
    }
    ASSERT (Buffer != NULL);
  }

  if ((Flags & OUTPUT_UNICODE) != 0) {
  8d:	83 e0 40             	and    $0x40,%eax
    BytesPerOutputCharacter = 2;
  90:	48 83 f8 01          	cmp    $0x1,%rax
  94:	19 c0                	sbb    %eax,%eax
  96:	89 44 24 54          	mov    %eax,0x54(%rsp)
  9a:	83 44 24 54 02       	addl   $0x2,0x54(%rsp)
  OriginalBuffer = NULL;

  //
  // Reserve space for the Null terminator.
  //
  if (Buffer != NULL) {
  9f:	48 85 ff             	test   %rdi,%rdi
  a2:	74 15                	je     b9 <BasePrintLibSPrintMarker+0xb9>
    OriginalBuffer = Buffer;

    //
    // Set the tag for the end of the input Buffer.
    //
    EndBuffer = Buffer + BufferSize * BytesPerOutputCharacter;
  a4:	8b 44 24 54          	mov    0x54(%rsp),%eax

  //
  // Reserve space for the Null terminator.
  //
  if (Buffer != NULL) {
    BufferSize--;
  a8:	49 ff cc             	dec    %r12
    OriginalBuffer = Buffer;

    //
    // Set the tag for the end of the input Buffer.
    //
    EndBuffer = Buffer + BufferSize * BytesPerOutputCharacter;
  ab:	49 0f af c4          	imul   %r12,%rax
  af:	48 01 f8             	add    %rdi,%rax
  b2:	48 89 44 24 48       	mov    %rax,0x48(%rsp)
  b7:	eb 09                	jmp    c2 <BasePrintLibSPrintMarker+0xc2>
  } else {
    BytesPerOutputCharacter = 1;
  }

  LengthToReturn = 0;
  EndBuffer = NULL;
  b9:	48 c7 44 24 48 00 00 	movq   $0x0,0x48(%rsp)
  c0:	00 00 
    // Set the tag for the end of the input Buffer.
    //
    EndBuffer = Buffer + BufferSize * BytesPerOutputCharacter;
  }

  if ((Flags & FORMAT_UNICODE) != 0) {
  c2:	f6 c7 01             	test   $0x1,%bh
  c5:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
  cc:	00 00 00 
  cf:	74 53                	je     124 <BasePrintLibSPrintMarker+0x124>
    //
    // Make sure format string cannot contain more than PcdMaximumUnicodeStringLength
    // Unicode characters if PcdMaximumUnicodeStringLength is not zero. 
    //
    ASSERT (StrSize ((CHAR16 *) Format) != 0);
  d1:	ff d0                	callq  *%rax
  d3:	84 c0                	test   %al,%al
  d5:	74 39                	je     110 <BasePrintLibSPrintMarker+0x110>
  d7:	4c 89 f1             	mov    %r14,%rcx
  da:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
  e1:	00 00 00 
  e4:	ff d0                	callq  *%rax
  e6:	48 85 c0             	test   %rax,%rax
  e9:	75 25                	jne    110 <BasePrintLibSPrintMarker+0x110>
  eb:	49 b8 00 00 00 00 00 	movabs $0x0,%r8
  f2:	00 00 00 
  f5:	ba 8d 01 00 00       	mov    $0x18d,%edx
  fa:	48 b9 00 00 00 00 00 	movabs $0x0,%rcx
 101:	00 00 00 
 104:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 10b:	00 00 00 
 10e:	ff d0                	callq  *%rax
    BytesPerFormatCharacter = 2;
    FormatMask = 0xffff;
 110:	48 c7 44 24 58 ff ff 	movq   $0xffff,0x58(%rsp)
 117:	00 00 
    //
    // Make sure format string cannot contain more than PcdMaximumUnicodeStringLength
    // Unicode characters if PcdMaximumUnicodeStringLength is not zero. 
    //
    ASSERT (StrSize ((CHAR16 *) Format) != 0);
    BytesPerFormatCharacter = 2;
 119:	48 c7 44 24 40 02 00 	movq   $0x2,0x40(%rsp)
 120:	00 00 
 122:	eb 51                	jmp    175 <BasePrintLibSPrintMarker+0x175>
  } else {
    //
    // Make sure format string cannot contain more than PcdMaximumAsciiStringLength
    // Ascii characters if PcdMaximumAsciiStringLength is not zero. 
    //
    ASSERT (AsciiStrSize (Format) != 0);
 124:	ff d0                	callq  *%rax
 126:	84 c0                	test   %al,%al
 128:	74 39                	je     163 <BasePrintLibSPrintMarker+0x163>
 12a:	4c 89 f1             	mov    %r14,%rcx
 12d:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 134:	00 00 00 
 137:	ff d0                	callq  *%rax
 139:	48 85 c0             	test   %rax,%rax
 13c:	75 25                	jne    163 <BasePrintLibSPrintMarker+0x163>
 13e:	49 b8 00 00 00 00 00 	movabs $0x0,%r8
 145:	00 00 00 
 148:	ba 95 01 00 00       	mov    $0x195,%edx
 14d:	48 b9 00 00 00 00 00 	movabs $0x0,%rcx
 154:	00 00 00 
 157:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 15e:	00 00 00 
 161:	ff d0                	callq  *%rax
    BytesPerFormatCharacter = 1;
    FormatMask = 0xff;
 163:	48 c7 44 24 58 ff 00 	movq   $0xff,0x58(%rsp)
 16a:	00 00 
    //
    // Make sure format string cannot contain more than PcdMaximumAsciiStringLength
    // Ascii characters if PcdMaximumAsciiStringLength is not zero. 
    //
    ASSERT (AsciiStrSize (Format) != 0);
    BytesPerFormatCharacter = 1;
 16c:	48 c7 44 24 40 01 00 	movq   $0x1,0x40(%rsp)
 173:	00 00 
  }

  //
  // Get the first character from the format string
  //
  FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 175:	41 0f be 46 01       	movsbl 0x1(%r14),%eax
 17a:	41 0f b6 16          	movzbl (%r14),%edx
    BytesPerOutputCharacter = 2;
  } else {
    BytesPerOutputCharacter = 1;
  }

  LengthToReturn = 0;
 17e:	48 c7 44 24 68 00 00 	movq   $0x0,0x68(%rsp)
 185:	00 00 
  }

  //
  // Get the first character from the format string
  //
  FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 187:	c1 e0 08             	shl    $0x8,%eax
 18a:	09 d0                	or     %edx,%eax
 18c:	48 98                	cltq   
 18e:	48 23 44 24 58       	and    0x58(%rsp),%rax
 193:	48 89 84 24 b8 00 00 	mov    %rax,0xb8(%rsp)
 19a:	00 

  //
  // Loop until the end of the format string is reached or the output buffer is full
  //
  while (FormatCharacter != 0) {
 19b:	48 8b 44 24 70       	mov    0x70(%rsp),%rax
 1a0:	48 89 44 24 38       	mov    %rax,0x38(%rsp)
 1a5:	48 8b 84 24 b8 00 00 	mov    0xb8(%rsp),%rax
 1ac:	00 
 1ad:	48 85 c0             	test   %rax,%rax
 1b0:	74 24                	je     1d6 <BasePrintLibSPrintMarker+0x1d6>
    if ((Buffer != NULL) && (Buffer >= EndBuffer)) {
 1b2:	48 8b 7c 24 38       	mov    0x38(%rsp),%rdi
 1b7:	48 8b 74 24 48       	mov    0x48(%rsp),%rsi
 1bc:	48 85 ff             	test   %rdi,%rdi
 1bf:	0f 95 84 24 90 00 00 	setne  0x90(%rsp)
 1c6:	00 
 1c7:	48 39 f7             	cmp    %rsi,%rdi
 1ca:	72 26                	jb     1f2 <BasePrintLibSPrintMarker+0x1f2>
 1cc:	80 bc 24 90 00 00 00 	cmpb   $0x0,0x90(%rsp)
 1d3:	00 
 1d4:	74 1c                	je     1f2 <BasePrintLibSPrintMarker+0x1f2>
    // Get the next character from the format string
    //
    FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
  }

  if ((Flags & COUNT_ONLY_NO_PRINT) != 0) {
 1d6:	f6 c7 20             	test   $0x20,%bh
 1d9:	8b 6c 24 54          	mov    0x54(%rsp),%ebp
 1dd:	0f 84 56 0c 00 00    	je     e39 <BasePrintLibSPrintMarker+0xe39>
    return (LengthToReturn / BytesPerOutputCharacter);
 1e3:	48 8b 44 24 68       	mov    0x68(%rsp),%rax
 1e8:	31 d2                	xor    %edx,%edx
 1ea:	48 f7 f5             	div    %rbp
 1ed:	e9 51 0d 00 00       	jmpq   f43 <BasePrintLibSPrintMarker+0xf43>
      break;
    }
    //
    // Clear all the flag bits except those that may have been passed in
    //
    Flags &= (UINTN) (OUTPUT_UNICODE | FORMAT_UNICODE | COUNT_ONLY_NO_PRINT);
 1f2:	81 e3 40 21 00 00    	and    $0x2140,%ebx
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;

    switch (FormatCharacter) {
 1f8:	48 83 f8 0d          	cmp    $0xd,%rax
 1fc:	0f 84 95 06 00 00    	je     897 <BasePrintLibSPrintMarker+0x897>
 202:	48 83 f8 25          	cmp    $0x25,%rax
 206:	74 0f                	je     217 <BasePrintLibSPrintMarker+0x217>
 208:	48 83 f8 0a          	cmp    $0xa,%rax
 20c:	0f 85 14 07 00 00    	jne    926 <BasePrintLibSPrintMarker+0x926>
 212:	e9 d8 06 00 00       	jmpq   8ef <BasePrintLibSPrintMarker+0x8ef>
 217:	48 c7 44 24 30 00 00 	movq   $0x0,0x30(%rsp)
 21e:	00 00 
 220:	41 ba 01 00 00 00    	mov    $0x1,%r10d
 226:	48 c7 44 24 60 00 00 	movq   $0x0,0x60(%rsp)
 22d:	00 00 
    case '%':
      //
      // Parse Flags and Width
      //
      for (Done = FALSE; !Done; ) {
        Format += BytesPerFormatCharacter;
 22f:	4c 03 74 24 40       	add    0x40(%rsp),%r14
        FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 234:	41 0f be 46 01       	movsbl 0x1(%r14),%eax
 239:	41 0f b6 16          	movzbl (%r14),%edx
 23d:	c1 e0 08             	shl    $0x8,%eax
 240:	09 d0                	or     %edx,%eax
 242:	48 98                	cltq   
 244:	48 23 44 24 58       	and    0x58(%rsp),%rax
        switch (FormatCharacter) {
 249:	48 83 f8 2d          	cmp    $0x2d,%rax
 24d:	0f 84 23 01 00 00    	je     376 <BasePrintLibSPrintMarker+0x376>
 253:	77 37                	ja     28c <BasePrintLibSPrintMarker+0x28c>
 255:	48 83 f8 2a          	cmp    $0x2a,%rax
 259:	0f 84 44 01 00 00    	je     3a3 <BasePrintLibSPrintMarker+0x3a3>
 25f:	77 15                	ja     276 <BasePrintLibSPrintMarker+0x276>
 261:	48 85 c0             	test   %rax,%rax
 264:	0f 84 e4 01 00 00    	je     44e <BasePrintLibSPrintMarker+0x44e>
 26a:	48 83 f8 20          	cmp    $0x20,%rax
 26e:	0f 84 14 01 00 00    	je     388 <BasePrintLibSPrintMarker+0x388>
 274:	eb 50                	jmp    2c6 <BasePrintLibSPrintMarker+0x2c6>
 276:	48 83 f8 2b          	cmp    $0x2b,%rax
 27a:	0f 84 ff 00 00 00    	je     37f <BasePrintLibSPrintMarker+0x37f>
 280:	48 83 f8 2c          	cmp    $0x2c,%rax
 284:	0f 84 07 01 00 00    	je     391 <BasePrintLibSPrintMarker+0x391>
 28a:	eb 3a                	jmp    2c6 <BasePrintLibSPrintMarker+0x2c6>
 28c:	48 83 f8 39          	cmp    $0x39,%rax
 290:	77 20                	ja     2b2 <BasePrintLibSPrintMarker+0x2b2>
 292:	48 83 f8 31          	cmp    $0x31,%rax
 296:	0f 83 55 01 00 00    	jae    3f1 <BasePrintLibSPrintMarker+0x3f1>
 29c:	48 83 f8 2e          	cmp    $0x2e,%rax
 2a0:	0f 84 c8 00 00 00    	je     36e <BasePrintLibSPrintMarker+0x36e>
 2a6:	48 83 f8 30          	cmp    $0x30,%rax
 2aa:	0f 84 33 01 00 00    	je     3e3 <BasePrintLibSPrintMarker+0x3e3>
 2b0:	eb 14                	jmp    2c6 <BasePrintLibSPrintMarker+0x2c6>
 2b2:	48 83 f8 4c          	cmp    $0x4c,%rax
 2b6:	0f 84 de 00 00 00    	je     39a <BasePrintLibSPrintMarker+0x39a>
 2bc:	48 83 f8 6c          	cmp    $0x6c,%rax
 2c0:	0f 84 d4 00 00 00    	je     39a <BasePrintLibSPrintMarker+0x39a>
      } 

      //
      // Handle each argument type
      //
      switch (FormatCharacter) {
 2c6:	48 83 f8 64          	cmp    $0x64,%rax
 2ca:	48 89 84 24 b8 00 00 	mov    %rax,0xb8(%rsp)
 2d1:	00 
 2d2:	0f 84 96 01 00 00    	je     46e <BasePrintLibSPrintMarker+0x46e>
 2d8:	77 48                	ja     322 <BasePrintLibSPrintMarker+0x322>
 2da:	48 83 f8 53          	cmp    $0x53,%rax
 2de:	0f 84 fd 02 00 00    	je     5e1 <BasePrintLibSPrintMarker+0x5e1>
 2e4:	77 19                	ja     2ff <BasePrintLibSPrintMarker+0x2ff>
 2e6:	48 83 f8 0a          	cmp    $0xa,%rax
 2ea:	0f 84 52 05 00 00    	je     842 <BasePrintLibSPrintMarker+0x842>
 2f0:	48 83 f8 0d          	cmp    $0xd,%rax
 2f4:	0f 84 f9 04 00 00    	je     7f3 <BasePrintLibSPrintMarker+0x7f3>
 2fa:	e9 7a 05 00 00       	jmpq   879 <BasePrintLibSPrintMarker+0x879>
 2ff:	48 83 f8 61          	cmp    $0x61,%rax
 303:	0f 84 db 02 00 00    	je     5e4 <BasePrintLibSPrintMarker+0x5e4>
 309:	48 83 f8 63          	cmp    $0x63,%rax
 30d:	0f 84 13 03 00 00    	je     626 <BasePrintLibSPrintMarker+0x626>
 313:	48 83 f8 58          	cmp    $0x58,%rax
 317:	0f 84 4a 01 00 00    	je     467 <BasePrintLibSPrintMarker+0x467>
 31d:	e9 57 05 00 00       	jmpq   879 <BasePrintLibSPrintMarker+0x879>
 322:	48 83 f8 72          	cmp    $0x72,%rax
 326:	0f 84 0f 04 00 00    	je     73b <BasePrintLibSPrintMarker+0x73b>
 32c:	77 21                	ja     34f <BasePrintLibSPrintMarker+0x34f>
 32e:	48 83 f8 67          	cmp    $0x67,%rax
 332:	0f 84 33 03 00 00    	je     66b <BasePrintLibSPrintMarker+0x66b>
 338:	48 83 f8 70          	cmp    $0x70,%rax
 33c:	0f 85 37 05 00 00    	jne    879 <BasePrintLibSPrintMarker+0x879>
      case 'p':
        //
        // Flag space, +, 0, L & l are invalid for type p.
        //
        Flags &= ~((UINTN) (PREFIX_BLANK | PREFIX_SIGN | PREFIX_ZERO | LONG_TYPE));
 342:	48 83 e3 c9          	and    $0xffffffffffffffc9,%rbx
        if (sizeof (VOID *) > 4) {
          Flags |= LONG_TYPE;
 346:	48 83 cb 10          	or     $0x10,%rbx
 34a:	e9 18 01 00 00       	jmpq   467 <BasePrintLibSPrintMarker+0x467>
      } 

      //
      // Handle each argument type
      //
      switch (FormatCharacter) {
 34f:	48 83 f8 74          	cmp    $0x74,%rax
 353:	0f 84 7e 03 00 00    	je     6d7 <BasePrintLibSPrintMarker+0x6d7>
 359:	0f 82 82 02 00 00    	jb     5e1 <BasePrintLibSPrintMarker+0x5e1>
 35f:	48 83 f8 78          	cmp    $0x78,%rax
 363:	0f 84 02 01 00 00    	je     46b <BasePrintLibSPrintMarker+0x46b>
 369:	e9 0b 05 00 00       	jmpq   879 <BasePrintLibSPrintMarker+0x879>
      for (Done = FALSE; !Done; ) {
        Format += BytesPerFormatCharacter;
        FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
        switch (FormatCharacter) {
        case '.': 
          Flags |= PRECISION; 
 36e:	80 cf 08             	or     $0x8,%bh
          break;
 371:	e9 b9 fe ff ff       	jmpq   22f <BasePrintLibSPrintMarker+0x22f>
        case '-': 
          Flags |= LEFT_JUSTIFY; 
 376:	48 83 cb 01          	or     $0x1,%rbx
          break;
 37a:	e9 b0 fe ff ff       	jmpq   22f <BasePrintLibSPrintMarker+0x22f>
        case '+': 
          Flags |= PREFIX_SIGN;  
 37f:	48 83 cb 02          	or     $0x2,%rbx
          break;
 383:	e9 a7 fe ff ff       	jmpq   22f <BasePrintLibSPrintMarker+0x22f>
        case ' ': 
          Flags |= PREFIX_BLANK; 
 388:	48 83 cb 04          	or     $0x4,%rbx
          break;
 38c:	e9 9e fe ff ff       	jmpq   22f <BasePrintLibSPrintMarker+0x22f>
        case ',': 
          Flags |= COMMA_TYPE; 
 391:	48 83 cb 08          	or     $0x8,%rbx
          break;
 395:	e9 95 fe ff ff       	jmpq   22f <BasePrintLibSPrintMarker+0x22f>
        case 'L':
        case 'l': 
          Flags |= LONG_TYPE;    
 39a:	48 83 cb 10          	or     $0x10,%rbx
          break;
 39e:	e9 8c fe ff ff       	jmpq   22f <BasePrintLibSPrintMarker+0x22f>
        case '*':
          if ((Flags & PRECISION) == 0) {
 3a3:	f6 c7 08             	test   $0x8,%bh
 3a6:	75 1d                	jne    3c5 <BasePrintLibSPrintMarker+0x3c5>
            Flags |= PAD_TO_WIDTH;
 3a8:	80 cf 02             	or     $0x2,%bh
            if (BaseListMarker == NULL) {
 3ab:	48 85 ed             	test   %rbp,%rbp
 3ae:	75 0a                	jne    3ba <BasePrintLibSPrintMarker+0x3ba>
              Width = VA_ARG (VaListMarker, UINTN);
 3b0:	49 8b 07             	mov    (%r15),%rax
 3b3:	48 89 44 24 60       	mov    %rax,0x60(%rsp)
 3b8:	eb 13                	jmp    3cd <BasePrintLibSPrintMarker+0x3cd>
            } else {
              Width = BASE_ARG (BaseListMarker, UINTN);
 3ba:	48 8b 45 00          	mov    0x0(%rbp),%rax
 3be:	48 89 44 24 60       	mov    %rax,0x60(%rsp)
 3c3:	eb 15                	jmp    3da <BasePrintLibSPrintMarker+0x3da>
            }
          } else {
            if (BaseListMarker == NULL) {
 3c5:	48 85 ed             	test   %rbp,%rbp
 3c8:	75 0c                	jne    3d6 <BasePrintLibSPrintMarker+0x3d6>
              Precision = VA_ARG (VaListMarker, UINTN);
 3ca:	4d 8b 17             	mov    (%r15),%r10
 3cd:	49 83 c7 08          	add    $0x8,%r15
 3d1:	e9 59 fe ff ff       	jmpq   22f <BasePrintLibSPrintMarker+0x22f>
            } else {
              Precision = BASE_ARG (BaseListMarker, UINTN);
 3d6:	4c 8b 55 00          	mov    0x0(%rbp),%r10
 3da:	48 83 c5 08          	add    $0x8,%rbp
 3de:	e9 4c fe ff ff       	jmpq   22f <BasePrintLibSPrintMarker+0x22f>
            }
          }
          break;
        case '0':
          if ((Flags & PRECISION) == 0) {
            Flags |= PREFIX_ZERO;
 3e3:	48 89 da             	mov    %rbx,%rdx
 3e6:	48 83 ca 20          	or     $0x20,%rdx
 3ea:	f6 c7 08             	test   $0x8,%bh
 3ed:	48 0f 44 da          	cmove  %rdx,%rbx
        case '5':
        case '6':
        case '7':
        case '8':
        case '9':
          for (Count = 0; ((FormatCharacter >= '0') &&  (FormatCharacter <= '9')); ){
 3f1:	48 c7 44 24 30 00 00 	movq   $0x0,0x30(%rsp)
 3f8:	00 00 
 3fa:	48 83 e8 30          	sub    $0x30,%rax
 3fe:	48 83 f8 09          	cmp    $0x9,%rax
 402:	77 2a                	ja     42e <BasePrintLibSPrintMarker+0x42e>
            Count = (Count * 10) + FormatCharacter - '0';
 404:	48 6b 54 24 30 0a    	imul   $0xa,0x30(%rsp),%rdx
            Format += BytesPerFormatCharacter;
 40a:	4c 03 74 24 40       	add    0x40(%rsp),%r14
        case '6':
        case '7':
        case '8':
        case '9':
          for (Count = 0; ((FormatCharacter >= '0') &&  (FormatCharacter <= '9')); ){
            Count = (Count * 10) + FormatCharacter - '0';
 40f:	48 01 d0             	add    %rdx,%rax
            Format += BytesPerFormatCharacter;
            FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 412:	41 0f b6 16          	movzbl (%r14),%edx
        case '6':
        case '7':
        case '8':
        case '9':
          for (Count = 0; ((FormatCharacter >= '0') &&  (FormatCharacter <= '9')); ){
            Count = (Count * 10) + FormatCharacter - '0';
 416:	48 89 44 24 30       	mov    %rax,0x30(%rsp)
            Format += BytesPerFormatCharacter;
            FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 41b:	41 0f be 46 01       	movsbl 0x1(%r14),%eax
 420:	c1 e0 08             	shl    $0x8,%eax
 423:	09 d0                	or     %edx,%eax
 425:	48 98                	cltq   
 427:	48 23 44 24 58       	and    0x58(%rsp),%rax
 42c:	eb cc                	jmp    3fa <BasePrintLibSPrintMarker+0x3fa>
          }
          Format -= BytesPerFormatCharacter;
 42e:	4c 2b 74 24 40       	sub    0x40(%rsp),%r14
          if ((Flags & PRECISION) == 0) {
 433:	f6 c7 08             	test   $0x8,%bh
 436:	0f 85 fd 0a 00 00    	jne    f39 <BasePrintLibSPrintMarker+0xf39>
 43c:	48 8b 44 24 30       	mov    0x30(%rsp),%rax
            Flags |= PAD_TO_WIDTH;
 441:	80 cf 02             	or     $0x2,%bh
 444:	48 89 44 24 60       	mov    %rax,0x60(%rsp)
 449:	e9 e1 fd ff ff       	jmpq   22f <BasePrintLibSPrintMarker+0x22f>
 44e:	48 c7 84 24 b8 00 00 	movq   $0x0,0xb8(%rsp)
 455:	00 00 00 00 00 
        case '\0':
          //
          // Make no output if Format string terminates unexpectedly when
          // looking up for flag, width, precision and type. 
          //
          Format   -= BytesPerFormatCharacter;
 45a:	4c 2b 74 24 40       	sub    0x40(%rsp),%r14
          Precision = 0;
 45f:	45 31 d2             	xor    %r10d,%r10d
 462:	e9 12 04 00 00       	jmpq   879 <BasePrintLibSPrintMarker+0x879>
        }
        //
        // break skipped on purpose
        //
      case 'X':
        Flags |= PREFIX_ZERO;
 467:	48 83 cb 20          	or     $0x20,%rbx
        //
        // break skipped on purpose
        //
      case 'x':
        Flags |= RADIX_HEX;
 46b:	80 cb 80             	or     $0x80,%bl
        //
        // break skipped on purpose
        //
      case 'd':
        if ((Flags & LONG_TYPE) == 0) {
 46e:	48 89 d8             	mov    %rbx,%rax
      } 

      //
      // Handle each argument type
      //
      switch (FormatCharacter) {
 471:	48 89 d9             	mov    %rbx,%rcx
        Flags |= RADIX_HEX;
        //
        // break skipped on purpose
        //
      case 'd':
        if ((Flags & LONG_TYPE) == 0) {
 474:	83 e0 10             	and    $0x10,%eax
 477:	75 10                	jne    489 <BasePrintLibSPrintMarker+0x489>
          // Specification for formatted strings.  It is recommended that the Base Types be used 
          // everywhere, but in this one case, compliance with ANSI C is more important, and 
          // provides an implementation that is compatible with that largest possible set of CPU 
          // architectures.  This is why the type "int" is used in this one case.
          //
          if (BaseListMarker == NULL) {
 479:	48 85 ed             	test   %rbp,%rbp
 47c:	75 05                	jne    483 <BasePrintLibSPrintMarker+0x483>
            Value = VA_ARG (VaListMarker, int);
 47e:	49 63 1f             	movslq (%r15),%rbx
 481:	eb 0e                	jmp    491 <BasePrintLibSPrintMarker+0x491>
          } else {
            Value = BASE_ARG (BaseListMarker, int);
 483:	48 63 5d 00          	movslq 0x0(%rbp),%rbx
 487:	eb 12                	jmp    49b <BasePrintLibSPrintMarker+0x49b>
          }
        } else {
          if (BaseListMarker == NULL) {
 489:	48 85 ed             	test   %rbp,%rbp
 48c:	75 09                	jne    497 <BasePrintLibSPrintMarker+0x497>
            Value = VA_ARG (VaListMarker, INT64);
 48e:	49 8b 1f             	mov    (%r15),%rbx
 491:	49 83 c7 08          	add    $0x8,%r15
 495:	eb 08                	jmp    49f <BasePrintLibSPrintMarker+0x49f>
          } else {
            Value = BASE_ARG (BaseListMarker, INT64);
 497:	48 8b 5d 00          	mov    0x0(%rbp),%rbx
 49b:	48 83 c5 08          	add    $0x8,%rbp
          }
        }
        if ((Flags & PREFIX_BLANK) != 0) {
 49f:	48 89 ca             	mov    %rcx,%rdx
 4a2:	83 e2 04             	and    $0x4,%edx
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 4a5:	48 83 fa 01          	cmp    $0x1,%rdx
        }
        if ((Flags & PREFIX_BLANK) != 0) {
          Prefix = ' ';
        }
        if ((Flags & PREFIX_SIGN) != 0) {
          Prefix = '+';
 4a9:	b2 2b                	mov    $0x2b,%dl
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 4ab:	45 19 e4             	sbb    %r12d,%r12d
 4ae:	41 f7 d4             	not    %r12d
 4b1:	41 83 e4 20          	and    $0x20,%r12d
        }
        if ((Flags & PREFIX_BLANK) != 0) {
          Prefix = ' ';
        }
        if ((Flags & PREFIX_SIGN) != 0) {
          Prefix = '+';
 4b5:	f6 c1 02             	test   $0x2,%cl
 4b8:	44 0f 45 e2          	cmovne %edx,%r12d
        }
        if ((Flags & COMMA_TYPE) != 0) {
          Comma = TRUE;
        }
        if ((Flags & RADIX_HEX) == 0) {
 4bc:	f6 c1 80             	test   $0x80,%cl
 4bf:	75 32                	jne    4f3 <BasePrintLibSPrintMarker+0x4f3>
          Prefix = ' ';
        }
        if ((Flags & PREFIX_SIGN) != 0) {
          Prefix = '+';
        }
        if ((Flags & COMMA_TYPE) != 0) {
 4c1:	49 89 c9             	mov    %rcx,%r9
 4c4:	49 c1 e9 03          	shr    $0x3,%r9
          Comma = TRUE;
        }
        if ((Flags & RADIX_HEX) == 0) {
          Radix = 10;
          if (Comma) {
 4c8:	44 88 c8             	mov    %r9b,%al
 4cb:	24 01                	and    $0x1,%al
 4cd:	88 44 24 53          	mov    %al,0x53(%rsp)
 4d1:	74 0a                	je     4dd <BasePrintLibSPrintMarker+0x4dd>
            Flags &= ~((UINTN) PREFIX_ZERO);
 4d3:	48 83 e1 df          	and    $0xffffffffffffffdf,%rcx
            Precision = 1;
 4d7:	41 ba 01 00 00 00    	mov    $0x1,%r10d
          }
          if (Value < 0) {
 4dd:	48 85 db             	test   %rbx,%rbx
        }
        if ((Flags & COMMA_TYPE) != 0) {
          Comma = TRUE;
        }
        if ((Flags & RADIX_HEX) == 0) {
          Radix = 10;
 4e0:	ba 0a 00 00 00       	mov    $0xa,%edx
          if (Comma) {
            Flags &= ~((UINTN) PREFIX_ZERO);
            Precision = 1;
          }
          if (Value < 0) {
 4e5:	79 22                	jns    509 <BasePrintLibSPrintMarker+0x509>
            Flags |= PREFIX_SIGN;
 4e7:	48 83 c9 02          	or     $0x2,%rcx
            Prefix = '-';
            Value = -Value;
 4eb:	48 f7 db             	neg    %rbx
            Flags &= ~((UINTN) PREFIX_ZERO);
            Precision = 1;
          }
          if (Value < 0) {
            Flags |= PREFIX_SIGN;
            Prefix = '-';
 4ee:	41 b4 2d             	mov    $0x2d,%r12b
 4f1:	eb 16                	jmp    509 <BasePrintLibSPrintMarker+0x509>
            Value = -Value;
          }
        } else {
          Radix = 16;
          Comma = FALSE;
          if ((Flags & LONG_TYPE) == 0 && Value < 0) {
 4f3:	48 85 c0             	test   %rax,%rax
 4f6:	75 07                	jne    4ff <BasePrintLibSPrintMarker+0x4ff>
 4f8:	48 85 db             	test   %rbx,%rbx
 4fb:	79 02                	jns    4ff <BasePrintLibSPrintMarker+0x4ff>
            // Specification for formatted strings.  It is recommended that the Base Types be used 
            // everywhere, but in this one case, compliance with ANSI C is more important, and 
            // provides an implementation that is compatible with that largest possible set of CPU 
            // architectures.  This is why the type "unsigned int" is used in this one case.
            //
            Value = (unsigned int)Value;
 4fd:	89 db                	mov    %ebx,%ebx
            Flags |= PREFIX_SIGN;
            Prefix = '-';
            Value = -Value;
          }
        } else {
          Radix = 16;
 4ff:	ba 10 00 00 00       	mov    $0x10,%edx
          Comma = FALSE;
 504:	c6 44 24 53 00       	movb   $0x0,0x53(%rsp)
 509:	4c 89 54 24 78       	mov    %r10,0x78(%rsp)
 50e:	48 89 4c 24 30       	mov    %rcx,0x30(%rsp)
          }
        }
        //
        // Convert Value to a reversed string
        //
        Count = BasePrintLibValueToString (ValueBuffer, Value, Radix) - ValueBuffer;
 513:	48 89 de             	mov    %rbx,%rsi
 516:	48 8d bc 24 da 00 00 	lea    0xda(%rsp),%rdi
 51d:	00 
 51e:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 525:	00 00 00 
 528:	ff d0                	callq  *%rax
        if (Value == 0 && Precision == 0) {
 52a:	4c 8b 54 24 78       	mov    0x78(%rsp),%r10
 52f:	48 8b 4c 24 30       	mov    0x30(%rsp),%rcx
 534:	4d 85 d2             	test   %r10,%r10
 537:	75 0e                	jne    547 <BasePrintLibSPrintMarker+0x547>
 539:	48 85 db             	test   %rbx,%rbx
          Count = 0;
 53c:	48 c7 44 24 30 00 00 	movq   $0x0,0x30(%rsp)
 543:	00 00 
        }
        //
        // Convert Value to a reversed string
        //
        Count = BasePrintLibValueToString (ValueBuffer, Value, Radix) - ValueBuffer;
        if (Value == 0 && Precision == 0) {
 545:	74 10                	je     557 <BasePrintLibSPrintMarker+0x557>
          }
        }
        //
        // Convert Value to a reversed string
        //
        Count = BasePrintLibValueToString (ValueBuffer, Value, Radix) - ValueBuffer;
 547:	48 8d b4 24 da 00 00 	lea    0xda(%rsp),%rsi
 54e:	00 
 54f:	48 29 f0             	sub    %rsi,%rax
 552:	48 89 44 24 30       	mov    %rax,0x30(%rsp)
        if (Value == 0 && Precision == 0) {
          Count = 0;
        }
        ArgumentString = (CHAR8 *)ValueBuffer + Count;
 557:	48 8b 44 24 30       	mov    0x30(%rsp),%rax
 55c:	4c 8d ac 24 da 00 00 	lea    0xda(%rsp),%r13
 563:	00 
        
        Digits = Count % 3;
 564:	be 03 00 00 00       	mov    $0x3,%esi
 569:	31 d2                	xor    %edx,%edx
        //
        Count = BasePrintLibValueToString (ValueBuffer, Value, Radix) - ValueBuffer;
        if (Value == 0 && Precision == 0) {
          Count = 0;
        }
        ArgumentString = (CHAR8 *)ValueBuffer + Count;
 56b:	49 01 c5             	add    %rax,%r13
        
        Digits = Count % 3;
 56e:	48 f7 f6             	div    %rsi
        if (Digits != 0) {
          Digits = 3 - Digits;
 571:	48 89 f0             	mov    %rsi,%rax
 574:	48 29 d0             	sub    %rdx,%rax
 577:	48 85 d2             	test   %rdx,%rdx
 57a:	48 0f 45 d0          	cmovne %rax,%rdx
        }
        if (Comma && Count != 0) {
 57e:	48 83 7c 24 30 00    	cmpq   $0x0,0x30(%rsp)
        }
        ArgumentString = (CHAR8 *)ValueBuffer + Count;
        
        Digits = Count % 3;
        if (Digits != 0) {
          Digits = 3 - Digits;
 584:	49 89 d3             	mov    %rdx,%r11
        }
        if (Comma && Count != 0) {
 587:	74 19                	je     5a2 <BasePrintLibSPrintMarker+0x5a2>
 589:	80 7c 24 53 00       	cmpb   $0x0,0x53(%rsp)
 58e:	74 12                	je     5a2 <BasePrintLibSPrintMarker+0x5a2>
          Count += ((Count - 1) / 3);
 590:	48 8b 44 24 30       	mov    0x30(%rsp),%rax
 595:	31 d2                	xor    %edx,%edx
 597:	48 ff c8             	dec    %rax
 59a:	48 f7 f6             	div    %rsi
 59d:	48 01 44 24 30       	add    %rax,0x30(%rsp)
        }
        if (Prefix != 0) {
 5a2:	45 84 e4             	test   %r12b,%r12b
 5a5:	74 08                	je     5af <BasePrintLibSPrintMarker+0x5af>
          Count++;
 5a7:	48 ff 44 24 30       	incq   0x30(%rsp)
          Precision++;
 5ac:	49 ff c2             	inc    %r10
        }
        Flags |= ARGUMENT_REVERSED;
 5af:	48 89 cb             	mov    %rcx,%rbx
        ZeroPad = TRUE;
 5b2:	41 b1 01             	mov    $0x1,%r9b
        }
        if (Prefix != 0) {
          Count++;
          Precision++;
        }
        Flags |= ARGUMENT_REVERSED;
 5b5:	80 cf 10             	or     $0x10,%bh
        ZeroPad = TRUE;
        if ((Flags & PREFIX_ZERO) != 0) {
 5b8:	f6 c1 20             	test   $0x20,%cl
 5bb:	0f 84 17 04 00 00    	je     9d8 <BasePrintLibSPrintMarker+0x9d8>
          if ((Flags & LEFT_JUSTIFY) == 0) {
 5c1:	f6 c1 01             	test   $0x1,%cl
 5c4:	0f 85 0e 04 00 00    	jne    9d8 <BasePrintLibSPrintMarker+0x9d8>
            if ((Flags & PAD_TO_WIDTH) != 0) {
 5ca:	f6 c5 02             	test   $0x2,%ch
 5cd:	0f 84 05 04 00 00    	je     9d8 <BasePrintLibSPrintMarker+0x9d8>
        if (Prefix != 0) {
          Count++;
          Precision++;
        }
        Flags |= ARGUMENT_REVERSED;
        ZeroPad = TRUE;
 5d3:	80 e5 08             	and    $0x8,%ch
 5d6:	4c 0f 44 54 24 60    	cmove  0x60(%rsp),%r10
 5dc:	e9 f7 03 00 00       	jmpq   9d8 <BasePrintLibSPrintMarker+0x9d8>
        }
        break;

      case 's':
      case 'S':
        Flags |= ARGUMENT_UNICODE;
 5e1:	80 cf 04             	or     $0x4,%bh
        //
        // break skipped on purpose
        //
      case 'a':
        if (BaseListMarker == NULL) {
 5e4:	48 85 ed             	test   %rbp,%rbp
 5e7:	75 09                	jne    5f2 <BasePrintLibSPrintMarker+0x5f2>
          ArgumentString = VA_ARG (VaListMarker, CHAR8 *);
 5e9:	4d 8b 2f             	mov    (%r15),%r13
 5ec:	49 83 c7 08          	add    $0x8,%r15
 5f0:	eb 08                	jmp    5fa <BasePrintLibSPrintMarker+0x5fa>
        } else {
          ArgumentString = BASE_ARG (BaseListMarker, CHAR8 *);
 5f2:	4c 8b 6d 00          	mov    0x0(%rbp),%r13
 5f6:	48 83 c5 08          	add    $0x8,%rbp
        }
        if (ArgumentString == NULL) {
 5fa:	4d 85 ed             	test   %r13,%r13
 5fd:	75 0d                	jne    60c <BasePrintLibSPrintMarker+0x60c>
          Flags &= ~((UINTN) ARGUMENT_UNICODE);
 5ff:	80 e7 fb             	and    $0xfb,%bh
          ArgumentString = "<null string>";
 602:	49 bd 00 00 00 00 00 	movabs $0x0,%r13
 609:	00 00 00 
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 60c:	45 31 db             	xor    %r11d,%r11d
 60f:	45 31 c9             	xor    %r9d,%r9d
 612:	45 31 e4             	xor    %r12d,%r12d
 615:	f6 c7 08             	test   $0x8,%bh
 618:	c6 44 24 53 00       	movb   $0x0,0x53(%rsp)
 61d:	4d 0f 44 d3          	cmove  %r11,%r10
 621:	e9 b2 03 00 00       	jmpq   9d8 <BasePrintLibSPrintMarker+0x9d8>
          Precision = 0;
        }
        break;

      case 'c':
        if (BaseListMarker == NULL) {
 626:	48 85 ed             	test   %rbp,%rbp
 629:	75 12                	jne    63d <BasePrintLibSPrintMarker+0x63d>
          Character = VA_ARG (VaListMarker, UINTN) & 0xffff;
 62b:	41 0f b7 07          	movzwl (%r15),%eax
 62f:	49 83 c7 08          	add    $0x8,%r15
 633:	48 89 84 24 c0 00 00 	mov    %rax,0xc0(%rsp)
 63a:	00 
 63b:	eb 10                	jmp    64d <BasePrintLibSPrintMarker+0x64d>
        } else {
          Character = BASE_ARG (BaseListMarker, UINTN) & 0xffff;
 63d:	0f b7 45 00          	movzwl 0x0(%rbp),%eax
 641:	48 83 c5 08          	add    $0x8,%rbp
 645:	48 89 84 24 c0 00 00 	mov    %rax,0xc0(%rsp)
 64c:	00 
        }
        ArgumentString = (CHAR8 *)&Character;
        Flags |= ARGUMENT_UNICODE;
 64d:	80 cf 04             	or     $0x4,%bh
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 650:	45 31 db             	xor    %r11d,%r11d
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
 653:	c6 44 24 53 00       	movb   $0x0,0x53(%rsp)
    ZeroPad   = FALSE;
 658:	45 31 c9             	xor    %r9d,%r9d
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 65b:	45 31 e4             	xor    %r12d,%r12d
        if (BaseListMarker == NULL) {
          Character = VA_ARG (VaListMarker, UINTN) & 0xffff;
        } else {
          Character = BASE_ARG (BaseListMarker, UINTN) & 0xffff;
        }
        ArgumentString = (CHAR8 *)&Character;
 65e:	4c 8d ac 24 c0 00 00 	lea    0xc0(%rsp),%r13
 665:	00 
        Flags |= ARGUMENT_UNICODE;
        break;
 666:	e9 6d 03 00 00       	jmpq   9d8 <BasePrintLibSPrintMarker+0x9d8>

      case 'g':
        if (BaseListMarker == NULL) {
 66b:	48 85 ed             	test   %rbp,%rbp
 66e:	75 09                	jne    679 <BasePrintLibSPrintMarker+0x679>
          TmpGuid = VA_ARG (VaListMarker, GUID *);
 670:	4d 8b 27             	mov    (%r15),%r12
 673:	49 83 c7 08          	add    $0x8,%r15
 677:	eb 08                	jmp    681 <BasePrintLibSPrintMarker+0x681>
        } else {
          TmpGuid = BASE_ARG (BaseListMarker, GUID *);
 679:	4c 8b 65 00          	mov    0x0(%rbp),%r12
 67d:	48 83 c5 08          	add    $0x8,%rbp
        }
        if (TmpGuid == NULL) {
 681:	4d 85 e4             	test   %r12,%r12
 684:	0f 84 c0 02 00 00    	je     94a <BasePrintLibSPrintMarker+0x94a>
 68a:	4c 89 54 24 78       	mov    %r10,0x78(%rsp)
          ArgumentString = "<null guid>";
        } else {
          GuidData1 = ReadUnaligned32 (&(TmpGuid->Data1));
 68f:	4c 89 e1             	mov    %r12,%rcx
          GuidData2 = ReadUnaligned16 (&(TmpGuid->Data2));
 692:	49 bd 00 00 00 00 00 	movabs $0x0,%r13
 699:	00 00 00 
          TmpGuid = BASE_ARG (BaseListMarker, GUID *);
        }
        if (TmpGuid == NULL) {
          ArgumentString = "<null guid>";
        } else {
          GuidData1 = ReadUnaligned32 (&(TmpGuid->Data1));
 69c:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 6a3:	00 00 00 
 6a6:	ff d0                	callq  *%rax
          GuidData2 = ReadUnaligned16 (&(TmpGuid->Data2));
 6a8:	49 8d 4c 24 04       	lea    0x4(%r12),%rcx
 6ad:	41 ff d5             	callq  *%r13
          GuidData3 = ReadUnaligned16 (&(TmpGuid->Data3));
 6b0:	49 8d 4c 24 06       	lea    0x6(%r12),%rcx
 6b5:	41 ff d5             	callq  *%r13
 6b8:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 6bf:	00 00 00 
{
  VA_LIST  Marker;
  UINTN    NumberOfPrinted;

  VA_START (Marker, FormatString);
  NumberOfPrinted = BasePrintLibSPrintMarker (StartOfBuffer, BufferSize, Flags, FormatString, Marker, NULL);
 6c2:	45 31 c9             	xor    %r9d,%r9d
 6c5:	4c 8d 84 24 d8 00 00 	lea    0xd8(%rsp),%r8
 6cc:	00 
 6cd:	48 89 84 24 d0 00 00 	mov    %rax,0xd0(%rsp)
 6d4:	00 
 6d5:	eb 41                	jmp    718 <BasePrintLibSPrintMarker+0x718>
          ArgumentString = ValueBuffer;
        }
        break;

      case 't':
        if (BaseListMarker == NULL) {
 6d7:	48 85 ed             	test   %rbp,%rbp
 6da:	75 09                	jne    6e5 <BasePrintLibSPrintMarker+0x6e5>
          TmpTime = VA_ARG (VaListMarker, TIME *); 
 6dc:	49 8b 07             	mov    (%r15),%rax
 6df:	49 83 c7 08          	add    $0x8,%r15
 6e3:	eb 08                	jmp    6ed <BasePrintLibSPrintMarker+0x6ed>
        } else {
          TmpTime = BASE_ARG (BaseListMarker, TIME *); 
 6e5:	48 8b 45 00          	mov    0x0(%rbp),%rax
 6e9:	48 83 c5 08          	add    $0x8,%rbp
        }
        if (TmpTime == NULL) {
 6ed:	48 85 c0             	test   %rax,%rax
 6f0:	0f 84 6e 02 00 00    	je     964 <BasePrintLibSPrintMarker+0x964>
 6f6:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 6fd:	00 00 00 
{
  VA_LIST  Marker;
  UINTN    NumberOfPrinted;

  VA_START (Marker, FormatString);
  NumberOfPrinted = BasePrintLibSPrintMarker (StartOfBuffer, BufferSize, Flags, FormatString, Marker, NULL);
 700:	4c 8d 84 24 d0 00 00 	lea    0xd0(%rsp),%r8
 707:	00 
 708:	4c 89 54 24 78       	mov    %r10,0x78(%rsp)
 70d:	48 89 84 24 c8 00 00 	mov    %rax,0xc8(%rsp)
 714:	00 
 715:	45 31 c9             	xor    %r9d,%r9d
 718:	48 89 c1             	mov    %rax,%rcx
 71b:	31 d2                	xor    %edx,%edx
 71d:	be 26 00 00 00       	mov    $0x26,%esi
 722:	48 8d bc 24 da 00 00 	lea    0xda(%rsp),%rdi
 729:	00 
 72a:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 731:	00 00 00 
 734:	ff d0                	callq  *%rax
 736:	e9 98 00 00 00       	jmpq   7d3 <BasePrintLibSPrintMarker+0x7d3>
          ArgumentString = ValueBuffer;
        }
        break;

      case 'r':
        if (BaseListMarker == NULL) {
 73b:	48 85 ed             	test   %rbp,%rbp
 73e:	75 09                	jne    749 <BasePrintLibSPrintMarker+0x749>
          Status = VA_ARG (VaListMarker, RETURN_STATUS);
 740:	49 8b 07             	mov    (%r15),%rax
 743:	49 83 c7 08          	add    $0x8,%r15
 747:	eb 08                	jmp    751 <BasePrintLibSPrintMarker+0x751>
        } else {
          Status = BASE_ARG (BaseListMarker, RETURN_STATUS);
 749:	48 8b 45 00          	mov    0x0(%rbp),%rax
 74d:	48 83 c5 08          	add    $0x8,%rbp
        }
        ArgumentString = ValueBuffer;
        if (RETURN_ERROR (Status)) {
 751:	48 85 c0             	test   %rax,%rax
 754:	79 28                	jns    77e <BasePrintLibSPrintMarker+0x77e>
          //
          // Clear error bit
          //
          Index = Status & ~MAX_BIT;
 756:	48 ba ff ff ff ff ff 	movabs $0x7fffffffffffffff,%rdx
 75d:	ff ff 7f 
 760:	48 21 c2             	and    %rax,%rdx
          if (Index > 0 && Index <= ERROR_STATUS_NUMBER) {
 763:	48 8d 4a ff          	lea    -0x1(%rdx),%rcx
 767:	48 83 f9 20          	cmp    $0x20,%rcx
 76b:	77 36                	ja     7a3 <BasePrintLibSPrintMarker+0x7a3>
            ArgumentString = mStatusString [Index + WARNING_STATUS_NUMBER];
 76d:	48 b9 00 00 00 00 00 	movabs $0x0,%rcx
 774:	00 00 00 
 777:	4c 8b 6c d1 28       	mov    0x28(%rcx,%rdx,8),%r13
 77c:	eb 14                	jmp    792 <BasePrintLibSPrintMarker+0x792>
          }
        } else {
          Index = Status;
          if (Index <= WARNING_STATUS_NUMBER) {
 77e:	48 83 f8 05          	cmp    $0x5,%rax
 782:	77 1f                	ja     7a3 <BasePrintLibSPrintMarker+0x7a3>
            ArgumentString = mStatusString [Index];
 784:	48 ba 00 00 00 00 00 	movabs $0x0,%rdx
 78b:	00 00 00 
 78e:	4c 8b 2c c2          	mov    (%rdx,%rax,8),%r13
          }
        }
        if (ArgumentString == ValueBuffer) {
 792:	48 8d b4 24 da 00 00 	lea    0xda(%rsp),%rsi
 799:	00 
 79a:	49 39 f5             	cmp    %rsi,%r13
 79d:	0f 85 db 01 00 00    	jne    97e <BasePrintLibSPrintMarker+0x97e>
          BasePrintLibSPrint ((CHAR8 *) ValueBuffer, MAXIMUM_VALUE_CHARACTERS, 0, "%08X", Status);
 7a3:	48 89 44 24 20       	mov    %rax,0x20(%rsp)
 7a8:	4c 89 54 24 78       	mov    %r10,0x78(%rsp)
 7ad:	49 b9 00 00 00 00 00 	movabs $0x0,%r9
 7b4:	00 00 00 
 7b7:	45 31 c0             	xor    %r8d,%r8d
 7ba:	ba 26 00 00 00       	mov    $0x26,%edx
 7bf:	48 8d 8c 24 da 00 00 	lea    0xda(%rsp),%rcx
 7c6:	00 
 7c7:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 7ce:	00 00 00 
 7d1:	ff d0                	callq  *%rax
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 7d3:	45 31 db             	xor    %r11d,%r11d
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
 7d6:	c6 44 24 53 00       	movb   $0x0,0x53(%rsp)
    ZeroPad   = FALSE;
 7db:	45 31 c9             	xor    %r9d,%r9d
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 7de:	45 31 e4             	xor    %r12d,%r12d
          if (Index <= WARNING_STATUS_NUMBER) {
            ArgumentString = mStatusString [Index];
          }
        }
        if (ArgumentString == ValueBuffer) {
          BasePrintLibSPrint ((CHAR8 *) ValueBuffer, MAXIMUM_VALUE_CHARACTERS, 0, "%08X", Status);
 7e1:	4c 8d ac 24 da 00 00 	lea    0xda(%rsp),%r13
 7e8:	00 
 7e9:	4c 8b 54 24 78       	mov    0x78(%rsp),%r10
 7ee:	e9 e5 01 00 00       	jmpq   9d8 <BasePrintLibSPrintMarker+0x9d8>
        }
        break;

      case '\r':
        Format += BytesPerFormatCharacter;
 7f3:	48 8b 7c 24 40       	mov    0x40(%rsp),%rdi
 7f8:	49 01 fe             	add    %rdi,%r14
        FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 7fb:	41 0f be 46 01       	movsbl 0x1(%r14),%eax
 800:	41 0f b6 16          	movzbl (%r14),%edx
 804:	c1 e0 08             	shl    $0x8,%eax
 807:	09 d0                	or     %edx,%eax
 809:	48 98                	cltq   
 80b:	48 23 44 24 58       	and    0x58(%rsp),%rax
        if (FormatCharacter == '\n') {
 810:	48 83 f8 0a          	cmp    $0xa,%rax
        }
        break;

      case '\r':
        Format += BytesPerFormatCharacter;
        FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 814:	48 89 84 24 b8 00 00 	mov    %rax,0xb8(%rsp)
 81b:	00 
        if (FormatCharacter == '\n') {
 81c:	0f 84 6c 01 00 00    	je     98e <BasePrintLibSPrintMarker+0x98e>
        } else {
          //
          // Translate '\r' to '\r'
          //
          ArgumentString = "\r";
          Format   -= BytesPerFormatCharacter;
 822:	49 29 fe             	sub    %rdi,%r14
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 825:	45 31 db             	xor    %r11d,%r11d
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
 828:	c6 44 24 53 00       	movb   $0x0,0x53(%rsp)
    ZeroPad   = FALSE;
 82d:	45 31 c9             	xor    %r9d,%r9d
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 830:	45 31 e4             	xor    %r12d,%r12d
          ArgumentString = "\r\n";
        } else {
          //
          // Translate '\r' to '\r'
          //
          ArgumentString = "\r";
 833:	49 bd 00 00 00 00 00 	movabs $0x0,%r13
 83a:	00 00 00 
 83d:	e9 96 01 00 00       	jmpq   9d8 <BasePrintLibSPrintMarker+0x9d8>
      case '\n':
        //
        // Translate '\n' to '\r\n' and '\n\r' to '\r\n'
        //
        ArgumentString = "\r\n";
        Format += BytesPerFormatCharacter;
 842:	48 8b 74 24 40       	mov    0x40(%rsp),%rsi
 847:	49 01 f6             	add    %rsi,%r14
        FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 84a:	41 0f be 46 01       	movsbl 0x1(%r14),%eax
 84f:	41 0f b6 16          	movzbl (%r14),%edx
 853:	c1 e0 08             	shl    $0x8,%eax
 856:	09 d0                	or     %edx,%eax
 858:	48 98                	cltq   
 85a:	48 23 44 24 58       	and    0x58(%rsp),%rax
        if (FormatCharacter != '\r') {
 85f:	48 83 f8 0d          	cmp    $0xd,%rax
        //
        // Translate '\n' to '\r\n' and '\n\r' to '\r\n'
        //
        ArgumentString = "\r\n";
        Format += BytesPerFormatCharacter;
        FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 863:	48 89 84 24 b8 00 00 	mov    %rax,0xb8(%rsp)
 86a:	00 
        if (FormatCharacter != '\r') {
 86b:	0f 84 1d 01 00 00    	je     98e <BasePrintLibSPrintMarker+0x98e>
          Format   -= BytesPerFormatCharacter;
 871:	49 29 f6             	sub    %rsi,%r14
 874:	e9 15 01 00 00       	jmpq   98e <BasePrintLibSPrintMarker+0x98e>
      default:
        //
        // if the type is '%' or unknown, then print it to the screen
        //
        ArgumentString = (CHAR8 *)&FormatCharacter;
        Flags |= ARGUMENT_UNICODE;
 879:	80 cf 04             	or     $0x4,%bh
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 87c:	45 31 db             	xor    %r11d,%r11d
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
 87f:	c6 44 24 53 00       	movb   $0x0,0x53(%rsp)
    ZeroPad   = FALSE;
 884:	45 31 c9             	xor    %r9d,%r9d
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 887:	45 31 e4             	xor    %r12d,%r12d
      case '%':
      default:
        //
        // if the type is '%' or unknown, then print it to the screen
        //
        ArgumentString = (CHAR8 *)&FormatCharacter;
 88a:	4c 8d ac 24 b8 00 00 	lea    0xb8(%rsp),%r13
 891:	00 
        Flags |= ARGUMENT_UNICODE;
        break;
 892:	e9 41 01 00 00       	jmpq   9d8 <BasePrintLibSPrintMarker+0x9d8>
      }
      break;
 
    case '\r':
      Format += BytesPerFormatCharacter;
 897:	48 8b 7c 24 40       	mov    0x40(%rsp),%rdi
 89c:	49 01 fe             	add    %rdi,%r14
      FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 89f:	41 0f be 46 01       	movsbl 0x1(%r14),%eax
 8a4:	41 0f b6 16          	movzbl (%r14),%edx
 8a8:	c1 e0 08             	shl    $0x8,%eax
 8ab:	09 d0                	or     %edx,%eax
 8ad:	48 98                	cltq   
 8af:	48 23 44 24 58       	and    0x58(%rsp),%rax
      if (FormatCharacter == '\n') {
 8b4:	48 83 f8 0a          	cmp    $0xa,%rax
      }
      break;
 
    case '\r':
      Format += BytesPerFormatCharacter;
      FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 8b8:	48 89 84 24 b8 00 00 	mov    %rax,0xb8(%rsp)
 8bf:	00 
      if (FormatCharacter == '\n') {
 8c0:	0f 84 e2 00 00 00    	je     9a8 <BasePrintLibSPrintMarker+0x9a8>
      } else {
        //
        // Translate '\r' to '\r'
        //
        ArgumentString = "\r";
        Format   -= BytesPerFormatCharacter;
 8c6:	49 29 fe             	sub    %rdi,%r14
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 8c9:	45 31 db             	xor    %r11d,%r11d
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
 8cc:	c6 44 24 53 00       	movb   $0x0,0x53(%rsp)
    ZeroPad   = FALSE;
 8d1:	45 31 c9             	xor    %r9d,%r9d
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 8d4:	45 31 e4             	xor    %r12d,%r12d
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
 8d7:	48 c7 44 24 30 00 00 	movq   $0x0,0x30(%rsp)
 8de:	00 00 
        ArgumentString = "\r\n";
      } else {
        //
        // Translate '\r' to '\r'
        //
        ArgumentString = "\r";
 8e0:	49 bd 00 00 00 00 00 	movabs $0x0,%r13
 8e7:	00 00 00 
 8ea:	e9 da 00 00 00       	jmpq   9c9 <BasePrintLibSPrintMarker+0x9c9>
    case '\n':
      //
      // Translate '\n' to '\r\n' and '\n\r' to '\r\n'
      //
      ArgumentString = "\r\n";
      Format += BytesPerFormatCharacter;
 8ef:	48 8b 74 24 40       	mov    0x40(%rsp),%rsi
 8f4:	49 01 f6             	add    %rsi,%r14
      FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 8f7:	41 0f be 46 01       	movsbl 0x1(%r14),%eax
 8fc:	41 0f b6 16          	movzbl (%r14),%edx
 900:	c1 e0 08             	shl    $0x8,%eax
 903:	09 d0                	or     %edx,%eax
 905:	48 98                	cltq   
 907:	48 23 44 24 58       	and    0x58(%rsp),%rax
      if (FormatCharacter != '\r') {
 90c:	48 83 f8 0d          	cmp    $0xd,%rax
      //
      // Translate '\n' to '\r\n' and '\n\r' to '\r\n'
      //
      ArgumentString = "\r\n";
      Format += BytesPerFormatCharacter;
      FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 910:	48 89 84 24 b8 00 00 	mov    %rax,0xb8(%rsp)
 917:	00 
      if (FormatCharacter != '\r') {
 918:	0f 84 8a 00 00 00    	je     9a8 <BasePrintLibSPrintMarker+0x9a8>
        Format   -= BytesPerFormatCharacter;
 91e:	49 29 f6             	sub    %rsi,%r14
 921:	e9 82 00 00 00       	jmpq   9a8 <BasePrintLibSPrintMarker+0x9a8>
      }
      break;

    default:
      ArgumentString = (CHAR8 *)&FormatCharacter;
      Flags |= ARGUMENT_UNICODE;
 926:	80 cf 04             	or     $0x4,%bh
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 929:	45 31 db             	xor    %r11d,%r11d
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
 92c:	c6 44 24 53 00       	movb   $0x0,0x53(%rsp)
    ZeroPad   = FALSE;
 931:	45 31 c9             	xor    %r9d,%r9d
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 934:	45 31 e4             	xor    %r12d,%r12d
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
 937:	48 c7 44 24 30 00 00 	movq   $0x0,0x30(%rsp)
 93e:	00 00 
        Format   -= BytesPerFormatCharacter;
      }
      break;

    default:
      ArgumentString = (CHAR8 *)&FormatCharacter;
 940:	4c 8d ac 24 b8 00 00 	lea    0xb8(%rsp),%r13
 947:	00 
 948:	eb 7f                	jmp    9c9 <BasePrintLibSPrintMarker+0x9c9>
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 94a:	45 31 db             	xor    %r11d,%r11d
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
 94d:	c6 44 24 53 00       	movb   $0x0,0x53(%rsp)
    ZeroPad   = FALSE;
 952:	45 31 c9             	xor    %r9d,%r9d
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 955:	45 31 e4             	xor    %r12d,%r12d
          TmpGuid = VA_ARG (VaListMarker, GUID *);
        } else {
          TmpGuid = BASE_ARG (BaseListMarker, GUID *);
        }
        if (TmpGuid == NULL) {
          ArgumentString = "<null guid>";
 958:	49 bd 00 00 00 00 00 	movabs $0x0,%r13
 95f:	00 00 00 
 962:	eb 74                	jmp    9d8 <BasePrintLibSPrintMarker+0x9d8>
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 964:	45 31 db             	xor    %r11d,%r11d
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
 967:	c6 44 24 53 00       	movb   $0x0,0x53(%rsp)
    ZeroPad   = FALSE;
 96c:	45 31 c9             	xor    %r9d,%r9d
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 96f:	45 31 e4             	xor    %r12d,%r12d
          TmpTime = VA_ARG (VaListMarker, TIME *); 
        } else {
          TmpTime = BASE_ARG (BaseListMarker, TIME *); 
        }
        if (TmpTime == NULL) {
          ArgumentString = "<null time>";
 972:	49 bd 00 00 00 00 00 	movabs $0x0,%r13
 979:	00 00 00 
 97c:	eb 5a                	jmp    9d8 <BasePrintLibSPrintMarker+0x9d8>
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 97e:	45 31 db             	xor    %r11d,%r11d
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
 981:	c6 44 24 53 00       	movb   $0x0,0x53(%rsp)
    ZeroPad   = FALSE;
 986:	45 31 c9             	xor    %r9d,%r9d
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 989:	45 31 e4             	xor    %r12d,%r12d
 98c:	eb 4a                	jmp    9d8 <BasePrintLibSPrintMarker+0x9d8>
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 98e:	45 31 db             	xor    %r11d,%r11d
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
 991:	c6 44 24 53 00       	movb   $0x0,0x53(%rsp)
    ZeroPad   = FALSE;
 996:	45 31 c9             	xor    %r9d,%r9d
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 999:	45 31 e4             	xor    %r12d,%r12d

      case '\n':
        //
        // Translate '\n' to '\r\n' and '\n\r' to '\r\n'
        //
        ArgumentString = "\r\n";
 99c:	49 bd 00 00 00 00 00 	movabs $0x0,%r13
 9a3:	00 00 00 
 9a6:	eb 30                	jmp    9d8 <BasePrintLibSPrintMarker+0x9d8>
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
    Digits    = 0;
 9a8:	45 31 db             	xor    %r11d,%r11d
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
    Comma     = FALSE;
 9ab:	c6 44 24 53 00       	movb   $0x0,0x53(%rsp)
    ZeroPad   = FALSE;
 9b0:	45 31 c9             	xor    %r9d,%r9d
    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
    Prefix    = 0;
 9b3:	45 31 e4             	xor    %r12d,%r12d
    Comma     = FALSE;
    ZeroPad   = FALSE;
    Count     = 0;
 9b6:	48 c7 44 24 30 00 00 	movq   $0x0,0x30(%rsp)
 9bd:	00 00 

    case '\n':
      //
      // Translate '\n' to '\r\n' and '\n\r' to '\r\n'
      //
      ArgumentString = "\r\n";
 9bf:	49 bd 00 00 00 00 00 	movabs $0x0,%r13
 9c6:	00 00 00 

    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
    Precision = 1;
 9c9:	41 ba 01 00 00 00    	mov    $0x1,%r10d
    Flags &= (UINTN) (OUTPUT_UNICODE | FORMAT_UNICODE | COUNT_ONLY_NO_PRINT);

    //
    // Set the default width to zero, and the default precision to 1
    //
    Width     = 0;
 9cf:	48 c7 44 24 60 00 00 	movq   $0x0,0x60(%rsp)
 9d6:	00 00 
    }

    //
    // Retrieve the ArgumentString attriubutes
    //
    if ((Flags & ARGUMENT_UNICODE) != 0) {
 9d8:	48 89 d8             	mov    %rbx,%rax
 9db:	25 00 04 00 00       	and    $0x400,%eax
      ArgumentMask = 0xffff;
      BytesPerArgumentCharacter = 2;
 9e0:	48 83 f8 01          	cmp    $0x1,%rax
 9e4:	48 19 f6             	sbb    %rsi,%rsi
 9e7:	48 89 74 24 78       	mov    %rsi,0x78(%rsp)
 9ec:	48 81 64 24 78 00 01 	andq   $0xffffffffffff0100,0x78(%rsp)
 9f3:	ff ff 
 9f5:	48 89 b4 24 80 00 00 	mov    %rsi,0x80(%rsp)
 9fc:	00 
 9fd:	48 81 44 24 78 ff ff 	addq   $0xffff,0x78(%rsp)
 a04:	00 00 
 a06:	48 83 84 24 80 00 00 	addq   $0x2,0x80(%rsp)
 a0d:	00 02 
    } else {
      ArgumentMask = 0xff;
      BytesPerArgumentCharacter = 1;
    }
    if ((Flags & ARGUMENT_REVERSED) != 0) {
 a0f:	f6 c7 10             	test   $0x10,%bh
 a12:	75 17                	jne    a2b <BasePrintLibSPrintMarker+0xa2b>
    } else {
      //
      // Compute the number of characters in ArgumentString and store it in Count
      // ArgumentString is either null-terminated, or it contains Precision characters
      //
      for (Count = 0; Count < Precision || ((Flags & PRECISION) == 0); Count++) {
 a14:	48 89 de             	mov    %rbx,%rsi
 a17:	4c 89 ea             	mov    %r13,%rdx
      BytesPerArgumentCharacter = 2;
    } else {
      ArgumentMask = 0xff;
      BytesPerArgumentCharacter = 1;
    }
    if ((Flags & ARGUMENT_REVERSED) != 0) {
 a1a:	48 c7 44 24 30 00 00 	movq   $0x0,0x30(%rsp)
 a21:	00 00 
    } else {
      //
      // Compute the number of characters in ArgumentString and store it in Count
      // ArgumentString is either null-terminated, or it contains Precision characters
      //
      for (Count = 0; Count < Precision || ((Flags & PRECISION) == 0); Count++) {
 a23:	81 e6 00 08 00 00    	and    $0x800,%esi
 a29:	eb 34                	jmp    a5f <BasePrintLibSPrintMarker+0xa5f>
    } else {
      ArgumentMask = 0xff;
      BytesPerArgumentCharacter = 1;
    }
    if ((Flags & ARGUMENT_REVERSED) != 0) {
      BytesPerArgumentCharacter = -BytesPerArgumentCharacter;
 a2b:	48 f7 9c 24 80 00 00 	negq   0x80(%rsp)
 a32:	00 
 a33:	eb 33                	jmp    a68 <BasePrintLibSPrintMarker+0xa68>
    } else {
      //
      // Compute the number of characters in ArgumentString and store it in Count
      // ArgumentString is either null-terminated, or it contains Precision characters
      //
      for (Count = 0; Count < Precision || ((Flags & PRECISION) == 0); Count++) {
 a35:	48 85 f6             	test   %rsi,%rsi
 a38:	75 2e                	jne    a68 <BasePrintLibSPrintMarker+0xa68>
 a3a:	48 89 d1             	mov    %rdx,%rcx
 a3d:	48 03 94 24 80 00 00 	add    0x80(%rsp),%rdx
 a44:	00 
        ArgumentCharacter = ((ArgumentString[Count * BytesPerArgumentCharacter] & 0xff) | ((ArgumentString[Count * BytesPerArgumentCharacter + 1]) << 8)) & ArgumentMask;
 a45:	0f be 41 01          	movsbl 0x1(%rcx),%eax
 a49:	0f b6 09             	movzbl (%rcx),%ecx
 a4c:	c1 e0 08             	shl    $0x8,%eax
 a4f:	09 c8                	or     %ecx,%eax
 a51:	48 98                	cltq   
        if (ArgumentCharacter == 0) {
 a53:	48 85 44 24 78       	test   %rax,0x78(%rsp)
 a58:	74 0e                	je     a68 <BasePrintLibSPrintMarker+0xa68>
    } else {
      //
      // Compute the number of characters in ArgumentString and store it in Count
      // ArgumentString is either null-terminated, or it contains Precision characters
      //
      for (Count = 0; Count < Precision || ((Flags & PRECISION) == 0); Count++) {
 a5a:	48 ff 44 24 30       	incq   0x30(%rsp)
 a5f:	4c 39 54 24 30       	cmp    %r10,0x30(%rsp)
 a64:	72 d4                	jb     a3a <BasePrintLibSPrintMarker+0xa3a>
 a66:	eb cd                	jmp    a35 <BasePrintLibSPrintMarker+0xa35>
 a68:	48 8b 44 24 30       	mov    0x30(%rsp),%rax
 a6d:	4c 39 d0             	cmp    %r10,%rax
 a70:	4c 0f 43 d0          	cmovae %rax,%r10
    }

    //
    // Pad before the string
    //
    if ((Flags & (PAD_TO_WIDTH | LEFT_JUSTIFY)) == (PAD_TO_WIDTH)) {
 a74:	48 89 d8             	mov    %rbx,%rax
 a77:	25 01 02 00 00       	and    $0x201,%eax
 a7c:	4c 89 94 24 88 00 00 	mov    %r10,0x88(%rsp)
 a83:	00 
 a84:	48 3d 00 02 00 00    	cmp    $0x200,%rax
 a8a:	48 89 84 24 98 00 00 	mov    %rax,0x98(%rsp)
 a91:	00 
 a92:	75 73                	jne    b07 <BasePrintLibSPrintMarker+0xb07>
      LengthToReturn += ((Width - Precision) * BytesPerOutputCharacter);
 a94:	48 8b 54 24 60       	mov    0x60(%rsp),%rdx
 a99:	44 8b 44 24 54       	mov    0x54(%rsp),%r8d
 a9e:	4c 29 d2             	sub    %r10,%rdx
 aa1:	48 89 d0             	mov    %rdx,%rax
 aa4:	49 0f af c0          	imul   %r8,%rax
 aa8:	48 01 44 24 68       	add    %rax,0x68(%rsp)
      if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
 aad:	f6 c7 20             	test   $0x20,%bh
 ab0:	75 55                	jne    b07 <BasePrintLibSPrintMarker+0xb07>
 ab2:	80 bc 24 90 00 00 00 	cmpb   $0x0,0x90(%rsp)
 ab9:	00 
 aba:	74 42                	je     afe <BasePrintLibSPrintMarker+0xafe>
 abc:	4c 89 9c 24 a0 00 00 	mov    %r11,0xa0(%rsp)
 ac3:	00 
 ac4:	44 89 8c 24 90 00 00 	mov    %r9d,0x90(%rsp)
 acb:	00 
        Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Width - Precision, ' ', BytesPerOutputCharacter);
 acc:	b9 20 00 00 00       	mov    $0x20,%ecx
 ad1:	48 8b 74 24 48       	mov    0x48(%rsp),%rsi
 ad6:	48 8b 7c 24 38       	mov    0x38(%rsp),%rdi
 adb:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 ae2:	00 00 00 
 ae5:	ff d0                	callq  *%rax
 ae7:	44 8b 8c 24 90 00 00 	mov    0x90(%rsp),%r9d
 aee:	00 
 aef:	48 89 44 24 38       	mov    %rax,0x38(%rsp)
 af4:	4c 8b 9c 24 a0 00 00 	mov    0xa0(%rsp),%r11
 afb:	00 
 afc:	eb 09                	jmp    b07 <BasePrintLibSPrintMarker+0xb07>
 afe:	48 c7 44 24 38 00 00 	movq   $0x0,0x38(%rsp)
 b05:	00 00 
      }
    }

    if (ZeroPad) {
 b07:	45 84 c9             	test   %r9b,%r9b
 b0a:	0f 84 b2 00 00 00    	je     bc2 <BasePrintLibSPrintMarker+0xbc2>
      if (Prefix != 0) {
 b10:	45 84 e4             	test   %r12b,%r12b
 b13:	74 48                	je     b5d <BasePrintLibSPrintMarker+0xb5d>
        LengthToReturn += (1 * BytesPerOutputCharacter);
 b15:	44 8b 44 24 54       	mov    0x54(%rsp),%r8d
 b1a:	4c 01 44 24 68       	add    %r8,0x68(%rsp)
        if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
 b1f:	f6 c7 20             	test   $0x20,%bh
 b22:	75 39                	jne    b5d <BasePrintLibSPrintMarker+0xb5d>
 b24:	48 8b 7c 24 38       	mov    0x38(%rsp),%rdi
 b29:	48 85 ff             	test   %rdi,%rdi
 b2c:	74 2f                	je     b5d <BasePrintLibSPrintMarker+0xb5d>
 b2e:	4c 89 9c 24 90 00 00 	mov    %r11,0x90(%rsp)
 b35:	00 
          Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, Prefix, BytesPerOutputCharacter);
 b36:	49 0f be cc          	movsbq %r12b,%rcx
 b3a:	ba 01 00 00 00       	mov    $0x1,%edx
 b3f:	48 8b 74 24 48       	mov    0x48(%rsp),%rsi
 b44:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 b4b:	00 00 00 
 b4e:	ff d0                	callq  *%rax
 b50:	4c 8b 9c 24 90 00 00 	mov    0x90(%rsp),%r11
 b57:	00 
 b58:	48 89 44 24 38       	mov    %rax,0x38(%rsp)
        }
      }
      LengthToReturn += ((Precision - Count) * BytesPerOutputCharacter);
 b5d:	48 8b 94 24 88 00 00 	mov    0x88(%rsp),%rdx
 b64:	00 
 b65:	48 2b 54 24 30       	sub    0x30(%rsp),%rdx
 b6a:	44 8b 44 24 54       	mov    0x54(%rsp),%r8d
 b6f:	48 89 d0             	mov    %rdx,%rax
 b72:	49 0f af c0          	imul   %r8,%rax
 b76:	48 01 44 24 68       	add    %rax,0x68(%rsp)
      if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
 b7b:	f6 c7 20             	test   $0x20,%bh
 b7e:	0f 85 0e 01 00 00    	jne    c92 <BasePrintLibSPrintMarker+0xc92>
 b84:	48 8b 7c 24 38       	mov    0x38(%rsp),%rdi
 b89:	48 85 ff             	test   %rdi,%rdi
 b8c:	0f 84 00 01 00 00    	je     c92 <BasePrintLibSPrintMarker+0xc92>
 b92:	4c 89 9c 24 90 00 00 	mov    %r11,0x90(%rsp)
 b99:	00 
        Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Precision - Count, '0', BytesPerOutputCharacter);
 b9a:	b9 30 00 00 00       	mov    $0x30,%ecx
 b9f:	48 8b 74 24 48       	mov    0x48(%rsp),%rsi
 ba4:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 bab:	00 00 00 
 bae:	ff d0                	callq  *%rax
 bb0:	4c 8b 9c 24 90 00 00 	mov    0x90(%rsp),%r11
 bb7:	00 
 bb8:	48 89 44 24 38       	mov    %rax,0x38(%rsp)
 bbd:	e9 d0 00 00 00       	jmpq   c92 <BasePrintLibSPrintMarker+0xc92>
      }
    } else {
      LengthToReturn += ((Precision - Count) * BytesPerOutputCharacter);
 bc2:	48 8b 94 24 88 00 00 	mov    0x88(%rsp),%rdx
 bc9:	00 
 bca:	48 2b 54 24 30       	sub    0x30(%rsp),%rdx
 bcf:	44 8b 4c 24 54       	mov    0x54(%rsp),%r9d
 bd4:	48 89 d0             	mov    %rdx,%rax
 bd7:	49 0f af c1          	imul   %r9,%rax
 bdb:	48 01 44 24 68       	add    %rax,0x68(%rsp)
      if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
 be0:	48 89 d8             	mov    %rbx,%rax
 be3:	25 00 20 00 00       	and    $0x2000,%eax
 be8:	48 89 84 24 90 00 00 	mov    %rax,0x90(%rsp)
 bef:	00 
 bf0:	75 48                	jne    c3a <BasePrintLibSPrintMarker+0xc3a>
 bf2:	48 8b 7c 24 38       	mov    0x38(%rsp),%rdi
 bf7:	48 85 ff             	test   %rdi,%rdi
 bfa:	74 3e                	je     c3a <BasePrintLibSPrintMarker+0xc3a>
 bfc:	4c 89 9c 24 a8 00 00 	mov    %r11,0xa8(%rsp)
 c03:	00 
        Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Precision - Count, ' ', BytesPerOutputCharacter);
 c04:	4d 89 c8             	mov    %r9,%r8
 c07:	4c 89 8c 24 a0 00 00 	mov    %r9,0xa0(%rsp)
 c0e:	00 
 c0f:	b9 20 00 00 00       	mov    $0x20,%ecx
 c14:	48 8b 74 24 48       	mov    0x48(%rsp),%rsi
 c19:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 c20:	00 00 00 
 c23:	ff d0                	callq  *%rax
 c25:	4c 8b 9c 24 a8 00 00 	mov    0xa8(%rsp),%r11
 c2c:	00 
 c2d:	4c 8b 8c 24 a0 00 00 	mov    0xa0(%rsp),%r9
 c34:	00 
 c35:	48 89 44 24 38       	mov    %rax,0x38(%rsp)
    }

    //
    // Output the Prefix character if it is present
    //
    Index = 0;
 c3a:	45 31 d2             	xor    %r10d,%r10d
    } else {
      LengthToReturn += ((Precision - Count) * BytesPerOutputCharacter);
      if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
        Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Precision - Count, ' ', BytesPerOutputCharacter);
      }
      if (Prefix != 0) {
 c3d:	45 84 e4             	test   %r12b,%r12b
 c40:	74 5e                	je     ca0 <BasePrintLibSPrintMarker+0xca0>
        LengthToReturn += (1 * BytesPerOutputCharacter);
 c42:	4c 01 4c 24 68       	add    %r9,0x68(%rsp)
        if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
 c47:	48 83 bc 24 90 00 00 	cmpq   $0x0,0x90(%rsp)
 c4e:	00 00 
 c50:	75 48                	jne    c9a <BasePrintLibSPrintMarker+0xc9a>
 c52:	48 8b 7c 24 38       	mov    0x38(%rsp),%rdi
 c57:	48 85 ff             	test   %rdi,%rdi
 c5a:	74 3e                	je     c9a <BasePrintLibSPrintMarker+0xc9a>
          Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, Prefix, BytesPerOutputCharacter);
 c5c:	44 8b 44 24 54       	mov    0x54(%rsp),%r8d
 c61:	4c 89 9c 24 90 00 00 	mov    %r11,0x90(%rsp)
 c68:	00 
 c69:	49 0f be cc          	movsbq %r12b,%rcx
 c6d:	ba 01 00 00 00       	mov    $0x1,%edx
 c72:	48 8b 74 24 48       	mov    0x48(%rsp),%rsi
 c77:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 c7e:	00 00 00 
 c81:	ff d0                	callq  *%rax
 c83:	4c 8b 9c 24 90 00 00 	mov    0x90(%rsp),%r11
 c8a:	00 
 c8b:	48 89 44 24 38       	mov    %rax,0x38(%rsp)
 c90:	eb 08                	jmp    c9a <BasePrintLibSPrintMarker+0xc9a>
    }

    //
    // Output the Prefix character if it is present
    //
    Index = 0;
 c92:	45 31 d2             	xor    %r10d,%r10d
    if (Prefix != 0) {
 c95:	45 84 e4             	test   %r12b,%r12b
 c98:	74 06                	je     ca0 <BasePrintLibSPrintMarker+0xca0>
      Index++;
 c9a:	41 ba 01 00 00 00    	mov    $0x1,%r10d
    //
    while (Index < Count) {
      ArgumentCharacter = ((*ArgumentString & 0xff) | (*(ArgumentString + 1) << 8)) & ArgumentMask;

      LengthToReturn += (1 * BytesPerOutputCharacter);
      if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
 ca0:	49 89 dc             	mov    %rbx,%r12
 ca3:	41 81 e4 00 20 00 00 	and    $0x2000,%r12d
    }

    //
    // Copy the string into the output buffer performing the required type conversions
    //
    while (Index < Count) {
 caa:	4c 3b 54 24 30       	cmp    0x30(%rsp),%r10
 caf:	0f 83 07 01 00 00    	jae    dbc <BasePrintLibSPrintMarker+0xdbc>
      ArgumentCharacter = ((*ArgumentString & 0xff) | (*(ArgumentString + 1) << 8)) & ArgumentMask;

      LengthToReturn += (1 * BytesPerOutputCharacter);
 cb5:	8b 7c 24 54          	mov    0x54(%rsp),%edi

    //
    // Copy the string into the output buffer performing the required type conversions
    //
    while (Index < Count) {
      ArgumentCharacter = ((*ArgumentString & 0xff) | (*(ArgumentString + 1) << 8)) & ArgumentMask;
 cb9:	41 0f b6 45 00       	movzbl 0x0(%r13),%eax

      LengthToReturn += (1 * BytesPerOutputCharacter);
 cbe:	48 01 7c 24 68       	add    %rdi,0x68(%rsp)
      if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
 cc3:	4d 85 e4             	test   %r12,%r12

    //
    // Copy the string into the output buffer performing the required type conversions
    //
    while (Index < Count) {
      ArgumentCharacter = ((*ArgumentString & 0xff) | (*(ArgumentString + 1) << 8)) & ArgumentMask;
 cc6:	41 0f be 4d 01       	movsbl 0x1(%r13),%ecx

      LengthToReturn += (1 * BytesPerOutputCharacter);
 ccb:	48 89 bc 24 90 00 00 	mov    %rdi,0x90(%rsp)
 cd2:	00 
      if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
 cd3:	75 5a                	jne    d2f <BasePrintLibSPrintMarker+0xd2f>
 cd5:	48 8b 7c 24 38       	mov    0x38(%rsp),%rdi
 cda:	48 85 ff             	test   %rdi,%rdi
 cdd:	74 50                	je     d2f <BasePrintLibSPrintMarker+0xd2f>

    //
    // Copy the string into the output buffer performing the required type conversions
    //
    while (Index < Count) {
      ArgumentCharacter = ((*ArgumentString & 0xff) | (*(ArgumentString + 1) << 8)) & ArgumentMask;
 cdf:	c1 e1 08             	shl    $0x8,%ecx
 ce2:	4c 89 9c 24 a8 00 00 	mov    %r11,0xa8(%rsp)
 ce9:	00 
 cea:	4c 89 94 24 a0 00 00 	mov    %r10,0xa0(%rsp)
 cf1:	00 
 cf2:	09 c1                	or     %eax,%ecx

      LengthToReturn += (1 * BytesPerOutputCharacter);
      if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
        Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ArgumentCharacter, BytesPerOutputCharacter);
 cf4:	4c 8b 84 24 90 00 00 	mov    0x90(%rsp),%r8
 cfb:	00 
 cfc:	ba 01 00 00 00       	mov    $0x1,%edx

    //
    // Copy the string into the output buffer performing the required type conversions
    //
    while (Index < Count) {
      ArgumentCharacter = ((*ArgumentString & 0xff) | (*(ArgumentString + 1) << 8)) & ArgumentMask;
 d01:	48 63 c9             	movslq %ecx,%rcx
 d04:	48 23 4c 24 78       	and    0x78(%rsp),%rcx

      LengthToReturn += (1 * BytesPerOutputCharacter);
      if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
        Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ArgumentCharacter, BytesPerOutputCharacter);
 d09:	48 8b 74 24 48       	mov    0x48(%rsp),%rsi
 d0e:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 d15:	00 00 00 
 d18:	ff d0                	callq  *%rax
 d1a:	4c 8b 9c 24 a8 00 00 	mov    0xa8(%rsp),%r11
 d21:	00 
 d22:	4c 8b 94 24 a0 00 00 	mov    0xa0(%rsp),%r10
 d29:	00 
 d2a:	48 89 44 24 38       	mov    %rax,0x38(%rsp)
      }
      ArgumentString    += BytesPerArgumentCharacter;
 d2f:	4c 03 ac 24 80 00 00 	add    0x80(%rsp),%r13
 d36:	00 
      Index++;
      if (Comma) {
 d37:	80 7c 24 53 00       	cmpb   $0x0,0x53(%rsp)
      LengthToReturn += (1 * BytesPerOutputCharacter);
      if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
        Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ArgumentCharacter, BytesPerOutputCharacter);
      }
      ArgumentString    += BytesPerArgumentCharacter;
      Index++;
 d3c:	4d 8d 4a 01          	lea    0x1(%r10),%r9
      if (Comma) {
 d40:	74 72                	je     db4 <BasePrintLibSPrintMarker+0xdb4>
        Digits++;
 d42:	49 ff c3             	inc    %r11
        if (Digits == 3) {
 d45:	49 83 fb 03          	cmp    $0x3,%r11
 d49:	75 69                	jne    db4 <BasePrintLibSPrintMarker+0xdb4>
          Digits = 0;
          Index++;
 d4b:	4d 8d 4a 02          	lea    0x2(%r10),%r9
      ArgumentString    += BytesPerArgumentCharacter;
      Index++;
      if (Comma) {
        Digits++;
        if (Digits == 3) {
          Digits = 0;
 d4f:	45 30 db             	xor    %r11b,%r11b
          Index++;
          if (Index < Count) {
 d52:	4c 3b 4c 24 30       	cmp    0x30(%rsp),%r9
 d57:	73 5b                	jae    db4 <BasePrintLibSPrintMarker+0xdb4>
            LengthToReturn += (1 * BytesPerOutputCharacter);
 d59:	48 8b 84 24 90 00 00 	mov    0x90(%rsp),%rax
 d60:	00 
 d61:	48 01 44 24 68       	add    %rax,0x68(%rsp)
            if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
 d66:	4d 85 e4             	test   %r12,%r12
 d69:	75 49                	jne    db4 <BasePrintLibSPrintMarker+0xdb4>
 d6b:	48 8b 7c 24 38       	mov    0x38(%rsp),%rdi
 d70:	48 85 ff             	test   %rdi,%rdi
 d73:	74 3a                	je     daf <BasePrintLibSPrintMarker+0xdaf>
              Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ',', BytesPerOutputCharacter);
 d75:	44 8b 44 24 54       	mov    0x54(%rsp),%r8d
 d7a:	4c 89 8c 24 90 00 00 	mov    %r9,0x90(%rsp)
 d81:	00 
 d82:	b9 2c 00 00 00       	mov    $0x2c,%ecx
 d87:	ba 01 00 00 00       	mov    $0x1,%edx
 d8c:	48 8b 74 24 48       	mov    0x48(%rsp),%rsi
 d91:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 d98:	00 00 00 
 d9b:	ff d0                	callq  *%rax
      ArgumentString    += BytesPerArgumentCharacter;
      Index++;
      if (Comma) {
        Digits++;
        if (Digits == 3) {
          Digits = 0;
 d9d:	4d 89 e3             	mov    %r12,%r11
          Index++;
          if (Index < Count) {
            LengthToReturn += (1 * BytesPerOutputCharacter);
            if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
              Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ',', BytesPerOutputCharacter);
 da0:	48 89 44 24 38       	mov    %rax,0x38(%rsp)
 da5:	4c 8b 8c 24 90 00 00 	mov    0x90(%rsp),%r9
 dac:	00 
 dad:	eb 05                	jmp    db4 <BasePrintLibSPrintMarker+0xdb4>
      ArgumentString    += BytesPerArgumentCharacter;
      Index++;
      if (Comma) {
        Digits++;
        if (Digits == 3) {
          Digits = 0;
 daf:	4c 8b 5c 24 38       	mov    0x38(%rsp),%r11
 db4:	4d 89 ca             	mov    %r9,%r10
 db7:	e9 ee fe ff ff       	jmpq   caa <BasePrintLibSPrintMarker+0xcaa>
    }

    //
    // Pad after the string
    //
    if ((Flags & (PAD_TO_WIDTH | LEFT_JUSTIFY)) == (PAD_TO_WIDTH | LEFT_JUSTIFY)) {
 dbc:	48 81 bc 24 98 00 00 	cmpq   $0x201,0x98(%rsp)
 dc3:	00 01 02 00 00 
 dc8:	75 48                	jne    e12 <BasePrintLibSPrintMarker+0xe12>
      LengthToReturn += ((Width - Precision) * BytesPerOutputCharacter);
 dca:	48 8b 54 24 60       	mov    0x60(%rsp),%rdx
 dcf:	48 2b 94 24 88 00 00 	sub    0x88(%rsp),%rdx
 dd6:	00 
 dd7:	44 8b 44 24 54       	mov    0x54(%rsp),%r8d
 ddc:	48 89 d0             	mov    %rdx,%rax
 ddf:	49 0f af c0          	imul   %r8,%rax
 de3:	48 01 44 24 68       	add    %rax,0x68(%rsp)
      if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {
 de8:	f6 c7 20             	test   $0x20,%bh
 deb:	75 25                	jne    e12 <BasePrintLibSPrintMarker+0xe12>
 ded:	48 8b 7c 24 38       	mov    0x38(%rsp),%rdi
 df2:	48 85 ff             	test   %rdi,%rdi
 df5:	74 1b                	je     e12 <BasePrintLibSPrintMarker+0xe12>
        Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Width - Precision, ' ', BytesPerOutputCharacter);
 df7:	b9 20 00 00 00       	mov    $0x20,%ecx
 dfc:	48 8b 74 24 48       	mov    0x48(%rsp),%rsi
 e01:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 e08:	00 00 00 
 e0b:	ff d0                	callq  *%rax
 e0d:	48 89 44 24 38       	mov    %rax,0x38(%rsp)
    }

    //
    // Get the next character from the format string
    //
    Format += BytesPerFormatCharacter;
 e12:	4c 03 74 24 40       	add    0x40(%rsp),%r14

    //
    // Get the next character from the format string
    //
    FormatCharacter = ((*Format & 0xff) | (*(Format + 1) << 8)) & FormatMask;
 e17:	41 0f be 46 01       	movsbl 0x1(%r14),%eax
 e1c:	41 0f b6 16          	movzbl (%r14),%edx
 e20:	c1 e0 08             	shl    $0x8,%eax
 e23:	09 d0                	or     %edx,%eax
 e25:	48 98                	cltq   
 e27:	48 23 44 24 58       	and    0x58(%rsp),%rax
 e2c:	48 89 84 24 b8 00 00 	mov    %rax,0xb8(%rsp)
 e33:	00 
 e34:	e9 6c f3 ff ff       	jmpq   1a5 <BasePrintLibSPrintMarker+0x1a5>

  if ((Flags & COUNT_ONLY_NO_PRINT) != 0) {
    return (LengthToReturn / BytesPerOutputCharacter);
  }

  ASSERT (Buffer != NULL);
 e39:	49 bc 00 00 00 00 00 	movabs $0x0,%r12
 e40:	00 00 00 
 e43:	41 ff d4             	callq  *%r12
 e46:	84 c0                	test   %al,%al
 e48:	74 2d                	je     e77 <BasePrintLibSPrintMarker+0xe77>
 e4a:	48 83 7c 24 38 00    	cmpq   $0x0,0x38(%rsp)
 e50:	75 25                	jne    e77 <BasePrintLibSPrintMarker+0xe77>
 e52:	49 b8 00 00 00 00 00 	movabs $0x0,%r8
 e59:	00 00 00 
 e5c:	ba c9 03 00 00       	mov    $0x3c9,%edx
 e61:	48 b9 00 00 00 00 00 	movabs $0x0,%rcx
 e68:	00 00 00 
 e6b:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 e72:	00 00 00 
 e75:	ff d0                	callq  *%rax
  //
  // Null terminate the Unicode or ASCII string
  //
  BasePrintLibFillBuffer (Buffer, EndBuffer + BytesPerOutputCharacter, 1, 0, BytesPerOutputCharacter);
 e77:	48 8b 74 24 48       	mov    0x48(%rsp),%rsi
 e7c:	31 c9                	xor    %ecx,%ecx
 e7e:	49 89 e8             	mov    %rbp,%r8
 e81:	ba 01 00 00 00       	mov    $0x1,%edx
 e86:	48 8b 7c 24 38       	mov    0x38(%rsp),%rdi
 e8b:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 e92:	00 00 00 
 e95:	48 01 ee             	add    %rbp,%rsi
 e98:	ff d0                	callq  *%rax
  //
  // Make sure output buffer cannot contain more than PcdMaximumUnicodeStringLength
  // Unicode characters if PcdMaximumUnicodeStringLength is not zero. 
  //
  ASSERT ((((Flags & OUTPUT_UNICODE) == 0)) || (StrSize ((CHAR16 *) OriginalBuffer) != 0));
 e9a:	41 ff d4             	callq  *%r12
 e9d:	84 c0                	test   %al,%al
 e9f:	74 40                	je     ee1 <BasePrintLibSPrintMarker+0xee1>
 ea1:	f6 c3 40             	test   $0x40,%bl
 ea4:	74 3b                	je     ee1 <BasePrintLibSPrintMarker+0xee1>
 ea6:	48 8b 4c 24 70       	mov    0x70(%rsp),%rcx
 eab:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 eb2:	00 00 00 
 eb5:	ff d0                	callq  *%rax
 eb7:	48 85 c0             	test   %rax,%rax
 eba:	75 25                	jne    ee1 <BasePrintLibSPrintMarker+0xee1>
 ebc:	49 b8 00 00 00 00 00 	movabs $0x0,%r8
 ec3:	00 00 00 
 ec6:	ba d2 03 00 00       	mov    $0x3d2,%edx
 ecb:	48 b9 00 00 00 00 00 	movabs $0x0,%rcx
 ed2:	00 00 00 
 ed5:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 edc:	00 00 00 
 edf:	ff d0                	callq  *%rax
  //
  // Make sure output buffer cannot contain more than PcdMaximumAsciiStringLength
  // ASCII characters if PcdMaximumAsciiStringLength is not zero. 
  //
  ASSERT ((((Flags & OUTPUT_UNICODE) != 0)) || (AsciiStrSize (OriginalBuffer) != 0));
 ee1:	41 ff d4             	callq  *%r12
 ee4:	84 c0                	test   %al,%al
 ee6:	74 40                	je     f28 <BasePrintLibSPrintMarker+0xf28>
 ee8:	80 e3 40             	and    $0x40,%bl
 eeb:	75 3b                	jne    f28 <BasePrintLibSPrintMarker+0xf28>
 eed:	48 8b 4c 24 70       	mov    0x70(%rsp),%rcx
 ef2:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 ef9:	00 00 00 
 efc:	ff d0                	callq  *%rax
 efe:	48 85 c0             	test   %rax,%rax
 f01:	75 25                	jne    f28 <BasePrintLibSPrintMarker+0xf28>
 f03:	49 b8 00 00 00 00 00 	movabs $0x0,%r8
 f0a:	00 00 00 
 f0d:	ba d7 03 00 00       	mov    $0x3d7,%edx
 f12:	48 b9 00 00 00 00 00 	movabs $0x0,%rcx
 f19:	00 00 00 
 f1c:	48 b8 00 00 00 00 00 	movabs $0x0,%rax
 f23:	00 00 00 
 f26:	ff d0                	callq  *%rax

  return ((Buffer - OriginalBuffer) / BytesPerOutputCharacter);
 f28:	48 8b 44 24 38       	mov    0x38(%rsp),%rax
 f2d:	48 2b 44 24 70       	sub    0x70(%rsp),%rax
 f32:	48 99                	cqto   
 f34:	48 f7 fd             	idiv   %rbp
 f37:	eb 0a                	jmp    f43 <BasePrintLibSPrintMarker+0xf43>
 f39:	4c 8b 54 24 30       	mov    0x30(%rsp),%r10
 f3e:	e9 ec f2 ff ff       	jmpq   22f <BasePrintLibSPrintMarker+0x22f>
}
 f43:	48 81 c4 08 01 00 00 	add    $0x108,%rsp
 f4a:	5b                   	pop    %rbx
 f4b:	5d                   	pop    %rbp
 f4c:	41 5c                	pop    %r12
 f4e:	41 5d                	pop    %r13
 f50:	41 5e                	pop    %r14
 f52:	41 5f                	pop    %r15
 f54:	c3                   	retq
------------------------------------------------------------------------------

Comments

Andrew Fish Nov. 4, 2014, 5:28 p.m. UTC | #1
> On Nov 4, 2014, at 5:48 AM, Laszlo Ersek <lersek@redhat.com> wrote:
> 
> diff --git a/MdePkg/Library/BasePrintLib/PrintLibInternal.c
> b/MdePkg/Library/BasePrintLib/PrintLibInternal.c
> index 8dc5ec7..fbb3726 100644
> --- a/MdePkg/Library/BasePrintLib/PrintLibInternal.c
> +++ b/MdePkg/Library/BasePrintLib/PrintLibInternal.c
> @@ -680,10 +680,20 @@ BasePrintLibSPrintMarker (
>         if (TmpGuid == NULL) {
>           ArgumentString = "<null guid>";
>         } else {
> +          UINTN (EFIAPI * volatile PrintFunction) (
> +                                     OUT CHAR8        *StartOfBuffer,
> +                                     IN  UINTN        BufferSize,
> +                                     IN  UINTN        Flags,
> +                                     IN  CONST CHAR8  *FormatString,
> +                                     ...
> +                                     );
> +
> +          PrintFunction = BasePrintLibSPrint;
> +
>           GuidData1 = ReadUnaligned32 (&(TmpGuid->Data1));
>           GuidData2 = ReadUnaligned16 (&(TmpGuid->Data2));
>           GuidData3 = ReadUnaligned16 (&(TmpGuid->Data3));
> -          BasePrintLibSPrint (
> +          PrintFunction (
>             ValueBuffer,
>             MAXIMUM_VALUE_CHARACTERS,
>             0,
> ----------------
> 
> With this patch, GUIDs are printed okay with -Os.
> 
> (Of course it's not edk2 that needs to be fixed.)
> 

But pedantically you need change the definition of BasePrintLibSPrint() to include EFIAPI. 

If you look at BasePrintLibSPrintMarker() (and some of the other routines) you will notice a BASE_LIST and a VA_LIST. We had an API that exposed a VA_LIST (well code that was casting to VA_LIST) in the report status code stack and it forced use to use our own made up BASE_LIST concept to get it to work. I think you are going to hit similar issues mixing calling conventions. 

So my 1st question is why do you need to mix calling conventions, and depend on EFIAPI for interoperability. Why not just change the ABI on all functions?

Problems with the mixed calling convention:
1) All assembly routines must be marked as EFIAPI, or the C code will generate the wrong calling convention. Not an issue in the MdePkg, but potentially an issue in other packages. 
2) The var arg chain needs to be constant. I think for i386 you get lucky and the calling conventions are close enough it kind of works, but for X64 they are very different. Even if you force VA_LIST to be the Microsoft one, it is not clear to me that forces the compiler to treat every … the Microsoft way. 

Thanks,

Andrew Fish
------------------------------------------------------------------------------
Laszlo Ersek Nov. 4, 2014, 7:31 p.m. UTC | #2
On 11/04/14 18:28, Andrew Fish wrote:
> 
>> On Nov 4, 2014, at 5:48 AM, Laszlo Ersek <lersek@redhat.com
>> <mailto:lersek@redhat.com>> wrote:
>>
>> diff --git a/MdePkg/Library/BasePrintLib/PrintLibInternal.c
>> b/MdePkg/Library/BasePrintLib/PrintLibInternal.c
>> index 8dc5ec7..fbb3726 100644
>> --- a/MdePkg/Library/BasePrintLib/PrintLibInternal.c
>> +++ b/MdePkg/Library/BasePrintLib/PrintLibInternal.c
>> @@ -680,10 +680,20 @@ BasePrintLibSPrintMarker (
>>         if (TmpGuid == NULL) {
>>           ArgumentString = "<null guid>";
>>         } else {
>> +          UINTN (EFIAPI * volatile PrintFunction) (
>> +                                     OUT CHAR8        *StartOfBuffer,
>> +                                     IN  UINTN        BufferSize,
>> +                                     IN  UINTN        Flags,
>> +                                     IN  CONST CHAR8  *FormatString,
>> +                                     ...
>> +                                     );
>> +
>> +          PrintFunction = BasePrintLibSPrint;
>> +
>>           GuidData1 = ReadUnaligned32 (&(TmpGuid->Data1));
>>           GuidData2 = ReadUnaligned16 (&(TmpGuid->Data2));
>>           GuidData3 = ReadUnaligned16 (&(TmpGuid->Data3));
>> -          BasePrintLibSPrint (
>> +          PrintFunction (
>>             ValueBuffer,
>>             MAXIMUM_VALUE_CHARACTERS,
>>             0,
>> ----------------
>>
>> With this patch, GUIDs are printed okay with -Os.
>>
>> (Of course it's not edk2 that needs to be fixed.)
>>
> 
> But pedantically you need change the definition of BasePrintLibSPrint()
> to include EFIAPI. 

I tried that (without applying above patch, before posting my message);
it didn't help.

Thanks,
Laszlo

> 
> If you look at BasePrintLibSPrintMarker() (and some of the other
> routines) you will notice a BASE_LIST and a VA_LIST. We had an API that
> exposed a VA_LIST (well code that was casting to VA_LIST) in the report
> status code stack and it forced use to use our own made up BASE_LIST
> concept to get it to work. I think you are going to hit similar issues
> mixing calling conventions. 
> 
> So my 1st question is why do you need to mix calling conventions, and
> depend on EFIAPI for interoperability. Why not just change the ABI on
> all functions?
> 
> Problems with the mixed calling convention:
> 1) All assembly routines must be marked as EFIAPI, or the C code will
> generate the wrong calling convention. Not an issue in the MdePkg, but
> potentially an issue in other packages. 
> 2) The var arg chain needs to be constant. I think for i386 you get
> lucky and the calling conventions are close enough it kind of works, but
> for X64 they are very different. Even if you force VA_LIST to be the
> Microsoft one, it is not clear to me that forces the compiler to treat
> every … the Microsoft way. 
> 
> Thanks,
> 
> Andrew Fish
> 
> 
> 
> ------------------------------------------------------------------------------
> 
> 
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
> 


------------------------------------------------------------------------------
Andrew Fish Nov. 4, 2014, 9:40 p.m. UTC | #3
> On Nov 4, 2014, at 12:15 PM, Scott Duplichan <scott@notabs.org> wrote:
> 
> But pedantically you need change the definition of BasePrintLibSPrint() to include EFIAPI. 
>  
> If you look at BasePrintLibSPrintMarker() (and some of the other routines) you will notice a BASE_LIST and a VA_LIST. We had an API that exposed a VA_LIST (well code that was casting to VA_LIST) in the report status code stack and it forced use to use our own made up BASE_LIST concept to get it to work. I think you are going to hit similar issues mixing calling conventions. 
>  
> So my 1st question is why do you need to mix calling conventions, and depend on EFIAPI for interoperability. Why not just change the ABI on all functions?
>  
> If I understand your question "Why not just change the ABI on all functions", you mean use Microsoft ABI throughout the code even when compiled with gcc? The gcc option -mabi=ms makes this easy, and it reduces code size too (8% in one test). Part of that code size reduction is because it removes the requirement to save xmm6-xmm15 when calling msabi code. Gcc doesn't optimize the save/restore of xmm6-xmm15, it just does them all. The problems with ms abi I can think of are:
> 1) Linux developers accustomed to stepping through the sysv calling convention would have to adapt to the ms calling convention.

Well all the public interfaces (EFI service, protocol member functions, etc.) are EFIAPI, so there will be a mix. 

> 2) -mabi=ms is probably  little used and therefore more likely to have bugs. This might require dropping support for older gcc tool chains.

Looks like mixing has bugs too. It looks like this issue is caused by a mismatch in the vararg definitions between the two worlds. You can’t really mix styles in a given call stack. It almost seems like you want to force one var arg scheme every place possible. 

> 3) According to an email from you in April, ms abi might not support stack trace without debug symbols.
>  

This is not the ABI it is VC++ code generation. There is  nothing in the ABI about how to unwind a stack frame, it is about how to call code in C. 

In my clang examples, in this thread,  we have an EFIAPI compatible calling convention with stack unwind. -target x86_64-pc-win32-macho means build an X64 image using EFIAPI, do the standard frame pointer, and we kick out a Mach-O executable for the debugger. We convert the Mach-O to PE/COFF for EFI compatibility. So on clang it as EFIABI, but with stack unwind. We can always unwind a frame without symbols, until we hit code compiled with VC++. 

> Even if ms abi is never made the default for gcc code, adding an environment variable such as EXTRA_CC_FLAGS would allow its use in custom builds by those who need the code size reduction it brings.
>  
> What about switching EDK2 to sysv abi? I assume that would require dropping support for Microsoft compilers. 


The EFI calling convention is in the spec, so all things EFI would break. Option ROMs on cards, installed Operating system, etc…. The edk2 is an open source project that implements industry standard, not just a chunk of code. 

Thanks,

Andrew Fish

>  
> Thanks,
> Scott
------------------------------------------------------------------------------
Jordan Justen Nov. 4, 2014, 10:32 p.m. UTC | #4
On Tue, Nov 4, 2014 at 9:28 AM, Andrew Fish <afish@apple.com> wrote:
> So my 1st question is why do you need to mix calling conventions, and depend
> on EFIAPI for interoperability. Why not just change the ABI on all
> functions?

GCC 4.4 doesn't support the command line option to change everything
over. So, EFIAPI was the only option then.

> Problems with the mixed calling convention:
> 1) All assembly routines must be marked as EFIAPI, or the C code will
> generate the wrong calling convention. Not an issue in the MdePkg, but
> potentially an issue in other packages.

I don't see this as a problem. I think this is the rules that we have
set up for EDK II. It just so happens that the GCC4X toolchains are
the only ones that use EFIAPI, and thus are the only ones that allow
us to keep our codebase clean with regards to EFIAPI.

For GCC >= 4.5, I actually think we should convert *RELEASE* builds
over to using the ms-abi all the time to generate smaller code. I
think we should leave DEBUG builds as mixed to help clean up EFIAPI
issues.

-Jordan

------------------------------------------------------------------------------
Tim Lewis Nov. 4, 2014, 10:37 p.m. UTC | #5
Another note (from the archives): vendors used mixed builds for VS2003/VS2005 on 32-bit in order to use __fastcall for internal function calls and then EFIABI for all the various UEFI calls. 

Tim

-----Original Message-----
From: Jordan Justen [mailto:jljusten@gmail.com] 
Sent: Tuesday, November 04, 2014 2:33 PM
To: Andrew J. Fish
Cc: Paolo Bonzini; edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] Enable optimization for gcc x64 builds

On Tue, Nov 4, 2014 at 9:28 AM, Andrew Fish <afish@apple.com> wrote:
> So my 1st question is why do you need to mix calling conventions, and 
> depend on EFIAPI for interoperability. Why not just change the ABI on 
> all functions?

GCC 4.4 doesn't support the command line option to change everything over. So, EFIAPI was the only option then.

> Problems with the mixed calling convention:
> 1) All assembly routines must be marked as EFIAPI, or the C code will 
> generate the wrong calling convention. Not an issue in the MdePkg, but 
> potentially an issue in other packages.

I don't see this as a problem. I think this is the rules that we have set up for EDK II. It just so happens that the GCC4X toolchains are the only ones that use EFIAPI, and thus are the only ones that allow us to keep our codebase clean with regards to EFIAPI.

For GCC >= 4.5, I actually think we should convert *RELEASE* builds over to using the ms-abi all the time to generate smaller code. I think we should leave DEBUG builds as mixed to help clean up EFIAPI issues.

-Jordan

------------------------------------------------------------------------------
Andrew Fish Nov. 4, 2014, 11:02 p.m. UTC | #6
> On Nov 4, 2014, at 2:32 PM, Jordan Justen <jljusten@gmail.com> wrote:
> 
> On Tue, Nov 4, 2014 at 9:28 AM, Andrew Fish <afish@apple.com> wrote:
>> So my 1st question is why do you need to mix calling conventions, and depend
>> on EFIAPI for interoperability. Why not just change the ABI on all
>> functions?
> 
> GCC 4.4 doesn't support the command line option to change everything
> over. So, EFIAPI was the only option then.
> 
>> Problems with the mixed calling convention:
>> 1) All assembly routines must be marked as EFIAPI, or the C code will
>> generate the wrong calling convention. Not an issue in the MdePkg, but
>> potentially an issue in other packages.
> 
> I don't see this as a problem. I think this is the rules that we have
> set up for EDK II. It just so happens that the GCC4X toolchains are
> the only ones that use EFIAPI, and thus are the only ones that allow
> us to keep our codebase clean with regards to EFIAPI.
> 

I agree it is good in keeping the edk2 code clean. I was more concerned about code from 3rd parties. 
So sorry this was more about a warning when you are porting code on what to look out for. 

I’m really only concerned about how the VA_LIST stuff is going to work? Does it need to shift for native vs. EFIAPI? If so how you pass the VA_LIST around if the code is not all the same ABI?

> For GCC >= 4.5, I actually think we should convert *RELEASE* builds
> over to using the ms-abi all the time to generate smaller code. I
> think we should leave DEBUG builds as mixed to help clean up EFIAPI
> issues.
> 

You guys should figure out if you can have a ms-abi but add the frame pointers. The compiler is open source ….

Thanks,

Andrew Fish

> -Jordan


------------------------------------------------------------------------------
Laszlo Ersek Nov. 5, 2014, 10 a.m. UTC | #7
On 11/05/14 00:02, Andrew Fish wrote:
> 
>> On Nov 4, 2014, at 2:32 PM, Jordan Justen <jljusten@gmail.com> wrote:
>>
>> On Tue, Nov 4, 2014 at 9:28 AM, Andrew Fish <afish@apple.com> wrote:
>>> So my 1st question is why do you need to mix calling conventions, and depend
>>> on EFIAPI for interoperability. Why not just change the ABI on all
>>> functions?
>>
>> GCC 4.4 doesn't support the command line option to change everything
>> over. So, EFIAPI was the only option then.
>>
>>> Problems with the mixed calling convention:
>>> 1) All assembly routines must be marked as EFIAPI, or the C code will
>>> generate the wrong calling convention. Not an issue in the MdePkg, but
>>> potentially an issue in other packages.
>>
>> I don't see this as a problem. I think this is the rules that we have
>> set up for EDK II. It just so happens that the GCC4X toolchains are
>> the only ones that use EFIAPI, and thus are the only ones that allow
>> us to keep our codebase clean with regards to EFIAPI.
>>
> 
> I agree it is good in keeping the edk2 code clean. I was more concerned about code from 3rd parties. 
> So sorry this was more about a warning when you are porting code on what to look out for. 
> 
> I’m really only concerned about how the VA_LIST stuff is going to
> work? Does it need to shift for native vs. EFIAPI? If so how you pass
> the VA_LIST around if the code is not all the same ABI?

We need to distinguish passing arguments through the ellipsis (...) from
passing VA_LIST (as a normal, named parameter).

For passing arguments through the ellipsis (...), the called function
*must* be EFIAPI (in the current state of the tree). Otherwise
VA_START() won't work in the callee.

(BTW I have no problem with the above "restriction".)

Regarding passing VA_LIST by name (which is identical to passing a
simple CHAR8* by name) -- it already works fine, regardless of EFIAPI
vs. no-EFIAPI.

The problem discussed in this thread is unrelated to EFIAPI. The problem
is (apparently) that gcc's -Os optimization corrupts a local variable in
a chain of recursive calls.

>> For GCC >= 4.5, I actually think we should convert *RELEASE* builds
>> over to using the ms-abi all the time to generate smaller code. I
>> think we should leave DEBUG builds as mixed to help clean up EFIAPI
>> issues.
>>
> 
> You guys should figure out if you can have a ms-abi but add the frame pointers. The compiler is open source ….

In my experimentation yesterday, one of the first things I tried (on
"gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-16)") was
'-fno-omit-frame-pointer'.

Because, '-Os' implies '-fomit-frame-pointer', and at that point I
thought that maybe '-fomit-frame-pointer', incurred by '-Os', was
causing the issue.

So, I added '-fno-omit-frame-pointer' *after* -Os.

It triggered a "sorry, unimplemented" bug, which was very similar to
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59927>:

    sorry, unimplemented: ms_abi attribute requires
    -maccumulate-outgoing-args or subtarget optimization implying it

However, after appending '-maccumulate-outgoing-args' as well, the build
resumed. (To clarify, this meant:

  -Os -fno-omit-frame-pointer -maccumulate-outgoing-args

.) Unfortunately, although the tree did build like this, the original
issue persisted. Which I took as proof that the bug was unrelated to
reserving or not reserving %rbp as frame pointer.

I wish I could write a small reproducer for this problem...

> 
> Thanks,
> 
> Andrew Fish
> 
>> -Jordan
> 
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
> 


------------------------------------------------------------------------------
Laszlo Ersek Nov. 5, 2014, 12:29 p.m. UTC | #8
On 11/05/14 11:00, Laszlo Ersek wrote:

> I wish I could write a small reproducer for this problem...

I wrote such a reproducer. I'll post it as a separate patch, just for
discussion. If we all agree that the code should work, then I could turn
it into a gcc bug report.

Thanks!
Laszlo


------------------------------------------------------------------------------
Andrew Fish Nov. 5, 2014, 4:40 p.m. UTC | #9
> On Nov 5, 2014, at 2:00 AM, Laszlo Ersek <lersek@redhat.com> wrote:
> 
> On 11/05/14 00:02, Andrew Fish wrote:
>> 
>>> On Nov 4, 2014, at 2:32 PM, Jordan Justen <jljusten@gmail.com> wrote:
>>> 
>>> On Tue, Nov 4, 2014 at 9:28 AM, Andrew Fish <afish@apple.com> wrote:
>>>> So my 1st question is why do you need to mix calling conventions, and depend
>>>> on EFIAPI for interoperability. Why not just change the ABI on all
>>>> functions?
>>> 
>>> GCC 4.4 doesn't support the command line option to change everything
>>> over. So, EFIAPI was the only option then.
>>> 
>>>> Problems with the mixed calling convention:
>>>> 1) All assembly routines must be marked as EFIAPI, or the C code will
>>>> generate the wrong calling convention. Not an issue in the MdePkg, but
>>>> potentially an issue in other packages.
>>> 
>>> I don't see this as a problem. I think this is the rules that we have
>>> set up for EDK II. It just so happens that the GCC4X toolchains are
>>> the only ones that use EFIAPI, and thus are the only ones that allow
>>> us to keep our codebase clean with regards to EFIAPI.
>>> 
>> 
>> I agree it is good in keeping the edk2 code clean. I was more concerned about code from 3rd parties. 
>> So sorry this was more about a warning when you are porting code on what to look out for. 
>> 
>> I’m really only concerned about how the VA_LIST stuff is going to
>> work? Does it need to shift for native vs. EFIAPI? If so how you pass
>> the VA_LIST around if the code is not all the same ABI?
> 
> We need to distinguish passing arguments through the ellipsis (...) from
> passing VA_LIST (as a normal, named parameter).
> 
> For passing arguments through the ellipsis (...), the called function
> *must* be EFIAPI (in the current state of the tree). Otherwise
> VA_START() won't work in the callee.
> 
> (BTW I have no problem with the above "restriction".)
> 
> Regarding passing VA_LIST by name (which is identical to passing a
> simple CHAR8* by name) -- it already works fine, regardless of EFIAPI
> vs. no-EFIAPI.
> 

OK thanks for the info. For some flavors of GCC the __buildin_va_list is a structure. Since the size of the structure is > 8 bytes it is passed via a pointer per the calling conventions. For X64  EFIAPI VA_LIST is a pointer to the frame where the register based arguments have have been spilled. 

For clang  x86_64 __buildin_va_list is also a structure, so you can’t mix and match.  

Thanks,

Andrew Fish

~/work/Compiler>cat vv.c
#include <stdarg.h>
#include <stdio.h>

int
main ()
{
  printf ("sizeof __builtin_va_list %lu\n", sizeof (__builtin_va_list));
  return 0;
}
~/work/Compiler>clang vv.c
~/work/Compiler>./a.out
sizeof __builtin_va_list 24
~/work/Compiler>clang -arch i386 vv.c
~/work/Compiler>./a.out
sizeof __builtin_va_list 4
~/work/Compiler>


> The problem discussed in this thread is unrelated to EFIAPI. The problem
> is (apparently) that gcc's -Os optimization corrupts a local variable in
> a chain of recursive calls.
> 
>>> For GCC >= 4.5, I actually think we should convert *RELEASE* builds
>>> over to using the ms-abi all the time to generate smaller code. I
>>> think we should leave DEBUG builds as mixed to help clean up EFIAPI
>>> issues.
>>> 
>> 
>> You guys should figure out if you can have a ms-abi but add the frame pointers. The compiler is open source ….
> 
> In my experimentation yesterday, one of the first things I tried (on
> "gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-16)") was
> '-fno-omit-frame-pointer'.
> 
> Because, '-Os' implies '-fomit-frame-pointer', and at that point I
> thought that maybe '-fomit-frame-pointer', incurred by '-Os', was
> causing the issue.
> 
> So, I added '-fno-omit-frame-pointer' *after* -Os.
> 
> It triggered a "sorry, unimplemented" bug, which was very similar to
> <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59927 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59927>>:
> 
>    sorry, unimplemented: ms_abi attribute requires
>    -maccumulate-outgoing-args or subtarget optimization implying it
> 
> However, after appending '-maccumulate-outgoing-args' as well, the build
> resumed. (To clarify, this meant:
> 
>  -Os -fno-omit-frame-pointer -maccumulate-outgoing-args
> 
> .) Unfortunately, although the tree did build like this, the original
> issue persisted. Which I took as proof that the bug was unrelated to
> reserving or not reserving %rbp as frame pointer.
> 
> I wish I could write a small reproducer for this problem...
> 
>>
------------------------------------------------------------------------------
Scott Duplichan Nov. 7, 2014, 4:16 p.m. UTC | #10
Andrew Fish [mailto:afish@apple.com] wrote:


Sent: Tuesday, November 04, 2014 03:40 PM
To: edk2-devel@lists.sourceforge.net
Cc: Paolo Bonzini
Subject: Re: [edk2] Enable optimization for gcc x64 builds

 

 

On Nov 4, 2014, at 12:15 PM, Scott Duplichan <scott@notabs.org <mailto:scott@notabs.org> > wrote:

 

But pedantically you need change the definition of BasePrintLibSPrint() to include EFIAPI. 

 

If you look at BasePrintLibSPrintMarker() (and some of the other routines) you will notice a BASE_LIST and a VA_LIST. We had an API that exposed a VA_LIST (well code that was casting to VA_LIST) in the report status code stack and it forced use to use our own made up BASE_LIST concept to get it to work. I think you are going to hit similar issues mixing calling conventions. 

 

So my 1st question is why do you need to mix calling conventions, and depend on EFIAPI for interoperability. Why not just change the ABI on all functions?

 

If I understand your question "Why not just change the ABI on all functions", you mean use Microsoft ABI throughout the code even when compiled with gcc? The gcc option -mabi=ms makes this easy, and it reduces code size too (8% in one test). Part of that code size reduction is because it removes the requirement to save xmm6-xmm15 when calling msabi code. Gcc doesn't optimize the save/restore of xmm6-xmm15, it just does them all. The problems with ms abi I can think of are:

1) Linux developers accustomed to stepping through the sysv calling convention would have to adapt to the ms calling convention.

 

Well all the public interfaces (EFI service, protocol member functions, etc.) are EFIAPI, so there will be a mix. 





2) -mabi=ms is probably  little used and therefore more likely to have bugs. This might require dropping support for older gcc tool chains.

 

Looks like mixing has bugs too. It looks like this issue is caused by a mismatch in the vararg definitions between the two worlds. You can’t really mix styles in a given call stack. It almost seems like you want to force one var arg scheme every place possible. 





3) According to an email from you in April, ms abi might not support stack trace without debug symbols.

 

 

This is not the ABI it is VC++ code generation. There is  nothing in the ABI about how to unwind a stack frame, it is about how to call code in C. 

 

In my clang examples, in this thread,  we have an EFIAPI compatible calling convention with stack unwind. -target x86_64-pc-win32-macho means build an X64 image using EFIAPI, do the standard frame pointer, and we kick out a Mach-O executable for the debugger. We convert the Mach-O to PE/COFF for EFI compatibility. So on clang it as EFIABI, but with stack unwind. We can always unwind a frame without symbols, until we hit code compiled with VC++. 





Even if ms abi is never made the default for gcc code, adding an environment variable such as EXTRA_CC_FLAGS would allow its use in custom builds by those who need the code size reduction it brings.

 

What about switching EDK2 to sysv abi? I assume that would require dropping support for Microsoft compilers. 

 

 

The EFI calling convention is in the spec, so all things EFI would break. Option ROMs on cards, installed Operating system, etc…. The edk2 is an open source project that implements industry standard, not just a chunk of code. 

 

Thanks,

 

Andrew Fish

 

These are all good answers. I can't come up with a strong argument for the mixed sysv/ms ABI. Maybe the next step is to test -mabi=ms using several gcc versions (I think -mabi=ms was introduced with gcc 4.5). If that works, I could submit a patch and see what happens..

Thanks,

Scott





 

Thanks,

Scott
------------------------------------------------------------------------------
Jordan Justen Nov. 7, 2014, 6:39 p.m. UTC | #11
On 2014-11-07 08:16:23, Scott Duplichan wrote:
> These are all good answers. I can't come up with a strong argument for the
> mixed sysv/ms ABI. Maybe the next step is to test -mabi=ms using several gcc
> versions (I think -mabi=ms was introduced with gcc 4.5). If that works, I could
> submit a patch and see what happens..

I mentioned a reason in this thread a few days back. But, we should
look into -mabi=ms for RELEASE builds.

-Jordan

------------------------------------------------------------------------------
Scott Duplichan Nov. 7, 2014, 8:29 p.m. UTC | #12
Jordan Justen [mailto:jordan.l.justen@intel.com] wrote:

]On 2014-11-07 08:16:23, Scott Duplichan wrote:
]> These are all good answers. I can't come up with a strong argument for the
]> mixed sysv/ms ABI. Maybe the next step is to test -mabi=ms using several gcc
]> versions (I think -mabi=ms was introduced with gcc 4.5). If that works, I could
]> submit a patch and see what happens..
]
]I mentioned a reason in this thread a few days back. But, we should
]look into -mabi=ms for RELEASE builds.
]
]-Jordan

I agree, the approach in your previous email is a good one. Prototyping
asm functions to enforce calling convention is always a good idea. In theory
an IA32 build could be done with a Microsoft compiler with option /Gr
(__fastcall calling convention) and it would work. This would not be possible
if asm function calling convention information were missing. If I make this
patch, I will add the gcc -mabi=ms to the release build.

Now for rants...
1) Why do so many developers never want to test release builds? To me, code
is not clean until both debug and release builds work smoothly.
2) Why is the NOOPT build missing from virtually every DSC file in EDK2?
The EDK NOOPT build is most like what developers call a DEBUG build. It is
the only one setup for source level debugging, at least for Microsoft tool
chains. The Duet DSC files are missing both RELEASE and NOOPT options. I
may submit a patch to allow all 3 builds to every DSC file.

Thanks,
Scott


------------------------------------------------------------------------------
Andrew Fish Nov. 7, 2014, 9:56 p.m. UTC | #13
> 
> Now for rants...
> 1) Why do so many developers never want to test release builds? To me, code
> is not clean until both debug and release builds work smoothly.
> 2) Why is the NOOPT build missing from virtually every DSC file in EDK2?
> The EDK NOOPT build is most like what developers call a DEBUG build. It is
> the only one setup for source level debugging, at least for Microsoft tool
> chains. The Duet DSC files are missing both RELEASE and NOOPT options. I
> may submit a patch to allow all 3 builds to every DSC file.
> 

Scott,

Historically, if I remember correctly, the NOOPT builds were added to support Nt32Pkg/EmulatorPkg. 

“Back in the day” a NOOPT build would not generally fit in a ROM. But given folks could be building an option ROM, shell, OS loader that don’t have size constraints I think you are right in pointing out the NOOPT builds should be in all the supported tool chains. 

Thanks,

Andrew Fish

> Thanks,
> Scott


------------------------------------------------------------------------------
Laszlo Ersek Nov. 11, 2014, 9:33 a.m. UTC | #14
On 11/07/14 21:29, Scott Duplichan wrote:
> Jordan Justen [mailto:jordan.l.justen@intel.com] wrote:
> 
> ]On 2014-11-07 08:16:23, Scott Duplichan wrote:
> ]> These are all good answers. I can't come up with a strong argument for the
> ]> mixed sysv/ms ABI. Maybe the next step is to test -mabi=ms using several gcc
> ]> versions (I think -mabi=ms was introduced with gcc 4.5). If that works, I could
> ]> submit a patch and see what happens..
> ]
> ]I mentioned a reason in this thread a few days back. But, we should
> ]look into -mabi=ms for RELEASE builds.
> ]
> ]-Jordan
> 
> I agree, the approach in your previous email is a good one. Prototyping
> asm functions to enforce calling convention is always a good idea. In theory
> an IA32 build could be done with a Microsoft compiler with option /Gr
> (__fastcall calling convention) and it would work. This would not be possible
> if asm function calling convention information were missing. If I make this
> patch, I will add the gcc -mabi=ms to the release build.
> 
> Now for rants...
> 1) Why do so many developers never want to test release builds? To me, code
> is not clean until both debug and release builds work smoothly.

In my experience, release (== optimized) builds are practically
unsupportable. Even the Linux kernel disables some optimizations that
make the disassembly unreadable. Unless stuff is power and/or
performance critical, I prefer if the code does exactly what I tell it
to do. (Case in point: the -Os bug with recursion + ellipsis. It works
with -O0. Compilers have bugs.)

*All* software is chock full of bugs, and having to figure out what goes
wrong at a customer's site is a question of "when", not "if". They
either won't be able, or willing, to attempt to reproduce the issue with
a debug build, or they will try and the bug might disappear.

Consequently, since I'm not keen on shipping anything but a debug build,
I don't feel like putting many resources into release builds.

> 2) Why is the NOOPT build missing from virtually every DSC file in EDK2?

I guess in OVMF we never needed it?

> The EDK NOOPT build is most like what developers call a DEBUG build. It is
> the only one setup for source level debugging, at least for Microsoft tool
> chains.

I don't use Microsoft tool chains. And source level debugging with gdb
is hardly possible even on DEBUG; you have to jump through incredible
hoops. NOOPT doesn't solve anything for Linux-based developers & users
of OVMF.

> The Duet DSC files are missing both RELEASE and NOOPT options.

It's an emulator platform, isn't it? You probably won't use it in
production.

Thanks
Laszlo

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
Scott Duplichan Nov. 11, 2014, 5:46 p.m. UTC | #15
Laszlo Ersek [mailto:lersek@redhat.com] wrote:

]On 11/07/14 21:29, Scott Duplichan wrote:
]> Jordan Justen [mailto:jordan.l.justen@intel.com] wrote:
]> 
]> ]On 2014-11-07 08:16:23, Scott Duplichan wrote:
]> ]> These are all good answers. I can't come up with a strong argument for the
]> ]> mixed sysv/ms ABI. Maybe the next step is to test -mabi=ms using several gcc
]> ]> versions (I think -mabi=ms was introduced with gcc 4.5). If that works, I could
]> ]> submit a patch and see what happens..
]> ]
]> ]I mentioned a reason in this thread a few days back. But, we should
]> ]look into -mabi=ms for RELEASE builds.
]> ]
]> ]-Jordan
]> 
]> I agree, the approach in your previous email is a good one. Prototyping
]> asm functions to enforce calling convention is always a good idea. In theory
]> an IA32 build could be done with a Microsoft compiler with option /Gr
]> (__fastcall calling convention) and it would work. This would not be possible
]> if asm function calling convention information were missing. If I make this
]> patch, I will add the gcc -mabi=ms to the release build.
]> 
]> Now for rants...
]> 1) Why do so many developers never want to test release builds? To me, code
]> is not clean until both debug and release builds work smoothly.
]
]In my experience, release (== optimized) builds are practically
]unsupportable. Even the Linux kernel disables some optimizations that
]make the disassembly unreadable. Unless stuff is power and/or
]performance critical, I prefer if the code does exactly what I tell it
]to do. (Case in point: the -Os bug with recursion + ellipsis. It works
]with -O0. Compilers have bugs.)
]
]*All* software is chock full of bugs, and having to figure out what goes
]wrong at a customer's site is a question of "when", not "if". They
]either won't be able, or willing, to attempt to reproduce the issue with
]a debug build, or they will try and the bug might disappear.
]
]Consequently, since I'm not keen on shipping anything but a debug build,
]I don't feel like putting many resources into release builds.

Release builds are/were shipped out of necessity, at least in the past.
This was due to a desire to cut board cost by using the smallest possible
flash chip. But times are changing and NOR flash capacity is growing 
even faster than code size. So the flash size reduction motivation for
optimizing code is losing importance I guess. In my experience, getting
a release build to work sometimes results in uncovering hidden coding
errors. A bigger reason to use release builds is boot time reduction.
While UEFI will never boot as fast as coreboot, it can narrow the gap
some by minimizing the time spent reading data from the flash chip.
Adding -Os and link time optimization can cut the image size in half.
That saves significant time when the image is read from the flash chip.
]
]> 2) Why is the NOOPT build missing from virtually every DSC file in EDK2?
]
]I guess in OVMF we never needed it?

I got OVMF booting on a real server a few years ago. Adding the NOOPT
build was the first thing I did. That let me step through the source code
and see all local variables. I couldn't have gotten it working as quickly
as I did without source level debugging.

Instead of adding NOOPT to every project, adding it to one or two might
be a better idea. I don't want to see a lot of code change just for the
sake debugger support. 

]> The EDK NOOPT build is most like what developers call a DEBUG build. It is
]> the only one setup for source level debugging, at least for Microsoft tool
]> chains.
]
]I don't use Microsoft tool chains. And source level debugging with gdb
]is hardly possible even on DEBUG; you have to jump through incredible
]hoops. NOOPT doesn't solve anything for Linux-based developers & users
]of OVMF.

I understand. But Microsoft tool chains are still supported by the EDK2
project. Dropping support for Microsoft tool chains would solve some
problems. But clearly that isn't going to happen any time soon. It is
surprising to see the strength and weaknesses of different tool chains.
Microsoft perfected link time optimization 10+ years ago. Yet they 
didn't even bother with C99 support until recently. GCC had C99 10+
years ago, yet only recently perfected link time optimization.

It is unfortunate there is no nice open source debugger for use with
EDK2 and other embedded projects. Some of the OEM and IBV debuggers
I used were really nice, though at the time they supported only
Microsoft debug symbols.

]> The Duet DSC files are missing both RELEASE and NOOPT options.
]
]It's an emulator platform, isn't it? You probably won't use it in
]production.

Of all EDK2 projects, Duet seems to need the fewest changes for use
on real hardware. You would be surprised to know how many Duet based
systems have shipped from tier one oems.

]Thanks
]Laszlo

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
diff mbox

Patch

diff --git a/MdePkg/Library/BasePrintLib/PrintLibInternal.c
b/MdePkg/Library/BasePrintLib/PrintLibInternal.c
index 8dc5ec7..fbb3726 100644
--- a/MdePkg/Library/BasePrintLib/PrintLibInternal.c
+++ b/MdePkg/Library/BasePrintLib/PrintLibInternal.c
@@ -680,10 +680,20 @@  BasePrintLibSPrintMarker (
         if (TmpGuid == NULL) {
           ArgumentString = "<null guid>";
         } else {
+          UINTN (EFIAPI * volatile PrintFunction) (
+                                     OUT CHAR8        *StartOfBuffer,
+                                     IN  UINTN        BufferSize,
+                                     IN  UINTN        Flags,
+                                     IN  CONST CHAR8  *FormatString,
+                                     ...
+                                     );
+
+          PrintFunction = BasePrintLibSPrint;
+
           GuidData1 = ReadUnaligned32 (&(TmpGuid->Data1));
           GuidData2 = ReadUnaligned16 (&(TmpGuid->Data2));
           GuidData3 = ReadUnaligned16 (&(TmpGuid->Data3));
-          BasePrintLibSPrint (
+          PrintFunction (
             ValueBuffer,
             MAXIMUM_VALUE_CHARACTERS,
             0,