#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_08() {
  printf("%4d\n", 1);
  printf("%4d\n", 12);
  printf("%4d\n", 123);
  printf("%4d\n", 1234);
  printf("%4d\n\n", 12345);
  printf("%4d\n", -1);
  printf("%4d\n", -12);
  printf("%4d\n", -123);
  printf("%4d\n", -1234);
  printf("%4d\n\n", -12345);
}


x86 assembly (clang, -O0):
<fig09_08>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
mov    $0x7b,%esi
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x4d2,%esi
call   1030 <printf@plt>
lea    0xea6(%rip),%rdi
mov    $0x3039,%esi
call   1030 <printf@plt>
lea    0xe90(%rip),%rdi
mov    $0xffffffff,%esi
call   1030 <printf@plt>
lea    0xe7f(%rip),%rdi
mov    $0xfffffff4,%esi
call   1030 <printf@plt>
lea    0xe6e(%rip),%rdi
mov    $0xffffff85,%esi
call   1030 <printf@plt>
lea    0xe5d(%rip),%rdi
mov    $0xfffffb2e,%esi
call   1030 <printf@plt>
lea    0xe51(%rip),%rdi
mov    $0xffffcfc7,%esi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fig09_08>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7b,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4d2,%esi
call   1030 <printf@plt>
lea    0xeaf(%rip),%r14
mov    %r14,%rdi
mov    $0x3039,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xfffffff4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xffffff85,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xfffffb2e,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0xffffcfc7,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%4d\0A\00"
@.str.1 = [6 x i8] c"%4d\0A\0A\00"
define void @fig09_08() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 12)
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 123)
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1234)
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 12345)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 -1)
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 -12)
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 -123)
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 -1234)
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 -12345)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%4d\0A\00"
@.str.1 = [6 x i8] c"%4d\0A\0A\00"
define void @fig09_08() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 12)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 123)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1234)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 12345)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 -1)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 -12)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 -123)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 -1234)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 -12345)
ret void
}