[llvm] r334830 - Re-apply "[DebugInfo] Check size of variable in ConvertDebugDeclareToDebugValue"

Friedman, Eli via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 19 13:57:19 PDT 2018


Preprocessed source attached. Reproduce with "clang -O3 -g 
--target=aarch64-pc-linux-gnu".

-Eli

On 6/19/2018 1:10 AM, Björn Pettersson A wrote:
>
> Preprocessed source would be helpful. I never used polly, so I’m not 
> sure exactly how to reproduce this.
>
> The "[DebugInfo] Check size of variable in 
> ConvertDebugDeclareToDebugValue" commit is basically about avoiding 
> faulty debug-info.
>
> I noticed that sometimes when a dbg.declare is removed and we convert 
> it to dbg.value (based on a store) we could insert incorrect dbg.value 
> intrinsics in case the store only stored to parts of the variable 
> (e.g. storing a single index in an array that was described by the 
> dbg.declare). That is what the commit should fix.
>
> The code for adding dbg.value based on a load/phi looked quite similar 
> as the store situation. However, I could not find a way to make a test 
> case where it failed for those (and I spent some time analyzing the 
> code and I could not see that we would suffer in the same way as for 
> store instructions), so I simply added some assertions that the size 
> of the variable and the value involved matched up. It is one of those 
> asserts that now trigger.
>
> I figure that it is more important that the code compiles compared to 
> having correct debug info (otherwise I suppose that we could add tons 
> of asserts that would fail almost every build with -g).
>
> I’ll simply remove those asserts until I can reproduce the problem 
> seen with polly-aosp.
>
> /Björn
>
> *From:*Friedman, Eli <efriedma at codeaurora.org>
> *Sent:* den 19 juni 2018 02:55
> *To:* Björn Pettersson A <bjorn.a.pettersson at ericsson.com>; 
> llvm-commits at lists.llvm.org
> *Subject:* Re: [llvm] r334830 - Re-apply "[DebugInfo] Check size of 
> variable in ConvertDebugDeclareToDebugValue"
>
> I'm seeing a crash on the polly-aosp buildbot 
> (http://lab.llvm.org:8011/builders/aosp-O3-polly-before-vectorizer-unprofitable/builds/552/steps/build-aosp/logs/stdio) 
> which looks like it's caused by this patch.  Any idea what's going 
> on?  I can send preprocessed source if you need it.
>
> -Eli
>
> from build log:
>
> clang: 
> /var/lib/buildbot/slaves/hexagon-build-03/aosp/llvm.src/lib/Transforms/Utils/Local.cpp:1317: 
> void llvm::ConvertDebugDeclareToDebugValue(llvm::DbgInfoIntrinsic *, 
> llvm::LoadInst *, llvm::DIBuilder &): Assertion 
> `valueCoversEntireFragment(LI->getType(), DII) && "Load is not loading 
> the full variable fragment."' failed.
> Stack dump:
> 0.    Program arguments: llvm.inst/bin/clang -cc1 -triple 
> aarch64--linux-android -emit-obj -mnoexecstack -disable-free 
> -main-file-name desc.c -mrelocation-model pic -pic-level 1 -pic-is-pie 
> -mthread-model posix -mdisable-fp-elim -relaxed-aliasing -fmath-errno 
> -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array 
> -target-cpu cortex-a53 -target-feature +fp-armv8 -target-feature +neon 
> -target-feature +crc -target-feature +crypto -target-abi aapcs -mllvm 
> -aarch64-fix-cortex-a53-835769=1 -fallow-half-arguments-and-returns 
> -dwarf-column-info -debug-info-kind=limited -dwarf-version=4 
> -debugger-tuning=gdb -ffunction-sections -fdata-sections 
> -coverage-notes-file 
> /var/lib/buildbot/slaves/hexagon-build-03/aosp/out/target/product/angler/obj/EXECUTABLES/strace_intermediates/desc.gcno 
> -nostdsysteminc -resource-dir llvm.inst/lib/clang/7.0.0 
> -dependency-file 
> out/target/product/angler/obj/EXECUTABLES/strace_intermediates/desc.d 
> -MT 
> out/target/product/angler/obj/EXECUTABLES/strace_intermediates/desc.o 
> -sys-header-deps -isystem frameworks/av/include -isystem 
> out/target/product/angler/obj/include -isystem 
> device/huawei/angler/kernel-headers -isystem 
> hardware/qcom/msm8994/kernel-headers -isystem 
> bionic/libc/arch-arm64/include -isystem bionic/libc/include -isystem 
> bionic/libc/kernel/uapi -isystem bionic/libc/kernel/uapi/asm-arm64 
> -isystem bionic/libc/kernel/android/uapi -I 
> external/strace/linux/aarch64 -I external/strace/linux -I 
> external/strace -I 
> out/target/product/angler/obj/EXECUTABLES/strace_intermediates -I 
> out/target/product/angler/gen/EXECUTABLES/strace_intermediates -I 
> libnativehelper/include/nativehelper -I external/libcxx/include -I 
> external/libcxxabi/include -I system/core/include -I 
> system/media/audio/include -I hardware/libhardware/include -I 
> hardware/libhardware_legacy/include -I hardware/ril/include -I 
> libnativehelper/include -I frameworks/native/include -I 
> frameworks/native/opengl/include -D _FORTIFY_SOURCE=2 -D NDEBUG -D 
> ANDROID -D NDEBUG -U DEBUG -D __compiler_offsetof=__builtin_offsetof 
> -D GETGROUPS_T=gid_t -U HAVE_ASM_CACHECTL_H -D HAVE_ASM_SIGCONTEXT_H=1 
> -D HAVE_BLKGETSIZE64=1 -U HAVE_BLUETOOTH_BLUETOOTH_H -D 
> HAVE___BUILTIN_POPCOUNT=1 -D HAVE_DIRENT_H=1 -D HAVE_DLADDR=1 -D 
> HAVE_ELF_H=1 -D HAVE_FOPEN64=1 -D HAVE_FORK=1 -D HAVE_FSTATAT=1 -D 
> HAVE_FTRUNCATE=1 -D HAVE_FUTIMENS=1 -D HAVE_IF_INDEXTONAME=1 -D 
> HAVE_INET_NTOP=1 -D HAVE_INET_PTON=1 -D HAVE_INTTYPES_H=1 -D 
> HAVE_LINUX_BPF_H=1 -D HAVE_LINUX_BSG_H=1 -D HAVE_LINUX_BTRFS_H=1 -D 
> HAVE_LINUX_FALLOC_H=1 -D HAVE_LINUX_FILTER_H=1 -D HAVE_LINUX_FUTEX_H=1 
> -D HAVE_LINUX_ICMP_H=1 -D HAVE_LINUX_IF_PACKET_H=1 -D 
> HAVE_LINUX_INPUT_H=1 -D HAVE_LINUX_IN6_H=1 -D HAVE_LINUX_IPC_H=1 -D 
> HAVE_LINUX_MQUEUE=1 -D HAVE_LINUX_MSG_H=1 -D HAVE_LINUX_NETLINK_H=1 -D 
> HAVE_LINUX_PERF_EVENT_H=1 -D HAVE_LINUX_SEM_H=1 -D HAVE_LINUX_SHM_H=1 
> -D HAVE_LITTLE_ENDIAN_LONG_LONG=1 -D HAVE_LONG_LONG=1 -D 
> HAVE_NETINET_TCP_H=1 -D HAVE_NETINET_UDP_H=1 -D HAVE_POLL_H=1 -D 
> HAVE_PRCTL=1 -D HAVE_PWRITEV=1 -D HAVE_SENDMSG=1 -D HAVE_SIGACTION=1 
> -D HAVE_SIG_ATOMIC_T=1 -D HAVE_SIGINFO_T=1 -D 
> HAVE_SIGINFO_T_SI_OVERRUN=1 -D HAVE_SIGINFO_T_SI_SYSCALL=1 -D 
> HAVE_SIGINFO_T_SI_TIMERID=1 -D HAVE_STATFS64=1 -D HAVE_STDBOOL_H=1 -D 
> HAVE_STRERROR=1 -D HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START=1 
> -D HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS=1 -D 
> HAVE_STRUCT_FLOCK=1 -D HAVE_STRUCT_FLOCK64=1 -D HAVE_STRUCT_MMSGHDR=1 
> -D HAVE_STRUCT_MSGHDR_MSG_CONTROL=1 -D HAVE_STRUCT_SIGCONTEXT=1 -D 
> HAVE_STRUCT_SIGEVENT__SIGEV_UN__PAD=1 -D 
> HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID=1 -D HAVE_STRUCT_STATFS64=1 -U 
> HAVE_STRUCT_STAT_ST_ACLCNT -D HAVE_STRUCT_STAT_ST_BLKSIZE=1 -D 
> HAVE_STRUCT_STAT_ST_BLOCKS=1 -U HAVE_STRUCT_STAT_ST_FLAGS -U 
> HAVE_STRUCT_STAT_ST_FSTYPE -U HAVE_STRUCT_STAT_ST_GEN -U 
> HAVE_STRUCT_STAT_ST_LEVEL -D HAVE_STRUCT_STAT_ST_RDEV=1 -D 
> HAVE_STRUCT_SYSINFO_FREEHIGH=1 -D HAVE_STRUCT_SYSINFO_MEM_UNIT=1 -D 
> HAVE_STRUCT_SYSINFO_TOTALHIGH=1 -D HAVE_STRUCT_UTSNAME_DOMAINNAME=1 -D 
> HAVE_SYS_EPOLL_H=1 -D HAVE_SYS_IOCTL_H=1 -D HAVE_SYS_POLL_H=1 -D 
> HAVE_SYS_REG_H=1 -D HAVE_SYS_VFS_H=1 -D HAVE_SYS_XATTR_H=1 -D 
> HAVE_UNISTD_H=1 -D HAVE_UTIMENSAT=1 -D MAJOR_IN_SYSMACROS -D 
> PACKAGE_NAME="strace" -D VERSION="(4.13-1)" -D 
> SIZEOF_OFF_T=SIZEOF_LONG -D SIZEOF_LONG_LONG=8 -D STDC_HEADERS=1 -D 
> STRACE_KNOWS_ONLY_EABI=1 -D _LFS64_LARGEFILE=1 -D _GNU_SOURCE=1 -D 
> _POSIX_SOURCE=1 -D AARCH64=1 -D SIZEOF_LONG=8 -D SIZEOF_RLIM_T=8 -D 
> _USING_LIBCXX -internal-isystem llvm.inst/lib/clang/7.0.0/include -O3 
> -Wno-multichar -Werror=format-security -Werror=pointer-to-int-cast 
> -Werror=int-to-pointer-cast -Werror=implicit-function-declaration 
> -Wstrict-aliasing=2 -W -Wall -Wno-unused -Winit-self -Wpointer-arith 
> -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic 
> -Wno-unused-command-line-argument -Wno-expansion-to-defined 
> -Werror=return-type -Werror=non-virtual-dtor -Werror=address 
> -Werror=sequence-point -Werror=date-time -Wall -Wwrite-strings 
> -Wsign-compare -Wno-missing-field-initializers -Wno-pointer-arith 
> -Wno-unused-parameter -Wno-sign-compare -Werror=int-to-pointer-cast 
> -Werror=pointer-to-int-cast -Werror=address-of-temporary 
> -Werror=return-type -Wno-error -std=gnu99 -fconst-strings 
> -fdebug-compilation-dir /var/lib/buildbot/slaves/hexagon-build-03/aosp 
> -fdebug-prefix-map=/proc/self/cwd= -ferror-limit 19 -fmessage-length 0 
> -stack-protector 2 -fno-signed-char -fobjc-runtime=gcc 
> -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops 
> -vectorize-slp -mllvm -polly -mllvm -polly-position=before-vectorizer 
> -mllvm -polly-process-unprofitable -o 
> out/target/product/angler/obj/EXECUTABLES/strace_intermediates/desc.o 
> -x c external/strace/desc.c
> 1.    <eof> parser at end of file
> 2.    Per-module optimization passes
> 3.    Running pass 'Function Pass Manager' on module 
> 'external/strace/desc.c'.
> 4.    Running pass 'Combine redundant instructions' on function 
> '@umove_kulong_array_or_printaddr'
> #0 0x00000000016611d4 PrintStackTraceSignalHandler(void*) 
> (llvm.inst/bin/clang+0x16611d4)
> #1 0x000000000165f550 llvm::sys::RunSignalHandlers() 
> (llvm.inst/bin/clang+0x165f550)
> #2 0x0000000001661378 SignalHandler(int) (llvm.inst/bin/clang+0x1661378)
> #3 0x00007fed8f475d10 __restore_rt 
> (/lib/x86_64-linux-gnu/libpthread.so.0+0x10d10)
> #4 0x00007fed8e053267 gsignal 
> /build/buildd/glibc-2.21/signal/../sysdeps/unix/sysv/linux/raise.c:55:0
> #5 0x00007fed8e054eca abort /build/buildd/glibc-2.21/stdlib/abort.c:91:0
> #6 0x00007fed8e04c03d __assert_fail_base 
> /build/buildd/glibc-2.21/assert/assert.c:92:0
> #7 0x00007fed8e04c0f2 (/lib/x86_64-linux-gnu/libc.so.6+0x2e0f2)
> #8 0x00000000016c20f2 (llvm.inst/bin/clang+0x16c20f2)
> #9 0x00000000016c2710 llvm::LowerDbgDeclare(llvm::Function&) 
> (llvm.inst/bin/clang+0x16c2710)
> #10 0x00000000012ab472 
> combineInstructionsOverFunction(llvm::Function&, 
> llvm::InstCombineWorklist&, llvm::AAResults*, llvm::AssumptionCache&, 
> llvm::TargetLibraryInfo&, llvm::DominatorTree&, 
> llvm::OptimizationRemarkEmitter&, bool, llvm::LoopInfo*) 
> (llvm.inst/bin/clang+0x12ab472)
> #11 0x00000000012aca4b 
> llvm::InstructionCombiningPass::runOnFunction(llvm::Function&) 
> (llvm.inst/bin/clang+0x12aca4b)
> #12 0x00000000011b8b57 
> llvm::FPPassManager::runOnFunction(llvm::Function&) 
> (llvm.inst/bin/clang+0x11b8b57)
> #13 0x00000000011b8db3 llvm::FPPassManager::runOnModule(llvm::Module&) 
> (llvm.inst/bin/clang+0x11b8db3)
> #14 0x00000000011b92bb 
> llvm::legacy::PassManagerImpl::run(llvm::Module&) 
> (llvm.inst/bin/clang+0x11b92bb)
> #15 0x000000000181f0ac 
> clang::EmitBackendOutput(clang::DiagnosticsEngine&, 
> clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, 
> clang::TargetOptions const&, clang::LangOptions const&, 
> llvm::DataLayout const&, llvm::Module*, clang::BackendAction, 
> std::unique_ptr<llvm::raw_pwrite_stream, 
> std::default_delete<llvm::raw_pwrite_stream> >) 
> (llvm.inst/bin/clang+0x181f0ac)
> #16 0x0000000002115f22 
> clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) 
> (llvm.inst/bin/clang+0x2115f22)
> #17 0x0000000002685084 clang::ParseAST(clang::Sema&, bool, bool) 
> (llvm.inst/bin/clang+0x2685084)
> #18 0x0000000001c8ef98 clang::FrontendAction::Execute() 
> (llvm.inst/bin/clang+0x1c8ef98)
> #19 0x0000000001c4e101 
> clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) 
> (llvm.inst/bin/clang+0x1c4e101)
> #20 0x0000000001d3205a 
> clang::ExecuteCompilerInvocation(clang::CompilerInstance*) 
> (llvm.inst/bin/clang+0x1d3205a)
> #21 0x0000000000854b9c cc1_main(llvm::ArrayRef<char const*>, char 
> const*, void*) (llvm.inst/bin/clang+0x854b9c)
> #22 0x0000000000853025 main (llvm.inst/bin/clang+0x853025)
> #23 0x00007fed8e03ea40 __libc_start_main 
> /build/buildd/glibc-2.21/csu/libc-start.c:323:0
> #24 0x000000000084fbb9 _start (llvm.inst/bin/clang+0x84fbb9)
> clang: error: unable to execute command: Aborted (core dumped)
> clang: error: clang frontend command failed due to signal (use -v to 
> see invocation)
> clang version 7.0.0 (trunk 334899)
> Target: aarch64--linux-android
> Thread model: posix
> InstalledDir: llvm.inst/bin
>
>
> On 6/15/2018 6:48 AM, Bjorn Pettersson via llvm-commits wrote:
>
>     Author: bjope
>
>     Date: Fri Jun 15 06:48:55 2018
>
>     New Revision: 334830
>
>     URL:http://llvm.org/viewvc/llvm-project?rev=334830&view=rev
>
>     Log:
>
>     Re-apply "[DebugInfo] Check size of variable in ConvertDebugDeclareToDebugValue"
>
>     This is r334704 (which was reverted in r334732) with a fix for
>
>     types like x86_fp80. We need to use getTypeAllocSizeInBits and
>
>     not getTypeStoreSizeInBits to avoid dropping debug info for
>
>     such types.
>
>     Original commit msg:
>
>         Summary:
>
>         Do not convert a DbgDeclare to DbgValue if the store
>
>         instruction only refer to a fragment of the variable
>
>         described by the DbgDeclare.
>
>         Problem was seen when for example having an alloca for an
>
>         array or struct, and there were stores to individual elements.
>
>         In the past we inserted a DbgValue intrinsics for each store,
>
>         just as if the store wrote the whole variable.
>
>         When handling store instructions we insert a DbgValue that
>
>         indicates that the variable is "undefined", as we do not know
>
>         which part of the variable that is updated by the store.
>
>         When ConvertDebugDeclareToDebugValue is used with a load/phi
>
>         instruction we assert that the referenced value is large enough
>
>         to cover the whole variable. Afaict this should be true for all
>
>         scenarios where those methods are used on trunk. If the assert
>
>         blows in the future I guess we could simply skip to insert a
>
>         dbg.value instruction.
>
>         In the future I think we should examine which part of the variable
>
>         that is accessed, and add a DbgValue instrinsic with an appropriate
>
>         DW_OP_LLVM_fragment expression.
>
>         Reviewers: dblaikie, aprantl, rnk
>
>         Reviewed By: aprantl
>
>         Subscribers: JDevlieghere, llvm-commits
>
>         Tags: #debug-info
>
>         Differential Revision:https://reviews.llvm.org/D48024
>
>     Added:
>
>          llvm/trunk/test/DebugInfo/X86/mem2reg_fp80.ll
>
>          llvm/trunk/test/Transforms/Mem2Reg/debug-alloca-phi-2.ll
>
>     Modified:
>
>          llvm/trunk/include/llvm/IR/IntrinsicInst.h
>
>          llvm/trunk/lib/IR/IntrinsicInst.cpp
>
>          llvm/trunk/lib/Transforms/Utils/Local.cpp
>
>          llvm/trunk/test/Transforms/InstCombine/debuginfo.ll
>
>     Modified: llvm/trunk/include/llvm/IR/IntrinsicInst.h
>
>     URL:http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/IntrinsicInst.h?rev=334830&r1=334829&r2=334830&view=diff
>
>     ==============================================================================
>
>     --- llvm/trunk/include/llvm/IR/IntrinsicInst.h (original)
>
>     +++ llvm/trunk/include/llvm/IR/IntrinsicInst.h Fri Jun 15 06:48:55 2018
>
>     @@ -93,6 +93,10 @@ namespace llvm {
>
>             return cast<MetadataAsValue>(getArgOperand(2))->getMetadata();
>
>           }
>
>       
>
>     +    /// Get the size (in bits) of the variable, or fragment of the variable that
>
>     +    /// is described.
>
>     +    Optional<uint64_t> getFragmentSizeInBits() const;
>
>     +
>
>           /// \name Casting methods
>
>           /// @{
>
>           static bool classof(const IntrinsicInst *I) {
>
>     Modified: llvm/trunk/lib/IR/IntrinsicInst.cpp
>
>     URL:http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/IntrinsicInst.cpp?rev=334830&r1=334829&r2=334830&view=diff
>
>     ==============================================================================
>
>     --- llvm/trunk/lib/IR/IntrinsicInst.cpp (original)
>
>     +++ llvm/trunk/lib/IR/IntrinsicInst.cpp Fri Jun 15 06:48:55 2018
>
>     @@ -24,6 +24,7 @@
>
>       #include "llvm/IR/IntrinsicInst.h"
>
>       #include "llvm/ADT/StringSwitch.h"
>
>       #include "llvm/IR/Constants.h"
>
>     +#include "llvm/IR/DebugInfoMetadata.h"
>
>       #include "llvm/IR/GlobalVariable.h"
>
>       #include "llvm/IR/Metadata.h"
>
>       #include "llvm/IR/Module.h"
>
>     @@ -48,6 +49,12 @@ Value *DbgInfoIntrinsic::getVariableLoca
>
>         return nullptr;
>
>       }
>
>       
>
>     +Optional<uint64_t> DbgInfoIntrinsic::getFragmentSizeInBits() const {
>
>     +  if (auto Fragment = getExpression()->getFragmentInfo())
>
>     +    return Fragment->SizeInBits;
>
>     +  return getVariable()->getSizeInBits();
>
>     +}
>
>     +
>
>       int llvm::Intrinsic::lookupLLVMIntrinsicByName(ArrayRef<const char *> NameTable,
>
>                                                      StringRef Name) {
>
>         assert(Name.startswith("llvm."));
>
>     Modified: llvm/trunk/lib/Transforms/Utils/Local.cpp
>
>     URL:http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Local.cpp?rev=334830&r1=334829&r2=334830&view=diff
>
>     ==============================================================================
>
>     --- llvm/trunk/lib/Transforms/Utils/Local.cpp (original)
>
>     +++ llvm/trunk/lib/Transforms/Utils/Local.cpp Fri Jun 15 06:48:55 2018
>
>     @@ -1228,6 +1228,23 @@ static bool PhiHasDebugValue(DILocalVari
>
>         return false;
>
>       }
>
>       
>
>     +/// Check if the alloc size of \p ValTy is large enough to cover the variable
>
>     +/// (or fragment of the variable) described by \p DII.
>
>     +///
>
>     +/// This is primarily intended as a helper for the different
>
>     +/// ConvertDebugDeclareToDebugValue functions. The dbg.declare/dbg.addr that is
>
>     +/// converted describes an alloca'd variable, so we need to use the
>
>     +/// alloc size of the value when doing the comparison. E.g. an i1 value will be
>
>     +/// identified as covering an n-bit fragment, if the store size of i1 is at
>
>     +/// least n bits.
>
>     +static bool valueCoversEntireFragment(Type *ValTy, DbgInfoIntrinsic *DII) {
>
>     +  const DataLayout &DL = DII->getModule()->getDataLayout();
>
>     +  uint64_t ValueSize = DL.getTypeAllocSizeInBits(ValTy);
>
>     +  if (auto FragmentSize = DII->getFragmentSizeInBits())
>
>     +    return ValueSize >= *FragmentSize;
>
>     +  return false;
>
>     +}
>
>     +
>
>       /// Inserts a llvm.dbg.value intrinsic before a store to an alloca'd value
>
>       /// that has an associated llvm.dbg.declare or llvm.dbg.addr intrinsic.
>
>       void llvm::ConvertDebugDeclareToDebugValue(DbgInfoIntrinsic *DII,
>
>     @@ -1238,6 +1255,21 @@ void llvm::ConvertDebugDeclareToDebugVal
>
>         auto *DIExpr = DII->getExpression();
>
>         Value *DV = SI->getOperand(0);
>
>       
>
>     +  if (!valueCoversEntireFragment(SI->getValueOperand()->getType(), DII)) {
>
>     +    // FIXME: If storing to a part of the variable described by the dbg.declare,
>
>     +    // then we want to insert a dbg.value for the corresponding fragment.
>
>     +    LLVM_DEBUG(dbgs() << "Failed to convert dbg.declare to dbg.value: "
>
>     +                      << *DII << '\n');
>
>     +    // For now, when there is a store to parts of the variable (but we do not
>
>     +    // know which part) we insert an dbg.value instrinsic to indicate that we
>
>     +    // know nothing about the variable's content.
>
>     +    DV = UndefValue::get(DV->getType());
>
>     +    if (!LdStHasDebugValue(DIVar, DIExpr, SI))
>
>     +      Builder.insertDbgValueIntrinsic(DV, DIVar, DIExpr, DII->getDebugLoc(),
>
>     +                                      SI);
>
>     +    return;
>
>     +  }
>
>     +
>
>         // If an argument is zero extended then use argument directly. The ZExt
>
>         // may be zapped by an optimization pass in future.
>
>         Argument *ExtendedArg = nullptr;
>
>     @@ -1281,6 +1313,9 @@ void llvm::ConvertDebugDeclareToDebugVal
>
>         if (LdStHasDebugValue(DIVar, DIExpr, LI))
>
>           return;
>
>       
>
>     +  assert(valueCoversEntireFragment(LI->getType(), DII) &&
>
>     +         "Load is not loading the full variable fragment.");
>
>     +
>
>         // We are now tracking the loaded value instead of the address. In the
>
>         // future if multi-location support is added to the IR, it might be
>
>         // preferable to keep tracking both the loaded value and the original
>
>     @@ -1301,6 +1336,9 @@ void llvm::ConvertDebugDeclareToDebugVal
>
>         if (PhiHasDebugValue(DIVar, DIExpr, APN))
>
>           return;
>
>       
>
>     +  assert(valueCoversEntireFragment(APN->getType(), DII) &&
>
>     +         "PHI node is not describing the full variable.");
>
>     +
>
>         BasicBlock *BB = APN->getParent();
>
>         auto InsertionPt = BB->getFirstInsertionPt();
>
>       
>
>     Added: llvm/trunk/test/DebugInfo/X86/mem2reg_fp80.ll
>
>     URL:http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/mem2reg_fp80.ll?rev=334830&view=auto
>
>     ==============================================================================
>
>     --- llvm/trunk/test/DebugInfo/X86/mem2reg_fp80.ll (added)
>
>     +++ llvm/trunk/test/DebugInfo/X86/mem2reg_fp80.ll Fri Jun 15 06:48:55 2018
>
>     @@ -0,0 +1,57 @@
>
>     +; RUN: opt < %s -mem2reg -S | FileCheck %s
>
>     +
>
>     +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
>
>     +target triple = "x86_64-unknown-linux-gnu"
>
>     +
>
>     +define dso_local x86_fp80 @powixf2() !dbg !1 {
>
>     +entry:
>
>     +  %r = alloca x86_fp80, align 16
>
>     +  call void @llvm.dbg.declare(metadata x86_fp80* %r, metadata !14, metadata !DIExpression()), !dbg !15
>
>     +  br i1 undef, label %if.then, label %if.end, !dbg !16
>
>     +
>
>     +if.then:                                          ; preds = %entry
>
>     +; CHECK-label: if.then:
>
>     +; CHECK: %mul = fmul x86_fp80
>
>     +; CHECK: call void @llvm.dbg.value(metadata x86_fp80 %mul, metadata {{.*}}, metadata !DIExpression())
>
>     +  %mul = fmul x86_fp80 undef, undef, !dbg !18
>
>     +  store x86_fp80 %mul, x86_fp80* %r, align 16, !dbg !18
>
>     +  br label %if.end, !dbg !20
>
>     +
>
>     +if.end:                                           ; preds = %if.then, %entry
>
>     +; CHECK-label: if.end:
>
>     +; CHECK: %r.0 = phi x86_fp80
>
>     +; CHECK: call void @llvm.dbg.value(metadata x86_fp80 %r.0, metadata {{.*}}, metadata !DIExpression())
>
>     +  %out = load x86_fp80, x86_fp80* %r, align 16, !dbg !21
>
>     +  ret x86_fp80 %out, !dbg !22
>
>     +}
>
>     +
>
>     +declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
>
>     +
>
>     +attributes #0 = { nounwind readnone speculatable }
>
>     +
>
>     +!llvm.dbg.cu = !{}
>
>     +!llvm.module.flags = !{!0}
>
>     +
>
>     +!0 = !{i32 2, !"Debug Info Version", i32 3}
>
>     +!1 = distinct !DISubprogram(name: "__powixf2", scope: !2, file: !2, line: 22, type: !3, isLocal: false, isDefinition: true, scopeLine: 23, flags: DIFlagPrototyped, isOptimized: true, unit: !11, retainedNodes: !13)
>
>     +!2 = !DIFile(filename: "powixf2.c", directory: "")
>
>     +!3 = !DISubroutineType(types: !4)
>
>     +!4 = !{!5, !5, !6}
>
>     +!5 = !DIBasicType(name: "long double", size: 128, encoding: DW_ATE_float)
>
>     +!6 = !DIDerivedType(tag: DW_TAG_typedef, name: "si_int", file: !7, line: 28, baseType: !8)
>
>     +!7 = !DIFile(filename: "int_types.h", directory: "")
>
>     +!8 = !DIDerivedType(tag: DW_TAG_typedef, name: "int32_t", file: !9, line: 39, baseType: !10)
>
>     +!9 = !DIFile(filename: "/usr/include/stdint.h", directory: "")
>
>     +!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
>
>     +!11 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 7.0.0 () ()", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !12)
>
>     +!12 = !{}
>
>     +!13 = !{!14}
>
>     +!14 = !DILocalVariable(name: "r", scope: !1, file: !2, line: 25, type: !5)
>
>     +!15 = !DILocation(line: 25, column: 17, scope: !1)
>
>     +!16 = !DILocation(line: 28, column: 13, scope: !17)
>
>     +!17 = distinct !DILexicalBlock(scope: !1, file: !2, line: 27, column: 5)
>
>     +!18 = !DILocation(line: 29, column: 15, scope: !19)
>
>     +!19 = distinct !DILexicalBlock(scope: !17, file: !2, line: 28, column: 13)
>
>     +!20 = !DILocation(line: 29, column: 13, scope: !19)
>
>     +!21 = !DILocation(line: 35, column: 22, scope: !1)
>
>     +!22 = !DILocation(line: 35, column: 5, scope: !1)
>
>     Modified: llvm/trunk/test/Transforms/InstCombine/debuginfo.ll
>
>     URL:http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/debuginfo.ll?rev=334830&r1=334829&r2=334830&view=diff
>
>     ==============================================================================
>
>     --- llvm/trunk/test/Transforms/InstCombine/debuginfo.ll (original)
>
>     +++ llvm/trunk/test/Transforms/InstCombine/debuginfo.ll Fri Jun 15 06:48:55 2018
>
>     @@ -71,9 +71,11 @@ entry:
>
>       ; NOLOWER-NOT: alloca
>
>       ; NOLOWER-NOT: store
>
>       ; NOLOWER-NOT: call void @llvm.dbg.declare
>
>     -; NOLOWER: call void @llvm.dbg.value(metadata i64 %o.coerce0, {{.*}})
>
>     +; Here we want to find:  call void @llvm.dbg.value(metadata i64 %o.coerce0, metadata [[VARIABLE_O]], metadata !DIExpression(DW_OP_LLVM_fragment, 0, 64))
>
>     +; NOLOWER: call void @llvm.dbg.value(metadata i64 undef, {{.*}})
>
>       ; NOLOWER-NOT: store
>
>     -; NOLOWER: call void @llvm.dbg.value(metadata i64 %o.coerce1, {{.*}})
>
>     +; Here we want to find:  call void @llvm.dbg.value(metadata i64 %o.coerce1, metadata [[VARIABLE_O]], metadata !DIExpression(DW_OP_LLVM_fragment, 64, 64))
>
>     +; NOLOWER: call void @llvm.dbg.value(metadata i64 undef, {{.*}})
>
>       ; NOLOWER-NOT: store
>
>       ; NOLOWER: call void @tworegs_callee(i64 %o.coerce0, i64 %o.coerce1)
>
>       
>
>     Added: llvm/trunk/test/Transforms/Mem2Reg/debug-alloca-phi-2.ll
>
>     URL:http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Mem2Reg/debug-alloca-phi-2.ll?rev=334830&view=auto
>
>     ==============================================================================
>
>     --- llvm/trunk/test/Transforms/Mem2Reg/debug-alloca-phi-2.ll (added)
>
>     +++ llvm/trunk/test/Transforms/Mem2Reg/debug-alloca-phi-2.ll Fri Jun 15 06:48:55 2018
>
>     @@ -0,0 +1,46 @@
>
>     +; RUN: opt < %s -mem2reg -S | FileCheck %s
>
>     +source_filename = "bugpoint-output.bc"
>
>     +target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
>
>     +target triple = "x86_64-apple-macosx10.12.0"
>
>     +
>
>     +define void @scan() #0 !dbg !12 {
>
>     +entry:
>
>     +  %entry1 = alloca i1, align 8
>
>     +  call void @llvm.dbg.declare(metadata i1* %entry1, metadata !18, metadata !19), !dbg !20
>
>     +  store i1 0, i1* %entry1, align 8, !dbg !20
>
>     +  br label %for.cond, !dbg !20
>
>     +
>
>     +for.cond:
>
>     +; CHECK: %[[PHI:.*]] = phi i1 [ false, %entry ], [ %0, %for.cond ]
>
>     +  %entryN = load i1, i1* %entry1, align 8, !dbg !20
>
>     +; CHECK: call void @llvm.dbg.value(metadata i1 %[[PHI]],
>
>     +; CHECK-SAME:                      metadata !DIExpression())
>
>     +  %0 = add i1 %entryN, 1
>
>     +; CHECK: %0 = add i1 %[[PHI]], true
>
>     +; CHECK: call void @llvm.dbg.value(metadata i1 %0,
>
>     +; CHECK-SAME:                      metadata !DIExpression())
>
>     +  store i1 %0, i1* %entry1, align 8, !dbg !20
>
>     +  br label %for.cond, !dbg !20
>
>     +}
>
>     +
>
>     +declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
>
>     +
>
>     +attributes #0 = { nounwind ssp uwtable }
>
>     +attributes #1 = { nounwind readnone }
>
>     +
>
>     +!llvm.dbg.cu = !{!0}
>
>     +!llvm.module.flags = !{!10, !11}
>
>     +
>
>     +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "adrian", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)
>
>     +!1 = !DIFile(filename: "<stdin>", directory: "/")
>
>     +!2 = !{}
>
>     +!4 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
>
>     +!10 = !{i32 2, !"Debug Info Version", i32 3}
>
>     +!11 = !{i32 1, !"PIC Level", i32 2}
>
>     +!12 = distinct !DISubprogram(name: "scan", scope: !1, file: !1, line: 4, type: !13, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !15)
>
>     +!13 = !DISubroutineType(types: !14)
>
>     +!14 = !{null, !4, !4}
>
>     +!15 = !{!18}
>
>     +!18 = !DILocalVariable(name: "entry", scope: !12, file: !1, line: 6, type: !4)
>
>     +!19 = !DIExpression()
>
>     +!20 = !DILocation(line: 6, scope: !12)
>
>     _______________________________________________
>
>     llvm-commits mailing list
>
>     llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>
>
>     http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
> -- 
> Employee of Qualcomm Innovation Center, Inc.
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project


-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180619/f45b0d4d/attachment.html>
-------------- next part --------------
# 1 "external/strace/desc.c"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 368 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "external/strace/desc.c" 2
# 31 "external/strace/desc.c"
# 1 "external/strace/defs.h" 1
# 37 "external/strace/defs.h"
# 1 "bionic/libc/include/features.h" 1 3
# 33 "bionic/libc/include/features.h" 3
# 1 "bionic/libc/include/sys/cdefs.h" 1 3
# 228 "bionic/libc/include/sys/cdefs.h" 3
# 1 "bionic/libc/include/android/api-level.h" 1 3
# 32 "bionic/libc/include/android/api-level.h" 3
# 1 "bionic/libc/include/sys/cdefs.h" 1 3
# 33 "bionic/libc/include/android/api-level.h" 2 3
# 229 "bionic/libc/include/sys/cdefs.h" 2 3
# 277 "bionic/libc/include/sys/cdefs.h" 3
# 1 "bionic/libc/include/android/versioning.h" 1 3
# 278 "bionic/libc/include/sys/cdefs.h" 2 3
# 34 "bionic/libc/include/features.h" 2 3
# 38 "external/strace/defs.h" 2
# 1 "external/libcxx/include/stdbool.h" 1
# 23 "external/libcxx/include/stdbool.h"
# 1 "external/libcxx/include/__config" 1
# 20 "external/libcxx/include/__config" 3
# 24 "external/libcxx/include/stdbool.h" 2
# 27 "external/libcxx/include/stdbool.h" 3


# 1 "llvm.inst/lib/clang/7.0.0/include/stdbool.h" 1 3
# 30 "external/libcxx/include/stdbool.h" 2 3
# 39 "external/strace/defs.h" 2
# 1 "bionic/libc/include/stdint.h" 1 3
# 32 "bionic/libc/include/stdint.h" 3
# 1 "bionic/libc/include/bits/wchar_limits.h" 1 3
# 33 "bionic/libc/include/stdint.h" 2 3
# 1 "external/libcxx/include/stddef.h" 1 3
# 44 "external/libcxx/include/stddef.h" 3


# 1 "llvm.inst/lib/clang/7.0.0/include/stddef.h" 1 3
# 51 "llvm.inst/lib/clang/7.0.0/include/stddef.h" 3
typedef long int ptrdiff_t;
# 62 "llvm.inst/lib/clang/7.0.0/include/stddef.h" 3
typedef long unsigned int size_t;
# 90 "llvm.inst/lib/clang/7.0.0/include/stddef.h" 3
typedef unsigned int wchar_t;
# 47 "external/libcxx/include/stddef.h" 2 3
# 34 "bionic/libc/include/stdint.h" 2 3


typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef short __int16_t;
typedef unsigned short __uint16_t;
typedef int __int32_t;
typedef unsigned int __uint32_t;

typedef long __int64_t;
typedef unsigned long __uint64_t;






typedef long __intptr_t;
typedef unsigned long __uintptr_t;





typedef __int8_t int8_t;
typedef __uint8_t uint8_t;

typedef __int16_t int16_t;
typedef __uint16_t uint16_t;

typedef __int32_t int32_t;
typedef __uint32_t uint32_t;

typedef __int64_t int64_t;
typedef __uint64_t uint64_t;

typedef __intptr_t intptr_t;
typedef __uintptr_t uintptr_t;

typedef int8_t int_least8_t;
typedef uint8_t uint_least8_t;

typedef int16_t int_least16_t;
typedef uint16_t uint_least16_t;

typedef int32_t int_least32_t;
typedef uint32_t uint_least32_t;

typedef int64_t int_least64_t;
typedef uint64_t uint_least64_t;

typedef int8_t int_fast8_t;
typedef uint8_t uint_fast8_t;

typedef int64_t int_fast64_t;
typedef uint64_t uint_fast64_t;


typedef int64_t int_fast16_t;
typedef uint64_t uint_fast16_t;
typedef int64_t int_fast32_t;
typedef uint64_t uint_fast32_t;







typedef uint64_t uintmax_t;
typedef int64_t intmax_t;
# 40 "external/strace/defs.h" 2
# 1 "external/libcxx/include/inttypes.h" 1
# 238 "external/libcxx/include/inttypes.h" 3


# 1 "bionic/libc/include/inttypes.h" 1 3
# 252 "bionic/libc/include/inttypes.h" 3
typedef struct {
 intmax_t quot;
 intmax_t rem;
} imaxdiv_t;


intmax_t imaxabs(intmax_t) __attribute__((__const__)) __attribute__((annotate("introduced_in=" "19")));
imaxdiv_t imaxdiv(intmax_t, intmax_t) __attribute__((__const__)) __attribute__((annotate("introduced_in=" "19")));
intmax_t strtoimax(const char *, char **, int);
uintmax_t strtoumax(const char *, char **, int);
intmax_t wcstoimax(const wchar_t* __restrict, wchar_t** __restrict, int) __attribute__((annotate("introduced_in=" "21")));
uintmax_t wcstoumax(const wchar_t* __restrict, wchar_t** __restrict, int) __attribute__((annotate("introduced_in=" "21")));
# 241 "external/libcxx/include/inttypes.h" 2 3
# 41 "external/strace/defs.h" 2
# 1 "bionic/libc/include/sys/types.h" 1 3
# 32 "bionic/libc/include/sys/types.h" 3
# 1 "external/libcxx/include/stddef.h" 1 3
# 33 "bionic/libc/include/sys/types.h" 2 3



# 1 "bionic/libc/kernel/uapi/linux/types.h" 1 3
# 21 "bionic/libc/kernel/uapi/linux/types.h" 3
# 1 "bionic/libc/kernel/uapi/asm-arm64/asm/types.h" 1 3
# 19 "bionic/libc/kernel/uapi/asm-arm64/asm/types.h" 3
# 1 "bionic/libc/kernel/uapi/asm-generic/types.h" 1 3
# 21 "bionic/libc/kernel/uapi/asm-generic/types.h" 3
# 1 "bionic/libc/kernel/uapi/asm-generic/int-ll64.h" 1 3
# 21 "bionic/libc/kernel/uapi/asm-generic/int-ll64.h" 3
# 1 "bionic/libc/kernel/uapi/asm-arm64/asm/bitsperlong.h" 1 3
# 22 "bionic/libc/kernel/uapi/asm-arm64/asm/bitsperlong.h" 3
# 1 "bionic/libc/kernel/uapi/asm-generic/bitsperlong.h" 1 3
# 23 "bionic/libc/kernel/uapi/asm-arm64/asm/bitsperlong.h" 2 3
# 22 "bionic/libc/kernel/uapi/asm-generic/int-ll64.h" 2 3


typedef __signed__ char __s8;
typedef unsigned char __u8;
typedef __signed__ short __s16;
typedef unsigned short __u16;

typedef __signed__ int __s32;
typedef unsigned int __u32;

__extension__ typedef __signed__ long long __s64;

__extension__ typedef unsigned long long __u64;
# 22 "bionic/libc/kernel/uapi/asm-generic/types.h" 2 3
# 20 "bionic/libc/kernel/uapi/asm-arm64/asm/types.h" 2 3
# 22 "bionic/libc/kernel/uapi/linux/types.h" 2 3


# 1 "bionic/libc/kernel/uapi/linux/posix_types.h" 1 3
# 21 "bionic/libc/kernel/uapi/linux/posix_types.h" 3
# 1 "bionic/libc/kernel/uapi/linux/stddef.h" 1 3
# 19 "bionic/libc/kernel/uapi/linux/stddef.h" 3
# 1 "bionic/libc/kernel/android/uapi/linux/compiler.h" 1 3
# 20 "bionic/libc/kernel/uapi/linux/stddef.h" 2 3
# 22 "bionic/libc/kernel/uapi/linux/posix_types.h" 2 3



typedef struct {
  unsigned long fds_bits[1024 / (8 * sizeof(long))];
} __kernel_fd_set;

typedef void(* __kernel_sighandler_t) (int);
typedef int __kernel_key_t;
typedef int __kernel_mqd_t;

# 1 "bionic/libc/kernel/uapi/asm-arm64/asm/posix_types.h" 1 3
# 21 "bionic/libc/kernel/uapi/asm-arm64/asm/posix_types.h" 3
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;



# 1 "bionic/libc/kernel/uapi/asm-generic/posix_types.h" 1 3
# 24 "bionic/libc/kernel/uapi/asm-generic/posix_types.h" 3
typedef long __kernel_long_t;
typedef unsigned long __kernel_ulong_t;



typedef __kernel_ulong_t __kernel_ino_t;


typedef unsigned int __kernel_mode_t;



typedef int __kernel_pid_t;



typedef int __kernel_ipc_pid_t;



typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;



typedef __kernel_long_t __kernel_suseconds_t;


typedef int __kernel_daddr_t;



typedef unsigned int __kernel_uid32_t;
typedef unsigned int __kernel_gid32_t;
# 66 "bionic/libc/kernel/uapi/asm-generic/posix_types.h" 3
typedef unsigned int __kernel_old_dev_t;
# 76 "bionic/libc/kernel/uapi/asm-generic/posix_types.h" 3
typedef __kernel_ulong_t __kernel_size_t;
typedef __kernel_long_t __kernel_ssize_t;

typedef __kernel_long_t __kernel_ptrdiff_t;




typedef struct {
  int val[2];
} __kernel_fsid_t;


typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_time_t;
typedef __kernel_long_t __kernel_clock_t;

typedef int __kernel_timer_t;
typedef int __kernel_clockid_t;
typedef char * __kernel_caddr_t;
typedef unsigned short __kernel_uid16_t;

typedef unsigned short __kernel_gid16_t;
# 26 "bionic/libc/kernel/uapi/asm-arm64/asm/posix_types.h" 2 3
# 33 "bionic/libc/kernel/uapi/linux/posix_types.h" 2 3
# 25 "bionic/libc/kernel/uapi/linux/types.h" 2 3


typedef __u16 __le16;

typedef __u16 __be16;
typedef __u32 __le32;
typedef __u32 __be32;
typedef __u64 __le64;

typedef __u64 __be64;
typedef __u16 __sum16;
typedef __u32 __wsum;
# 37 "bionic/libc/include/sys/types.h" 2 3


# 1 "bionic/libc/include/bits/pthread_types.h" 1 3
# 33 "bionic/libc/include/bits/pthread_types.h" 3
# 1 "bionic/libc/include/sys/types.h" 1 3
# 34 "bionic/libc/include/bits/pthread_types.h" 2 3

typedef struct {
  uint32_t flags;
  void* stack_base;
  size_t stack_size;
  size_t guard_size;
  int32_t sched_policy;
  int32_t sched_priority;

  char __reserved[16];

} pthread_attr_t;

typedef struct {

  int64_t __private[4];



} pthread_barrier_t;

typedef int pthread_barrierattr_t;

typedef struct {

  int32_t __private[12];



} pthread_cond_t;

typedef long pthread_condattr_t;

typedef int pthread_key_t;

typedef struct {

  int32_t __private[10];



} pthread_mutex_t;

typedef long pthread_mutexattr_t;

typedef int pthread_once_t;

typedef struct {

  int32_t __private[14];



} pthread_rwlock_t;

typedef long pthread_rwlockattr_t;

typedef struct {

  int64_t __private;



} pthread_spinlock_t;

typedef long pthread_t;
# 40 "bionic/libc/include/sys/types.h" 2 3


typedef __kernel_gid32_t __gid_t;
typedef __gid_t gid_t;
typedef __kernel_uid32_t __uid_t;
typedef __uid_t uid_t;
typedef __kernel_pid_t __pid_t;
typedef __pid_t pid_t;
typedef uint32_t __id_t;
typedef __id_t id_t;

typedef unsigned long blkcnt_t;
typedef unsigned long blksize_t;
typedef __kernel_caddr_t caddr_t;
typedef __kernel_clock_t clock_t;

typedef __kernel_clockid_t __clockid_t;
typedef __clockid_t clockid_t;

typedef __kernel_daddr_t daddr_t;
typedef unsigned long fsblkcnt_t;
typedef unsigned long fsfilcnt_t;

typedef __kernel_mode_t __mode_t;
typedef __mode_t mode_t;

typedef __kernel_key_t __key_t;
typedef __key_t key_t;

typedef __kernel_ino_t __ino_t;
typedef __ino_t ino_t;

typedef uint64_t ino64_t;

typedef uint32_t __nlink_t;
typedef __nlink_t nlink_t;

typedef void* __timer_t;
typedef __timer_t timer_t;

typedef __kernel_suseconds_t __suseconds_t;
typedef __suseconds_t suseconds_t;


typedef uint32_t __useconds_t;
typedef __useconds_t useconds_t;





typedef uint64_t dev_t;



typedef __kernel_time_t __time_t;
typedef __time_t time_t;


typedef int64_t off_t;
typedef off_t loff_t;
typedef loff_t off64_t;
# 114 "bionic/libc/include/sys/types.h" 3
typedef uint32_t __socklen_t;

typedef __socklen_t socklen_t;

typedef __builtin_va_list __va_list;
# 127 "bionic/libc/include/sys/types.h" 3
typedef __kernel_ssize_t ssize_t;


typedef unsigned int uint_t;
typedef unsigned int uint;



# 1 "bionic/libc/include/sys/sysmacros.h" 1 3
# 135 "bionic/libc/include/sys/types.h" 2 3

typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;

typedef uint32_t u_int32_t;
typedef uint16_t u_int16_t;
typedef uint8_t u_int8_t;
typedef uint64_t u_int64_t;
# 42 "external/strace/defs.h" 2
# 1 "external/libcxx/include/stddef.h" 1
# 43 "external/strace/defs.h" 2
# 1 "bionic/libc/include/unistd.h" 1 3
# 32 "bionic/libc/include/unistd.h" 3
# 1 "external/libcxx/include/stddef.h" 1 3
# 33 "bionic/libc/include/unistd.h" 2 3


# 1 "bionic/libc/include/sys/select.h" 1 3
# 35 "bionic/libc/include/sys/select.h" 3
# 1 "bionic/libc/kernel/uapi/linux/time.h" 1 3
# 25 "bionic/libc/kernel/uapi/linux/time.h" 3
struct timespec {
  __kernel_time_t tv_sec;
  long tv_nsec;

};

struct timeval {
  __kernel_time_t tv_sec;

  __kernel_suseconds_t tv_usec;
};
struct timezone {
  int tz_minuteswest;

  int tz_dsttime;
};




struct itimerspec {
  struct timespec it_interval;
  struct timespec it_value;

};
struct itimerval {
  struct timeval it_interval;
  struct timeval it_value;

};
# 36 "bionic/libc/include/sys/select.h" 2 3
# 1 "bionic/libc/include/signal.h" 1 3
# 35 "bionic/libc/include/signal.h" 3
# 1 "bionic/libc/kernel/uapi/asm-arm64/asm/sigcontext.h" 1 3
# 22 "bionic/libc/kernel/uapi/asm-arm64/asm/sigcontext.h" 3
struct sigcontext {

  __u64 fault_address;
  __u64 regs[31];
  __u64 sp;
  __u64 pc;

  __u64 pstate;
  __u8 __reserved[4096] __attribute__((__aligned__(16)));
};
struct _aarch64_ctx {

  __u32 magic;
  __u32 size;
};


struct fpsimd_context {
  struct _aarch64_ctx head;
  __u32 fpsr;
  __u32 fpcr;

  __uint128_t vregs[32];
};

struct esr_context {

  struct _aarch64_ctx head;
  __u64 esr;
};
# 36 "bionic/libc/include/signal.h" 2 3

# 1 "bionic/libc/include/bits/timespec.h" 1 3
# 38 "bionic/libc/include/signal.h" 2 3
# 1 "bionic/libc/include/limits.h" 1 3
# 41 "bionic/libc/include/limits.h" 3
# 1 "external/libcxx/include/float.h" 1 3
# 67 "external/libcxx/include/float.h" 3


# 1 "llvm.inst/lib/clang/7.0.0/include/float.h" 1 3
# 70 "external/libcxx/include/float.h" 2 3
# 42 "bionic/libc/include/limits.h" 2 3

# 1 "bionic/libc/kernel/uapi/linux/limits.h" 1 3
# 44 "bionic/libc/include/limits.h" 2 3
# 137 "bionic/libc/include/limits.h" 3
# 1 "bionic/libc/include/bits/posix_limits.h" 1 3
# 138 "bionic/libc/include/limits.h" 2 3
# 39 "bionic/libc/include/signal.h" 2 3





# 1 "bionic/libc/kernel/uapi/linux/signal.h" 1 3
# 21 "bionic/libc/kernel/uapi/linux/signal.h" 3
# 1 "bionic/libc/kernel/uapi/asm-arm64/asm/signal.h" 1 3
# 25 "bionic/libc/kernel/uapi/asm-arm64/asm/signal.h" 3
# 1 "bionic/libc/kernel/uapi/asm-generic/signal.h" 1 3
# 91 "bionic/libc/kernel/uapi/asm-generic/signal.h" 3
typedef struct {
  unsigned long sig[(64 / 64)];

} sigset_t;
typedef unsigned long old_sigset_t;

# 1 "bionic/libc/kernel/uapi/asm-generic/signal-defs.h" 1 3
# 35 "bionic/libc/kernel/uapi/asm-generic/signal-defs.h" 3
typedef void __signalfn_t(int);
typedef __signalfn_t * __sighandler_t;
typedef void __restorefn_t(void);

typedef __restorefn_t * __sigrestore_t;
# 97 "bionic/libc/kernel/uapi/asm-generic/signal.h" 2 3




struct __kernel_sigaction {
  __sighandler_t sa_handler;

  unsigned long sa_flags;

  __sigrestore_t sa_restorer;


  sigset_t sa_mask;
};
typedef struct sigaltstack {
  void * ss_sp;

  int ss_flags;
  size_t ss_size;
} stack_t;
# 26 "bionic/libc/kernel/uapi/asm-arm64/asm/signal.h" 2 3
# 22 "bionic/libc/kernel/uapi/linux/signal.h" 2 3
# 1 "bionic/libc/kernel/uapi/asm-arm64/asm/siginfo.h" 1 3
# 22 "bionic/libc/kernel/uapi/asm-arm64/asm/siginfo.h" 3
# 1 "bionic/libc/kernel/uapi/asm-generic/siginfo.h" 1 3
# 24 "bionic/libc/kernel/uapi/asm-generic/siginfo.h" 3
typedef union sigval {
  int sival_int;
  void * sival_ptr;
} sigval_t;
# 54 "bionic/libc/kernel/uapi/asm-generic/siginfo.h" 3
typedef struct siginfo {
  int si_signo;
  int si_errno;
  int si_code;

  union {
    int _pad[((128 - (4 * sizeof(int))) / sizeof(int))];
    struct {
      __kernel_pid_t _pid;

      __kernel_uid32_t _uid;
    } _kill;
    struct {
      __kernel_timer_t _tid;

      int _overrun;
      char _pad[sizeof(__kernel_uid32_t) - sizeof(int)];
      sigval_t _sigval;
      int _sys_private;

    } _timer;
    struct {
      __kernel_pid_t _pid;
      __kernel_uid32_t _uid;

      sigval_t _sigval;
    } _rt;
    struct {
      __kernel_pid_t _pid;

      __kernel_uid32_t _uid;
      int _status;
      __kernel_clock_t _utime;
      __kernel_clock_t _stime;

    } _sigchld;
    struct {
      void * _addr;




      short _addr_lsb;
      union {

        struct {
          void * _lower;
          void * _upper;
        } _addr_bnd;

        __u32 _pkey;
      };
    } _sigfault;
    struct {

      long _band;
      int _fd;
    } _sigpoll;
    struct {

      void * _call_addr;
      int _syscall;
      unsigned int _arch;
    } _sigsys;

  } _sifields;
} siginfo_t;
# 255 "bionic/libc/kernel/uapi/asm-generic/siginfo.h" 3
typedef struct sigevent {
  sigval_t sigev_value;
  int sigev_signo;

  int sigev_notify;
  union {
    int _pad[((64 - (sizeof(int) * 2 + sizeof(sigval_t))) / sizeof(int))];
    int _tid;

    struct {
      void(* _function) (sigval_t);
      void * _attribute;
    } _sigev_thread;

  } _sigev_un;
} sigevent_t;
# 23 "bionic/libc/kernel/uapi/asm-arm64/asm/siginfo.h" 2 3
# 23 "bionic/libc/kernel/uapi/linux/signal.h" 2 3
# 45 "bionic/libc/include/signal.h" 2 3







# 1 "bionic/libc/include/sys/ucontext.h" 1 3
# 34 "bionic/libc/include/sys/ucontext.h" 3
# 1 "bionic/libc/include/signal.h" 1 3
# 35 "bionic/libc/include/sys/ucontext.h" 2 3
# 1 "bionic/libc/include/sys/user.h" 1 3
# 33 "bionic/libc/include/sys/user.h" 3
# 1 "external/libcxx/include/stddef.h" 1 3
# 34 "bionic/libc/include/sys/user.h" 2 3
# 236 "bionic/libc/include/sys/user.h" 3
struct user_regs_struct {
  uint64_t regs[31];
  uint64_t sp;
  uint64_t pc;
  uint64_t pstate;
};
struct user_fpsimd_struct {
  __uint128_t vregs[32];
  uint32_t fpsr;
  uint32_t fpcr;
};
# 36 "bionic/libc/include/sys/ucontext.h" 2 3
# 85 "bionic/libc/include/sys/ucontext.h" 3
typedef unsigned long greg_t;
typedef greg_t gregset_t[34];
typedef struct user_fpsimd_struct fpregset_t;


typedef struct sigcontext mcontext_t;

typedef struct ucontext {
  unsigned long uc_flags;
  struct ucontext *uc_link;
  stack_t uc_stack;
  sigset_t uc_sigmask;

  char __padding[128 - sizeof(sigset_t)];
  mcontext_t uc_mcontext;
} ucontext_t;
# 53 "bionic/libc/include/signal.h" 2 3





#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnullability-completeness"


typedef int sig_atomic_t;
# 81 "bionic/libc/include/signal.h" 3
int __libc_current_sigrtmin(void) __attribute__((annotate("introduced_in=" "21")));
int __libc_current_sigrtmax(void) __attribute__((annotate("introduced_in=" "21")));

extern const char* const sys_siglist[(64 + 1)];
extern const char* const sys_signame[(64 + 1)];

typedef __sighandler_t sig_t;
typedef __sighandler_t sighandler_t;





struct sigaction {
  unsigned int sa_flags;
  union {
    sighandler_t sa_handler;
    void (*sa_sigaction)(int, struct siginfo*, void*);
  };
  sigset_t sa_mask;
  void (*sa_restorer)(void);
};
# 117 "bionic/libc/include/signal.h" 3
int sigaction(int, const struct sigaction*, struct sigaction*);

int siginterrupt(int, int);


sighandler_t signal(int, sighandler_t) __attribute__((annotate("introduced_in=" "21")));
int sigaddset(sigset_t*, int) __attribute__((annotate("introduced_in=" "21")));
int sigdelset(sigset_t*, int) __attribute__((annotate("introduced_in=" "21")));
int sigemptyset(sigset_t*) __attribute__((annotate("introduced_in=" "21")));
int sigfillset(sigset_t*) __attribute__((annotate("introduced_in=" "21")));
int sigismember(const sigset_t*, int) __attribute__((annotate("introduced_in=" "21")));




int sigpending(sigset_t* _Nonnull);
int sigprocmask(int, const sigset_t*, sigset_t*);
int sigsuspend(const sigset_t* _Nonnull);
int sigwait(const sigset_t* _Nonnull, int* _Nonnull);

int sighold(int)
  __attribute__((deprecated("use sigprocmask() or pthread_sigmask() instead")))
  __attribute__((annotate("introduced_in_future")));
int sigignore(int)
  __attribute__((deprecated("use sigaction() instead"))) __attribute__((annotate("introduced_in_future")));
int sigpause(int)
  __attribute__((deprecated("use sigsuspend() instead"))) __attribute__((annotate("introduced_in_future")));
int sigrelse(int)
  __attribute__((deprecated("use sigprocmask() or pthread_sigmask() instead")))
  __attribute__((annotate("introduced_in_future")));
sighandler_t sigset(int, sighandler_t)
  __attribute__((deprecated("use sigaction() instead"))) __attribute__((annotate("introduced_in_future")));

int raise(int);
int kill(pid_t, int);
int killpg(int, int);
int tgkill(int tgid, int tid, int sig) __attribute__((annotate("introduced_in_32=" "16")));

int sigaltstack(const stack_t*, stack_t*);

void psiginfo(const siginfo_t*, const char*) __attribute__((annotate("introduced_in=" "17")));
void psignal(int, const char*) __attribute__((annotate("introduced_in=" "17")));

int pthread_kill(pthread_t, int);
int pthread_sigmask(int, const sigset_t*, sigset_t*);

int sigqueue(pid_t, int, const union sigval) __attribute__((annotate("introduced_in=" "23")));
int sigtimedwait(const sigset_t* _Nonnull, siginfo_t*, const struct timespec*) __attribute__((annotate("introduced_in=" "23")));
int sigwaitinfo(const sigset_t* _Nonnull, siginfo_t*) __attribute__((annotate("introduced_in=" "23")));


#pragma clang diagnostic pop





# 1 "bionic/libc/include/android/legacy_signal_inlines.h" 1 3
# 32 "bionic/libc/include/android/legacy_signal_inlines.h" 3
# 1 "external/libcxx/include/errno.h" 1 3
# 30 "external/libcxx/include/errno.h" 3


# 1 "bionic/libc/include/errno.h" 1 3
# 32 "bionic/libc/include/errno.h" 3
# 1 "bionic/libc/kernel/uapi/linux/errno.h" 1 3
# 19 "bionic/libc/kernel/uapi/linux/errno.h" 3
# 1 "bionic/libc/kernel/uapi/asm-arm64/asm/errno.h" 1 3
# 19 "bionic/libc/kernel/uapi/asm-arm64/asm/errno.h" 3
# 1 "bionic/libc/kernel/uapi/asm-generic/errno.h" 1 3
# 21 "bionic/libc/kernel/uapi/asm-generic/errno.h" 3
# 1 "bionic/libc/kernel/uapi/asm-generic/errno-base.h" 1 3
# 22 "bionic/libc/kernel/uapi/asm-generic/errno.h" 2 3
# 20 "bionic/libc/kernel/uapi/asm-arm64/asm/errno.h" 2 3
# 20 "bionic/libc/kernel/uapi/linux/errno.h" 2 3
# 33 "bionic/libc/include/errno.h" 2 3
# 44 "bionic/libc/include/errno.h" 3
volatile int* __errno(void) __attribute__((__const__));







# 1 "bionic/libc/include/android/legacy_errno_inlines.h" 1 3
# 32 "bionic/libc/include/android/legacy_errno_inlines.h" 3
# 1 "external/libcxx/include/errno.h" 1 3
# 33 "bionic/libc/include/android/legacy_errno_inlines.h" 2 3
# 52 "bionic/libc/include/errno.h" 2 3
# 33 "external/libcxx/include/errno.h" 2 3
# 33 "bionic/libc/include/android/legacy_signal_inlines.h" 2 3
# 1 "bionic/libc/include/signal.h" 1 3
# 34 "bionic/libc/include/android/legacy_signal_inlines.h" 2 3
# 1 "external/libcxx/include/string.h" 1 3
# 59 "external/libcxx/include/string.h" 3


# 1 "bionic/libc/include/string.h" 1 3
# 33 "bionic/libc/include/string.h" 3
# 1 "external/libcxx/include/stddef.h" 1 3
# 34 "bionic/libc/include/string.h" 2 3
# 1 "bionic/libc/include/xlocale.h" 1 3
# 35 "bionic/libc/include/xlocale.h" 3
struct __locale_t;
typedef struct __locale_t* locale_t;
# 35 "bionic/libc/include/string.h" 2 3

# 1 "bionic/libc/include/bits/strcasecmp.h" 1 3
# 38 "bionic/libc/include/bits/strcasecmp.h" 3
int strcasecmp(const char*, const char*) __attribute__((__pure__));
int strcasecmp_l(const char*, const char*, locale_t) __attribute__((__pure__)) __attribute__((annotate("introduced_in=" "23")));
int strncasecmp(const char*, const char*, size_t) __attribute__((__pure__));
int strncasecmp_l(const char*, const char*, size_t, locale_t) __attribute__((__pure__)) __attribute__((annotate("introduced_in=" "23")));
# 37 "bionic/libc/include/string.h" 2 3




#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnullability-completeness"




# 1 "bionic/libc/include/strings.h" 1 3
# 57 "bionic/libc/include/strings.h" 3
int ffs(int) __attribute__((annotate("introduced_in_x86=" "18")));
# 47 "bionic/libc/include/string.h" 2 3


void* memccpy(void* _Nonnull __restrict, const void* _Nonnull __restrict, int, size_t);
void* memchr(const void* _Nonnull, int, size_t) __attribute__((__pure__));
void* memrchr(const void* _Nonnull, int, size_t) __attribute__((__pure__));
int memcmp(const void* _Nonnull, const void* _Nonnull, size_t) __attribute__((__pure__));
void* memcpy(void* _Nonnull __restrict, const void* _Nonnull __restrict, size_t);

void* mempcpy(void* _Nonnull __restrict, const void* _Nonnull __restrict, size_t) __attribute__((annotate("introduced_in=" "23")));

void* memmove(void* _Nonnull, const void* _Nonnull, size_t);
void* memset(void* _Nonnull, int, size_t);
void* memmem(const void* _Nonnull, size_t, const void* _Nonnull, size_t) __attribute__((__pure__));

char* strchr(const char* _Nonnull, int) __attribute__((__pure__));
char* __strchr_chk(const char* _Nonnull, int, size_t) __attribute__((annotate("introduced_in=" "18")));





char* strchrnul(const char* _Nonnull, int) __attribute__((__pure__)) __attribute__((annotate("introduced_in=" "24")));



char* strrchr(const char* _Nonnull, int) __attribute__((__pure__));
char* __strrchr_chk(const char* _Nonnull, int, size_t) __attribute__((annotate("introduced_in=" "18")));

size_t strlen(const char* _Nonnull) __attribute__((__pure__));
size_t __strlen_chk(const char* _Nonnull, size_t) __attribute__((annotate("introduced_in=" "17")));
int strcmp(const char* _Nonnull, const char* _Nonnull) __attribute__((__pure__));
char* stpcpy(char* _Nonnull __restrict, const char* _Nonnull__restrict) __attribute__((annotate("introduced_in=" "21")));
char* strcpy(char* _Nonnull __restrict, const char* _Nonnull __restrict);
char* strcat(char* _Nonnull __restrict, const char* _Nonnull __restrict);

char* strdup(const char* _Nonnull);

char* strstr(const char* _Nonnull, const char* _Nonnull) __attribute__((__pure__));
char* strcasestr(const char* _Nonnull, const char* _Nonnull) __attribute__((__pure__));
char* strtok(char* __restrict, const char* _Nonnull __restrict);
char* strtok_r(char* __restrict, const char* _Nonnull __restrict, char** _Nonnull __restrict);

char* strerror(int);
char* strerror_l(int, locale_t) __attribute__((annotate("introduced_in=" "23")));

char* strerror_r(int, char*, size_t) __asm__("__gnu_strerror_r") __attribute__((annotate("introduced_in=" "23")));




size_t strnlen(const char* _Nonnull, size_t) __attribute__((__pure__));
char* strncat(char* _Nonnull __restrict, const char* _Nonnull __restrict, size_t);
char* strndup(const char* _Nonnull, size_t);
int strncmp(const char* _Nonnull, const char* _Nonnull, size_t) __attribute__((__pure__));
char* stpncpy(char* _Nonnull __restrict, const char* _Nonnull __restrict, size_t) __attribute__((annotate("introduced_in=" "21")));
char* strncpy(char* _Nonnull __restrict, const char* _Nonnull __restrict, size_t);

size_t strlcat(char* _Nonnull __restrict, const char* _Nonnull __restrict, size_t);
size_t strlcpy(char* _Nonnull __restrict, const char* _Nonnull __restrict, size_t);

size_t strcspn(const char* _Nonnull, const char* _Nonnull) __attribute__((__pure__));
char* strpbrk(const char* _Nonnull, const char* _Nonnull) __attribute__((__pure__));
char* strsep(char** _Nonnull __restrict, const char* _Nonnull __restrict);
size_t strspn(const char* _Nonnull, const char* _Nonnull);

char* strsignal(int);

int strcoll(const char* _Nonnull, const char* _Nonnull) __attribute__((__pure__));
size_t strxfrm(char* __restrict, const char* _Nonnull __restrict, size_t);


int strcoll_l(const char* _Nonnull, const char* _Nonnull, locale_t) __attribute__((__pure__)) __attribute__((annotate("introduced_in=" "21")));
size_t strxfrm_l(char* __restrict, const char* _Nonnull __restrict, size_t, locale_t) __attribute__((annotate("introduced_in=" "21")));
# 133 "bionic/libc/include/string.h" 3
char* basename(const char* _Nonnull) __asm__("__gnu_basename") __attribute__((annotate("introduced_in=" "23")));



void* __memchr_chk(const void* _Nonnull, int, size_t, size_t) __attribute__((annotate("introduced_in=" "23")));
extern void __memchr_buf_size_error(void) __attribute__((unavailable("memchr called with size bigger than buffer")));

void* __memrchr_chk(const void* _Nonnull, int, size_t, size_t) __attribute__((annotate("introduced_in=" "23")));
extern void __memrchr_buf_size_error(void) __attribute__((unavailable("memrchr called with size bigger than buffer")));
void* __memrchr_real(const void* _Nonnull, int, size_t) __asm__("memrchr");

char* __stpncpy_chk2(char* _Nonnull __restrict, const char* _Nonnull __restrict, size_t, size_t, size_t)
  __attribute__((annotate("introduced_in=" "21")));
char* __strncpy_chk2(char* _Nonnull __restrict, const char* _Nonnull __restrict, size_t, size_t, size_t)
  __attribute__((annotate("introduced_in=" "21")));
size_t __strlcpy_real(char* _Nonnull __restrict, const char* _Nonnull __restrict, size_t) __asm__("strlcpy");
size_t __strlcpy_chk(char* _Nonnull __restrict, const char* _Nonnull __restrict, size_t, size_t) __attribute__((annotate("introduced_in=" "17")));
size_t __strlcat_real(char* _Nonnull __restrict, const char* _Nonnull __restrict, size_t) __asm__("strlcat");
size_t __strlcat_chk(char* _Nonnull __restrict, const char* _Nonnull __restrict, size_t, size_t) __attribute__((annotate("introduced_in=" "17")));




extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
void* memchr(const void* s, int c, size_t n) {
    size_t bos = __builtin_object_size((s), 1);
# 174 "bionic/libc/include/string.h" 3
    return __memchr_chk(s, c, n, bos);
}

extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
void* memrchr(const void* s, int c, size_t n) {
    size_t bos = __builtin_object_size((s), 1);
# 195 "bionic/libc/include/string.h" 3
    return __memrchr_chk(s, c, n, bos);
}



extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
void* memcpy(void* _Nonnull __restrict dst, const void* _Nonnull __restrict src, size_t copy_amount) {
    return __builtin___memcpy_chk(dst, src, copy_amount, __builtin_object_size((dst), 0));
}

extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
void* memmove(void* _Nonnull dst, const void* _Nonnull src, size_t len) {
    return __builtin___memmove_chk(dst, src, len, __builtin_object_size((dst), 0));
}



extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
char* stpcpy(char* _Nonnull __restrict dst, const char* _Nonnull __restrict src) {
    return __builtin___stpcpy_chk(dst, src, __builtin_object_size((dst), 1));
}



extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
char* strcpy(char* _Nonnull __restrict dst, const char* _Nonnull __restrict src) {
    return __builtin___strcpy_chk(dst, src, __builtin_object_size((dst), 1));
}



extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
char* stpncpy(char* _Nonnull __restrict dst, const char* _Nonnull __restrict src, size_t n) {
    size_t bos_dst = __builtin_object_size((dst), 1);
    size_t bos_src = __builtin_object_size((src), 1);

    if (bos_src == ((size_t) (-1))) {
        return __builtin___stpncpy_chk(dst, src, n, bos_dst);
    }

    if (__builtin_constant_p(n) && (n <= bos_src)) {
        return __builtin___stpncpy_chk(dst, src, n, bos_dst);
    }

    size_t slen = __builtin_strlen(src);
    if (__builtin_constant_p(slen)) {
        return __builtin___stpncpy_chk(dst, src, n, bos_dst);
    }

    return __stpncpy_chk2(dst, src, n, bos_dst, bos_src);
}

extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
char* strncpy(char* _Nonnull __restrict dst, const char* _Nonnull __restrict src, size_t n) {
    size_t bos_dst = __builtin_object_size((dst), 1);
    size_t bos_src = __builtin_object_size((src), 1);

    if (bos_src == ((size_t) (-1))) {
        return __builtin___strncpy_chk(dst, src, n, bos_dst);
    }

    if (__builtin_constant_p(n) && (n <= bos_src)) {
        return __builtin___strncpy_chk(dst, src, n, bos_dst);
    }

    size_t slen = __builtin_strlen(src);
    if (__builtin_constant_p(slen)) {
        return __builtin___strncpy_chk(dst, src, n, bos_dst);
    }

    return __strncpy_chk2(dst, src, n, bos_dst, bos_src);
}



extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
char* strcat(char* _Nonnull __restrict dst, const char* _Nonnull __restrict src) {
    return __builtin___strcat_chk(dst, src, __builtin_object_size((dst), 1));
}

extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
char *strncat(char* _Nonnull __restrict dst, const char* _Nonnull __restrict src, size_t n) {
    return __builtin___strncat_chk(dst, src, n, __builtin_object_size((dst), 1));
}

extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
void* memset(void* _Nonnull s, int c, size_t n) {
    return __builtin___memset_chk(s, c, n, __builtin_object_size((s), 0));
}

extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
size_t strlcpy(char* _Nonnull __restrict dst, const char* _Nonnull __restrict src, size_t size) {
    size_t bos = __builtin_object_size((dst), 1);
# 302 "bionic/libc/include/string.h" 3
    return __strlcpy_chk(dst, src, size, bos);
}


extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
size_t strlcat(char* _Nonnull __restrict dst, const char* _Nonnull __restrict src, size_t size) {
    size_t bos = __builtin_object_size((dst), 1);
# 323 "bionic/libc/include/string.h" 3
    return __strlcat_chk(dst, src, size, bos);
}

extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
size_t strlen(const char* _Nonnull s) {
    size_t bos = __builtin_object_size((s), 1);
# 342 "bionic/libc/include/string.h" 3
    return __strlen_chk(s, bos);
}



extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
char* strchr(const char* _Nonnull s, int c) {
    size_t bos = __builtin_object_size((s), 1);
# 363 "bionic/libc/include/string.h" 3
    return __strchr_chk(s, c, bos);
}

extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
char* strrchr(const char* _Nonnull s, int c) {
    size_t bos = __builtin_object_size((s), 1);
# 382 "bionic/libc/include/string.h" 3
    return __strrchr_chk(s, c, bos);
}





#pragma clang diagnostic pop
# 62 "external/libcxx/include/string.h" 2 3
# 35 "bionic/libc/include/android/legacy_signal_inlines.h" 2 3





sighandler_t bsd_signal(int signum, sighandler_t handler) __attribute__((annotate("obsoleted_in=" "21")));
# 174 "bionic/libc/include/signal.h" 2 3
# 37 "bionic/libc/include/sys/select.h" 2 3







typedef struct {
  unsigned long fds_bits[(1024/(8 * sizeof(unsigned long)))];
} fd_set;
# 61 "bionic/libc/include/sys/select.h" 3
void __FD_CLR_chk(int, fd_set*, size_t) __attribute__((annotate("introduced_in=" "21")));
void __FD_SET_chk(int, fd_set*, size_t) __attribute__((annotate("introduced_in=" "21")));
int __FD_ISSET_chk(int, fd_set*, size_t) __attribute__((annotate("introduced_in=" "21")));
# 75 "bionic/libc/include/sys/select.h" 3
int select(int, fd_set*, fd_set*, fd_set*, struct timeval*);
int pselect(int, fd_set*, fd_set*, fd_set*, const struct timespec*, const sigset_t*);
# 36 "bionic/libc/include/unistd.h" 2 3

# 1 "bionic/libc/include/bits/fcntl.h" 1 3
# 36 "bionic/libc/include/bits/fcntl.h" 3
int fcntl(int, int, ...);
# 38 "bionic/libc/include/unistd.h" 2 3
# 1 "bionic/libc/include/bits/getopt.h" 1 3
# 36 "bionic/libc/include/bits/getopt.h" 3
int getopt(int, char * const [], const char *);

extern char *optarg;
extern int optind, opterr, optopt;
# 39 "bionic/libc/include/unistd.h" 2 3
# 1 "bionic/libc/include/bits/ioctl.h" 1 3
# 36 "bionic/libc/include/bits/ioctl.h" 3
int ioctl(int, int, ...);
# 40 "bionic/libc/include/unistd.h" 2 3
# 1 "bionic/libc/include/bits/lockf.h" 1 3
# 45 "bionic/libc/include/bits/lockf.h" 3
int lockf(int, int, off_t) __attribute__((annotate("introduced_in=" "24")));

int lockf64(int, int, off64_t) __attribute__((annotate("introduced_in=" "24")));
# 41 "bionic/libc/include/unistd.h" 2 3

# 1 "bionic/libc/include/bits/seek_constants.h" 1 3
# 43 "bionic/libc/include/unistd.h" 2 3
# 1 "bionic/libc/include/bits/sysconf.h" 1 3
# 192 "bionic/libc/include/bits/sysconf.h" 3
long sysconf(int __name);
# 44 "bionic/libc/include/unistd.h" 2 3
# 77 "bionic/libc/include/unistd.h" 3
extern char** environ;

__attribute__((__noreturn__)) void _exit(int __status);

pid_t fork(void);
pid_t vfork(void);
pid_t getpid(void);
pid_t gettid(void) __attribute__((__const__));
pid_t getpgid(pid_t __pid);
int setpgid(pid_t __pid, pid_t __pgid);
pid_t getppid(void);
pid_t getpgrp(void);
int setpgrp(void);
pid_t getsid(pid_t __pid) __attribute__((annotate("introduced_in=" "17")));
pid_t setsid(void);

int execv(const char* __path, char* const* __argv);
int execvp(const char* __file, char* const* __argv);
int execvpe(const char* __file, char* const* __argv, char* const* __envp) __attribute__((annotate("introduced_in=" "21")));
int execve(const char* __file, char* const* __argv, char* const* __envp);
int execl(const char* __path, const char* __arg0, ...) __attribute__((__sentinel__));
int execlp(const char* __file, const char* __arg0, ...) __attribute__((__sentinel__));
int execle(const char* __path, const char* __arg0, ... )
    __attribute__((__sentinel__(1)));

int nice(int __incr);

int setuid(uid_t __uid);
uid_t getuid(void);
int seteuid(uid_t __uid);
uid_t geteuid(void);
int setgid(gid_t __gid);
gid_t getgid(void);
int setegid(gid_t __gid);
gid_t getegid(void);
int getgroups(int __size, gid_t* __list);
int setgroups(size_t __size, const gid_t* __list);
int setreuid(uid_t __ruid, uid_t __euid);
int setregid(gid_t __rgid, gid_t __egid);
int setresuid(uid_t __ruid, uid_t __euid, uid_t __suid);
int setresgid(gid_t __rgid, gid_t __egid, gid_t __sgid);
int getresuid(uid_t* __ruid, uid_t* __euid, uid_t* __suid);
int getresgid(gid_t* __rgid, gid_t* __egid, gid_t* __sgid);
char* getlogin(void);

long fpathconf(int __fd, int __name);
long pathconf(const char* __path, int __name);

int access(const char* __path, int __mode);
int faccessat(int __dirfd, const char* __path, int __mode, int __flags) __attribute__((annotate("introduced_in=" "16")));
int link(const char* __oldpath, const char* __newpath);
int linkat(int __olddirfd, const char* __oldpath, int __newdirfd,
           const char* __newpath, int __flags) __attribute__((annotate("introduced_in=" "21")));
int unlink(const char* __path);
int unlinkat(int __dirfd, const char* __path, int __flags);
int chdir(const char* __path);
int fchdir(int __fd);
int rmdir(const char* __path);
int pipe(int* __pipefd);

int pipe2(int* __pipefd, int __flags) __attribute__((annotate("introduced_in=" "9")));

int chroot(const char* __path);
int symlink(const char* __oldpath, const char* __newpath);
int symlinkat(const char* __oldpath, int __newdirfd, const char* __newpath) __attribute__((annotate("introduced_in=" "21")));
ssize_t readlink(const char* __path, char* __buf, size_t __bufsiz);
ssize_t readlinkat(int __dirfd, const char* __path, char* __buf,
                   size_t __bufsiz) __attribute__((annotate("introduced_in=" "21")));
int chown(const char* __path, uid_t __owner, gid_t __group);
int fchown(int __fd, uid_t __owner, gid_t __group);
int fchownat(int __dirfd, const char* __path, uid_t __owner, gid_t __group, int __flags);
int lchown(const char* __path, uid_t __owner, gid_t __group);
char* getcwd(char* __buf, size_t __size);

void sync(void);

int close(int __fd);

ssize_t read(int __fd, void* __buf, size_t __count);
ssize_t write(int __fd, const void* __buf, size_t __count);

int dup(int __oldfd);
int dup2(int __oldfd, int __newfd);
int dup3(int __oldfd, int __newfd, int __flags) __attribute__((annotate("introduced_in=" "21")));
int fsync(int __fd);
int fdatasync(int __fd) __attribute__((annotate("introduced_in=" "9")));




off_t lseek(int __fd, off_t __offset, int __whence);


off64_t lseek64(int __fd, off64_t __offset, int __whence);
# 180 "bionic/libc/include/unistd.h" 3
int truncate(const char* __path, off_t __length);
ssize_t pread(int __fd, void* __buf, size_t __count, off_t __offset);
ssize_t pwrite(int __fd, const void* __buf, size_t __count, off_t __offset);
int ftruncate(int __fd, off_t __length);


int truncate64(const char* __path, off64_t __length) __attribute__((annotate("introduced_in=" "21")));
ssize_t pread64(int __fd, void* __buf, size_t __count, off64_t __offset) __attribute__((annotate("introduced_in=" "12")));
ssize_t pwrite64(int __fd, const void* __buf, size_t __count, off64_t __offset)
  __attribute__((annotate("introduced_in=" "12")));
int ftruncate64(int __fd, off64_t __length) __attribute__((annotate("introduced_in=" "12")));

int pause(void);
unsigned int alarm(unsigned int __seconds);
unsigned int sleep(unsigned int __seconds);
int usleep(useconds_t __usec);

int gethostname(char* __name, size_t __len);
int sethostname(const char* __name, size_t __len) __attribute__((annotate("introduced_in=" "23")));

int brk(void* __addr);
void* sbrk(ptrdiff_t __increment);

int isatty(int __fd);
char* ttyname(int __fd);
int ttyname_r(int __fd, char* __buf, size_t __buflen) __attribute__((annotate("introduced_in=" "8")));

int acct(const char* __filepath);


int getpagesize(void) __attribute__((annotate("introduced_in=" "21")));






long syscall(long __number, ...);

int daemon(int __nochdir, int __noclose);






pid_t tcgetpgrp(int __fd);
int tcsetpgrp(int __fd, pid_t __pid);
# 238 "bionic/libc/include/unistd.h" 3
char* __getcwd_chk(char*, size_t, size_t) __attribute__((annotate("introduced_in=" "24")));
extern void __getcwd_dest_size_error(void) __attribute__((unavailable("getcwd called with size bigger than destination")));
char* __getcwd_real(char*, size_t) __asm__("getcwd");

ssize_t __pread_chk(int, void*, size_t, off_t, size_t) __attribute__((annotate("introduced_in=" "23")));
extern void __pread_dest_size_error(void) __attribute__((unavailable("pread called with size bigger than destination")));
extern void __pread_count_toobig_error(void) __attribute__((unavailable("pread called with count > SSIZE_MAX")));
ssize_t __pread_real(int, void*, size_t, off_t) __asm__("pread");

ssize_t __pread64_chk(int, void*, size_t, off64_t, size_t) __attribute__((annotate("introduced_in=" "23")));
extern void __pread64_dest_size_error(void) __attribute__((unavailable("pread64 called with size bigger than destination")));
extern void __pread64_count_toobig_error(void) __attribute__((unavailable("pread64 called with count > SSIZE_MAX")));
ssize_t __pread64_real(int, void*, size_t, off64_t) __asm__("pread64") __attribute__((annotate("introduced_in=" "12")));

ssize_t __pwrite_chk(int, const void*, size_t, off_t, size_t) __attribute__((annotate("introduced_in=" "24")));
extern void __pwrite_dest_size_error(void) __attribute__((unavailable("pwrite called with size bigger than destination")));
extern void __pwrite_count_toobig_error(void) __attribute__((unavailable("pwrite called with count > SSIZE_MAX")));
ssize_t __pwrite_real(int, const void*, size_t, off_t) __asm__("pwrite");

ssize_t __pwrite64_chk(int, const void*, size_t, off64_t, size_t) __attribute__((annotate("introduced_in=" "24")));
extern void __pwrite64_dest_size_error(void) __attribute__((unavailable("pwrite64 called with size bigger than destination")));
extern void __pwrite64_count_toobig_error(void) __attribute__((unavailable("pwrite64 called with count > SSIZE_MAX")));
ssize_t __pwrite64_real(int, const void*, size_t, off64_t) __asm__("pwrite64") __attribute__((annotate("introduced_in=" "12")));

ssize_t __read_chk(int, void*, size_t, size_t) __attribute__((annotate("introduced_in=" "21")));
extern void __read_dest_size_error(void) __attribute__((unavailable("read called with size bigger than destination")));
extern void __read_count_toobig_error(void) __attribute__((unavailable("read called with count > SSIZE_MAX")));
ssize_t __read_real(int, void*, size_t) __asm__("read");

ssize_t __write_chk(int, const void*, size_t, size_t) __attribute__((annotate("introduced_in=" "24")));
extern void __write_dest_size_error(void) __attribute__((unavailable("write called with size bigger than destination")));
extern void __write_count_toobig_error(void) __attribute__((unavailable("write called with count > SSIZE_MAX")));
ssize_t __write_real(int, const void*, size_t) __asm__("write");

ssize_t __readlink_chk(const char*, char*, size_t, size_t) __attribute__((annotate("introduced_in=" "23")));
extern void __readlink_dest_size_error(void) __attribute__((unavailable("readlink called with size bigger than destination")));
extern void __readlink_size_toobig_error(void) __attribute__((unavailable("readlink called with size > SSIZE_MAX")));
ssize_t __readlink_real(const char*, char*, size_t) __asm__("readlink");

ssize_t __readlinkat_chk(int dirfd, const char*, char*, size_t, size_t) __attribute__((annotate("introduced_in=" "23")));
extern void __readlinkat_dest_size_error(void) __attribute__((unavailable("readlinkat called with size bigger than destination")));
extern void __readlinkat_size_toobig_error(void) __attribute__((unavailable("readlinkat called with size > SSIZE_MAX")));
ssize_t __readlinkat_real(int dirfd, const char*, char*, size_t) __asm__("readlinkat") __attribute__((annotate("introduced_in=" "21")));

int getdomainname(char*, size_t) __attribute__((annotate("introduced_in_future")));
int setdomainname(const char*, size_t) __attribute__((annotate("introduced_in_future")));




extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
char* getcwd(char* buf, size_t size) {
    size_t bos = __builtin_object_size((buf), 1);
# 299 "bionic/libc/include/unistd.h" 3
    if (buf == ((void*)0)) {
        bos = ((size_t) (-1));
    }
# 316 "bionic/libc/include/unistd.h" 3
    return __getcwd_chk(buf, size, bos);
}
# 327 "bionic/libc/include/unistd.h" 3
extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
ssize_t pread(int fd, void* buf, size_t count, off_t offset) {
    size_t bos = __builtin_object_size((buf), 0);
# 349 "bionic/libc/include/unistd.h" 3
    return __pread_chk(fd, buf, count, offset, bos);
}

extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
ssize_t pread64(int fd, void* buf, size_t count, off64_t offset) {
    size_t bos = __builtin_object_size((buf), 0);
# 374 "bionic/libc/include/unistd.h" 3
    return __pread64_chk(fd, buf, count, offset, bos);
}
# 385 "bionic/libc/include/unistd.h" 3
extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
ssize_t pwrite(int fd, const void* buf, size_t count, off_t offset) {
    size_t bos = __builtin_object_size((buf), 0);
# 407 "bionic/libc/include/unistd.h" 3
    return __pwrite_chk(fd, buf, count, offset, bos);
}

extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
ssize_t pwrite64(int fd, const void* buf, size_t count, off64_t offset) {
    size_t bos = __builtin_object_size((buf), 0);
# 432 "bionic/libc/include/unistd.h" 3
    return __pwrite64_chk(fd, buf, count, offset, bos);
}



extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
ssize_t read(int fd, void* buf, size_t count) {
    size_t bos = __builtin_object_size((buf), 0);
# 459 "bionic/libc/include/unistd.h" 3
    return __read_chk(fd, buf, count, bos);
}



extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
ssize_t write(int fd, const void* buf, size_t count) {
    size_t bos = __builtin_object_size((buf), 0);
# 488 "bionic/libc/include/unistd.h" 3
    return __write_chk(fd, buf, count, bos);
}



extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
ssize_t readlink(const char* path, char* buf, size_t size) {
    size_t bos = __builtin_object_size((buf), 1);
# 515 "bionic/libc/include/unistd.h" 3
    return __readlink_chk(path, buf, size, bos);
}

extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
ssize_t readlinkat(int dirfd, const char* path, char* buf, size_t size) {
    size_t bos = __builtin_object_size((buf), 1);
# 540 "bionic/libc/include/unistd.h" 3
    return __readlinkat_chk(dirfd, path, buf, size, bos);
}
# 44 "external/strace/defs.h" 2
# 1 "external/libcxx/include/stdlib.h" 1
# 92 "external/libcxx/include/stdlib.h" 3


# 1 "bionic/libc/include/stdlib.h" 1 3
# 35 "bionic/libc/include/stdlib.h" 3
# 1 "bionic/libc/include/alloca.h" 1 3
# 36 "bionic/libc/include/stdlib.h" 2 3
# 1 "bionic/libc/include/malloc.h" 1 3
# 21 "bionic/libc/include/malloc.h" 3
# 1 "external/libcxx/include/stddef.h" 1 3
# 22 "bionic/libc/include/malloc.h" 2 3
# 1 "external/libcxx/include/stdio.h" 1 3
# 106 "external/libcxx/include/stdio.h" 3


# 1 "bionic/libc/include/stdio.h" 1 3
# 44 "bionic/libc/include/stdio.h" 3
# 1 "llvm.inst/lib/clang/7.0.0/include/stdarg.h" 1 3
# 30 "llvm.inst/lib/clang/7.0.0/include/stdarg.h" 3
typedef __builtin_va_list va_list;
# 48 "llvm.inst/lib/clang/7.0.0/include/stdarg.h" 3
typedef __builtin_va_list __gnuc_va_list;
# 45 "bionic/libc/include/stdio.h" 2 3
# 1 "external/libcxx/include/stddef.h" 1 3
# 46 "bionic/libc/include/stdio.h" 2 3


# 1 "external/libcxx/include/stddef.h" 1 3
# 16 "external/libcxx/include/stddef.h" 3


# 1 "llvm.inst/lib/clang/7.0.0/include/stddef.h" 1 3
# 19 "external/libcxx/include/stddef.h" 2 3
# 49 "bionic/libc/include/stdio.h" 2 3
# 59 "bionic/libc/include/stdio.h" 3
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnullability-completeness"


typedef off_t fpos_t;
typedef off64_t fpos64_t;

struct __sFILE;
typedef struct __sFILE FILE;


extern FILE* stdin __attribute__((annotate("introduced_in=" "23")));
extern FILE* stdout __attribute__((annotate("introduced_in=" "23")));
extern FILE* stderr __attribute__((annotate("introduced_in=" "23")));
# 118 "bionic/libc/include/stdio.h" 3
void clearerr(FILE *);
int fclose(FILE *);
int feof(FILE *);
int ferror(FILE *);
int fflush(FILE *);
int fgetc(FILE *);
char *fgets(char * __restrict, int, FILE * __restrict);
int fprintf(FILE * __restrict , const char * __restrict _Nonnull, ...) __attribute__((__format__(printf, 2, 3)));
int fputc(int, FILE *);
int fputs(const char * __restrict, FILE * __restrict);
size_t fread(void * __restrict, size_t, size_t, FILE * __restrict);
int fscanf(FILE * __restrict, const char * __restrict _Nonnull, ...) __attribute__((__format__(scanf, 2, 3)));
size_t fwrite(const void * __restrict, size_t, size_t, FILE * __restrict);
int getc(FILE *);
int getchar(void);
ssize_t getdelim(char** __restrict, size_t* __restrict, int, FILE* __restrict) __attribute__((annotate("introduced_in=" "18")));
ssize_t getline(char** __restrict, size_t* __restrict, FILE* __restrict) __attribute__((annotate("introduced_in=" "18")));

void perror(const char *);
int printf(const char * __restrict _Nonnull, ...) __attribute__((__format__(printf, 1, 2)));
int putc(int, FILE *);
int putchar(int);
int puts(const char *);
int remove(const char *);
void rewind(FILE *);
int scanf(const char * __restrict _Nonnull, ...) __attribute__((__format__(scanf, 1, 2)));
void setbuf(FILE * __restrict, char * __restrict);
int setvbuf(FILE * __restrict, char * __restrict, int, size_t);
int sscanf(const char * __restrict, const char * __restrict _Nonnull, ...) __attribute__((__format__(scanf, 2, 3)));
int ungetc(int, FILE *);
int vfprintf(FILE * __restrict, const char * __restrict _Nonnull, __va_list) __attribute__((__format__(printf, 2, 0)));
int vprintf(const char * __restrict _Nonnull, __va_list) __attribute__((__format__(printf, 1, 0)));

int dprintf(int, const char* __restrict _Nonnull, ...) __attribute__((__format__(printf, 2, 3))) __attribute__((annotate("introduced_in=" "21")));
int vdprintf(int, const char* __restrict _Nonnull, __va_list) __attribute__((__format__(printf, 2, 0))) __attribute__((annotate("introduced_in=" "21")));



char* gets(char*) __attribute__((deprecated("gets is unsafe, use fgets instead")));

int sprintf(char* __restrict, const char* __restrict _Nonnull, ...) __attribute__((__format__(printf, 2, 3)));
int vsprintf(char* __restrict, const char* __restrict _Nonnull, __va_list) __attribute__((__format__(printf, 2, 0)));
char* tmpnam(char*) __attribute__((deprecated("tmpnam is unsafe, use mkstemp or tmpfile instead")));

char* tempnam(const char*, const char*)
    __attribute__((deprecated("tempnam is unsafe, use mkstemp or tmpfile instead")));

int rename(const char*, const char*);
int renameat(int, const char*, int, const char*);

int fseek(FILE*, long, int);
long ftell(FILE*);
# 184 "bionic/libc/include/stdio.h" 3
int fgetpos(FILE*, fpos_t*);
int fsetpos(FILE*, const fpos_t*);
int fseeko(FILE*, off_t, int);
off_t ftello(FILE*);

FILE* funopen(const void*,
              int (*)(void*, char*, int),
              int (*)(void*, const char*, int),
              fpos_t (*)(void*, fpos_t, int),
              int (*)(void*));


int fgetpos64(FILE*, fpos64_t*) __attribute__((annotate("introduced_in=" "24")));
int fsetpos64(FILE*, const fpos64_t*) __attribute__((annotate("introduced_in=" "24")));
int fseeko64(FILE*, off64_t, int) __attribute__((annotate("introduced_in=" "24")));
off64_t ftello64(FILE*) __attribute__((annotate("introduced_in=" "24")));

FILE* funopen64(const void*, int (*)(void*, char*, int), int (*)(void*, const char*, int),
                fpos64_t (*)(void*, fpos64_t, int), int (*)(void*)) __attribute__((annotate("introduced_in=" "24")));


FILE* fopen(const char* __restrict, const char* __restrict);
FILE* fopen64(const char* __restrict, const char* __restrict) __attribute__((annotate("introduced_in=" "24")));
FILE* freopen(const char* __restrict, const char* __restrict, FILE* __restrict);
FILE* freopen64(const char* __restrict, const char* __restrict, FILE* __restrict)
  __attribute__((annotate("introduced_in=" "24")));
FILE* tmpfile(void);
FILE* tmpfile64(void) __attribute__((annotate("introduced_in=" "24")));

int snprintf(char* __restrict, size_t, const char* __restrict _Nonnull, ...) __attribute__((__format__(printf, 3, 4)));
int vfscanf(FILE* __restrict, const char* __restrict _Nonnull, __va_list) __attribute__((__format__(scanf, 2, 0)));
int vscanf(const char* _Nonnull , __va_list) __attribute__((__format__(scanf, 1, 0)));
int vsnprintf(char* __restrict, size_t, const char* __restrict _Nonnull, __va_list) __attribute__((__format__(printf, 3, 0)));
int vsscanf(const char* __restrict _Nonnull, const char* __restrict _Nonnull, __va_list) __attribute__((__format__(scanf, 2, 0)));


char* ctermid(char*) __attribute__((annotate("introduced_in_future")));

FILE* fdopen(int, const char*);
int fileno(FILE*);
int pclose(FILE*);
FILE* popen(const char*, const char*);
void flockfile(FILE*);
int ftrylockfile(FILE*);
void funlockfile(FILE*);
int getc_unlocked(FILE*);
int getchar_unlocked(void);
int putc_unlocked(int, FILE*);
int putchar_unlocked(int);

FILE* fmemopen(void*, size_t, const char*) __attribute__((annotate("introduced_in=" "23")));
FILE* open_memstream(char**, size_t*) __attribute__((annotate("introduced_in=" "23")));


int asprintf(char** __restrict, const char* __restrict _Nonnull, ...) __attribute__((__format__(printf, 2, 3)));
char* fgetln(FILE* __restrict, size_t* __restrict);
int fpurge(FILE*);
void setbuffer(FILE*, char*, int);
int setlinebuf(FILE*);
int vasprintf(char** __restrict, const char* __restrict _Nonnull, __va_list) __attribute__((__format__(printf, 2, 0)));
void clearerr_unlocked(FILE*) __attribute__((annotate("introduced_in=" "23")));
int feof_unlocked(FILE*) __attribute__((annotate("introduced_in=" "23")));
int ferror_unlocked(FILE*) __attribute__((annotate("introduced_in=" "23")));
int fileno_unlocked(FILE*) __attribute__((annotate("introduced_in=" "24")));




char* __fgets_chk(char*, int, FILE*, size_t) __attribute__((annotate("introduced_in=" "17")));
char* __fgets_real(char*, int, FILE*) __asm__("fgets");
extern void __fgets_too_big_error(void) __attribute__((unavailable("fgets called with size bigger than buffer")));
extern void __fgets_too_small_error(void) __attribute__((unavailable("fgets called with size less than zero")));

size_t __fread_chk(void* __restrict, size_t, size_t, FILE* __restrict, size_t)
  __attribute__((annotate("introduced_in=" "24")));
size_t __fread_real(void * __restrict, size_t, size_t, FILE * __restrict) __asm__("fread");
extern void __fread_too_big_error(void) __attribute__((unavailable("fread called with size * count bigger than buffer")));
extern void __fread_overflow(void) __attribute__((unavailable("fread called with overflowing size * count")));

size_t __fwrite_chk(const void* __restrict, size_t, size_t, FILE* __restrict, size_t)
  __attribute__((annotate("introduced_in=" "24")));
size_t __fwrite_real(const void * __restrict, size_t, size_t, FILE * __restrict) __asm__("fwrite");
extern void __fwrite_too_big_error(void) __attribute__((unavailable("fwrite called with size * count bigger than buffer")));
extern void __fwrite_overflow(void) __attribute__((unavailable("fwrite called with overflowing size * count")));




extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
__attribute__((__format__(printf, 3, 0))) int vsnprintf(char* dest, size_t size, const char* _Nonnull format, __va_list ap) {
    return __builtin___vsnprintf_chk(dest, size, 0, __builtin_object_size((dest), 1), format, ap);
}

extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
__attribute__((__format__(printf, 2, 0))) int vsprintf(char* dest, const char* _Nonnull format, __va_list ap) {
    return __builtin___vsprintf_chk(dest, 0, __builtin_object_size((dest), 1), format, ap);
}
# 308 "bionic/libc/include/stdio.h" 3
extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
size_t fread(void * __restrict buf, size_t size, size_t count, FILE * __restrict stream) {
    size_t bos = __builtin_object_size((buf), 0);
# 331 "bionic/libc/include/stdio.h" 3
    return __fread_chk(buf, size, count, stream, bos);
}

extern __inline__ __attribute__((__always_inline__)) __attribute__((gnu_inline))
size_t fwrite(const void * __restrict buf, size_t size, size_t count, FILE * __restrict stream) {
    size_t bos = __builtin_object_size((buf), 0);
# 357 "bionic/libc/include/stdio.h" 3
    return __fwrite_chk(buf, size, count, stream, bos);
}
# 398 "bionic/libc/include/stdio.h" 3
#pragma clang diagnostic pop
# 109 "external/libcxx/include/stdio.h" 2 3
# 23 "bionic/libc/include/malloc.h" 2 3
# 32 "bionic/libc/include/malloc.h" 3
void* malloc(size_t byte_count) __attribute__((__malloc__)) __attribute__((__warn_unused_result__));
void* calloc(size_t item_count, size_t item_size) __attribute__((__malloc__)) __attribute__((__warn_unused_result__));
void* realloc(void* p, size_t byte_count) __attribute__((__warn_unused_result__));
void free(void* p);

void* memalign(size_t alignment, size_t byte_count) __attribute__((__malloc__)) __attribute__((__warn_unused_result__));
size_t malloc_usable_size(const void* p) __attribute__((annotate("introduced_in=" "17")));



struct mallinfo {
  size_t arena;
  size_t ordblks;
  size_t smblks;
  size_t hblks;
  size_t hblkhd;
  size_t usmblks;
  size_t fsmblks;
  size_t uordblks;
  size_t fordblks;
  size_t keepcost;
};


struct mallinfo mallinfo(void);
# 77 "bionic/libc/include/malloc.h" 3
int malloc_info(int, FILE*) __attribute__((annotate("introduced_in=" "23")));
# 37 "bionic/libc/include/stdlib.h" 2 3
# 1 "external/libcxx/include/stddef.h" 1 3
# 38 "bionic/libc/include/stdlib.h" 2 3






__attribute__((__noreturn__)) void abort(void);
__attribute__((__noreturn__)) void exit(int);
__attribute__((__noreturn__)) void _Exit(int) __attribute__((annotate("introduced_in=" "21")));
int atexit(void (*)(void));

int at_quick_exit(void (*)(void)) __attribute__((annotate("introduced_in=" "21")));
void quick_exit(int) __attribute__((__noreturn__)) __attribute__((annotate("introduced_in=" "21")));

char* getenv(const char*);
int putenv(char*);
int setenv(const char*, const char*, int);
int unsetenv(const char*);
int clearenv(void);

char* mkdtemp(char*);
char* mktemp(char*) __attribute__((deprecated("mktemp is unsafe, use mkstemp or tmpfile instead")));

int mkostemp64(char*, int) __attribute__((annotate("introduced_in=" "23")));
int mkostemp(char*, int) __attribute__((annotate("introduced_in=" "23")));
int mkostemps64(char*, int, int) __attribute__((annotate("introduced_in=" "23")));
int mkostemps(char*, int, int) __attribute__((annotate("introduced_in=" "23")));
int mkstemp64(char*) __attribute__((annotate("introduced_in=" "21")));
int mkstemp(char*);
int mkstemps64(char*, int) __attribute__((annotate("introduced_in=" "23")));
int mkstemps(char*, int);

long strtol(const char *, char **, int);
long long strtoll(const char *, char **, int);
unsigned long strtoul(const char *, char **, int);
unsigned long long strtoull(const char *, char **, int);

int posix_memalign(void** memptr, size_t alignment, size_t size) __attribute__((annotate("introduced_in=" "16")));

double strtod(const char*, char**);
long double strtold(const char*, char**) __attribute__((annotate("introduced_in=" "21")));

unsigned long strtoul_l(const char*, char**, int, locale_t) __attribute__((annotate("introduced_in_future")));

int atoi(const char*) __attribute__((__pure__));
long atol(const char*) __attribute__((__pure__));
long long atoll(const char*) __attribute__((__pure__));

char* realpath(const char* path, char* resolved);
int system(const char* string);

void* bsearch(const void* key, const void* base0, size_t nmemb, size_t size,
              int (*compar)(const void*, const void*));

void qsort(void*, size_t, size_t, int (*)(const void*, const void*));

uint32_t arc4random(void);
uint32_t arc4random_uniform(uint32_t);
void arc4random_buf(void*, size_t);



int rand_r(unsigned int*) __attribute__((annotate("introduced_in=" "21")));

double drand48(void);
double erand48(unsigned short[3]);
long jrand48(unsigned short[3]);
void lcong48(unsigned short[7]) __attribute__((annotate("introduced_in=" "23")));
long lrand48(void);
long mrand48(void);
long nrand48(unsigned short[3]);
unsigned short* seed48(unsigned short[3]);
void srand48(long);

char* initstate(unsigned int, char*, size_t) __attribute__((annotate("introduced_in=" "21")));
char* setstate(char*) __attribute__((annotate("introduced_in=" "21")));

int getpt(void);
int posix_openpt(int) __attribute__((annotate("introduced_in=" "21")));
char* ptsname(int);
int ptsname_r(int, char*, size_t);
int unlockpt(int);

int getsubopt(char**, char* const*, char**) __attribute__((annotate("introduced_in_future")));

typedef struct {
    int quot;
    int rem;
} div_t;

div_t div(int, int) __attribute__((__const__));

typedef struct {
    long int quot;
    long int rem;
} ldiv_t;

ldiv_t ldiv(long, long) __attribute__((__const__));

typedef struct {
    long long int quot;
    long long int rem;
} lldiv_t;

lldiv_t lldiv(long long, long long) __attribute__((__const__));


const char* getprogname(void) __attribute__((annotate("introduced_in=" "21")));
void setprogname(const char*) __attribute__((annotate("introduced_in=" "21")));

int mblen(const char*, size_t) __attribute__((annotate("introduced_in_future"))) __attribute__((annotate("versioner_no_guard")));
size_t mbstowcs(wchar_t*, const char*, size_t);
int mbtowc(wchar_t*, const char*, size_t) __attribute__((annotate("introduced_in=" "21"))) __attribute__((annotate("versioner_no_guard")));
int wctomb(char*, wchar_t) __attribute__((annotate("introduced_in=" "21"))) __attribute__((annotate("versioner_no_guard")));

size_t wcstombs(char*, const wchar_t*, size_t);


size_t __ctype_get_mb_cur_max(void) __attribute__((annotate("introduced_in=" "21")));
# 168 "bionic/libc/include/stdlib.h" 3
char* __realpath_real(const char*, char*) __asm__("realpath");
extern void __realpath_size_error(void) __attribute__((unavailable("realpath output parameter must be NULL or a >= PATH_MAX bytes buffer")));
# 188 "bionic/libc/include/stdlib.h" 3
float strtof(const char*, char**) __attribute__((annotate("introduced_in=" "21")));
double atof(const char*) __attribute__((__pure__)) __attribute__((annotate("introduced_in=" "21")));
int abs(int) __attribute__((__const__)) __attribute__((annotate("introduced_in=" "21")));
long labs(long) __attribute__((__const__)) __attribute__((annotate("introduced_in=" "21")));
long long llabs(long long) __attribute__((__const__)) __attribute__((annotate("introduced_in=" "21")));
int rand(void) __attribute__((annotate("introduced_in=" "21")));
void srand(unsigned int) __attribute__((annotate("introduced_in=" "21")));
long random(void) __attribute__((annotate("introduced_in=" "21")));
void srandom(unsigned int) __attribute__((annotate("introduced_in=" "21")));
int grantpt(int) __attribute__((annotate("introduced_in=" "21")));

long long strtoll_l(const char*, char**, int, locale_t) __attribute__((annotate("introduced_in=" "21")));
unsigned long long strtoull_l(const char*, char**, int, locale_t) __attribute__((annotate("introduced_in=" "21")));
long double strtold_l(const char*, char**, locale_t) __attribute__((annotate("introduced_in=" "21")));





double strtod_l(const char*, char**, locale_t) __attribute__((annotate("introduced_in_future")));
float strtof_l(const char*, char**, locale_t) __attribute__((annotate("introduced_in_future")));
long strtol_l(const char*, char**, int, locale_t) __attribute__((annotate("introduced_in_future")));







# 1 "bionic/libc/include/android/legacy_stdlib_inlines.h" 1 3
# 32 "bionic/libc/include/android/legacy_stdlib_inlines.h" 3
# 1 "external/libcxx/include/stdlib.h" 1 3
# 33 "bionic/libc/include/android/legacy_stdlib_inlines.h" 2 3
# 217 "bionic/libc/include/stdlib.h" 2 3
# 95 "external/libcxx/include/stdlib.h" 2 3
# 45 "external/strace/defs.h" 2
# 1 "external/libcxx/include/stdio.h" 1
# 46 "external/strace/defs.h" 2






# 1 "bionic/libc/include/time.h" 1 3
# 33 "bionic/libc/include/time.h" 3
# 1 "bionic/libc/include/sys/time.h" 1 3
# 41 "bionic/libc/include/sys/time.h" 3
int gettimeofday(struct timeval*, struct timezone*);
int settimeofday(const struct timeval*, const struct timezone*);

int getitimer(int, struct itimerval*);
int setitimer(int, const struct itimerval*, struct itimerval*);

int utimes(const char*, const struct timeval*);


int futimes(int, const struct timeval[2]) __attribute__((annotate("introduced_in_future")));
int lutimes(const char*, const struct timeval[2]) __attribute__((annotate("introduced_in_future")));



int futimesat(int, const char*, const struct timeval[2]) __attribute__((annotate("introduced_in_future")));
# 34 "bionic/libc/include/time.h" 2 3






extern char* tzname[];
extern int daylight;
extern long int timezone;

struct sigevent;

struct tm {
  int tm_sec;
  int tm_min;
  int tm_hour;
  int tm_mday;
  int tm_mon;
  int tm_year;
  int tm_wday;
  int tm_yday;
  int tm_isdst;
  long int tm_gmtoff;
  const char* tm_zone;
};



time_t time(time_t*);
int nanosleep(const struct timespec*, struct timespec*);

char* asctime(const struct tm*);
char* asctime_r(const struct tm*, char*);

double difftime(time_t, time_t);
time_t mktime(struct tm*);

struct tm* localtime(const time_t*);
struct tm* localtime_r(const time_t*, struct tm*);

struct tm* gmtime(const time_t*);
struct tm* gmtime_r(const time_t*, struct tm*);

char* strptime(const char*, const char*, struct tm*);
size_t strftime(char*, size_t, const char*, const struct tm*);


size_t strftime_l(char*, size_t, const char*, const struct tm*, locale_t) __attribute__((annotate("introduced_in=" "21")));




char* ctime(const time_t*);
char* ctime_r(const time_t*, char*);

void tzset(void);

clock_t clock(void);

int clock_getcpuclockid(pid_t, clockid_t*) __attribute__((annotate("introduced_in=" "23")));

int clock_getres(clockid_t, struct timespec*);
int clock_gettime(clockid_t, struct timespec*);
int clock_nanosleep(clockid_t, int, const struct timespec*, struct timespec*);
int clock_settime(clockid_t, const struct timespec*);

int timer_create(int, struct sigevent*, timer_t*);
int timer_delete(timer_t);
int timer_settime(timer_t, int, const struct itimerspec*, struct itimerspec*);
int timer_gettime(timer_t, struct itimerspec*);
int timer_getoverrun(timer_t);


time_t timelocal(struct tm*) __attribute__((annotate("introduced_in=" "12")));
time_t timegm(struct tm*) __attribute__((annotate("introduced_in=" "12")));
# 53 "external/strace/defs.h" 2

# 1 "bionic/libc/kernel/uapi/asm-arm64/asm/unistd.h" 1 3
# 20 "bionic/libc/kernel/uapi/asm-arm64/asm/unistd.h" 3
# 1 "bionic/libc/kernel/uapi/asm-generic/unistd.h" 1 3
# 21 "bionic/libc/kernel/uapi/asm-arm64/asm/unistd.h" 2 3
# 55 "external/strace/defs.h" 2

# 1 "external/strace/mpers_type.h" 1
# 57 "external/strace/defs.h" 2
# 1 "external/strace/gcc_compat.h" 1
# 58 "external/strace/defs.h" 2
# 68 "external/strace/defs.h"
extern char *strace_stpcpy(char *dst, const char *src);
# 195 "external/strace/defs.h"
typedef struct sysent {
 unsigned nargs;
 int sys_flags;
 int sen;
 int (*sys_func)();
 const char *sys_name;
} struct_sysent;

typedef struct ioctlent {
 const char *symbol;
 unsigned int code;
} struct_ioctlent;
# 215 "external/strace/defs.h"
struct tcb {
 int flags;
 int pid;
 int qual_flg;
 unsigned long u_error;
 long scno;
 long u_arg[6];




 long u_rval;

 unsigned int currpers;

 int sys_func_rval;
 int curcol;
 FILE *outf;
 const char *auxstr;
 void *_priv_data;
 void (*_free_priv_data)(void *);
 const struct_sysent *s_ent;
 const struct_sysent *s_prev_ent;
 struct timeval stime;
 struct timeval dtime;
 struct timeval etime;
# 249 "external/strace/defs.h"
};
# 283 "external/strace/defs.h"
typedef uint8_t qualbits_t;
# 294 "external/strace/defs.h"
# 1 "external/strace/xlat.h" 1





struct xlat {
 uint64_t val;
 const char *str;
};
# 295 "external/strace/defs.h" 2

extern const struct xlat addrfams[];
extern const struct xlat at_flags[];
extern const struct xlat dirent_types[];
extern const struct xlat evdev_abs[];
extern const struct xlat msg_flags[];
extern const struct xlat open_access_modes[];
extern const struct xlat open_mode_flags[];
extern const struct xlat resource_flags[];
extern const struct xlat socketlayers[];
extern const struct xlat whence_codes[];
# 362 "external/strace/defs.h"
enum sock_proto {
 SOCK_PROTO_UNKNOWN,
 SOCK_PROTO_UNIX,
 SOCK_PROTO_TCP,
 SOCK_PROTO_UDP,
 SOCK_PROTO_TCPv6,
 SOCK_PROTO_UDPv6,
 SOCK_PROTO_NETLINK
};
extern enum sock_proto get_proto_by_name(const char *);

enum iov_decode {
 IOV_DECODE_ADDR,
 IOV_DECODE_STR,
 IOV_DECODE_NETLINK
};

typedef enum {
 CFLAG_NONE = 0,
 CFLAG_ONLY_STATS,
 CFLAG_BOTH
} cflag_t;
extern cflag_t cflag;
extern _Bool debug_flag;
extern _Bool Tflag;
extern _Bool iflag;
extern _Bool count_wallclock;
extern unsigned int qflag;
extern _Bool not_failing_only;
extern unsigned int show_fd_path;
extern _Bool hide_log_until_execve;

extern const char **paths_selected;

extern unsigned xflag;
extern unsigned followfork;




extern unsigned ptrace_setoptions;
extern unsigned max_strlen;
extern unsigned os_release;



void error_msg(const char *fmt, ...) __attribute__((__format__ (printf, 1, 2)));
void perror_msg(const char *fmt, ...) __attribute__((__format__ (printf, 1, 2)));
void error_msg_and_die(const char *fmt, ...)
 __attribute__((__format__ (printf, 1, 2))) __attribute__((__noreturn__));
void error_msg_and_help(const char *fmt, ...)
 __attribute__((__format__ (printf, 1, 2))) __attribute__((__noreturn__));
void perror_msg_and_die(const char *fmt, ...)
 __attribute__((__format__ (printf, 1, 2))) __attribute__((__noreturn__));
void die_out_of_memory(void) __attribute__((__noreturn__));

void *xmalloc(size_t size) __attribute__((__malloc__)) ;
void *xcalloc(size_t nmemb, size_t size)
 __attribute__((__malloc__)) ;
void *xreallocarray(void *ptr, size_t nmemb, size_t size)
                             ;
char *xstrdup(const char *str) __attribute__((__malloc__));
# 435 "external/strace/defs.h"
extern int read_int_from_file(const char *, int *);

extern void set_sortby(const char *);
extern void set_overhead(int);
extern void qualify(const char *);
extern void print_pc(struct tcb *);
extern int trace_syscall(struct tcb *);
extern void count_syscall(struct tcb *, const struct timeval *);
extern void call_summary(FILE *);

extern void clear_regs(void);
extern void get_regs(pid_t pid);
extern int get_scno(struct tcb *tcp);
extern const char *syscall_name(long scno);
extern const char *err_name(unsigned long err);

extern _Bool is_erestart(struct tcb *);
extern void temporarily_clear_syserror(struct tcb *);
extern void restore_cleared_syserror(struct tcb *);

extern void *get_tcb_priv_data(const struct tcb *);
extern int set_tcb_priv_data(struct tcb *, void *priv_data,
        void (*free_priv_data)(void *));
extern void free_tcb_priv_data(struct tcb *);

static inline unsigned long get_tcb_priv_ulong(const struct tcb *tcp)
{
 return (unsigned long) get_tcb_priv_data(tcp);
}

static inline int set_tcb_priv_ulong(struct tcb *tcp, unsigned long val)
{
 return set_tcb_priv_data(tcp, (void *) val, 0);
}

extern int umoven(struct tcb *, long, unsigned int, void *);


extern int umoven_or_printaddr(struct tcb *, long, unsigned int, void *);


extern int umovestr(struct tcb *, long, unsigned int, char *);
extern int upeek(int pid, long, long *);

extern _Bool
print_array(struct tcb *tcp,
     const unsigned long start_addr,
     const size_t nmemb,
     void *const elem_buf,
     const size_t elem_size,
     int (*const umoven_func)(struct tcb *,
         long,
         unsigned int,
         void *),
     _Bool (*const print_func)(struct tcb *,
         void *elem_buf,
         size_t elem_size,
         void *opaque_data),
     void *const opaque_data);
# 503 "external/strace/defs.h"
extern const char *signame(const int);
extern void pathtrace_select(const char *);
extern int pathtrace_match(struct tcb *);
extern int getfdpath(struct tcb *, int, char *, unsigned);
extern enum sock_proto getfdproto(struct tcb *, int);

extern const char *xlookup(const struct xlat *, const uint64_t);
extern const char *xlat_search(const struct xlat *, const size_t, const uint64_t);

extern unsigned long get_pagesize(void);
extern int string_to_uint(const char *str);
extern int next_set_bit(const void *bit_array, unsigned cur_bit, unsigned size_bits);





extern int string_quote(const char *, char *, unsigned int, unsigned int);
extern int print_quoted_string(const char *, unsigned int, unsigned int);
# 533 "external/strace/defs.h"
extern int getllval(struct tcb *, unsigned long long *, int);
extern int printllval(struct tcb *, const char *, int)
 __attribute__((__format__ (printf, 2, 0)));

extern void printaddr(long);
extern void printxvals(const uint64_t, const char *, const struct xlat *, ...)
 __attribute__((__sentinel__));
extern long long getarg_ll(struct tcb *tcp, int argn);
extern unsigned long long getarg_ull(struct tcb *tcp, int argn);
extern int printargs(struct tcb *);
extern int printargs_u(struct tcb *);
extern int printargs_d(struct tcb *);

extern void addflags(const struct xlat *, uint64_t);
extern int printflags64(const struct xlat *, uint64_t, const char *);
extern const char *sprintflags(const char *, const struct xlat *, uint64_t);
extern const char *sprinttime(time_t);
extern void print_symbolic_mode_t(unsigned int);
extern void print_numeric_umode_t(unsigned short);
extern void print_numeric_long_umask(unsigned long);
extern void dumpiov_in_msghdr(struct tcb *, long, unsigned long);
extern void dumpiov_in_mmsghdr(struct tcb *, long);
extern void dumpiov_upto(struct tcb *, int, long, unsigned long);


extern void dumpstr(struct tcb *, long, int);
extern void printstr_ex(struct tcb *, long addr, long len,
 unsigned int user_style);
extern _Bool printnum_short(struct tcb *, long, const char *)
 __attribute__((__format__ (printf, 3, 0)));
extern _Bool printnum_int(struct tcb *, long, const char *)
 __attribute__((__format__ (printf, 3, 0)));
extern _Bool printnum_int64(struct tcb *, long, const char *)
 __attribute__((__format__ (printf, 3, 0)));


extern _Bool printnum_long_int(struct tcb *, long, const char *, const char *)
 __attribute__((__format__ (printf, 3, 0)))
 __attribute__((__format__ (printf, 4, 0)));
# 594 "external/strace/defs.h"
extern _Bool printpair_int(struct tcb *, long, const char *)
 __attribute__((__format__ (printf, 3, 0)));
extern _Bool printpair_int64(struct tcb *, long, const char *)
 __attribute__((__format__ (printf, 3, 0)));
extern void printpath(struct tcb *, long);
extern void printpathn(struct tcb *, long, unsigned int);


extern void printfd(struct tcb *, int);
extern void print_sockaddr(struct tcb *tcp, const void *, int);
extern _Bool print_sockaddr_by_inode(const unsigned long, const enum sock_proto);
extern _Bool print_sockaddr_by_inode_cached(const unsigned long);
extern void print_dirfd(struct tcb *, int);
extern int decode_sockaddr(struct tcb *, long, int);







extern void printuid(const char *, const unsigned int);
extern void print_sigset_addr_len(struct tcb *, long, long);
extern const char *sprintsigmask_n(const char *, const void *, unsigned int);


extern void printsignal(int);
extern void tprint_iov(struct tcb *, unsigned long, unsigned long, enum iov_decode);
extern void tprint_iov_upto(struct tcb *, unsigned long, unsigned long,
       enum iov_decode, unsigned long);
extern void decode_netlink(struct tcb *, unsigned long, unsigned long);
extern void tprint_open_modes(unsigned int);
extern const char *sprint_open_modes(unsigned int);
extern void print_seccomp_filter(struct tcb *, unsigned long);
extern void print_seccomp_fprog(struct tcb *, unsigned long, unsigned short);

struct strace_stat;
extern void print_struct_stat(struct tcb *tcp, const struct strace_stat *const st);

struct strace_statfs;
extern void print_struct_statfs(struct tcb *tcp, long);
extern void print_struct_statfs64(struct tcb *tcp, long, unsigned long);

extern void print_ifindex(unsigned int);

extern int file_ioctl(struct tcb *, const unsigned int, long);
extern int fs_x_ioctl(struct tcb *, const unsigned int, long);
extern int loop_ioctl(struct tcb *, const unsigned int, long);
extern int ptp_ioctl(struct tcb *, const unsigned int, long);
extern int scsi_ioctl(struct tcb *, const unsigned int, long);
extern int sock_ioctl(struct tcb *, const unsigned int, long);
extern int term_ioctl(struct tcb *, const unsigned int, long);
extern int ubi_ioctl(struct tcb *, const unsigned int, long);
extern int uffdio_ioctl(struct tcb *, const unsigned int, long);

extern int tv_nz(const struct timeval *);
extern int tv_cmp(const struct timeval *, const struct timeval *);
extern double tv_float(const struct timeval *);
extern void tv_add(struct timeval *, const struct timeval *, const struct timeval *);
extern void tv_sub(struct timeval *, const struct timeval *, const struct timeval *);
extern void tv_mul(struct timeval *, const struct timeval *, int);
extern void tv_div(struct timeval *, const struct timeval *, int);
# 666 "external/strace/defs.h"
static inline void
printstr(struct tcb *tcp, long addr, long len)
{
 printstr_ex(tcp, addr, len, 0);
}

static inline int
printflags(const struct xlat *x, unsigned int flags, const char *dflt)
{
 return printflags64(x, flags, dflt);
}

static inline int
printflags_long(const struct xlat *x, unsigned long flags, const char *dflt)
{
 return printflags64(x, flags, dflt);
}

static inline void
printxval64(const struct xlat *x, const uint64_t val, const char *dflt)
{
 printxvals(val, dflt, x, ((void*)0));
}

static inline void
printxval(const struct xlat *x, const unsigned int val, const char *dflt)
{
 printxvals(val, dflt, x, ((void*)0));
}

static inline void
printxval_long(const struct xlat *x, const unsigned long val, const char *dflt)
{
 printxvals(val, dflt, x, ((void*)0));
}
# 719 "external/strace/defs.h"
extern struct tcb *printing_tcp;
extern void printleader(struct tcb *);
extern void line_ended(void);
extern void tabto(void);
extern void tprintf(const char *fmt, ...) __attribute__((__format__ (printf, 1, 2)));
extern void tprints(const char *str);


extern void set_personality(int personality);
extern unsigned current_personality;
# 740 "external/strace/defs.h"
extern unsigned current_wordsize;
# 774 "external/strace/defs.h"
extern const struct_sysent sysent0[];
extern const char *const errnoent0[];
extern const char *const signalent0[];
extern const struct_ioctlent ioctlent0[];
extern qualbits_t *qual_vec[2];



extern const struct_sysent *sysent;
extern const char *const *errnoent;
extern const char *const *signalent;
extern const struct_ioctlent *ioctlent;







extern unsigned nsyscalls;
extern unsigned nerrnos;
extern unsigned nsignals;
extern unsigned nioctlents;
extern unsigned num_quals;







# 1 "external/strace/printers.h" 1

typedef struct {
 int (*block_ioctl)(struct tcb *tcp, const unsigned int code, const long arg);


 int (*btrfs_ioctl)(struct tcb *tcp, const unsigned int code, const long arg);


 int (*evdev_ioctl)(struct tcb *tcp, const unsigned int code, const long arg);


 _Bool (*fetch_seccomp_fprog)(struct tcb *tcp, const long addr, void *p);


 _Bool (*fetch_struct_flock)(struct tcb *tcp, const long addr, void *p);


 _Bool (*fetch_struct_flock64)(struct tcb *tcp, const long addr, void *p);


 int (*fetch_struct_mmsghdr)(struct tcb *tcp, const unsigned long addr, void *p);


 unsigned int (*sizeof_struct_mmsghdr)(void);


 int (*fetch_struct_msghdr)(struct tcb *tcp, const unsigned long addr, void *p);


 _Bool (*fetch_struct_stat)(struct tcb *tcp, const unsigned long addr, struct strace_stat *const dst);


 _Bool (*fetch_struct_stat64)(struct tcb *tcp, const unsigned long addr, struct strace_stat *const dst);


 _Bool (*fetch_struct_statfs)(struct tcb *tcp, const long addr, struct strace_statfs *p);


 _Bool (*fetch_struct_statfs64)(struct tcb *tcp, const long addr, const unsigned long size, struct strace_statfs *p);


 int (*hdio_ioctl)(struct tcb *tcp, const unsigned int code, const long arg);


 int (*mtd_ioctl)(struct tcb *tcp, const unsigned int code, const long arg);


 void (*printmqattr)(struct tcb *tcp, const long addr);


 void (*tprint_msgbuf)(struct tcb *tcp, const long addr, const unsigned long count);


 void (*print_sigevent)(struct tcb *tcp, const long addr);


 void (*print_timespec)(struct tcb *tcp, const long addr);


 const char * (*sprint_timespec)(struct tcb *tcp, const long addr);


 void (*print_timespec_utime_pair)(struct tcb *tcp, const long addr);


 void (*print_itimerspec)(struct tcb *tcp, const long addr);


 void (*print_timeval)(struct tcb *tcp, const long addr);


 void (*print_timeval_pair)(struct tcb *tcp, const long addr);


 const char * (*sprint_timeval)(struct tcb *tcp, const long addr);


 void (*print_itimerval)(struct tcb *tcp, const long addr);


 int (*print_timex)(struct tcb *tcp, const long addr);


 void (*printrusage)(struct tcb *tcp, long addr);


 void (*printsiginfo_at)(struct tcb *tcp, long addr);


 void (*print_siginfo_array)(struct tcb *tcp, unsigned long addr, unsigned long len);


 int (*rtc_ioctl)(struct tcb *tcp, const unsigned int code, const long arg);


 int (*v4l2_ioctl)(struct tcb *tcp, const unsigned int code, const long arg);


} struct_printers;
extern const struct_printers *printers;
# 805 "external/strace/defs.h" 2
# 32 "external/strace/desc.c" 2

int sys_close(struct tcb *tcp)
{
 printfd(tcp, tcp->u_arg[0]);

 return 0100;
}

int sys_dup(struct tcb *tcp)
{
 printfd(tcp, tcp->u_arg[0]);

 return 0100 | 010;
}

static int
do_dup2(struct tcb *tcp, int flags_arg)
{
 printfd(tcp, tcp->u_arg[0]);
 tprints(", ");
 printfd(tcp, tcp->u_arg[1]);
 if (flags_arg >= 0) {
  tprints(", ");
  printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
 }

 return 0100 | 010;
}

int sys_dup2(struct tcb *tcp)
{
 return do_dup2(tcp, -1);
}

int sys_dup3(struct tcb *tcp)
{
 return do_dup2(tcp, 2);
}

static int
decode_select(struct tcb *tcp, long *args,
       void (*print_tv_ts) (struct tcb *, const long),
       const char * (*sprint_tv_ts) (struct tcb *, const long))
{
 int i, j;
 int nfds, fdsize;
 fd_set *fds = ((void*)0);
 const char *sep;
 long arg;


 nfds = (int) args[0];


 if (nfds < 0)
  nfds = 0;


 if (nfds > 1024*1024)
  nfds = 1024*1024;





 fdsize = (((nfds + 7) / 8) + current_wordsize-1) & -current_wordsize;

 if ((!((tcp)->flags & 0x04))) {
  tprintf("%d", (int) args[0]);

  if (((tcp)->qual_flg & 0x004) && fdsize > 0)
   fds = malloc(fdsize);
  for (i = 0; i < 3; i++) {
   arg = args[i+1];
   tprints(", ");
   if (!fds) {
    printaddr(arg);
    continue;
   }
   if (umoven_or_printaddr(tcp, arg, fdsize, fds))
    continue;
   tprints("[");
   for (j = 0, sep = "";; j++) {
    j = next_set_bit(fds, j, nfds);
    if (j < 0)
     break;
    tprints(sep);
    printfd(tcp, j);
    sep = " ";
   }
   tprints("]");
  }
  free(fds);
  tprints(", ");
  print_tv_ts(tcp, args[4]);
 } else {
  static char outstr[1024];
  char *outptr;

  int ready_fds;

  if (((tcp)->u_error != 0))
   return 0;

  ready_fds = tcp->u_rval;
  if (ready_fds == 0) {
   tcp->auxstr = "Timeout";
   return 020;
  }

  fds = malloc(fdsize);

  outptr = outstr;
  sep = "";
  for (i = 0; i < 3 && ready_fds > 0; i++) {
   int first = 1;

   arg = args[i+1];
   if (!arg || !fds || umoven(tcp, arg, fdsize, fds) < 0)
    continue;
   for (j = 0;; j++) {
    j = next_set_bit(fds, j, nfds);
    if (j < 0)
     break;

    if (outptr < (outstr + sizeof(outstr)) - (sizeof(", except [") + sizeof(int)*3 + 2)) {
     if (first) {
      outptr += __builtin___sprintf_chk(outptr, 0, __builtin_object_size((outptr), 1), "%s%s [%u", sep, i == 0 ? "in" : i == 1 ? "out" : "except", j);




      first = 0;
      sep = ", ";
     }
     else {
      outptr += __builtin___sprintf_chk(outptr, 0, __builtin_object_size((outptr), 1), " %u", j);
     }
    }
    if (--ready_fds == 0)
     break;
   }
   if (outptr != outstr)
    *outptr++ = ']';
  }
  free(fds);

  if (args[4]) {
   const char *str = sprint_tv_ts(tcp, args[4]);
   if (outptr + sizeof("left ") + strlen(sep) + strlen(str) < (outstr + sizeof(outstr))) {
    outptr += __builtin___sprintf_chk(outptr, 0, __builtin_object_size((outptr), 1), "%sleft %s", sep, str);
   }
  }
  *outptr = '\0';
  tcp->auxstr = outstr;
  return 020;

 }
 return 0;
}

int sys_oldselect(struct tcb *tcp)
{
 long long_args[5];




 unsigned int oldselect_args[5];
 unsigned int i;


 if (umoven((tcp), (tcp->u_arg[0]), sizeof(*(&oldselect_args)), (void *) (&oldselect_args)) < 0) {
  printaddr(tcp->u_arg[0]);
  return 0;
 }

 for (i = 0; i < 5; i++) {
  long_args[i] = oldselect_args[i];
 }

 return decode_select(tcp, long_args, printers->print_timeval, printers->sprint_timeval);

}
# 224 "external/strace/desc.c"
int sys_select(struct tcb *tcp)
{
 return decode_select(tcp, tcp->u_arg, printers->print_timeval, printers->sprint_timeval);
}


# 1 "external/strace/kernel_types.h" 1
# 45 "external/strace/kernel_types.h"
typedef long kernel_long_t;
typedef unsigned long kernel_ulong_t;



typedef struct {
 kernel_ulong_t d_ino;
 kernel_ulong_t d_off;
 unsigned short d_reclen;
 char d_name[1];
} kernel_dirent;
# 230 "external/strace/desc.c" 2

static int
umove_kulong_array_or_printaddr(struct tcb *tcp, const long addr,
    kernel_ulong_t *ptr, size_t n)
{



 if (current_wordsize < sizeof(*ptr)) {

  uint32_t ptr32[n];
  int r = umoven_or_printaddr((tcp), (addr), sizeof(*(&ptr32)), (void *) (&ptr32));
  if (!r) {
   size_t i;

   for (i = 0; i < n; ++i)
    ptr[i] = (kernel_ulong_t) ptr32[i];
  }
  return r;
 }
 return umoven_or_printaddr(tcp, addr, n * sizeof(*ptr), ptr);
}

int sys_pselect6(struct tcb *tcp)
{
 int rc = decode_select(tcp, tcp->u_arg, printers->print_timespec, printers->sprint_timespec);
 if ((!((tcp)->flags & 0x04))) {
  kernel_ulong_t data[2];

  tprints(", ");
  if (!umove_kulong_array_or_printaddr(tcp, tcp->u_arg[5],
           data, (sizeof(data) / sizeof((data)[0])))) {
   tprints("{");

   print_sigset_addr_len(tcp, (unsigned long) data[0],
           (unsigned long) data[1]);
   tprintf(", %llu}", (unsigned long long) data[1]);
  }
 }

 return rc;
}


More information about the llvm-commits mailing list