#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, int, int, int, int, int, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *, int *, int *, int *, int *, int *,
                         int *);
void fig09_18() {
  int a;
  int b;
  int c;
  int d;
  int e;
  int f;
  int g;
  puts("Enter seven integers: ");
  scanf("%d%i%i%i%o%u%x", &a, &b, &c, &d, &e, &f, &g);
  puts("\nThe input displayed as decimal integers is: ");
  printf("%d %d %d %d %d %d %d\n", a, b, c, d, e, f, g);
}


x86 assembly (clang, -O0):
<fig09_18>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
lea    -0x10(%rbp),%r8
lea    -0x14(%rbp),%r9
lea    -0x18(%rbp),%r10
lea    -0x1c(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1050 <scanf@plt>
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    -0x18(%rbp),%r10d
mov    -0x1c(%rbp),%eax
lea    0xeb4(%rip),%rdi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fig09_18>:
sub    $0x28,%rsp
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rax
lea    0x10(%rsp),%r10
lea    0xec6(%rip),%rdi
lea    0x24(%rsp),%rsi
lea    0x20(%rsp),%rdx
lea    0x1c(%rsp),%rcx
lea    0x18(%rsp),%r8
lea    0x14(%rsp),%r9
push   %rax
push   %r10
call   1050 <scanf@plt>
add    $0x10,%rsp
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
mov    0x24(%rsp),%esi
mov    0x20(%rsp),%edx
mov    0x1c(%rsp),%ecx
mov    0x18(%rsp),%r8d
mov    0x14(%rsp),%r9d
mov    0x10(%rsp),%r10d
mov    0xc(%rsp),%eax
lea    0xeac(%rip),%rdi
push   %rax
push   %r10
call   1040 <printf@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Enter seven integers: \00"
@.str.1 = [15 x i8] c"%d%i%i%i%o%u%x\00"
@.str.2 = [46 x i8] c"\0AThe input displayed as decimal integers is: \00"
@.str.3 = [22 x i8] c"%d %d %d %d %d %d %d\0A\00"
define void @fig09_18() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = call i32 @puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7)
%10 = call i32 @puts(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %11, i32 %12, i32 %13, i32 %14, i32 %15, i32 %16, i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Enter seven integers: \00"
@.str.1 = [15 x i8] c"%d%i%i%i%o%u%x\00"
@.str.2 = [46 x i8] c"\0AThe input displayed as decimal integers is: \00"
@.str.3 = [22 x i8] c"%d %d %d %d %d %d %d\0A\00"
define void @fig09_18() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = bitcast i32* %1 to i8*
%9 = bitcast i32* %2 to i8*
%10 = bitcast i32* %3 to i8*
%11 = bitcast i32* %4 to i8*
%12 = bitcast i32* %5 to i8*
%13 = bitcast i32* %6 to i8*
%14 = bitcast i32* %7 to i8*
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%18 = load i32, i32* %1
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = load i32, i32* %7
%25 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %18, i32 %19, i32 %20, i32 %21, i32 %22, i32 %23, i32 %24)
ret void
}