#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 uint32_t;

/* Variables and functions */
void Interp1(uint32_t *pc, uint32_t c1, uint32_t c2) {
  if (c1 == c2) {
    *pc = c1;
    return;
  }
  *pc = ((((c1 & 0x00FF00) * 3 + (c2 & 0x00FF00)) >> 2) & 0x00FF00) +
        ((((c1 & 0xFF00FF) * 3 + (c2 & 0xFF00FF)) >> 2) & 0xFF00FF);
}


x86 assembly (clang, -O0):
<Interp1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1128 <Interp1+0x28>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
jmp    116c <Interp1+0x6c>
mov    -0xc(%rbp),%eax
and    $0xff00,%eax
imul   $0x3,%eax,%ecx
mov    -0x10(%rbp),%eax
and    $0xff00,%eax
add    %eax,%ecx
sar    $0x2,%ecx
and    $0xff00,%ecx
mov    -0xc(%rbp),%eax
and    $0xff00ff,%eax
imul   $0x3,%eax,%eax
mov    -0x10(%rbp),%edx
and    $0xff00ff,%edx
add    %edx,%eax
sar    $0x2,%eax
and    $0xff00ff,%eax
add    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp1>:
cmp    %edx,%esi
je     113f <Interp1+0x3f>
mov    %esi,%eax
and    $0xff00,%eax
lea    (%rax,%rax,2),%eax
mov    %edx,%ecx
and    $0xff00,%ecx
add    %eax,%ecx
shr    $0x2,%ecx
and    $0xff00,%ecx
and    $0xff00ff,%esi
lea    (%rsi,%rsi,2),%eax
and    $0xff00ff,%edx
add    %eax,%edx
shr    $0x2,%edx
and    $0xff00ff,%edx
or     %ecx,%edx
mov    %edx,%esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @Interp1(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
br label %32
13: ; preds = %3
%14 = load i32, i32* %5
%15 = and i32 %14, 65280
%16 = mul nsw i32 %15, 3
%17 = load i32, i32* %6
%18 = and i32 %17, 65280
%19 = add nsw i32 %16, %18
%20 = ashr i32 %19, 2
%21 = and i32 %20, 65280
%22 = load i32, i32* %5
%23 = and i32 %22, 16711935
%24 = mul nsw i32 %23, 3
%25 = load i32, i32* %6
%26 = and i32 %25, 16711935
%27 = add nsw i32 %24, %26
%28 = ashr i32 %27, 2
%29 = and i32 %28, 16711935
%30 = add nsw i32 %21, %29
%31 = load i32*, i32** %4
store i32 %30, i32* %31
br label %32
32: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
define void @Interp1(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, %2
br i1 %4, label %19, label %5
5: ; preds = %3
%6 = and i32 %1, 65280
%7 = mul nuw nsw i32 %6, 3
%8 = and i32 %2, 65280
%9 = add nuw nsw i32 %7, %8
%10 = lshr exact i32 %9, 2
%11 = and i32 %10, 65280
%12 = and i32 %1, 16711935
%13 = mul nuw nsw i32 %12, 3
%14 = and i32 %2, 16711935
%15 = add nuw nsw i32 %13, %14
%16 = lshr i32 %15, 2
%17 = and i32 %16, 16711935
%18 = or i32 %11, %17
br label %19
19: ; preds = %3, %5
%20 = phi i32 [ %18, %5 ], [ %1, %3 ]
store i32 %20, i32* %0
ret void
}