#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 printTypes() {
  printf("short:\t\t%d Bit\n", sizeof(short) * 8);
  printf("int:\t\t%d Bit\n", sizeof(int) * 8);
  printf("long:\t\t%d Bit\n", sizeof(long) * 8);
  printf("long long:\t%d Bit\n", sizeof(long long) * 8);
  printf("float:\t\t%d Bit\n", sizeof(float) * 8);
  printf("double:\t\t%d Bit\n", sizeof(double) * 8);
  printf("long double:\t%d Bit\n", sizeof(long double) * 8);
  char str = 'A';
  int a = (int)str;
  printf("Cast 'A' to int: %d\n", a);
}


x86 assembly (clang, -O0):
<printTypes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
mov    $0x20,%esi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x40,%esi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x40,%esi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x20,%esi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0x40,%esi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0x80,%esi
call   1030 <printf@plt>
movb   $0x41,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTypes>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
mov    $0x20,%esi
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0x40,%esi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x40,%esi
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0x20,%esi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x40,%esi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x80,%esi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
mov    $0x41,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"short:\09\09%d Bit\0A\00"
@.str.1 = [14 x i8] c"int:\09\09%d Bit\0A\00"
@.str.2 = [15 x i8] c"long:\09\09%d Bit\0A\00"
@.str.3 = [19 x i8] c"long long:\09%d Bit\0A\00"
@.str.4 = [16 x i8] c"float:\09\09%d Bit\0A\00"
@.str.5 = [17 x i8] c"double:\09\09%d Bit\0A\00"
@.str.6 = [21 x i8] c"long double:\09%d Bit\0A\00"
@.str.7 = [21 x i8] c"Cast 'A' to int: %d\0A\00"
define void @printTypes() {
%1 = alloca i8
%2 = alloca i32
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 16)
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 32)
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 64)
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 64)
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 32)
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 64)
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i32 128)
store i8 65, i8* %1
%10 = load i8, i8* %1
%11 = sext i8 %10 to i32
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"short:\09\09%d Bit\0A\00"
@.str.1 = [14 x i8] c"int:\09\09%d Bit\0A\00"
@.str.2 = [15 x i8] c"long:\09\09%d Bit\0A\00"
@.str.3 = [19 x i8] c"long long:\09%d Bit\0A\00"
@.str.4 = [16 x i8] c"float:\09\09%d Bit\0A\00"
@.str.5 = [17 x i8] c"double:\09\09%d Bit\0A\00"
@.str.6 = [21 x i8] c"long double:\09%d Bit\0A\00"
@.str.7 = [21 x i8] c"Cast 'A' to int: %d\0A\00"
define void @printTypes() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 16)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 32)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 64)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 64)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 32)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 64)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i32 128)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i32 65)
ret void
}