#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*/ boxBlur_4(int *, int *, int, int, int);
int /*<<< orphan*/ boxesForGauss(int, int *, int);
void gaussBlur_4(int *source, int *dest, int w, int h, int r) {
  int bxs[3];
  boxesForGauss(r, bxs, 3);
  boxBlur_4(source, dest, w, h, (bxs[0] - 1) / 2);
  boxBlur_4(dest, source, w, h, (bxs[1] - 1) / 2);
  boxBlur_4(source, dest, w, h, (bxs[2] - 1) / 2);
}


x86 assembly (clang, -O0):
<gaussBlur_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0x3,%edx
call   1030 <boxesForGauss@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x28(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%r8d
cltd
idiv   %r8d
mov    -0x34(%rbp),%edx
mov    %eax,%r8d
call   1040 <boxBlur_4@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%r8d
cltd
idiv   %r8d
mov    -0x30(%rbp),%edx
mov    %eax,%r8d
call   1040 <boxBlur_4@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x20(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%r8d
cltd
idiv   %r8d
mov    -0x2c(%rbp),%edx
mov    %eax,%r8d
call   1040 <boxBlur_4@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gaussBlur_4>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0xc(%rsp),%rsi
mov    %r8d,%edi
mov    $0x3,%edx
call   1030 <boxesForGauss@plt>
mov    0xc(%rsp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
shr    $0x1f,%ecx
lea    (%rax,%rcx,1),%r8d
add    $0xffffffff,%r8d
sar    %r8d
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r14d,%ecx
call   1040 <boxBlur_4@plt>
mov    0x10(%rsp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
shr    $0x1f,%ecx
lea    (%rax,%rcx,1),%r8d
add    $0xffffffff,%r8d
sar    %r8d
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r15d,%edx
mov    %r14d,%ecx
call   1040 <boxBlur_4@plt>
mov    0x14(%rsp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
shr    $0x1f,%ecx
lea    (%rax,%rcx,1),%r8d
add    $0xffffffff,%r8d
sar    %r8d
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r14d,%ecx
call   1040 <boxBlur_4@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @gaussBlur_4(i32* %0, i32* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [3 x i32]
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i32, i32* %10
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 0
%14 = call i32 @boxesForGauss(i32 %12, i32* %13, i32 3)
%15 = load i32*, i32** %6
%16 = load i32*, i32** %7
%17 = load i32, i32* %8
%18 = load i32, i32* %9
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 0
%20 = load i32, i32* %19
%21 = sub nsw i32 %20, 1
%22 = sdiv i32 %21, 2
%23 = call i32 @boxBlur_4(i32* %15, i32* %16, i32 %17, i32 %18, i32 %22)
%24 = load i32*, i32** %7
%25 = load i32*, i32** %6
%26 = load i32, i32* %8
%27 = load i32, i32* %9
%28 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 1
%29 = load i32, i32* %28
%30 = sub nsw i32 %29, 1
%31 = sdiv i32 %30, 2
%32 = call i32 @boxBlur_4(i32* %24, i32* %25, i32 %26, i32 %27, i32 %31)
%33 = load i32*, i32** %6
%34 = load i32*, i32** %7
%35 = load i32, i32* %8
%36 = load i32, i32* %9
%37 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 2
%38 = load i32, i32* %37
%39 = sub nsw i32 %38, 1
%40 = sdiv i32 %39, 2
%41 = call i32 @boxBlur_4(i32* %33, i32* %34, i32 %35, i32 %36, i32 %40)
ret void
}

LLVM IR (-O2):
define void @gaussBlur_4(i32* %0, i32* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca [3 x i32]
%7 = bitcast [3 x i32]* %6 to i8*
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%9 = call i32 @boxesForGauss(i32 %4, i32* %8, i32 3)
%10 = load i32, i32* %8
%11 = add nsw i32 %10, -1
%12 = sdiv i32 %11, 2
%13 = call i32 @boxBlur_4(i32* %0, i32* %1, i32 %2, i32 %3, i32 %12)
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 1
%15 = load i32, i32* %14
%16 = add nsw i32 %15, -1
%17 = sdiv i32 %16, 2
%18 = call i32 @boxBlur_4(i32* %1, i32* %0, i32 %2, i32 %3, i32 %17)
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 2
%20 = load i32, i32* %19
%21 = add nsw i32 %20, -1
%22 = sdiv i32 %21, 2
%23 = call i32 @boxBlur_4(i32* %0, i32* %1, i32 %2, i32 %3, i32 %22)
ret void
}