#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, const char *argv[]) {
  int x = 255;
  printf("x is %d.\n", x);
  printf("In octal, x is %o.\n", x);
  printf("In hexadecimal, x is %x.\n", x);
  long lx = 255;
  printf("x is %ld.\n", lx);
  printf("In octal, x is %lo.\n", lx);
  printf("In hexadecimal, x is %lx.\n", lx);
  unsigned long ulx = 255;
  printf("x is %ld.\n", ulx);
  printf("In octal, x is %lo.\n", ulx);
  printf("In hexadecimal, x is %lx.\n", ulx);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xff,-0x14(%rbp)
movslq -0x14(%rbp),%rsi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
movslq -0x14(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
movslq -0x14(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
movq   $0xff,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
movq   $0xff,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xee4(%rip),%rdi
mov    $0xff,%esi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0xff,%esi
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
mov    $0xff,%esi
call   1030 <printf@plt>
lea    0xee9(%rip),%r14
mov    $0xff,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0xee0(%rip),%r15
mov    $0xff,%esi
mov    %r15,%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rbx
mov    $0xff,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0xff,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    $0xff,%esi
mov    %r15,%rdi
call   1030 <printf@plt>
mov    $0xff,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"x is %d.\0A\00"
@.str.1 = [20 x i8] c"In octal, x is %o.\0A\00"
@.str.2 = [26 x i8] c"In hexadecimal, x is %x.\0A\00"
@.str.3 = [11 x i8] c"x is %ld.\0A\00"
@.str.4 = [21 x i8] c"In octal, x is %lo.\0A\00"
@.str.5 = [27 x i8] c"In hexadecimal, x is %lx.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 255, i32* %6
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i64 %13)
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i64 %16)
store i64 255, i64* %7
%18 = load i64, i64* %7
%19 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i64 %18)
%20 = load i64, i64* %7
%21 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i64 %20)
%22 = load i64, i64* %7
%23 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i64 %22)
store i64 255, i64* %8
%24 = load i64, i64* %8
%25 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i64 %24)
%26 = load i64, i64* %8
%27 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i64 %26)
%28 = load i64, i64* %8
%29 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i64 %28)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"x is %d.\0A\00"
@.str.1 = [20 x i8] c"In octal, x is %o.\0A\00"
@.str.2 = [26 x i8] c"In hexadecimal, x is %x.\0A\00"
@.str.3 = [11 x i8] c"x is %ld.\0A\00"
@.str.4 = [21 x i8] c"In octal, x is %lo.\0A\00"
@.str.5 = [27 x i8] c"In hexadecimal, x is %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 255)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i64 255)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i64 255)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i64 255)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i64 255)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i64 255)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i64 255)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i64 255)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i64 255)
ret i32 0
}