#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*/ WrMessage(char *);
int /*<<< orphan*/ printf(char *, ...);
void WrImplicitCast(void) {
  int int_val;
  float real_val;
  WrMessage("@IMPLICIT-CAST");
  int_val = 1;
  real_val = 1.1F;
  printf("Real, integer: %d %d\n", real_val, int_val);
  printf("Real:          %d\n", real_val);
  printf("Integer:       %d\n", int_val);
  printf("\n");
  return;
}


x86 assembly (clang, -O0):
<WrImplicitCast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed5(%rip),%rdi
call   1040 <WrMessage@plt>
movl   $0x1,-0x4(%rbp)
movss  0xebd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x4(%rbp),%esi
lea    0xeb8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WrImplicitCast>:
push   %rax
lea    0xed0(%rip),%rdi
call   1050 <WrMessage@plt>
lea    0xed3(%rip),%rdi
movsd  0xeb4(%rip),%xmm0
mov    $0x1,%esi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
movsd  0xe99(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"@IMPLICIT-CAST\00"
@.str.1 = [22 x i8] c"Real, integer: %d %d\0A\00"
@.str.2 = [19 x i8] c"Real: %d\0A\00"
@.str.3 = [19 x i8] c"Integer: %d\0A\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @WrImplicitCast() {
%1 = alloca i32
%2 = alloca float
%3 = call i32 @WrMessage(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
store float 0x3FF19999A0000000, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = load i32, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), double %5, i32 %6)
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), double %9)
%11 = load i32, i32* %1
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"@IMPLICIT-CAST\00"
@.str.1 = [22 x i8] c"Real, integer: %d %d\0A\00"
@.str.2 = [19 x i8] c"Real: %d\0A\00"
@.str.3 = [19 x i8] c"Integer: %d\0A\00"
define void @WrImplicitCast() {
%1 = tail call i32 @WrMessage(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), double 0x3FF19999A0000000, i32 1)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), double 0x3FF19999A0000000)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 1)
%5 = tail call i32 @putchar(i32 10)
ret void
}