-#if SIZEOF_LONG == SIZEOF_LONG_LONG
-# if SUPPORTED_PERSONALITIES > 1
- if (current_wordsize == sizeof(long))
-# endif
- tprintf("%lu", (unsigned long) tcp->u_arg[arg]);
-# if SUPPORTED_PERSONALITIES > 1
- else
- tprintf("%lu",
- ((unsigned long) tcp->u_arg[arg + 1] << current_wordsize * 8)
- | (unsigned long) tcp->u_arg[arg]);
-# endif
-#else
-# ifdef X32
- if (current_personality == 0)
- tprintf("%llu", (unsigned long long) tcp->ext_arg[arg]);
- else
-# endif
- tprintf("%llu",
- ((unsigned long long) (unsigned long) tcp->u_arg[arg + 1] << sizeof(long) * 8)
- | (unsigned long long) (unsigned long) tcp->u_arg[arg]);
+#if SIZEOF_LONG > 4 && SIZEOF_LONG == SIZEOF_LONG_LONG
+# ifndef current_klongsize
+ if (current_klongsize < SIZEOF_LONG) {
+ tprintf("%" PRI_krd, (tcp->u_arg[arg + 1] << current_wordsize * 8)
+ | tcp->u_arg[arg]);
+ } else
+# endif /* !current_klongsize */
+ {
+ tprintf("%" PRI_krd, tcp->u_arg[arg]);
+ }
+#elif SIZEOF_LONG > 4
+# error Unsupported configuration: SIZEOF_LONG > 4 && SIZEOF_LONG_LONG > SIZEOF_LONG
+#elif HAVE_STRUCT_TCB_EXT_ARG
+# ifndef current_klongsize
+ if (current_klongsize < SIZEOF_LONG_LONG) {
+ tprintf("%lld",
+ (zero_extend_signed_to_ull(tcp->u_arg[arg + 1]) << sizeof(long) * 8)
+ | zero_extend_signed_to_ull(tcp->u_arg[arg]));
+ } else
+# endif /* !current_klongsize */
+ {
+ tprintf("%lld", tcp->ext_arg[arg]);
+ }
+#else /* SIZEOF_LONG_LONG > SIZEOF_LONG && !HAVE_STRUCT_TCB_EXT_ARG */
+ tprintf("%lld",
+ (zero_extend_signed_to_ull(tcp->u_arg[arg + 1]) << sizeof(long) * 8)
+ | zero_extend_signed_to_ull(tcp->u_arg[arg]));