#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 */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ convolve(int *, int *, int, int, int, int /*<<< orphan*/ *);
void convolveHV(uint32_t filtersX_offset, uint32_t filtersY_offset,
                uint32_t tmp_offset, uint32_t srcW, uint32_t srcH,
                uint32_t destW, uint32_t destH) {
  uint8_t *memory = 0;
  uint32_t *src = (uint32_t *)memory;
  int16_t *filterX = (int16_t *)(memory + filtersX_offset);
  int16_t *filterY = (int16_t *)(memory + filtersY_offset);
  uint32_t *tmp = (uint32_t *)(memory + tmp_offset);
  convolve(src, tmp, srcW, srcH, destW, filterX);
  convolve(tmp, src, srcH, destW, destH, filterY);
}


x86 assembly (clang, -O0):
<convolveHV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x4(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x8(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x30(%rbp),%r9
call   1030 <convolve@plt>
mov    -0x40(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    0x10(%rbp),%r8d
mov    -0x38(%rbp),%r9
call   1030 <convolve@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convolveHV>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r9d,%r15d
mov    %r8d,%r12d
mov    0x30(%rsp),%r14d
movslq %edi,%r9
shl    $0x2,%r9
movslq %esi,%rbx
shl    $0x2,%rbx
movslq %edx,%rbp
shl    $0x2,%rbp
xor    %edi,%edi
mov    %rbp,%rsi
mov    %ecx,%edx
mov    %r8d,%ecx
mov    %r15d,%r8d
call   1030 <convolve@plt>
mov    %rbp,%rdi
xor    %esi,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
mov    %rbx,%r9
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <convolve@plt>

LLVM IR (-O0):
define void @convolveHV(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i32*
%19 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
store i32* null, i32** %15
%20 = load i32*, i32** %15
store i32* %20, i32** %16
%21 = load i32*, i32** %15
%22 = load i32, i32* %8
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
store i32* %24, i32** %17
%25 = load i32*, i32** %15
%26 = load i32, i32* %9
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %25, i64 %27
store i32* %28, i32** %18
%29 = load i32*, i32** %15
%30 = load i32, i32* %10
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i32, i32* %29, i64 %31
store i32* %32, i32** %19
%33 = load i32*, i32** %16
%34 = load i32*, i32** %19
%35 = load i32, i32* %11
%36 = load i32, i32* %12
%37 = load i32, i32* %13
%38 = load i32*, i32** %17
%39 = call i32 @convolve(i32* %33, i32* %34, i32 %35, i32 %36, i32 %37, i32* %38)
%40 = load i32*, i32** %19
%41 = load i32*, i32** %16
%42 = load i32, i32* %12
%43 = load i32, i32* %13
%44 = load i32, i32* %14
%45 = load i32*, i32** %18
%46 = call i32 @convolve(i32* %40, i32* %41, i32 %42, i32 %43, i32 %44, i32* %45)
ret void
}

LLVM IR (-O2):
define void @convolveHV(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = sext i32 %0 to i64
%9 = getelementptr inbounds i32, i32* null, i64 %8
%10 = sext i32 %1 to i64
%11 = getelementptr inbounds i32, i32* null, i64 %10
%12 = sext i32 %2 to i64
%13 = getelementptr inbounds i32, i32* null, i64 %12
%14 = tail call i32 @convolve(i32* null, i32* %13, i32 %3, i32 %4, i32 %5, i32* %9)
%15 = tail call i32 @convolve(i32* %13, i32* null, i32 %4, i32 %5, i32 %6, i32* %11)
ret void
}