#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 GBlur1D(double, int);
double GBlur2D(double, double, int);
int /*<<< orphan*/ printf(char *, double);
char *test_gblur() {
  printf("GBlur1D(0.2, 0.12): %f\n", GBlur1D(0.2, 0.12));
  printf("GBlur2D(0.5, 0.25, 0.22): %f\n", GBlur2D(0.5, 0.25, 0.22));
  do {
    if (!(GBlur1D(0, 1) == 0.0))
      return "GBlur1D should be 0 when stdDev = 0";
  } while (0);
  do {
    if (!(GBlur2D(0, 2.3, 1) == 0.0))
      return "GBlur2D should be 0 when stdDev = 0";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_gblur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xed0(%rip),%xmm0
xor    %edi,%edi
call   1030 <GBlur1D@plt>
lea    0xed2(%rip),%rdi
call   1040 <printf@plt>
movsd  0xea5(%rip),%xmm0
movsd  0xea5(%rip),%xmm1
xor    %edi,%edi
call   1050 <GBlur2D@plt>
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
mov    $0x1,%edi
call   1030 <GBlur1D@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    119b <test_gblur+0x6b>
jp     119b <test_gblur+0x6b>
jmp    11ab <test_gblur+0x7b>
lea    0xeb4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11ff <test_gblur+0xcf>
jmp    11b0 <test_gblur+0x80>
jmp    11b5 <test_gblur+0x85>
xorps  %xmm0,%xmm0
movsd  0xe58(%rip),%xmm1
mov    $0x1,%edi
call   1050 <GBlur2D@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11e2 <test_gblur+0xb2>
jp     11e2 <test_gblur+0xb2>
jmp    11f2 <test_gblur+0xc2>
lea    0xe91(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11ff <test_gblur+0xcf>
jmp    11f7 <test_gblur+0xc7>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_gblur>:
push   %rax
movsd  0xec7(%rip),%xmm0
xor    %edi,%edi
call   1030 <GBlur1D@plt>
lea    0xee1(%rip),%rdi
call   1040 <printf@plt>
movsd  0xeb4(%rip),%xmm0
movsd  0xeb4(%rip),%xmm1
xor    %edi,%edi
call   1050 <GBlur2D@plt>
lea    0xed6(%rip),%rdi
call   1040 <printf@plt>
xorpd  %xmm0,%xmm0
mov    $0x1,%edi
call   1030 <GBlur1D@plt>
ucomisd 0xe9b(%rip),%xmm0
jne    11ba <test_gblur+0x8a>
jp     11ba <test_gblur+0x8a>
movsd  0xe87(%rip),%xmm1
xorpd  %xmm0,%xmm0
mov    $0x1,%edi
call   1050 <GBlur2D@plt>
xor    %eax,%eax
ucomisd 0xe77(%rip),%xmm0
lea    0xed2(%rip),%rcx
cmovne %rcx,%rax
cmovp  %rcx,%rax
pop    %rcx
ret
lea    0xe9d(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"GBlur1D(0.2, 0.12): %f\0A\00"
@.str.1 = [30 x i8] c"GBlur2D(0.5, 0.25, 0.22): %f\0A\00"
@.str.2 = [36 x i8] c"GBlur1D should be 0 when stdDev = 0\00"
@.str.3 = [36 x i8] c"GBlur2D should be 0 when stdDev = 0\00"
define i8* @test_gblur() {
%1 = alloca i8*
%2 = call double @GBlur1D(double 2.000000e-01, i32 0)
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double %2)
%4 = call double @GBlur2D(double 5.000000e-01, double 2.500000e-01, i32 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), double %4)
br label %6
6: ; preds = %0
%7 = call double @GBlur1D(double 0.000000e+00, i32 1)
%8 = fcmp oeq double %7, 0.000000e+00
br i1 %8, label %10, label %9
9: ; preds = %6
store i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8** %1
br label %18
10: ; preds = %6
br label %11
11: ; preds = %10
br label %12
12: ; preds = %11
%13 = call double @GBlur2D(double 0.000000e+00, double 2.300000e+00, i32 1)
%14 = fcmp oeq double %13, 0.000000e+00
br i1 %14, label %16, label %15
15: ; preds = %12
store i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8** %1
br label %18
16: ; preds = %12
br label %17
17: ; preds = %16
store i8* null, i8** %1
br label %18
18: ; preds = %17, %15, %9
%19 = load i8*, i8** %1
ret i8* %19
}

LLVM IR (-O2):
@.str = [24 x i8] c"GBlur1D(0.2, 0.12): %f\0A\00"
@.str.1 = [30 x i8] c"GBlur2D(0.5, 0.25, 0.22): %f\0A\00"
@.str.2 = [36 x i8] c"GBlur1D should be 0 when stdDev = 0\00"
@.str.3 = [36 x i8] c"GBlur2D should be 0 when stdDev = 0\00"
define i8* @test_gblur() {
%1 = tail call double @GBlur1D(double 2.000000e-01, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call double @GBlur2D(double 5.000000e-01, double 2.500000e-01, i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), double %3)
%5 = tail call double @GBlur1D(double 0.000000e+00, i32 1)
%6 = fcmp oeq double %5, 0.000000e+00
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = tail call double @GBlur2D(double 0.000000e+00, double 2.300000e+00, i32 1)
%9 = fcmp oeq double %8, 0.000000e+00
%10 = select i1 %9, i8* null, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0)
br label %11
11: ; preds = %7, %0
%12 = phi i8* [ getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), %0 ], [ %10, %7 ]
ret i8* %12
}