#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 *, int);
void fig09_02() {
  printf("%d\n", 455);
  printf("%i\n", 455);
  printf("%d\n", +455);
  printf("%d\n", -455);
  printf("%hd\n", 3200);
  printf("%ld\n", 2000000000L);
  printf("%o\n", 455);
  printf("%u\n", 455);
  printf("%u\n", -455);
  printf("%x\n", 455);
  printf("%X\n", 455);
}


x86 assembly (clang, -O0):
<fig09_02>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1c7,%esi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x1c7,%esi
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
mov    $0x1c7,%esi
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    $0xfffffe39,%esi
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
mov    $0xc80,%esi
call   1030 <printf@plt>
lea    0xe9d(%rip),%rdi
mov    $0x77359400,%esi
call   1030 <printf@plt>
lea    0xe91(%rip),%rdi
mov    $0x1c7,%esi
call   1030 <printf@plt>
lea    0xe84(%rip),%rdi
mov    $0x1c7,%esi
call   1030 <printf@plt>
lea    0xe73(%rip),%rdi
mov    $0xfffffe39,%esi
call   1030 <printf@plt>
lea    0xe66(%rip),%rdi
mov    $0x1c7,%esi
call   1030 <printf@plt>
lea    0xe59(%rip),%rdi
mov    $0x1c7,%esi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fig09_02>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1c7,%esi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x1c7,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1c7,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xfffffe39,%esi
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
mov    $0xc80,%esi
call   1030 <printf@plt>
lea    0xea5(%rip),%rdi
mov    $0x77359400,%esi
call   1030 <printf@plt>
lea    0xe99(%rip),%rdi
mov    $0x1c7,%esi
call   1030 <printf@plt>
lea    0xe8c(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1c7,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xfffffe39,%esi
call   1030 <printf@plt>
lea    0xe6f(%rip),%rdi
mov    $0x1c7,%esi
call   1030 <printf@plt>
lea    0xe62(%rip),%rdi
mov    $0x1c7,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%i\0A\00"
@.str.2 = [5 x i8] c"%hd\0A\00"
@.str.3 = [5 x i8] c"%ld\0A\00"
@.str.4 = [4 x i8] c"%o\0A\00"
@.str.5 = [4 x i8] c"%u\0A\00"
@.str.6 = [4 x i8] c"%x\0A\00"
@.str.7 = [4 x i8] c"%X\0A\00"
define void @fig09_02() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 455)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 455)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 455)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -455)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 3200)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 2000000000)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 455)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 455)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 -455)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 455)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 455)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%i\0A\00"
@.str.2 = [5 x i8] c"%hd\0A\00"
@.str.3 = [5 x i8] c"%ld\0A\00"
@.str.4 = [4 x i8] c"%o\0A\00"
@.str.5 = [4 x i8] c"%u\0A\00"
@.str.6 = [4 x i8] c"%x\0A\00"
@.str.7 = [4 x i8] c"%X\0A\00"
define void @fig09_02() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 455)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 455)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 455)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -455)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 3200)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 2000000000)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 455)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 455)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 -455)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 455)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 455)
ret void
}