-#if SIZEOF_LONG == SIZEOF_LONG_LONG
-# if SUPPORTED_PERSONALITIES > 1
-# ifdef X86_64
- if (current_personality != 1)
-# else
- if (current_wordsize == sizeof(long))
-# endif
-# endif
- tprintf("%ld", tcp->u_arg[arg]);
-# if SUPPORTED_PERSONALITIES > 1
- else
- tprintf("%ld",
- ((unsigned long) tcp->u_arg[arg + 1] << current_wordsize * 8)
- | (unsigned long) tcp->u_arg[arg]);
-# endif
-#else
-# ifdef X32
- if (current_personality == 0)
+#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 */
+ {