#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 main(void) {
  short s = sizeof(short);
  int w1 = sizeof(int);
  int w2 = sizeof(long);
  int w3 = sizeof(long long);
  int p = sizeof(int *);
  int x = sizeof(float);
  int y = sizeof(double);
  printf("short = %d\n", s * 8);
  printf("int = %d\n", w1 * 8);
  printf("long = %d\n", w2 * 8);
  printf("long long = %d\n", w3 * 8);
  printf("pointer = %d\n", p * 8);
  printf("float = %d\n", x * 8);
  printf("double = %d\n", y * 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x2,-0x6(%rbp)
movl   $0x4,-0xc(%rbp)
movl   $0x8,-0x10(%rbp)
movl   $0x8,-0x14(%rbp)
movl   $0x8,-0x18(%rbp)
movl   $0x4,-0x1c(%rbp)
movl   $0x8,-0x20(%rbp)
movswl -0x6(%rbp),%esi
shl    $0x3,%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
shl    $0x3,%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
shl    $0x3,%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
shl    $0x3,%esi
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
shl    $0x3,%esi
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
shl    $0x3,%esi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
shl    $0x3,%esi
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x20,%esi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x40,%esi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x40,%esi
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
mov    $0x40,%esi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x20,%esi
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
mov    $0x40,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"short = %d\0A\00"
@.str.1 = [10 x i8] c"int = %d\0A\00"
@.str.2 = [11 x i8] c"long = %d\0A\00"
@.str.3 = [16 x i8] c"long long = %d\0A\00"
@.str.4 = [14 x i8] c"pointer = %d\0A\00"
@.str.5 = [12 x i8] c"float = %d\0A\00"
@.str.6 = [13 x i8] c"double = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i16 2, i16* %2
store i32 4, i32* %3
store i32 8, i32* %4
store i32 8, i32* %5
store i32 8, i32* %6
store i32 4, i32* %7
store i32 8, i32* %8
%9 = load i16, i16* %2
%10 = sext i16 %9 to i32
%11 = mul nsw i32 %10, 8
%12 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %3
%14 = mul nsw i32 %13, 8
%15 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %4
%17 = mul nsw i32 %16, 8
%18 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %5
%20 = mul nsw i32 %19, 8
%21 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %6
%23 = mul nsw i32 %22, 8
%24 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %23)
%25 = load i32, i32* %7
%26 = mul nsw i32 %25, 8
%27 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 %26)
%28 = load i32, i32* %8
%29 = mul nsw i32 %28, 8
%30 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"short = %d\0A\00"
@.str.1 = [10 x i8] c"int = %d\0A\00"
@.str.2 = [11 x i8] c"long = %d\0A\00"
@.str.3 = [16 x i8] c"long long = %d\0A\00"
@.str.4 = [14 x i8] c"pointer = %d\0A\00"
@.str.5 = [12 x i8] c"float = %d\0A\00"
@.str.6 = [13 x i8] c"double = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 16)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 32)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 64)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 64)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 64)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 32)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 64)
ret i32 0
}