#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, int,
                          int, int, int, int, int, int, int, int, int);
void fig07_17() {
  char c;
  short s;
  int i;
  long l;
  long long ll;
  float f;
  double d;
  long double ld;
  int array[20];
  int *ptr = array;
  printf("    sizeof c = %u\tsizeof(char) = %u"
         "\n    sizeof s = %u\tsizeof(short) = %u"
         "\n    sizeof i = %u\tsizeof(int) = %u"
         "\n    sizeof l = %u\tsizeof(long) = %u"
         "\n    sizeof ll = %u\tsizeof(long long) = %u"
         "\n    sizeof f = %u\tsizeof(float) = %u"
         "\n    sizeof d = %u\tsizeof(double) = %u"
         "\n    sizeof ld = %u\tsizeof(long double) = %u"
         "\n    sizeof array = %u"
         "\n    sizeof ptr = %u\n",
         sizeof c, sizeof(char), sizeof s, sizeof(short), sizeof i, sizeof(int),
         sizeof l, sizeof(long), sizeof ll, sizeof(long long), sizeof f,
         sizeof(float), sizeof d, sizeof(double), sizeof ld,
         sizeof(long double), sizeof array, sizeof ptr);
}


x86 assembly (clang, -O0):
<fig07_17>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x90(%rbp),%rax
mov    %rax,-0x98(%rbp)
lea    0xed0(%rip),%rdi
mov    $0x1,%edx
mov    $0x2,%r8d
mov    $0x4,%r9d
mov    %edx,%esi
mov    %r8d,%ecx
movl   $0x4,(%rsp)
movl   $0x8,0x8(%rsp)
movl   $0x8,0x10(%rsp)
movl   $0x8,0x18(%rsp)
movl   $0x8,0x20(%rsp)
movl   $0x4,0x28(%rsp)
movl   $0x4,0x30(%rsp)
movl   $0x8,0x38(%rsp)
movl   $0x8,0x40(%rsp)
movl   $0x10,0x48(%rsp)
movl   $0x10,0x50(%rsp)
movl   $0x50,0x58(%rsp)
movl   $0x8,0x60(%rsp)
call   1030 <printf@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fig07_17>:
push   %rax
sub    $0x8,%rsp
lea    0xee4(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x2,%r8d
mov    $0x4,%r9d
push   $0x8
push   $0x50
push   $0x10
push   $0x10
push   $0x8
push   $0x8
push   $0x4
push   $0x4
push   $0x8
push   $0x8
push   $0x8
push   $0x8
push   $0x4
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [348 x i8] c" sizeof c = %u\09sizeof(char) = %u\0A sizeof s = %u\09sizeof(short) = %u\0A sizeof i = %u\09sizeof(int) = %u\0A sizeof l = %u\09sizeof(long) = %u\0A sizeof ll = %u\09sizeof(long long) = %u\0A sizeof f = %u\09sizeof(float) = %u\0A sizeof d = %u\09sizeof(double) = %u\0A sizeof ld = %u\09sizeof(long double) = %u\0A sizeof array = %u\0A sizeof ptr = %u\0A\00"
define void @fig07_17() {
%1 = alloca i8
%2 = alloca i16
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca float
%7 = alloca double
%8 = alloca x86_fp80
%9 = alloca [20 x i32]
%10 = alloca i32*
%11 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
store i32* %11, i32** %10
%12 = call i32 @printf(i8* getelementptr inbounds ([348 x i8], [348 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 2, i32 2, i32 4, i32 4, i32 8, i32 8, i32 8, i32 8, i32 4, i32 4, i32 8, i32 8, i32 16, i32 16, i32 80, i32 8)
ret void
}

LLVM IR (-O2):
@.str = [348 x i8] c" sizeof c = %u\09sizeof(char) = %u\0A sizeof s = %u\09sizeof(short) = %u\0A sizeof i = %u\09sizeof(int) = %u\0A sizeof l = %u\09sizeof(long) = %u\0A sizeof ll = %u\09sizeof(long long) = %u\0A sizeof f = %u\09sizeof(float) = %u\0A sizeof d = %u\09sizeof(double) = %u\0A sizeof ld = %u\09sizeof(long double) = %u\0A sizeof array = %u\0A sizeof ptr = %u\0A\00"
define void @fig07_17() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([348 x i8], [348 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 2, i32 2, i32 4, i32 4, i32 8, i32 8, i32 8, i32 8, i32 4, i32 4, i32 8, i32 8, i32 16, i32 16, i32 80, i32 8)
ret void
}