#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 */
unsigned char bmul(unsigned char, unsigned char);
int /*<<< orphan*/ unpack(unsigned long, unsigned char *);
unsigned char product(unsigned long x, unsigned long y) {
  unsigned char xb[4], yb[4];
  unpack(x, xb);
  unpack(y, yb);
  return bmul(xb[0], yb[0]) ^ bmul(xb[1], yb[1]) ^ bmul(xb[2], yb[2]) ^
         bmul(xb[3], yb[3]);
}


x86 assembly (clang, -O0):
<product>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <unpack@plt>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <unpack@plt>
mov    -0x14(%rbp),%al
movzbl %al,%edi
movzbl -0x18(%rbp),%esi
call   1040 <bmul@plt>
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x13(%rbp),%al
movzbl %al,%edi
movzbl -0x17(%rbp),%esi
call   1040 <bmul@plt>
mov    %al,%cl
mov    -0x24(%rbp),%eax
movzbl %cl,%ecx
xor    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x12(%rbp),%al
movzbl %al,%edi
movzbl -0x16(%rbp),%esi
call   1040 <bmul@plt>
mov    %al,%cl
mov    -0x20(%rbp),%eax
movzbl %cl,%ecx
xor    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x11(%rbp),%al
movzbl %al,%edi
movzbl -0x15(%rbp),%esi
call   1040 <bmul@plt>
mov    %al,%cl
mov    -0x1c(%rbp),%eax
movzbl %cl,%ecx
xor    %ecx,%eax
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<product>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
lea    0x4(%rsp),%rsi
call   1030 <unpack@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <unpack@plt>
movzbl 0x4(%rsp),%edi
movzbl (%rsp),%esi
call   1040 <bmul@plt>
mov    %eax,%ebp
movzbl 0x5(%rsp),%edi
movzbl 0x1(%rsp),%esi
call   1040 <bmul@plt>
mov    %eax,%ebx
xor    %bpl,%bl
movzbl 0x6(%rsp),%edi
movzbl 0x2(%rsp),%esi
call   1040 <bmul@plt>
mov    %eax,%ebp
movzbl 0x7(%rsp),%edi
movzbl 0x3(%rsp),%esi
call   1040 <bmul@plt>
xor    %bpl,%al
xor    %bl,%al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i8 @product(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca [4 x i8]
%6 = alloca [4 x i8]
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%9 = call i32 @unpack(i64 %7, i8* %8)
%10 = load i64, i64* %4
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%12 = call i32 @unpack(i64 %10, i8* %11)
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%14 = load i8, i8* %13
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%16 = load i8, i8* %15
%17 = call zeroext i8 @bmul(i8 zeroext %14, i8 zeroext %16)
%18 = zext i8 %17 to i32
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 1
%20 = load i8, i8* %19
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 1
%22 = load i8, i8* %21
%23 = call zeroext i8 @bmul(i8 zeroext %20, i8 zeroext %22)
%24 = zext i8 %23 to i32
%25 = xor i32 %18, %24
%26 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 2
%27 = load i8, i8* %26
%28 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 2
%29 = load i8, i8* %28
%30 = call zeroext i8 @bmul(i8 zeroext %27, i8 zeroext %29)
%31 = zext i8 %30 to i32
%32 = xor i32 %25, %31
%33 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 3
%34 = load i8, i8* %33
%35 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 3
%36 = load i8, i8* %35
%37 = call zeroext i8 @bmul(i8 zeroext %34, i8 zeroext %36)
%38 = zext i8 %37 to i32
%39 = xor i32 %32, %38
%40 = trunc i32 %39 to i8
ret i8 %40
}

LLVM IR (-O2):
define zeroext i8 @product(i64 %0, i64 %1) {
%3 = alloca [4 x i8]
%4 = alloca [4 x i8]
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%7 = call i32 @unpack(i64 %0, i8* %5)
%8 = call i32 @unpack(i64 %1, i8* %6)
%9 = load i8, i8* %5
%10 = load i8, i8* %6
%11 = call zeroext i8 @bmul(i8 zeroext %9, i8 zeroext %10)
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
%13 = load i8, i8* %12
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 1
%15 = load i8, i8* %14
%16 = call zeroext i8 @bmul(i8 zeroext %13, i8 zeroext %15)
%17 = xor i8 %16, %11
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
%19 = load i8, i8* %18
%20 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 2
%21 = load i8, i8* %20
%22 = call zeroext i8 @bmul(i8 zeroext %19, i8 zeroext %21)
%23 = xor i8 %17, %22
%24 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
%25 = load i8, i8* %24
%26 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 3
%27 = load i8, i8* %26
%28 = call zeroext i8 @bmul(i8 zeroext %25, i8 zeroext %27)
%29 = xor i8 %23, %28
ret i8 %29
}