#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 */
typedef int uint64_t;

/* Variables and functions */
int UINT_MAX;
int /*<<< orphan*/ printf(char *, char *, int, int);
int main() {
  printf("%-42s = 0x%08x %010u\n", "DVI_BASE_ADDRESS", 0x80000000U,
         0x80000000U);
  printf("%-42s = 0x%08x %010u\n", "DVI_VMEM_ADDRESS", 0x80000000U + 32U,
         0x80000000U + 32U);
  printf("%-42s = 0x%08x %010u\n", "DVI_VMEM_SIZE", 0x400000U, 0x400000U);
  printf("%-42s = 0x%08x %010u\n", "UINT_MAX", UINT_MAX, UINT_MAX);
  printf("%-42s = 0x%08x %010u\n", "UINT_MAX-1", UINT_MAX - 1, UINT_MAX - 1);
  printf("%-42s = 0x%08x %010u\n", "UINT_MAX-DVI_VMEM_SIZE",
         UINT_MAX - 0x400000U, UINT_MAX - 0x400000U);
  printf("%-42s = 0x%08x %010u\n", "UINT_MAX-DVI_VMEM_ADDRESS",
         UINT_MAX - 0x80000000U + 32U, UINT_MAX - 0x80000000U + 32U);
  printf("%-42s = 0x%08x %010u\n", "UINT_MAX-DVI_VMEM_SIZE-DVI_VMEM_ADDRESS",
         UINT_MAX - 0x400000U - 0x80000000U + 32U,
         UINT_MAX - 0x400000U - 0x80000000U + 32U);
  printf("%-42s = 0x%08x %010u\n", "UINT_MAX-(DVI_VMEM_ADDRESS+DVI_VMEM_SIZE)",
         UINT_MAX - (0x80000000U + 32U + 0x400000U),
         UINT_MAX - (0x80000000U + 32U + 0x400000U));
  uint64_t a = UINT_MAX;
  uint64_t b = 0x80000000U + 32U;
  uint64_t c = 0x400000U;
  uint64_t d = a - b - c - 1;
  printf("%-42s = 0x%08llx %010llu\n", "d", d, d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xee9(%rip),%rsi
mov    $0x80000000,%ecx
mov    %ecx,%edx
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    0xf3c(%rip),%rsi
mov    $0x80000020,%ecx
mov    %ecx,%edx
call   1030 <printf@plt>
lea    0xea6(%rip),%rdi
lea    0xee3(%rip),%rsi
mov    $0x400000,%ecx
mov    %ecx,%edx
call   1030 <printf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edx
mov    0x2e6b(%rip),%rax
mov    (%rax),%ecx
lea    0xe7a(%rip),%rdi
lea    0xe9a(%rip),%rsi
call   1030 <printf@plt>
mov    0x2e4f(%rip),%rax
mov    (%rax),%edx
sub    $0x1,%edx
mov    0x2e43(%rip),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
lea    0xe4f(%rip),%rdi
lea    0xe78(%rip),%rsi
call   1030 <printf@plt>
mov    0x2e24(%rip),%rax
mov    (%rax),%edx
sub    $0x400000,%edx
mov    0x2e15(%rip),%rax
mov    (%rax),%ecx
sub    $0x400000,%ecx
lea    0xe1e(%rip),%rdi
lea    0xe52(%rip),%rsi
call   1030 <printf@plt>
mov    0x2df3(%rip),%rax
mov    (%rax),%edx
sub    $0x80000000,%edx
add    $0x20,%edx
mov    0x2de1(%rip),%rax
mov    (%rax),%ecx
sub    $0x80000000,%ecx
add    $0x20,%ecx
lea    0xde7(%rip),%rdi
lea    0xe32(%rip),%rsi
call   1030 <printf@plt>
mov    0x2dbc(%rip),%rax
mov    (%rax),%edx
sub    $0x400000,%edx
sub    $0x80000000,%edx
add    $0x20,%edx
mov    0x2da4(%rip),%rax
mov    (%rax),%ecx
sub    $0x400000,%ecx
sub    $0x80000000,%ecx
add    $0x20,%ecx
lea    0xda4(%rip),%rdi
lea    0xe09(%rip),%rsi
call   1030 <printf@plt>
mov    0x2d79(%rip),%rax
mov    (%rax),%edx
sub    $0x80400020,%edx
mov    0x2d6a(%rip),%rax
mov    (%rax),%ecx
sub    $0x80400020,%ecx
lea    0xd73(%rip),%rdi
lea    0xe00(%rip),%rsi
call   1030 <printf@plt>
mov    0x2d48(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
movl   $0x80000020,-0xc(%rbp)
movl   $0x400000,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xdef(%rip),%rdi
lea    0xe02(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xee5(%rip),%rbx
lea    0xef4(%rip),%rsi
mov    %rbx,%rdi
mov    $0x80000000,%edx
mov    $0x80000000,%ecx
call   1030 <printf@plt>
lea    0xf48(%rip),%rsi
mov    $0x80000020,%ebp
mov    %rbx,%rdi
mov    $0x80000020,%edx
mov    $0x80000020,%ecx
call   1030 <printf@plt>
lea    0xeeb(%rip),%rsi
mov    %rbx,%rdi
mov    $0x400000,%edx
mov    $0x400000,%ecx
call   1030 <printf@plt>
mov    0x2e76(%rip),%r14
mov    (%r14),%ecx
lea    0xeab(%rip),%rsi
mov    %rbx,%rdi
mov    %ecx,%edx
call   1030 <printf@plt>
mov    (%r14),%ecx
add    $0xffffffff,%ecx
lea    0xe9d(%rip),%rsi
mov    %rbx,%rdi
mov    %ecx,%edx
call   1030 <printf@plt>
mov    $0xffc00000,%ecx
add    (%r14),%ecx
lea    0xe8f(%rip),%rsi
mov    %rbx,%rdi
mov    %ecx,%edx
call   1030 <printf@plt>
add    (%r14),%ebp
lea    0xe92(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
mov    %ebp,%ecx
call   1030 <printf@plt>
mov    $0x7fc00020,%ecx
add    (%r14),%ecx
lea    0xe91(%rip),%rsi
mov    %rbx,%rdi
mov    %ecx,%edx
call   1030 <printf@plt>
mov    $0x7fbfffe0,%ecx
add    (%r14),%ecx
lea    0xea0(%rip),%rsi
mov    %rbx,%rdi
mov    %ecx,%edx
call   1030 <printf@plt>
mov    $0x7fbfffdf,%ecx
add    (%r14),%ecx
lea    0xeb1(%rip),%rdi
lea    0xec4(%rip),%rsi
mov    %ecx,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"%-42s = 0x%08x %010u\0A\00"
@.str.1 = [17 x i8] c"DVI_BASE_ADDRESS\00"
@.str.2 = [17 x i8] c"DVI_VMEM_ADDRESS\00"
@.str.3 = [14 x i8] c"DVI_VMEM_SIZE\00"
@.str.4 = [9 x i8] c"UINT_MAX\00"
@UINT_MAX = global i32 0
@.str.5 = [11 x i8] c"UINT_MAX-1\00"
@.str.6 = [23 x i8] c"UINT_MAX-DVI_VMEM_SIZE\00"
@.str.7 = [26 x i8] c"UINT_MAX-DVI_VMEM_ADDRESS\00"
@.str.8 = [40 x i8] c"UINT_MAX-DVI_VMEM_SIZE-DVI_VMEM_ADDRESS\00"
@.str.9 = [42 x i8] c"UINT_MAX-(DVI_VMEM_ADDRESS+DVI_VMEM_SIZE)\00"
@.str.10 = [26 x i8] c"%-42s = 0x%08llx %010llu\0A\00"
@.str.11 = [2 x i8] c"d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 -2147483648, i32 -2147483648)
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 -2147483616, i32 -2147483616)
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 4194304, i32 4194304)
%9 = load i32, i32* @UINT_MAX
%10 = load i32, i32* @UINT_MAX
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %9, i32 %10)
%12 = load i32, i32* @UINT_MAX
%13 = sub nsw i32 %12, 1
%14 = load i32, i32* @UINT_MAX
%15 = sub nsw i32 %14, 1
%16 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 %13, i32 %15)
%17 = load i32, i32* @UINT_MAX
%18 = sub i32 %17, 4194304
%19 = load i32, i32* @UINT_MAX
%20 = sub i32 %19, 4194304
%21 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 %18, i32 %20)
%22 = load i32, i32* @UINT_MAX
%23 = sub i32 %22, -2147483648
%24 = add i32 %23, 32
%25 = load i32, i32* @UINT_MAX
%26 = sub i32 %25, -2147483648
%27 = add i32 %26, 32
%28 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i32 %24, i32 %27)
%29 = load i32, i32* @UINT_MAX
%30 = sub i32 %29, 4194304
%31 = sub i32 %30, -2147483648
%32 = add i32 %31, 32
%33 = load i32, i32* @UINT_MAX
%34 = sub i32 %33, 4194304
%35 = sub i32 %34, -2147483648
%36 = add i32 %35, 32
%37 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0), i32 %32, i32 %36)
%38 = load i32, i32* @UINT_MAX
%39 = sub i32 %38, -2143289312
%40 = load i32, i32* @UINT_MAX
%41 = sub i32 %40, -2143289312
%42 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0), i32 %39, i32 %41)
%43 = load i32, i32* @UINT_MAX
store i32 %43, i32* %2
store i32 -2147483616, i32* %3
store i32 4194304, i32* %4
%44 = load i32, i32* %2
%45 = load i32, i32* %3
%46 = sub nsw i32 %44, %45
%47 = load i32, i32* %4
%48 = sub nsw i32 %46, %47
%49 = sub nsw i32 %48, 1
store i32 %49, i32* %5
%50 = load i32, i32* %5
%51 = load i32, i32* %5
%52 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i32 %50, i32 %51)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"%-42s = 0x%08x %010u\0A\00"
@.str.1 = [17 x i8] c"DVI_BASE_ADDRESS\00"
@.str.2 = [17 x i8] c"DVI_VMEM_ADDRESS\00"
@.str.3 = [14 x i8] c"DVI_VMEM_SIZE\00"
@.str.4 = [9 x i8] c"UINT_MAX\00"
@UINT_MAX = global i32 0
@.str.5 = [11 x i8] c"UINT_MAX-1\00"
@.str.6 = [23 x i8] c"UINT_MAX-DVI_VMEM_SIZE\00"
@.str.7 = [26 x i8] c"UINT_MAX-DVI_VMEM_ADDRESS\00"
@.str.8 = [40 x i8] c"UINT_MAX-DVI_VMEM_SIZE-DVI_VMEM_ADDRESS\00"
@.str.9 = [42 x i8] c"UINT_MAX-(DVI_VMEM_ADDRESS+DVI_VMEM_SIZE)\00"
@.str.10 = [26 x i8] c"%-42s = 0x%08llx %010llu\0A\00"
@.str.11 = [2 x i8] c"d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 -2147483648, i32 -2147483648)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 -2147483616, i32 -2147483616)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 4194304, i32 4194304)
%4 = load i32, i32* @UINT_MAX
%5 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %4, i32 %4)
%6 = load i32, i32* @UINT_MAX
%7 = add nsw i32 %6, -1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 %7, i32 %7)
%9 = load i32, i32* @UINT_MAX
%10 = add i32 %9, -4194304
%11 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 %10, i32 %10)
%12 = load i32, i32* @UINT_MAX
%13 = add i32 %12, -2147483616
%14 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i32 %13, i32 %13)
%15 = load i32, i32* @UINT_MAX
%16 = add i32 %15, 2143289376
%17 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0), i32 %16, i32 %16)
%18 = load i32, i32* @UINT_MAX
%19 = add i32 %18, 2143289312
%20 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0), i32 %19, i32 %19)
%21 = load i32, i32* @UINT_MAX
%22 = add nsw i32 %21, 2143289311
%23 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i32 %22, i32 %22)
ret i32 0
}