#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 */
scalar_t__ ceil(int);
int /*<<< orphan*/ convolve_symm(float const *, float *, int, int, float *, int,
                                 float *, int);
float *malloc_gaussian_symm_kernel(float, int);
int /*<<< orphan*/ xfree(float *);
void sift_add_gaussian_blur(const float *in, float *out, int w, int h,
                            float sigma) {
  int r_gker = (int)ceil(4 * sigma);
  float *gker = malloc_gaussian_symm_kernel(sigma, r_gker);
  convolve_symm(in, out, w, h, gker, r_gker, gker, r_gker);
  xfree(gker);
}


x86 assembly (clang, -O0):
<sift_add_gaussian_blur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
movss  0xe9d(%rip),%xmm0
mulss  -0x1c(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <ceil@plt>
mov    %eax,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
mov    -0x20(%rbp),%edi
call   1050 <malloc_gaussian_symm_kernel@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x20(%rbp),%r9d
mov    -0x28(%rbp),%r10
mov    -0x20(%rbp),%eax
mov    %r10,(%rsp)
mov    %eax,0x8(%rsp)
call   1060 <convolve_symm@plt>
mov    -0x28(%rbp),%rdi
call   1040 <xfree@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sift_add_gaussian_blur>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movss  %xmm0,0x4(%rsp)
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rsi,%r12
mov    %rdi,%r13
movss  0xe9b(%rip),%xmm1
mulss  %xmm0,%xmm1
cvttss2si %xmm1,%edi
call   1030 <ceil@plt>
mov    %rax,%rbx
movss  0x4(%rsp),%xmm0
mov    %ebx,%edi
call   1050 <malloc_gaussian_symm_kernel@plt>
mov    %rax,%rbp
mov    %r13,%rdi
mov    %r12,%rsi
mov    %r15d,%edx
mov    %r14d,%ecx
mov    %rax,%r8
mov    %ebx,%r9d
push   %rbx
push   %rax
call   1060 <convolve_symm@plt>
add    $0x10,%rsp
mov    %rbp,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <xfree@plt>

LLVM IR (-O0):
define void @sift_add_gaussian_blur(float* %0, float* %1, i32 %2, i32 %3, float %4) {
%6 = alloca float*
%7 = alloca float*
%8 = alloca i32
%9 = alloca i32
%10 = alloca float
%11 = alloca i32
%12 = alloca float*
store float* %0, float** %6
store float* %1, float** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store float %4, float* %10
%13 = load float, float* %10
%14 = fmul float 4.000000e+00, %13
%15 = fptosi float %14 to i32
%16 = call i64 @ceil(i32 %15)
%17 = trunc i64 %16 to i32
store i32 %17, i32* %11
%18 = load float, float* %10
%19 = load i32, i32* %11
%20 = call float* @malloc_gaussian_symm_kernel(float %18, i32 %19)
store float* %20, float** %12
%21 = load float*, float** %6
%22 = load float*, float** %7
%23 = load i32, i32* %8
%24 = load i32, i32* %9
%25 = load float*, float** %12
%26 = load i32, i32* %11
%27 = load float*, float** %12
%28 = load i32, i32* %11
%29 = call i32 @convolve_symm(float* %21, float* %22, i32 %23, i32 %24, float* %25, i32 %26, float* %27, i32 %28)
%30 = load float*, float** %12
%31 = call i32 @xfree(float* %30)
ret void
}

LLVM IR (-O2):
define void @sift_add_gaussian_blur(float* %0, float* %1, i32 %2, i32 %3, float %4) {
%6 = fmul float %4, 4.000000e+00
%7 = fptosi float %6 to i32
%8 = tail call i64 @ceil(i32 %7)
%9 = trunc i64 %8 to i32
%10 = tail call float* @malloc_gaussian_symm_kernel(float %4, i32 %9)
%11 = tail call i32 @convolve_symm(float* %0, float* %1, i32 %2, i32 %3, float* %10, i32 %9, float* %10, i32 %9)
%12 = tail call i32 @xfree(float* %10)
ret void
}