#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 */
float get22();
double get55();
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  printf("calling get22() to init float f value.\n");
  float f = get22();
  if (f == 22.) {
    printf("f equals 22.\n");
  } else {
    printf("f is %f but should be 22.\n", f);
  }
  printf("\ncalling get55() to init double d value. \n");
  double d = get55();
  if (d == 55.) {
    printf("d is 55.\n");
  } else {
    printf("d is %f but should be 55.\n", d);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <get22@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe8f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1194 <main+0x64>
jp     1194 <main+0x64>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11ab <main+0x7b>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea2(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <get55@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe36(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11f5 <main+0xc5>
jp     11f5 <main+0xc5>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1208 <main+0xd8>
movsd  -0x20(%rbp),%xmm0
lea    0xe95(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <get22@plt>
ucomiss 0xea5(%rip),%xmm0
jne    116d <main+0x2d>
jp     116d <main+0x2d>
lea    0xf3a(%rip),%rdi
call   1030 <puts@plt>
jmp    117f <main+0x3f>
cvtss2sd %xmm0,%xmm0
lea    0xe98(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <get55@plt>
ucomisd 0xe6e(%rip),%xmm0
jne    11ac <main+0x6c>
jp     11ac <main+0x6c>
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
jmp    11ba <main+0x7a>
lea    0xe78(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"calling get22() to init float f value.\0A\00"
@.str.1 = [14 x i8] c"f equals 22.\0A\00"
@.str.2 = [27 x i8] c"f is %f but should be 22.\0A\00"
@.str.3 = [43 x i8] c"\0Acalling get55() to init double d value. \0A\00"
@.str.4 = [10 x i8] c"d is 55.\0A\00"
@.str.5 = [27 x i8] c"d is %f but should be 55.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%9 = call float (...) @get22()
store float %9, float* %6
%10 = load float, float* %6
%11 = fpext float %10 to double
%12 = fcmp oeq double %11, 2.200000e+01
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %19
15: ; preds = %2
%16 = load float, float* %6
%17 = fpext float %16 to double
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), double %17)
br label %19
19: ; preds = %15, %13
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
%21 = call double (...) @get55()
store double %21, double* %7
%22 = load double, double* %7
%23 = fcmp oeq double %22, 5.500000e+01
br i1 %23, label %24, label %26
24: ; preds = %19
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
br label %29
26: ; preds = %19
%27 = load double, double* %7
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), double %27)
br label %29
29: ; preds = %26, %24
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
@.str.2 = [27 x i8] c"f is %f but should be 22.\0A\00"
@.str.5 = [27 x i8] c"d is %f but should be 55.\0A\00"
@str = [39 x i8] c"calling get22() to init float f value.\00"
@str.6 = [42 x i8] c"\0Acalling get55() to init double d value. \00"
@str.7 = [9 x i8] c"d is 55.\00"
@str.8 = [13 x i8] c"f equals 22.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%4 = tail call float (...) @get22()
%5 = fcmp oeq float %4, 2.200000e+01
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.8, i64 0, i64 0))
br label %11
8: ; preds = %2
%9 = fpext float %4 to double
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), double %9)
br label %11
11: ; preds = %8, %6
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.6, i64 0, i64 0))
%13 = tail call double (...) @get55()
%14 = fcmp oeq double %13, 5.500000e+01
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.7, i64 0, i64 0))
br label %19
17: ; preds = %11
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), double %13)
br label %19
19: ; preds = %17, %15
ret i32 0
}