#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 Interp3(uint32_t *pc, uint32_t c1, uint32_t c2) {
  if (c1 == c2) {
    *pc = c1;
    return;
  }
  *pc = ((((c1 & 0x00FF00) * 7 + (c2 & 0x00FF00)) >> 3) & 0x00FF00) +
        ((((c1 & 0xFF00FF) * 7 + (c2 & 0xFF00FF)) >> 3) & 0xFF00FF);
}


x86 assembly (clang, -O0):
<Interp3>:
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 <Interp3+0x28>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
jmp    116c <Interp3+0x6c>
mov    -0xc(%rbp),%eax
and    $0xff00,%eax
imul   $0x7,%eax,%ecx
mov    -0x10(%rbp),%eax
and    $0xff00,%eax
add    %eax,%ecx
sar    $0x3,%ecx
and    $0xff00,%ecx
mov    -0xc(%rbp),%eax
and    $0xff00ff,%eax
imul   $0x7,%eax,%eax
mov    -0x10(%rbp),%edx
and    $0xff00ff,%edx
add    %edx,%eax
sar    $0x3,%eax
and    $0xff00ff,%eax
add    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp3>:
cmp    %edx,%esi
je     1149 <Interp3+0x49>
mov    %esi,%eax
and    $0xff00,%eax
lea    0x0(,%rax,8),%ecx
sub    %eax,%ecx
mov    %edx,%eax
and    $0xff00,%eax
add    %ecx,%eax
shr    $0x3,%eax
and    $0xff00,%eax
and    $0xff00ff,%esi
lea    0x0(,%rsi,8),%ecx
sub    %esi,%ecx
and    $0xff00ff,%edx
add    %ecx,%edx
shr    $0x3,%edx
and    $0xff00ff,%edx
or     %eax,%edx
mov    %edx,%esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @Interp3(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, 7
%17 = load i32, i32* %6
%18 = and i32 %17, 65280
%19 = add nsw i32 %16, %18
%20 = ashr i32 %19, 3
%21 = and i32 %20, 65280
%22 = load i32, i32* %5
%23 = and i32 %22, 16711935
%24 = mul nsw i32 %23, 7
%25 = load i32, i32* %6
%26 = and i32 %25, 16711935
%27 = add nsw i32 %24, %26
%28 = ashr i32 %27, 3
%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 @Interp3(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, 7
%8 = and i32 %2, 65280
%9 = add nuw nsw i32 %7, %8
%10 = lshr exact i32 %9, 3
%11 = and i32 %10, 65280
%12 = and i32 %1, 16711935
%13 = mul nuw nsw i32 %12, 7
%14 = and i32 %2, 16711935
%15 = add nuw nsw i32 %13, %14
%16 = lshr i32 %15, 3
%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
}