#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 */
typedef int /*<<< orphan*/ ptr4;
typedef int /*<<< orphan*/ ptr3;
typedef int /*<<< orphan*/ ptr2;
typedef int /*<<< orphan*/ ptr1;
typedef int /*<<< orphan*/ i;
typedef int /*<<< orphan*/ f;
typedef int /*<<< orphan*/ d;
typedef int /*<<< orphan*/ c;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i, *ptr1 = &i;
  char c, *ptr2 = &c;
  float f, *ptr3 = &f;
  double d, *ptr4 = &d;
  printf("Size of i is %d and Size of ptr1 is %d\n", sizeof(i), sizeof(ptr1));
  printf("Size of c is %d and Size of ptr2 is %d\n", sizeof(c), sizeof(ptr2));
  printf("Size of f is %d and Size of ptr3 is %d\n", sizeof(f), sizeof(ptr3));
  printf("Size of d is %d and Size of ptr4 is %d\n", sizeof(d), sizeof(ptr4));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x11(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x24(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x4,%esi
mov    $0x8,%edx
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x4,%esi
mov    $0x8,%edx
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
mov    $0x8,%edx
mov    %edx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x4,%esi
mov    $0x8,%edx
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
mov    $0x1,%esi
mov    $0x8,%edx
call   1030 <printf@plt>
lea    0xf0c(%rip),%rdi
mov    $0x4,%esi
mov    $0x8,%edx
call   1030 <printf@plt>
lea    0xf1e(%rip),%rdi
mov    $0x8,%esi
mov    $0x8,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Size of i is %d and Size of ptr1 is %d\0A\00"
@.str.1 = [40 x i8] c"Size of c is %d and Size of ptr2 is %d\0A\00"
@.str.2 = [40 x i8] c"Size of f is %d and Size of ptr3 is %d\0A\00"
@.str.3 = [40 x i8] c"Size of d is %d and Size of ptr4 is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i8
%5 = alloca i8*
%6 = alloca float
%7 = alloca float*
%8 = alloca double
%9 = alloca double*
store i32 0, i32* %1
store i32* %2, i32** %3
store i8* %4, i8** %5
store float* %6, float** %7
store double* %8, double** %9
%10 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 4, i32 8)
%11 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 8)
%12 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 4, i32 8)
%13 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i32 8, i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"Size of i is %d and Size of ptr1 is %d\0A\00"
@.str.1 = [40 x i8] c"Size of c is %d and Size of ptr2 is %d\0A\00"
@.str.2 = [40 x i8] c"Size of f is %d and Size of ptr3 is %d\0A\00"
@.str.3 = [40 x i8] c"Size of d is %d and Size of ptr4 is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 4, i32 8)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 8)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 4, i32 8)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i32 8, i32 8)
ret i32 0
}