#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*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
main() {
  char c;
  int i;
  float x;
  double d;
  c = 'A';
  i = c;
  c = i;
  printf("c=%c\n", c);
  i = 10;
  x = i;
  i = x;
  printf("i=%d\n", i);
  x = 3.14;
  i = x;
  printf("x=%f, i=%d, i=%f\n", x, i, (float)i);
  d = 2.718259238;
  x = d;
  printf("d=%1.9f, x=%1.9f\n", d, x);
  d = (double)i;
  printf("d=%f\n", d);
  printf("Press any key to end...");
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movb   $0x41,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%esi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xa,-0x8(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
cvttss2si -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  0xe8b(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
cvttss2si -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x8(%rbp),%esi
cvtsi2ssl -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe72(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  0xe4b(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movsd  -0x18(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe4d(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe42(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
mov    $0x41,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
movsd  0xeaa(%rip),%xmm0
movsd  0xeaa(%rip),%xmm1
mov    $0x3,%esi
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
movsd  0xe97(%rip),%xmm0
movsd  0xe97(%rip),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
movsd  0xe71(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"c=%c\0A\00"
@.str.1 = [6 x i8] c"i=%d\0A\00"
@.str.2 = [18 x i8] c"x=%f, i=%d, i=%f\0A\00"
@.str.3 = [18 x i8] c"d=%1.9f, x=%1.9f\0A\00"
@.str.4 = [6 x i8] c"d=%f\0A\00"
@.str.5 = [24 x i8] c"Press any key to end...\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i32
%3 = alloca float
%4 = alloca double
store i8 65, i8* %1
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = trunc i32 %7 to i8
store i8 %8, i8* %1
%9 = load i8, i8* %1
%10 = sext i8 %9 to i32
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %10)
store i32 10, i32* %2
%12 = load i32, i32* %2
%13 = sitofp i32 %12 to float
store float %13, float* %3
%14 = load float, float* %3
%15 = fptosi float %14 to i32
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %16)
store float 0x40091EB860000000, float* %3
%18 = load float, float* %3
%19 = fptosi float %18 to i32
store i32 %19, i32* %2
%20 = load float, float* %3
%21 = fpext float %20 to double
%22 = load i32, i32* %2
%23 = load i32, i32* %2
%24 = sitofp i32 %23 to float
%25 = fpext float %24 to double
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), double %21, i32 %22, double %25)
store double 0x4005BEFEB30A143C, double* %4
%27 = load double, double* %4
%28 = fptrunc double %27 to float
store float %28, float* %3
%29 = load double, double* %4
%30 = load float, float* %3
%31 = fpext float %30 to double
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), double %29, double %31)
%33 = load i32, i32* %2
%34 = sitofp i32 %33 to double
store double %34, double* %4
%35 = load double, double* %4
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %35)
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
%38 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"c=%c\0A\00"
@.str.1 = [6 x i8] c"i=%d\0A\00"
@.str.2 = [18 x i8] c"x=%f, i=%d, i=%f\0A\00"
@.str.3 = [18 x i8] c"d=%1.9f, x=%1.9f\0A\00"
@.str.4 = [6 x i8] c"d=%f\0A\00"
@.str.5 = [24 x i8] c"Press any key to end...\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 65)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 10)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), double 0x40091EB860000000, i32 3, double 3.000000e+00)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), double 0x4005BEFEB30A143C, double 0x4005BEFEC0000000)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double 3.000000e+00)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
%7 = tail call i32 (...) @getchar()
ret i32 0
}