From patchwork Tue Nov 4 13:48:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 40155 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A118E21894 for ; Tue, 4 Nov 2014 13:48:55 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id n15sf2178021lbi.6 for ; Tue, 04 Nov 2014 05:48:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:references:in-reply-to:cc:subject:precedence :reply-to:list-id:list-unsubscribe:list-archive:list-post:list-help :list-subscribe:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type; bh=G8VbUZI8KGmA9njKF0MrgLAm9Xthu+OX34gpQ9zD0hk=; b=UpEorMeUG9Kl0fgR7pAdf/KHaf6v5LK6R63BxLa9IteaDjW+G2591phsCqOeHp1A7R R5ybO/NeRJXx9Bs62AICCJnUe9HVhjAeQ2vP6dh9G/aRa2GY7QKY7wJyfGclWiAlB4J5 AWN3/4QT5hRmd/jxALpyI/oTe1HYARfZBygtAaOBReVLg/v+Jn9/74nNlfp9xkBpNahS zgwYy6/8Ryl5u9DnmqqnGme8/NbOKYLVsJ3Ddq1hFgfWU5QIiyqpG7O8t2YwLnDUVXyV uun4ZeZd/qoUJ1aV4F3DV4dYszNdlO8XUpYLLEGpVPP1Aeg9LW+Wlebj+Ly8IlpAFXLZ LTcA== X-Gm-Message-State: ALoCoQnd+cfys/DpqtCT+t4GrfxKo1OVjU0kjA84XJEMvc4Hpa3UUm9Nan+GROWkZCA2AjH0t309 X-Received: by 10.152.30.66 with SMTP id q2mr22105lah.2.1415108934433; Tue, 04 Nov 2014 05:48:54 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.134 with SMTP id b6ls761744laa.77.gmail; Tue, 04 Nov 2014 05:48:54 -0800 (PST) X-Received: by 10.112.138.39 with SMTP id qn7mr45835338lbb.57.1415108934058; Tue, 04 Nov 2014 05:48:54 -0800 (PST) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id dv6si863996lbc.52.2014.11.04.05.48.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Nov 2014 05:48:54 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by mail-lb0-f180.google.com with SMTP id u10so2784861lbd.11 for ; Tue, 04 Nov 2014 05:48:54 -0800 (PST) X-Received: by 10.152.42.226 with SMTP id r2mr28440002lal.29.1415108933917; Tue, 04 Nov 2014 05:48:53 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp116984lbc; Tue, 4 Nov 2014 05:48:51 -0800 (PST) X-Received: by 10.107.133.234 with SMTP id p103mr54419757ioi.7.1415108930967; Tue, 04 Nov 2014 05:48:50 -0800 (PST) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id jx5si1150080icc.101.2014.11.04.05.48.49 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 04 Nov 2014 05:48:50 -0800 (PST) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1XleTH-0003nF-Em; Tue, 04 Nov 2014 13:48:31 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1XleTE-0003n2-TN for edk2-devel@lists.sourceforge.net; Tue, 04 Nov 2014 13:48:29 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=lersek@redhat.com; helo=mx1.redhat.com; Received: from mx1.redhat.com ([209.132.183.28]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1XleT3-0004zT-C9 for edk2-devel@lists.sourceforge.net; Tue, 04 Nov 2014 13:48:28 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sA4DmAmd000548 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 4 Nov 2014 08:48:10 -0500 Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-81.ams2.redhat.com [10.36.116.81]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sA4Dm51P006850; Tue, 4 Nov 2014 08:48:06 -0500 Message-ID: <5458D914.1070608@redhat.com> Date: Tue, 04 Nov 2014 14:48:04 +0100 From: Laszlo Ersek User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: edk2-devel@lists.sourceforge.net References: <003501cff335$1f003fc0$5d00bf40$@notabs.org> <5457AA80.6010300@redhat.com> <000001cff7a4$1c37cd30$54a76790$@notabs.org> In-Reply-To: <000001cff7a4$1c37cd30$54a76790$@notabs.org> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Spam-Score: -2.1 (--) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.6 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain X-Headers-End: 1XleT3-0004zT-C9 Cc: Paolo Bonzini Subject: Re: [edk2] Enable optimization for gcc x64 builds X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lersek@redhat.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 --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 : 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 14: 48 39 d7 cmp %rdx,%rdi 17: 7d 14 jge 2d *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 *(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 } Buffer += Increment; } return Buffer; } 2d: c3 retq Disassembly of section .text.BasePrintLibValueToString: 0000000000000000 : 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 // // 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 : 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 2e: 4d 85 ed test %r13,%r13 31: 75 25 jne 58 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 5f: 49 83 fc 25 cmp $0x25,%r12 63: 76 25 jbe 8a 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 91: 48 f7 c5 56 ff ff ff test $0xffffffffffffff56,%rbp 98: 74 25 je bf 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 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 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 100: 40 f6 c5 08 test $0x8,%bpl 104: 74 10 je 116 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 137: 40 f6 c5 80 test $0x80,%bpl 13b: 75 1f jne 15c 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 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 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 Digits++; 22e: 49 ff c4 inc %r12 if (Digits == 3) { 231: 49 83 fc 03 cmp $0x3,%r12 235: 75 33 jne 26a Digits = 0; if ((Index + 1) < Count) { 237: 48 3b 6c 24 28 cmp 0x28(%rsp),%rbp 23c: 73 29 jae 267 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 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 } // // 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 : 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 : 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 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 } 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 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 5a: 48 83 7c 24 70 00 cmpq $0x0,0x70(%rsp) 60: 75 25 jne 87 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 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 } 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 // // 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 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 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 } 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 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 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 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 1d7: 80 bc 24 90 00 00 00 cmpb $0x0,0x90(%rsp) 1de: 00 1df: 74 1f je 200 // 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 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 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 210: 48 83 f8 25 cmp $0x25,%rax 214: 74 0f je 225 216: 48 83 f8 0a cmp $0xa,%rax 21a: 0f 85 95 07 00 00 jne 9b5 220: e9 60 07 00 00 jmpq 985 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 261: 77 37 ja 29a 263: 48 83 f8 2a cmp $0x2a,%rax 267: 0f 84 44 01 00 00 je 3b1 26d: 77 15 ja 284 26f: 48 85 c0 test %rax,%rax 272: 0f 84 f3 01 00 00 je 46b 278: 48 83 f8 20 cmp $0x20,%rax 27c: 0f 84 14 01 00 00 je 396 282: eb 50 jmp 2d4 284: 48 83 f8 2b cmp $0x2b,%rax 288: 0f 84 ff 00 00 00 je 38d 28e: 48 83 f8 2c cmp $0x2c,%rax 292: 0f 84 07 01 00 00 je 39f 298: eb 3a jmp 2d4 29a: 48 83 f8 39 cmp $0x39,%rax 29e: 77 20 ja 2c0 2a0: 48 83 f8 31 cmp $0x31,%rax 2a4: 0f 83 64 01 00 00 jae 40e 2aa: 48 83 f8 2e cmp $0x2e,%rax 2ae: 0f 84 c8 00 00 00 je 37c 2b4: 48 83 f8 30 cmp $0x30,%rax 2b8: 0f 84 42 01 00 00 je 400 2be: eb 14 jmp 2d4 2c0: 48 83 f8 4c cmp $0x4c,%rax 2c4: 0f 84 de 00 00 00 je 3a8 2ca: 48 83 f8 6c cmp $0x6c,%rax 2ce: 0f 84 d4 00 00 00 je 3a8 } // // 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 2e6: 77 48 ja 330 2e8: 48 83 f8 53 cmp $0x53,%rax 2ec: 0f 84 1f 03 00 00 je 611 2f2: 77 19 ja 30d 2f4: 48 83 f8 0a cmp $0xa,%rax 2f8: 0f 84 de 05 00 00 je 8dc 2fe: 48 83 f8 0d cmp $0xd,%rax 302: 0f 84 87 05 00 00 je 88f 308: e9 06 06 00 00 jmpq 913 30d: 48 83 f8 61 cmp $0x61,%rax 311: 0f 84 fd 02 00 00 je 614 317: 48 83 f8 63 cmp $0x63,%rax 31b: 0f 84 3d 03 00 00 je 65e 321: 48 83 f8 58 cmp $0x58,%rax 325: 0f 84 59 01 00 00 je 484 32b: e9 e3 05 00 00 jmpq 913 330: 48 83 f8 72 cmp $0x72,%rax 334: 0f 84 95 04 00 00 je 7cf 33a: 77 21 ja 35d 33c: 48 83 f8 67 cmp $0x67,%rax 340: 0f 84 67 03 00 00 je 6ad 346: 48 83 f8 70 cmp $0x70,%rax 34a: 0f 85 c3 05 00 00 jne 913 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 } // // Handle each argument type // switch (FormatCharacter) { 35d: 48 83 f8 74 cmp $0x74,%rax 361: 0f 84 fa 03 00 00 je 761 367: 0f 82 a4 02 00 00 jb 611 36d: 48 83 f8 78 cmp $0x78,%rax 371: 0f 84 11 01 00 00 je 488 377: e9 97 05 00 00 jmpq 913 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 case '-': Flags |= LEFT_JUSTIFY; 384: 48 83 cb 01 or $0x1,%rbx break; 388: e9 b0 fe ff ff jmpq 23d case '+': Flags |= PREFIX_SIGN; 38d: 48 83 cb 02 or $0x2,%rbx break; 391: e9 a7 fe ff ff jmpq 23d case ' ': Flags |= PREFIX_BLANK; 396: 48 83 cb 04 or $0x4,%rbx break; 39a: e9 9e fe ff ff jmpq 23d case ',': Flags |= COMMA_TYPE; 39f: 48 83 cb 08 or $0x8,%rbx break; 3a3: e9 95 fe ff ff jmpq 23d case 'L': case 'l': Flags |= LONG_TYPE; 3a8: 48 83 cb 10 or $0x10,%rbx break; 3ac: e9 8c fe ff ff jmpq 23d case '*': if ((Flags & PRECISION) == 0) { 3b1: f6 c7 08 test $0x8,%bh 3b4: 75 22 jne 3d8 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 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 } 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 } } else { if (BaseListMarker == NULL) { 3d8: 48 85 ed test %rbp,%rbp 3db: 75 16 jne 3f3 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 } 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 } } 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 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 } 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 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 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 } // // 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 // 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 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 } else { Value = BASE_ARG (BaseListMarker, int); 4a5: 48 63 5d 00 movslq 0x0(%rbp),%rbx 4a9: eb 1c jmp 4c7 } } else { if (BaseListMarker == NULL) { 4ab: 48 85 ed test %rbp,%rbp 4ae: 75 13 jne 4c3 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 } 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 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 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 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 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 51f: 48 85 db test %rbx,%rbx 522: 79 02 jns 526 // 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 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 } } // // 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 5bb: 45 84 c9 test %r9b,%r9b 5be: 74 12 je 5d2 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 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 if ((Flags & LEFT_JUSTIFY) == 0) { 5f1: f6 c1 01 test $0x1,%cl 5f4: 0f 85 61 04 00 00 jne a5b if ((Flags & PAD_TO_WIDTH) != 0) { 5fa: f6 c5 02 test $0x2,%ch 5fd: 0f 84 58 04 00 00 je a5b 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 } 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 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 } 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 Flags &= ~((UINTN) ARGUMENT_UNICODE); 639: 80 e7 fb and $0xfb,%bh ArgumentString = ""; 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 Precision = 0; } break; case 'c': if (BaseListMarker == NULL) { 65e: 48 85 ed test %rbp,%rbp 661: 75 1e jne 681 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 } 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 case 'g': if (BaseListMarker == NULL) { 6ad: 48 85 ed test %rbp,%rbp 6b0: 75 13 jne 6c5 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 } 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 6d6: 4c 89 94 24 80 00 00 mov %r10,0x80(%rsp) 6dd: 00 ArgumentString = ""; } 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 = ""; } 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 = ""; } 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 = ""; } 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 = ""; } 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 = ""; } 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 ArgumentString = ValueBuffer; } break; case 't': if (BaseListMarker == NULL) { 761: 48 85 ed test %rbp,%rbp 764: 75 13 jne 779 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 } 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 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 ArgumentString = ValueBuffer; } break; case 'r': if (BaseListMarker == NULL) { 7cf: 48 85 ed test %rbp,%rbp 7d2: 75 13 jne 7e7 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 } 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 // // 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 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 } } else { Index = Status; if (Index <= WARNING_STATUS_NUMBER) { 81c: 48 83 f8 05 cmp $0x5,%rax 820: 77 1f ja 841 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 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 } 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 } 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 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 Format -= BytesPerFormatCharacter; 90b: 49 29 f7 sub %rsi,%r15 90e: e9 02 01 00 00 jmpq a15 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 } 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 } 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 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 Format -= BytesPerFormatCharacter; 9b0: 49 29 f7 sub %rsi,%r15 9b3: eb 78 jmp a2d } 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 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 = ""; 9e3: 49 bd 00 00 00 00 00 movabs $0x0,%r13 9ea: 00 00 00 9ed: eb 6c jmp a5b 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 = ""; 9fb: 49 bd 00 00 00 00 00 movabs $0x0,%r13 a02: 00 00 00 a05: eb 54 jmp a5b 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 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 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 } 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 } 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 } 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 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 } 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 ae9: eb cd jmp ab8 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 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 b38: 80 bc 24 90 00 00 00 cmpb $0x0,0x90(%rsp) b3f: 00 b40: 74 42 je b84 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 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 if (Prefix != 0) { b96: 45 84 e4 test %r12b,%r12b b99: 74 4b je be6 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 bad: 48 8b 7c 24 38 mov 0x38(%rsp),%rdi bb2: 48 85 ff test %rdi,%rdi bb5: 74 2f je be6 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 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 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 } } 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 c81: 48 8b 7c 24 38 mov 0x38(%rsp),%rdi c86: 48 85 ff test %rdi,%rdi c89: 74 3e je cc9 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 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 ce1: 48 8b 7c 24 38 mov 0x38(%rsp),%rdi ce6: 48 85 ff test %rdi,%rdi ce9: 74 41 je d2c 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 } // // 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 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 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 d63: 48 8b 7c 24 38 mov 0x38(%rsp),%rdi d68: 48 85 ff test %rdi,%rdi d6b: 74 5b je dc8 // // 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 Digits++; de1: 49 ff c6 inc %r14 if (Digits == 3) { de4: 49 83 fe 03 cmp $0x3,%r14 de8: 75 6c jne e56 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 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 e0a: 48 8b 7c 24 38 mov 0x38(%rsp),%rdi e0f: 48 85 ff test %rdi,%rdi e12: 74 3d je e51 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 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 } // // 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 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 e97: 48 8b 7c 24 38 mov 0x38(%rsp),%rdi e9c: 48 85 ff test %rdi,%rdi e9f: 74 1b je ebc 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 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 ef4: 48 83 7c 24 38 00 cmpq $0x0,0x38(%rsp) efa: 75 25 jne f21 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 f4b: f6 c3 40 test $0x40,%bl f4e: 74 3b je f8b 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 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 f92: 80 e3 40 and $0x40,%bl f95: 75 3b jne fd2 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 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 fe3: 4c 8b 54 24 30 mov 0x30(%rsp),%r10 fe8: e9 50 f2 ff ff jmpq 23d } 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 : 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 14: 48 39 d7 cmp %rdx,%rdi 17: 7d 14 jge 2d *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 *(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 } Buffer += Increment; } return Buffer; } 2d: c3 retq Disassembly of section .text.BasePrintLibValueToString: 0000000000000000 : 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 // // 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 : 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 2e: 4d 85 ed test %r13,%r13 31: 75 25 jne 58 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 5f: 49 83 fc 25 cmp $0x25,%r12 63: 76 25 jbe 8a 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 91: 48 f7 c5 56 ff ff ff test $0xffffffffffffff56,%rbp 98: 74 25 je bf 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 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 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 100: 40 f6 c5 08 test $0x8,%bpl 104: 74 10 je 116 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 137: 40 f6 c5 80 test $0x80,%bpl 13b: 75 1f jne 15c 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 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 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 Digits++; 22e: 49 ff c4 inc %r12 if (Digits == 3) { 231: 49 83 fc 03 cmp $0x3,%r12 235: 75 33 jne 26a Digits = 0; if ((Index + 1) < Count) { 237: 48 3b 6c 24 28 cmp 0x28(%rsp),%rbp 23c: 73 29 jae 267 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 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 } // // 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 : 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 : 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 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 } 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 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 58: 48 83 7c 24 70 00 cmpq $0x0,0x70(%rsp) 5e: 75 25 jne 85 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 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 } 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 // // 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 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 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 } 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 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 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 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 1cc: 80 bc 24 90 00 00 00 cmpb $0x0,0x90(%rsp) 1d3: 00 1d4: 74 1c je 1f2 // 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 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 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 202: 48 83 f8 25 cmp $0x25,%rax 206: 74 0f je 217 208: 48 83 f8 0a cmp $0xa,%rax 20c: 0f 85 14 07 00 00 jne 926 212: e9 d8 06 00 00 jmpq 8ef 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 253: 77 37 ja 28c 255: 48 83 f8 2a cmp $0x2a,%rax 259: 0f 84 44 01 00 00 je 3a3 25f: 77 15 ja 276 261: 48 85 c0 test %rax,%rax 264: 0f 84 e4 01 00 00 je 44e 26a: 48 83 f8 20 cmp $0x20,%rax 26e: 0f 84 14 01 00 00 je 388 274: eb 50 jmp 2c6 276: 48 83 f8 2b cmp $0x2b,%rax 27a: 0f 84 ff 00 00 00 je 37f 280: 48 83 f8 2c cmp $0x2c,%rax 284: 0f 84 07 01 00 00 je 391 28a: eb 3a jmp 2c6 28c: 48 83 f8 39 cmp $0x39,%rax 290: 77 20 ja 2b2 292: 48 83 f8 31 cmp $0x31,%rax 296: 0f 83 55 01 00 00 jae 3f1 29c: 48 83 f8 2e cmp $0x2e,%rax 2a0: 0f 84 c8 00 00 00 je 36e 2a6: 48 83 f8 30 cmp $0x30,%rax 2aa: 0f 84 33 01 00 00 je 3e3 2b0: eb 14 jmp 2c6 2b2: 48 83 f8 4c cmp $0x4c,%rax 2b6: 0f 84 de 00 00 00 je 39a 2bc: 48 83 f8 6c cmp $0x6c,%rax 2c0: 0f 84 d4 00 00 00 je 39a } // // 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 2d8: 77 48 ja 322 2da: 48 83 f8 53 cmp $0x53,%rax 2de: 0f 84 fd 02 00 00 je 5e1 2e4: 77 19 ja 2ff 2e6: 48 83 f8 0a cmp $0xa,%rax 2ea: 0f 84 52 05 00 00 je 842 2f0: 48 83 f8 0d cmp $0xd,%rax 2f4: 0f 84 f9 04 00 00 je 7f3 2fa: e9 7a 05 00 00 jmpq 879 2ff: 48 83 f8 61 cmp $0x61,%rax 303: 0f 84 db 02 00 00 je 5e4 309: 48 83 f8 63 cmp $0x63,%rax 30d: 0f 84 13 03 00 00 je 626 313: 48 83 f8 58 cmp $0x58,%rax 317: 0f 84 4a 01 00 00 je 467 31d: e9 57 05 00 00 jmpq 879 322: 48 83 f8 72 cmp $0x72,%rax 326: 0f 84 0f 04 00 00 je 73b 32c: 77 21 ja 34f 32e: 48 83 f8 67 cmp $0x67,%rax 332: 0f 84 33 03 00 00 je 66b 338: 48 83 f8 70 cmp $0x70,%rax 33c: 0f 85 37 05 00 00 jne 879 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 } // // Handle each argument type // switch (FormatCharacter) { 34f: 48 83 f8 74 cmp $0x74,%rax 353: 0f 84 7e 03 00 00 je 6d7 359: 0f 82 82 02 00 00 jb 5e1 35f: 48 83 f8 78 cmp $0x78,%rax 363: 0f 84 02 01 00 00 je 46b 369: e9 0b 05 00 00 jmpq 879 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 case '-': Flags |= LEFT_JUSTIFY; 376: 48 83 cb 01 or $0x1,%rbx break; 37a: e9 b0 fe ff ff jmpq 22f case '+': Flags |= PREFIX_SIGN; 37f: 48 83 cb 02 or $0x2,%rbx break; 383: e9 a7 fe ff ff jmpq 22f case ' ': Flags |= PREFIX_BLANK; 388: 48 83 cb 04 or $0x4,%rbx break; 38c: e9 9e fe ff ff jmpq 22f case ',': Flags |= COMMA_TYPE; 391: 48 83 cb 08 or $0x8,%rbx break; 395: e9 95 fe ff ff jmpq 22f case 'L': case 'l': Flags |= LONG_TYPE; 39a: 48 83 cb 10 or $0x10,%rbx break; 39e: e9 8c fe ff ff jmpq 22f case '*': if ((Flags & PRECISION) == 0) { 3a3: f6 c7 08 test $0x8,%bh 3a6: 75 1d jne 3c5 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 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 } 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 } } else { if (BaseListMarker == NULL) { 3c5: 48 85 ed test %rbp,%rbp 3c8: 75 0c jne 3d6 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 } 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 } } 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 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 } 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 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 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 } // // 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 // 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 Value = VA_ARG (VaListMarker, int); 47e: 49 63 1f movslq (%r15),%rbx 481: eb 0e jmp 491 } else { Value = BASE_ARG (BaseListMarker, int); 483: 48 63 5d 00 movslq 0x0(%rbp),%rbx 487: eb 12 jmp 49b } } else { if (BaseListMarker == NULL) { 489: 48 85 ed test %rbp,%rbp 48c: 75 09 jne 497 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 } 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 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 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 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 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 4f8: 48 85 db test %rbx,%rbx 4fb: 79 02 jns 4ff // 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 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 } } // // 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 589: 80 7c 24 53 00 cmpb $0x0,0x53(%rsp) 58e: 74 12 je 5a2 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 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 if ((Flags & LEFT_JUSTIFY) == 0) { 5c1: f6 c1 01 test $0x1,%cl 5c4: 0f 85 0e 04 00 00 jne 9d8 if ((Flags & PAD_TO_WIDTH) != 0) { 5ca: f6 c5 02 test $0x2,%ch 5cd: 0f 84 05 04 00 00 je 9d8 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 } 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 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 } 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 Flags &= ~((UINTN) ARGUMENT_UNICODE); 5ff: 80 e7 fb and $0xfb,%bh ArgumentString = ""; 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 Precision = 0; } break; case 'c': if (BaseListMarker == NULL) { 626: 48 85 ed test %rbp,%rbp 629: 75 12 jne 63d 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 } 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 case 'g': if (BaseListMarker == NULL) { 66b: 48 85 ed test %rbp,%rbp 66e: 75 09 jne 679 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 } 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 68a: 4c 89 54 24 78 mov %r10,0x78(%rsp) ArgumentString = ""; } 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 = ""; } 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 ArgumentString = ValueBuffer; } break; case 't': if (BaseListMarker == NULL) { 6d7: 48 85 ed test %rbp,%rbp 6da: 75 09 jne 6e5 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 } 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 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 ArgumentString = ValueBuffer; } break; case 'r': if (BaseListMarker == NULL) { 73b: 48 85 ed test %rbp,%rbp 73e: 75 09 jne 749 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 } 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 // // 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 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 } } else { Index = Status; if (Index <= WARNING_STATUS_NUMBER) { 77e: 48 83 f8 05 cmp $0x5,%rax 782: 77 1f ja 7a3 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 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 } 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 } 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 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 Format -= BytesPerFormatCharacter; 871: 49 29 f6 sub %rsi,%r14 874: e9 15 01 00 00 jmpq 98e 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 } 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 } 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 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 Format -= BytesPerFormatCharacter; 91e: 49 29 f6 sub %rsi,%r14 921: e9 82 00 00 00 jmpq 9a8 } 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 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 = ""; 958: 49 bd 00 00 00 00 00 movabs $0x0,%r13 95f: 00 00 00 962: eb 74 jmp 9d8 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 = ""; 972: 49 bd 00 00 00 00 00 movabs $0x0,%r13 979: 00 00 00 97c: eb 5a jmp 9d8 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 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 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 } 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 } 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 } 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 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 } 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 a66: eb cd jmp a35 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 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 ab2: 80 bc 24 90 00 00 00 cmpb $0x0,0x90(%rsp) ab9: 00 aba: 74 42 je afe 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 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 if (Prefix != 0) { b10: 45 84 e4 test %r12b,%r12b b13: 74 48 je b5d 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 b24: 48 8b 7c 24 38 mov 0x38(%rsp),%rdi b29: 48 85 ff test %rdi,%rdi b2c: 74 2f je b5d 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 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 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 } } 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 bf2: 48 8b 7c 24 38 mov 0x38(%rsp),%rdi bf7: 48 85 ff test %rdi,%rdi bfa: 74 3e je c3a 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 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 c52: 48 8b 7c 24 38 mov 0x38(%rsp),%rdi c57: 48 85 ff test %rdi,%rdi c5a: 74 3e je c9a 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 } // // 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 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 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 cd5: 48 8b 7c 24 38 mov 0x38(%rsp),%rdi cda: 48 85 ff test %rdi,%rdi cdd: 74 50 je d2f // // 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 Digits++; d42: 49 ff c3 inc %r11 if (Digits == 3) { d45: 49 83 fb 03 cmp $0x3,%r11 d49: 75 69 jne db4 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 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 d6b: 48 8b 7c 24 38 mov 0x38(%rsp),%rdi d70: 48 85 ff test %rdi,%rdi d73: 74 3a je daf 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 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 } // // 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 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 ded: 48 8b 7c 24 38 mov 0x38(%rsp),%rdi df2: 48 85 ff test %rdi,%rdi df5: 74 1b je e12 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 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 e4a: 48 83 7c 24 38 00 cmpq $0x0,0x38(%rsp) e50: 75 25 jne e77 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 ea1: f6 c3 40 test $0x40,%bl ea4: 74 3b je ee1 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 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 ee8: 80 e3 40 and $0x40,%bl eeb: 75 3b jne f28 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 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 f39: 4c 8b 54 24 30 mov 0x30(%rsp),%r10 f3e: e9 ec f2 ff ff jmpq 22f } 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 ------------------------------------------------------------------------------ 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 = ""; } 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,