#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
int main(int argc, char *argv[]) {
  unsigned long a = 0UL;
  printf("a is %lx\n", a - 1UL);
  printf("%lx\n", (1UL << 63) - 1UL);
  printf("%lx\n", (1UL << 62) - 1UL);
  printf("%lx\n", (1UL << 61) - 1UL);
  printf("%lx\n", (1UL << 60) - 1UL);
  printf("%lx\n", (1UL << 59) - 1UL);
  printf("%lx\n", (1UL << 4) - 1UL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
sub    $0x1,%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
movabs $0x7fffffffffffffff,%rsi
ff ff 7f
call   1030 <printf@plt>
lea    0xea6(%rip),%rdi
movabs $0x3fffffffffffffff,%rsi
ff ff 3f
call   1030 <printf@plt>
lea    0xe90(%rip),%rdi
movabs $0x1fffffffffffffff,%rsi
ff ff 1f
call   1030 <printf@plt>
lea    0xe7a(%rip),%rdi
movabs $0xfffffffffffffff,%rsi
ff ff 0f
call   1030 <printf@plt>
lea    0xe64(%rip),%rdi
movabs $0x7ffffffffffffff,%rsi
ff ff 07
call   1030 <printf@plt>
lea    0xe4e(%rip),%rdi
mov    $0xf,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rdi
mov    $0xffffffffffffffff,%rsi
call   1030 <printf@plt>
lea    0xeda(%rip),%rbx
movabs $0x7fffffffffffffff,%rsi
ff ff 7f
mov    %rbx,%rdi
call   1030 <printf@plt>
movabs $0x3fffffffffffffff,%rsi
ff ff 3f
mov    %rbx,%rdi
call   1030 <printf@plt>
movabs $0x1fffffffffffffff,%rsi
ff ff 1f
mov    %rbx,%rdi
call   1030 <printf@plt>
movabs $0xfffffffffffffff,%rsi
ff ff 0f
mov    %rbx,%rdi
call   1030 <printf@plt>
movabs $0x7ffffffffffffff,%rsi
ff ff 07
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0xf,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"a is %lx\0A\00"
@.str.1 = [5 x i8] c"%lx\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %6
%7 = load i64, i64* %6
%8 = sub i64 %7, 1
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 9223372036854775807)
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 4611686018427387903)
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 2305843009213693951)
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 1152921504606846975)
%14 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 576460752303423487)
%15 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 15)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"a is %lx\0A\00"
@.str.1 = [5 x i8] c"%lx\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 -1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 9223372036854775807)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 4611686018427387903)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 2305843009213693951)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 1152921504606846975)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 576460752303423487)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 15)
ret i32 0
}