#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*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ x264_median(int /*<<< orphan*/, int /*<<< orphan*/,
                               int /*<<< orphan*/);
void x264_median_mv(int16_t *dst, int16_t *a, int16_t *b, int16_t *c) {
  dst[0] = x264_median(a[0], b[0], c[0]);
  dst[1] = x264_median(a[1], b[1], c[1]);
}


x86 assembly (clang, -O0):
<x264_median_mv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
call   1030 <x264_median@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%edx
call   1030 <x264_median@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x264_median_mv>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r12
mov    (%rsi),%edi
mov    (%rdx),%esi
mov    (%rcx),%edx
call   1030 <x264_median@plt>
mov    %eax,(%r12)
mov    0x4(%rbx),%edi
mov    0x4(%r15),%esi
mov    0x4(%r14),%edx
call   1030 <x264_median@plt>
mov    %eax,0x4(%r12)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @x264_median_mv(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %6
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = load i32*, i32** %7
%13 = getelementptr inbounds i32, i32* %12, i64 0
%14 = load i32, i32* %13
%15 = load i32*, i32** %8
%16 = getelementptr inbounds i32, i32* %15, i64 0
%17 = load i32, i32* %16
%18 = call i32 @x264_median(i32 %11, i32 %14, i32 %17)
%19 = load i32*, i32** %5
%20 = getelementptr inbounds i32, i32* %19, i64 0
store i32 %18, i32* %20
%21 = load i32*, i32** %6
%22 = getelementptr inbounds i32, i32* %21, i64 1
%23 = load i32, i32* %22
%24 = load i32*, i32** %7
%25 = getelementptr inbounds i32, i32* %24, i64 1
%26 = load i32, i32* %25
%27 = load i32*, i32** %8
%28 = getelementptr inbounds i32, i32* %27, i64 1
%29 = load i32, i32* %28
%30 = call i32 @x264_median(i32 %23, i32 %26, i32 %29)
%31 = load i32*, i32** %5
%32 = getelementptr inbounds i32, i32* %31, i64 1
store i32 %30, i32* %32
ret void
}

LLVM IR (-O2):
define void @x264_median_mv(i32* nocapture writeonly %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3) {
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = tail call i32 @x264_median(i32 %5, i32 %6, i32 %7)
store i32 %8, i32* %0
%9 = getelementptr inbounds i32, i32* %1, i64 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds i32, i32* %2, i64 1
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %3, i64 1
%14 = load i32, i32* %13
%15 = tail call i32 @x264_median(i32 %10, i32 %12, i32 %14)
%16 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %15, i32* %16
ret void
}