#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 */
double INFINITY;
double pow(float, int);
int /*<<< orphan*/ printf(char *, ...);
double sqrt(double);
void invalid_operations() {
  printf("\n=========Invalid operations behaviour========\n");
  printf("INFINITY + (-INFINITY):           %g\n", INFINITY + -INFINITY);
  printf("0 * INFINITY:                     %g\n", 0 * INFINITY);
  printf("INFINITY / INFINITY:              %g\n", INFINITY / INFINITY);
  printf("sqrt(-1):                         %g\n", sqrt(-1));
  printf("sqrt(INFINITY):                   %g\n", sqrt(INFINITY));
  printf("sqrt(-INFINITY):                  %g\n", sqrt(-INFINITY));
  printf("(-3) / (-INFINITY):               %g\n", (-3) / (-INFINITY));
  printf("4 - INFINITY:                     %g\n", 4 - INFINITY);
  float x = 3 * pow(10, 70), y = 4 * pow(10, 70);
  printf("(3*10^70)^2:                      %g\n", pow(x, 2));
  printf("(4*10^70)^2:                      %g\n", pow(y, 2));
  printf("(3*10^70)^2 + (4*10^70)^2:        %g\n", pow(x, 2) + pow(y, 2));
  printf("sqrt((3*10^70)^2 + (4*10^70)^2):  %g\n", sqrt(pow(x, 2) + pow(y, 2)));
}


x86 assembly (clang, -O0):
<invalid_operations>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e9b(%rip),%rax
movsd  (%rax),%xmm0
mov    0x2e90(%rip),%rax
movsd  (%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
addsd  %xmm1,%xmm0
lea    0xed6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
mov    0x2e59(%rip),%rax
mulsd  (%rax),%xmm0
lea    0xee0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2e40(%rip),%rax
movsd  (%rax),%xmm0
mov    0x2e35(%rip),%rax
divsd  (%rax),%xmm0
lea    0xee2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xe4b(%rip),%xmm0
call   1050 <sqrt@plt>
lea    0xeed(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2e01(%rip),%rax
movsd  (%rax),%xmm0
call   1050 <sqrt@plt>
lea    0xef5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2de3(%rip),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1050 <sqrt@plt>
lea    0xee6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2dae(%rip),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xdb3(%rip),%xmm0
divsd  %xmm1,%xmm0
lea    0xed0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xd89(%rip),%xmm0
mov    0x2d6a(%rip),%rax
subsd  (%rax),%xmm0
lea    0xed5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0xd88(%rip),%xmm0
mov    $0x46,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xd5b(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xd5e(%rip),%xmm0
mov    $0x46,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xd29(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
lea    0xe8a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
lea    0xe93(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm1,%xmm0
lea    0xe7c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
addsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
lea    0xe60(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalid_operations>:
push   %rbx
sub    $0x20,%rsp
lea    0x10c0(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e90(%rip),%rbx
movsd  (%rbx),%xmm0
subsd  %xmm0,%xmm0
lea    0xedd(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorpd  %xmm1,%xmm1
movsd  (%rbx),%xmm0
mulsd  %xmm1,%xmm0
lea    0xee9(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  (%rbx),%xmm0
divsd  %xmm0,%xmm0
lea    0xef9(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe5a(%rip),%xmm0
call   1060 <sqrt@plt>
lea    0xf04(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  (%rbx),%xmm0
ucomisd 0xe5b(%rip),%xmm0
jb     11cd <invalid_operations+0x8d>
sqrtsd %xmm0,%xmm0
jmp    11d2 <invalid_operations+0x92>
call   1060 <sqrt@plt>
lea    0xf03(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  (%rbx),%xmm1
movapd 0xe44(%rip),%xmm0
xorpd  %xmm1,%xmm0
movsd  0xe10(%rip),%xmm2
ucomisd %xmm1,%xmm2
jb     1204 <invalid_operations+0xc4>
sqrtsd %xmm0,%xmm0
jmp    1209 <invalid_operations+0xc9>
call   1060 <sqrt@plt>
lea    0xef2(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xdf1(%rip),%xmm0
divsd  (%rbx),%xmm0
lea    0xefe(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xddf(%rip),%xmm0
subsd  (%rbx),%xmm0
lea    0xf0a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0xded(%rip),%xmm0
mov    $0x46,%edi
call   1050 <pow@plt>
mulsd  0xdab(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x10(%rsp)
movss  0xdc9(%rip),%xmm0
mov    $0x46,%edi
call   1050 <pow@plt>
mulsd  0xd8f(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
movss  0x10(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
lea    0xeca(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
lea    0xed2(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x10(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movsd  %xmm0,0x18(%rsp)
movss  0xc(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
addsd  0x18(%rsp),%xmm0
lea    0xebe(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x10(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movsd  %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
addsd  0x10(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1345 <invalid_operations+0x205>
sqrtsd %xmm0,%xmm0
jmp    134a <invalid_operations+0x20a>
call   1060 <sqrt@plt>
lea    0xe95(%rip),%rdi
mov    $0x1,%al
add    $0x20,%rsp
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"\0A=========Invalid operations behaviour========\0A\00"
@.str.1 = [38 x i8] c"INFINITY + (-INFINITY): %g\0A\00"
@INFINITY = global double 0.000000e+00
@.str.2 = [38 x i8] c"0 * INFINITY: %g\0A\00"
@.str.3 = [38 x i8] c"INFINITY / INFINITY: %g\0A\00"
@.str.4 = [38 x i8] c"sqrt(-1): %g\0A\00"
@.str.5 = [38 x i8] c"sqrt(INFINITY): %g\0A\00"
@.str.6 = [38 x i8] c"sqrt(-INFINITY): %g\0A\00"
@.str.7 = [38 x i8] c"(-3) / (-INFINITY): %g\0A\00"
@.str.8 = [38 x i8] c"4 - INFINITY: %g\0A\00"
@.str.9 = [38 x i8] c"(3*10^70)^2: %g\0A\00"
@.str.10 = [38 x i8] c"(4*10^70)^2: %g\0A\00"
@.str.11 = [38 x i8] c"(3*10^70)^2 + (4*10^70)^2: %g\0A\00"
@.str.12 = [38 x i8] c"sqrt((3*10^70)^2 + (4*10^70)^2): %g\0A\00"
define void @invalid_operations() {
%1 = alloca float
%2 = alloca float
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%4 = load double, double* @INFINITY
%5 = load double, double* @INFINITY
%6 = fneg double %5
%7 = fadd double %4, %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), double %7)
%9 = load double, double* @INFINITY
%10 = fmul double 0.000000e+00, %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), double %10)
%12 = load double, double* @INFINITY
%13 = load double, double* @INFINITY
%14 = fdiv double %12, %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double %14)
%16 = call double @sqrt(double -1.000000e+00)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), double %16)
%18 = load double, double* @INFINITY
%19 = call double @sqrt(double %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0), double %19)
%21 = load double, double* @INFINITY
%22 = fneg double %21
%23 = call double @sqrt(double %22)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0), double %23)
%25 = load double, double* @INFINITY
%26 = fneg double %25
%27 = fdiv double -3.000000e+00, %26
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0), double %27)
%29 = load double, double* @INFINITY
%30 = fsub double 4.000000e+00, %29
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.8, i64 0, i64 0), double %30)
%32 = call double @pow(float 1.000000e+01, i32 70)
%33 = fmul double 3.000000e+00, %32
%34 = fptrunc double %33 to float
store float %34, float* %1
%35 = call double @pow(float 1.000000e+01, i32 70)
%36 = fmul double 4.000000e+00, %35
%37 = fptrunc double %36 to float
store float %37, float* %2
%38 = load float, float* %1
%39 = call double @pow(float %38, i32 2)
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0), double %39)
%41 = load float, float* %2
%42 = call double @pow(float %41, i32 2)
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0), double %42)
%44 = load float, float* %1
%45 = call double @pow(float %44, i32 2)
%46 = load float, float* %2
%47 = call double @pow(float %46, i32 2)
%48 = fadd double %45, %47
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.11, i64 0, i64 0), double %48)
%50 = load float, float* %1
%51 = call double @pow(float %50, i32 2)
%52 = load float, float* %2
%53 = call double @pow(float %52, i32 2)
%54 = fadd double %51, %53
%55 = call double @sqrt(double %54)
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.12, i64 0, i64 0), double %55)
ret void
}

LLVM IR (-O2):
@.str.1 = [38 x i8] c"INFINITY + (-INFINITY): %g\0A\00"
@INFINITY = global double 0.000000e+00
@.str.2 = [38 x i8] c"0 * INFINITY: %g\0A\00"
@.str.3 = [38 x i8] c"INFINITY / INFINITY: %g\0A\00"
@.str.4 = [38 x i8] c"sqrt(-1): %g\0A\00"
@.str.5 = [38 x i8] c"sqrt(INFINITY): %g\0A\00"
@.str.6 = [38 x i8] c"sqrt(-INFINITY): %g\0A\00"
@.str.7 = [38 x i8] c"(-3) / (-INFINITY): %g\0A\00"
@.str.8 = [38 x i8] c"4 - INFINITY: %g\0A\00"
@.str.9 = [38 x i8] c"(3*10^70)^2: %g\0A\00"
@.str.10 = [38 x i8] c"(4*10^70)^2: %g\0A\00"
@.str.11 = [38 x i8] c"(3*10^70)^2 + (4*10^70)^2: %g\0A\00"
@.str.12 = [38 x i8] c"sqrt((3*10^70)^2 + (4*10^70)^2): %g\0A\00"
@str = [47 x i8] c"\0A=========Invalid operations behaviour========\00"
define void @invalid_operations() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%2 = load double, double* @INFINITY
%3 = fsub double %2, %2
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), double %3)
%5 = load double, double* @INFINITY
%6 = fmul double %5, 0.000000e+00
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), double %6)
%8 = load double, double* @INFINITY
%9 = fdiv double %8, %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double %9)
%11 = tail call double @sqrt(double -1.000000e+00)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), double %11)
%13 = load double, double* @INFINITY
%14 = tail call double @sqrt(double %13)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0), double %14)
%16 = load double, double* @INFINITY
%17 = fneg double %16
%18 = tail call double @sqrt(double %17)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0), double %18)
%20 = load double, double* @INFINITY
%21 = fdiv double 3.000000e+00, %20
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0), double %21)
%23 = load double, double* @INFINITY
%24 = fsub double 4.000000e+00, %23
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.8, i64 0, i64 0), double %24)
%26 = tail call double @pow(float 1.000000e+01, i32 70)
%27 = fmul double %26, 3.000000e+00
%28 = fptrunc double %27 to float
%29 = tail call double @pow(float 1.000000e+01, i32 70)
%30 = fmul double %29, 4.000000e+00
%31 = fptrunc double %30 to float
%32 = tail call double @pow(float %28, i32 2)
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0), double %32)
%34 = tail call double @pow(float %31, i32 2)
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0), double %34)
%36 = tail call double @pow(float %28, i32 2)
%37 = tail call double @pow(float %31, i32 2)
%38 = fadd double %36, %37
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.11, i64 0, i64 0), double %38)
%40 = tail call double @pow(float %28, i32 2)
%41 = tail call double @pow(float %31, i32 2)
%42 = fadd double %40, %41
%43 = tail call double @sqrt(double %42)
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.12, i64 0, i64 0), double %43)
ret void
}