#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 main() {
  int m = 0;
  long n = 10000000000;
  float x = 0;
  double y = 2E300;
  printf("Before m = n;\n int m: %d\n long n: %ld\n", m, n);
  m = n;
  printf("After m = n;\n int m: %d\n long n: %ld\n", m, n);
  printf("\n");
  printf("Before x = y;\n float x: %e\n double y: %le\n", x, y);
  x = y;
  printf("After x = y;\n float x: %e\n double y: %le\n", x, y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movabs $0x2540be400,%rax
mov    %rax,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movsd  0xebc(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xeb8(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xeb9(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rdi
movabs $0x2540be400,%rbx
xor    %esi,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef2(%rip),%rdi
mov    $0x540be400,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xef8(%rip),%rdi
movsd  0xe93(%rip),%xmm1
xorps  %xmm0,%xmm0
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xf0a(%rip),%rdi
movsd  0xe82(%rip),%xmm0
movsd  0xe72(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Before m = n;\0A int m: %d\0A long n: %ld\0A\00"
@.str.1 = [38 x i8] c"After m = n;\0A int m: %d\0A long n: %ld\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [43 x i8] c"Before x = y;\0A float x: %e\0A double y: %le\0A\00"
@.str.4 = [42 x i8] c"After x = y;\0A float x: %e\0A double y: %le\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca float
%5 = alloca double
store i32 0, i32* %1
store i32 0, i32* %2
store i64 10000000000, i64* %3
store float 0.000000e+00, float* %4
store double 2.000000e+300, double* %5
%6 = load i32, i32* %2
%7 = load i64, i64* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %6, i64 %7)
%9 = load i64, i64* %3
%10 = trunc i64 %9 to i32
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = load i64, i64* %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %11, i64 %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%15 = load float, float* %4
%16 = fpext float %15 to double
%17 = load double, double* %5
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), double %16, double %17)
%19 = load double, double* %5
%20 = fptrunc double %19 to float
store float %20, float* %4
%21 = load float, float* %4
%22 = fpext float %21 to double
%23 = load double, double* %5
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), double %22, double %23)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"Before m = n;\0A int m: %d\0A long n: %ld\0A\00"
@.str.1 = [38 x i8] c"After m = n;\0A int m: %d\0A long n: %ld\0A\00"
@.str.3 = [43 x i8] c"Before x = y;\0A float x: %e\0A double y: %le\0A\00"
@.str.4 = [42 x i8] c"After x = y;\0A float x: %e\0A double y: %le\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 0, i64 10000000000)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 1410065408, i64 10000000000)
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), double 0.000000e+00, double 2.000000e+300)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), double 0x7FF0000000000000, double 2.000000e+300)
ret i32 0
}