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

/* Variables and functions */
int mul01(int);
int mul02(int);
int mul03(int);
void MixColumns(uint8_t *s0, uint8_t *s1, uint8_t *s2, uint8_t *s3) {
  uint8_t t0 = mul02(*s0) ^ mul03(*s1) ^ mul01(*s2) ^ mul01(*s3);
  uint8_t t1 = mul01(*s0) ^ mul02(*s1) ^ mul03(*s2) ^ mul01(*s3);
  uint8_t t2 = mul01(*s0) ^ mul01(*s1) ^ mul02(*s2) ^ mul03(*s3);
  uint8_t t3 = mul03(*s0) ^ mul01(*s1) ^ mul01(*s2) ^ mul02(*s3);
  *s0 = t0;
  *s1 = t1;
  *s2 = t2;
  *s3 = t3;
}


x86 assembly (clang, -O0):
<MixColumns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <mul02@plt>
mov    %eax,-0x60(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1040 <mul03@plt>
mov    %eax,%ecx
mov    -0x60(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1050 <mul01@plt>
mov    %eax,%ecx
mov    -0x5c(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x58(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   1050 <mul01@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1050 <mul01@plt>
mov    %eax,-0x54(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <mul02@plt>
mov    %eax,%ecx
mov    -0x54(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x50(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1040 <mul03@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   1050 <mul01@plt>
mov    %eax,%ecx
mov    -0x4c(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1050 <mul01@plt>
mov    %eax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1050 <mul01@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x44(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1030 <mul02@plt>
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x40(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   1040 <mul03@plt>
mov    %eax,%ecx
mov    -0x40(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <mul03@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1050 <mul01@plt>
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1050 <mul01@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   1030 <mul02@plt>
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x30(%rbp)
mov    -0x24(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x2c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x30(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MixColumns>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rcx,%r14
mov    %rcx,0x18(%rsp)
mov    %rdx,%rbx
mov    %rdx,0x20(%rsp)
mov    %rsi,%rbp
mov    %rdi,%rax
mov    (%rdi),%edi
mov    %rax,%r13
call   1030 <mul02@plt>
mov    %eax,%r15d
mov    0x0(%rbp),%edi
mov    %rbp,%r12
call   1040 <mul03@plt>
mov    %eax,%ebp
xor    %r15d,%ebp
mov    (%rbx),%edi
call   1050 <mul01@plt>
mov    %eax,%ebx
mov    (%r14),%edi
call   1050 <mul01@plt>
xor    %ebx,%eax
xor    %ebp,%eax
mov    %eax,0x4(%rsp)
mov    0x0(%r13),%edi
mov    %r13,%r15
mov    %r13,0x10(%rsp)
call   1050 <mul01@plt>
mov    %eax,%ebx
mov    (%r12),%edi
mov    %r12,0x8(%rsp)
call   1030 <mul02@plt>
mov    %eax,%ebp
xor    %ebx,%ebp
mov    0x20(%rsp),%r13
mov    0x0(%r13),%edi
call   1040 <mul03@plt>
mov    %eax,%r14d
mov    0x18(%rsp),%rax
mov    (%rax),%edi
call   1050 <mul01@plt>
mov    %eax,%ebx
xor    %r14d,%ebx
xor    %ebp,%ebx
mov    (%r15),%edi
call   1050 <mul01@plt>
mov    %eax,%ebp
mov    (%r12),%edi
call   1050 <mul01@plt>
mov    %eax,%r12d
xor    %ebp,%r12d
mov    0x0(%r13),%edi
call   1030 <mul02@plt>
mov    %eax,%ebp
mov    0x18(%rsp),%r15
mov    (%r15),%edi
call   1040 <mul03@plt>
mov    %eax,%r14d
xor    %ebp,%r14d
xor    %r12d,%r14d
mov    0x10(%rsp),%rax
mov    (%rax),%edi
call   1040 <mul03@plt>
mov    %eax,%r12d
mov    0x8(%rsp),%rax
mov    (%rax),%edi
call   1050 <mul01@plt>
mov    %eax,%ebp
xor    %r12d,%ebp
mov    0x0(%r13),%edi
call   1050 <mul01@plt>
mov    %eax,%r12d
mov    (%r15),%edi
call   1030 <mul02@plt>
xor    %r12d,%eax
xor    %ebp,%eax
mov    0x4(%rsp),%ecx
mov    0x10(%rsp),%rdx
mov    %ecx,(%rdx)
mov    0x8(%rsp),%rcx
mov    %ebx,(%rcx)
mov    %r14d,0x0(%r13)
mov    %eax,(%r15)
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @MixColumns(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = call i32 @mul02(i32 %14)
%16 = load i32*, i32** %6
%17 = load i32, i32* %16
%18 = call i32 @mul03(i32 %17)
%19 = xor i32 %15, %18
%20 = load i32*, i32** %7
%21 = load i32, i32* %20
%22 = call i32 @mul01(i32 %21)
%23 = xor i32 %19, %22
%24 = load i32*, i32** %8
%25 = load i32, i32* %24
%26 = call i32 @mul01(i32 %25)
%27 = xor i32 %23, %26
store i32 %27, i32* %9
%28 = load i32*, i32** %5
%29 = load i32, i32* %28
%30 = call i32 @mul01(i32 %29)
%31 = load i32*, i32** %6
%32 = load i32, i32* %31
%33 = call i32 @mul02(i32 %32)
%34 = xor i32 %30, %33
%35 = load i32*, i32** %7
%36 = load i32, i32* %35
%37 = call i32 @mul03(i32 %36)
%38 = xor i32 %34, %37
%39 = load i32*, i32** %8
%40 = load i32, i32* %39
%41 = call i32 @mul01(i32 %40)
%42 = xor i32 %38, %41
store i32 %42, i32* %10
%43 = load i32*, i32** %5
%44 = load i32, i32* %43
%45 = call i32 @mul01(i32 %44)
%46 = load i32*, i32** %6
%47 = load i32, i32* %46
%48 = call i32 @mul01(i32 %47)
%49 = xor i32 %45, %48
%50 = load i32*, i32** %7
%51 = load i32, i32* %50
%52 = call i32 @mul02(i32 %51)
%53 = xor i32 %49, %52
%54 = load i32*, i32** %8
%55 = load i32, i32* %54
%56 = call i32 @mul03(i32 %55)
%57 = xor i32 %53, %56
store i32 %57, i32* %11
%58 = load i32*, i32** %5
%59 = load i32, i32* %58
%60 = call i32 @mul03(i32 %59)
%61 = load i32*, i32** %6
%62 = load i32, i32* %61
%63 = call i32 @mul01(i32 %62)
%64 = xor i32 %60, %63
%65 = load i32*, i32** %7
%66 = load i32, i32* %65
%67 = call i32 @mul01(i32 %66)
%68 = xor i32 %64, %67
%69 = load i32*, i32** %8
%70 = load i32, i32* %69
%71 = call i32 @mul02(i32 %70)
%72 = xor i32 %68, %71
store i32 %72, i32* %12
%73 = load i32, i32* %9
%74 = load i32*, i32** %5
store i32 %73, i32* %74
%75 = load i32, i32* %10
%76 = load i32*, i32** %6
store i32 %75, i32* %76
%77 = load i32, i32* %11
%78 = load i32*, i32** %7
store i32 %77, i32* %78
%79 = load i32, i32* %12
%80 = load i32*, i32** %8
store i32 %79, i32* %80
ret void
}

LLVM IR (-O2):
define void @MixColumns(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3) {
%5 = load i32, i32* %0
%6 = tail call i32 @mul02(i32 %5)
%7 = load i32, i32* %1
%8 = tail call i32 @mul03(i32 %7)
%9 = xor i32 %8, %6
%10 = load i32, i32* %2
%11 = tail call i32 @mul01(i32 %10)
%12 = xor i32 %9, %11
%13 = load i32, i32* %3
%14 = tail call i32 @mul01(i32 %13)
%15 = xor i32 %12, %14
%16 = load i32, i32* %0
%17 = tail call i32 @mul01(i32 %16)
%18 = load i32, i32* %1
%19 = tail call i32 @mul02(i32 %18)
%20 = xor i32 %19, %17
%21 = load i32, i32* %2
%22 = tail call i32 @mul03(i32 %21)
%23 = xor i32 %20, %22
%24 = load i32, i32* %3
%25 = tail call i32 @mul01(i32 %24)
%26 = xor i32 %23, %25
%27 = load i32, i32* %0
%28 = tail call i32 @mul01(i32 %27)
%29 = load i32, i32* %1
%30 = tail call i32 @mul01(i32 %29)
%31 = xor i32 %30, %28
%32 = load i32, i32* %2
%33 = tail call i32 @mul02(i32 %32)
%34 = xor i32 %31, %33
%35 = load i32, i32* %3
%36 = tail call i32 @mul03(i32 %35)
%37 = xor i32 %34, %36
%38 = load i32, i32* %0
%39 = tail call i32 @mul03(i32 %38)
%40 = load i32, i32* %1
%41 = tail call i32 @mul01(i32 %40)
%42 = xor i32 %41, %39
%43 = load i32, i32* %2
%44 = tail call i32 @mul01(i32 %43)
%45 = xor i32 %42, %44
%46 = load i32, i32* %3
%47 = tail call i32 @mul02(i32 %46)
%48 = xor i32 %45, %47
store i32 %15, i32* %0
store i32 %26, i32* %1
store i32 %37, i32* %2
store i32 %48, i32* %3
ret void
}