#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 LONG_MAX;
int /*<<< orphan*/ ULONG_MAX;
int /*<<< orphan*/ printf(char *, long, long, long, unsigned long,
                          unsigned long, unsigned long, long, long, long, int,
                          int, int, int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/);
int main(int argc, char **argv) {
  long a = LONG_MAX - 10;
  unsigned long b = a;
  long c = b;
  printf("a=%ld %lu %lx b=%ld %lu %lx c=%ld %lu %lx LONG_MAX=%ld %lu %lx "
         "ULONG_MAX=%ld %lu %lx\n",
         a, a, a, b, b, b, c, c, c, LONG_MAX, LONG_MAX, LONG_MAX, ULONG_MAX,
         ULONG_MAX, ULONG_MAX);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %edi,-0x2c(%rbp)
mov    %rsi,-0x38(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
sub    $0xa,%eax
cltq
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x40(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x40(%rbp),%rcx
mov    -0x48(%rbp),%r8
mov    -0x48(%rbp),%r9
mov    -0x48(%rbp),%rax
mov    -0x50(%rbp),%rdi
mov    %rdi,-0x60(%rbp)
mov    -0x50(%rbp),%r13
mov    -0x50(%rbp),%r12
mov    0x2e64(%rip),%rdi
mov    (%rdi),%r15d
mov    0x2e5a(%rip),%rdi
mov    (%rdi),%r14d
mov    0x2e50(%rip),%rdi
mov    (%rdi),%ebx
mov    0x2e37(%rip),%rdi
mov    (%rdi),%r11d
mov    0x2e2d(%rip),%rdi
mov    (%rdi),%r10d
mov    0x2e23(%rip),%rdi
mov    (%rdi),%edi
mov    %edi,-0x54(%rbp)
lea    0xe47(%rip),%rdi
mov    %rax,(%rsp)
mov    -0x60(%rbp),%rax
mov    %rax,0x8(%rsp)
mov    -0x54(%rbp),%eax
mov    %r13,0x10(%rsp)
mov    %r12,0x18(%rsp)
mov    %r15d,0x20(%rsp)
mov    %r14d,0x28(%rsp)
mov    %ebx,0x30(%rsp)
mov    %r11d,0x38(%rsp)
mov    %r10d,0x40(%rsp)
mov    %eax,0x48(%rsp)
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
movslq (%rax),%r10
mov    %r10,%rcx
add    $0xfffffffffffffff6,%rcx
mov    0x2ea7(%rip),%rdx
mov    (%rdx),%eax
lea    0xece(%rip),%rdi
mov    %rcx,%rsi
mov    %rcx,%rdx
mov    %rcx,%r8
mov    %rcx,%r9
push   %rax
push   %rax
push   %rax
push   %r10
push   %r10
push   %r10
push   %rcx
push   %rcx
push   %rcx
push   %rcx
call   1030 <printf@plt>
add    $0x50,%rsp
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LONG_MAX = global i32 0
@.str = [86 x i8] c"a=%ld %lu %lx b=%ld %lu %lx c=%ld %lu %lx LONG_MAX=%ld %lu %lx ULONG_MAX=%ld %lu %lx\0A\00"
@ULONG_MAX = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i32 %0, i32* %3
store i8** %1, i8*** %4
%8 = load i32, i32* @LONG_MAX
%9 = sub nsw i32 %8, 10
%10 = sext i32 %9 to i64
store i64 %10, i64* %5
%11 = load i64, i64* %5
store i64 %11, i64* %6
%12 = load i64, i64* %6
store i64 %12, i64* %7
%13 = load i64, i64* %5
%14 = load i64, i64* %5
%15 = load i64, i64* %5
%16 = load i64, i64* %6
%17 = load i64, i64* %6
%18 = load i64, i64* %6
%19 = load i64, i64* %7
%20 = load i64, i64* %7
%21 = load i64, i64* %7
%22 = load i32, i32* @LONG_MAX
%23 = load i32, i32* @LONG_MAX
%24 = load i32, i32* @LONG_MAX
%25 = load i32, i32* @ULONG_MAX
%26 = load i32, i32* @ULONG_MAX
%27 = load i32, i32* @ULONG_MAX
%28 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i64 %13, i64 %14, i64 %15, i64 %16, i64 %17, i64 %18, i64 %19, i64 %20, i64 %21, i32 %22, i32 %23, i32 %24, i32 %25, i32 %26, i32 %27)
ret i32 0
}

LLVM IR (-O2):
@LONG_MAX = global i32 0
@.str = [86 x i8] c"a=%ld %lu %lx b=%ld %lu %lx c=%ld %lu %lx LONG_MAX=%ld %lu %lx ULONG_MAX=%ld %lu %lx\0A\00"
@ULONG_MAX = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @LONG_MAX
%4 = add nsw i32 %3, -10
%5 = sext i32 %4 to i64
%6 = load i32, i32* @ULONG_MAX
%7 = tail call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i64 %5, i64 %5, i64 %5, i64 %5, i64 %5, i64 %5, i64 %5, i64 %5, i64 %5, i32 %3, i32 %3, i32 %3, i32 %6, i32 %6, i32 %6)
ret i32 0
}