#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 *, double);
int main(int argc, char *argv[]) {
  int myint;
  float mynum;
  double mydouble, mysumdouble;
  mynum = 24.4;
  printf("mynum is equal to %f\n", mynum);
  mydouble = 243.95;
  mysumdouble = 3.5 + mydouble;
  printf("mysumdouble is equal to %f\n", mysumdouble);
  myint = 3;
  mysumdouble = mysumdouble + myint;
  printf("mysumdouble is now equal to %f\n", mysumdouble);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  0xee2(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
movsd  0xeb8(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xea3(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x3,-0x14(%rbp)
movsd  -0x28(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf00(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf02(%rip),%rdi
movsd  0xed4(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf0a(%rip),%rdi
movsd  0xec8(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"mynum is equal to %f\0A\00"
@.str.1 = [28 x i8] c"mysumdouble is equal to %f\0A\00"
@.str.2 = [32 x i8] c"mysumdouble is now equal to %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float
%8 = alloca double
%9 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 0x4038666660000000, float* %7
%10 = load float, float* %7
%11 = fpext float %10 to double
%12 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %11)
store double 2.439500e+02, double* %8
%13 = load double, double* %8
%14 = fadd double 3.500000e+00, %13
store double %14, double* %9
%15 = load double, double* %9
%16 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), double %15)
store i32 3, i32* %6
%17 = load double, double* %9
%18 = load i32, i32* %6
%19 = sitofp i32 %18 to double
%20 = fadd double %17, %19
store double %20, double* %9
%21 = load double, double* %9
%22 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), double %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"mynum is equal to %f\0A\00"
@.str.1 = [28 x i8] c"mysumdouble is equal to %f\0A\00"
@.str.2 = [32 x i8] c"mysumdouble is now equal to %f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double 0x4038666660000000)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), double 2.474500e+02)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), double 2.504500e+02)
ret i32 0
}