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

/* Variables and functions */
int /*<<< orphan*/ Round(int /*<<< orphan*/ **, int /*<<< orphan*/ **, size_t);
void KeccakF1600(uint64_t A[5][5]) {
  uint64_t T[5][5];
  size_t i;
  A[0][1] = ~A[0][1];
  A[0][2] = ~A[0][2];
  A[1][3] = ~A[1][3];
  A[2][2] = ~A[2][2];
  A[3][2] = ~A[3][2];
  A[4][0] = ~A[4][0];
  for (i = 0; i < 24; i += 2) {
    Round(T, A, i);
    Round(A, T, i + 1);
  }
  A[0][1] = ~A[0][1];
  A[0][2] = ~A[0][2];
  A[1][3] = ~A[1][3];
  A[2][2] = ~A[2][2];
  A[3][2] = ~A[3][2];
  A[4][0] = ~A[4][0];
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x20(%rax)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x30(%rax)
mov    -0x8(%rbp),%rax
mov    0x44(%rax),%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x44(%rax)
mov    -0x8(%rbp),%rax
mov    0x50(%rax),%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x50(%rax)
movq   $0x0,-0x78(%rbp)
cmpq   $0x18,-0x78(%rbp)
jae    11cf <KeccakF1600+0xbf>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x78(%rbp),%rdx
call   1030 <Round@plt>
mov    -0x8(%rbp),%rdi
lea    -0x70(%rbp),%rsi
mov    -0x78(%rbp),%rdx
add    $0x1,%rdx
call   1030 <Round@plt>
mov    -0x78(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x78(%rbp)
jmp    118d <KeccakF1600+0x7d>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x20(%rax)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x30(%rax)
mov    -0x8(%rbp),%rax
mov    0x44(%rax),%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x44(%rax)
mov    -0x8(%rbp),%rax
mov    0x50(%rax),%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x50(%rax)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rdi,%rbx
notl   0x4(%rdi)
notl   0x8(%rdi)
notl   0x20(%rdi)
notl   0x30(%rdi)
notl   0x44(%rdi)
notl   0x50(%rdi)
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <Round@plt>
mov    $0x1,%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <Round@plt>
mov    $0x2,%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <Round@plt>
mov    $0x3,%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <Round@plt>
mov    $0x4,%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <Round@plt>
mov    $0x5,%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <Round@plt>
mov    $0x6,%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <Round@plt>
mov    $0x7,%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <Round@plt>
mov    $0x8,%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <Round@plt>
mov    $0x9,%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <Round@plt>
mov    $0xa,%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <Round@plt>
mov    $0xb,%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <Round@plt>
mov    $0xc,%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <Round@plt>
mov    $0xd,%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <Round@plt>
mov    $0xe,%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <Round@plt>
mov    $0xf,%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <Round@plt>
mov    $0x10,%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <Round@plt>
mov    $0x11,%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <Round@plt>
mov    $0x12,%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <Round@plt>
mov    $0x13,%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <Round@plt>
mov    $0x14,%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <Round@plt>
mov    $0x15,%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <Round@plt>
mov    $0x16,%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <Round@plt>
mov    $0x17,%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <Round@plt>
notl   0x4(%rbx)
notl   0x8(%rbx)
notl   0x20(%rbx)
notl   0x30(%rbx)
notl   0x44(%rbx)
notl   0x50(%rbx)
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @KeccakF1600([5 x i32]* %0) {
%2 = alloca [5 x i32]*
%3 = alloca [5 x [5 x i32]]
%4 = alloca i64
store [5 x i32]* %0, [5 x i32]** %2
%5 = load [5 x i32]*, [5 x i32]** %2
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 1
%8 = load i32, i32* %7
%9 = xor i32 %8, -1
%10 = load [5 x i32]*, [5 x i32]** %2
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %10, i64 0
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %11, i64 0, i64 1
store i32 %9, i32* %12
%13 = load [5 x i32]*, [5 x i32]** %2
%14 = getelementptr inbounds [5 x i32], [5 x i32]* %13, i64 0
%15 = getelementptr inbounds [5 x i32], [5 x i32]* %14, i64 0, i64 2
%16 = load i32, i32* %15
%17 = xor i32 %16, -1
%18 = load [5 x i32]*, [5 x i32]** %2
%19 = getelementptr inbounds [5 x i32], [5 x i32]* %18, i64 0
%20 = getelementptr inbounds [5 x i32], [5 x i32]* %19, i64 0, i64 2
store i32 %17, i32* %20
%21 = load [5 x i32]*, [5 x i32]** %2
%22 = getelementptr inbounds [5 x i32], [5 x i32]* %21, i64 1
%23 = getelementptr inbounds [5 x i32], [5 x i32]* %22, i64 0, i64 3
%24 = load i32, i32* %23
%25 = xor i32 %24, -1
%26 = load [5 x i32]*, [5 x i32]** %2
%27 = getelementptr inbounds [5 x i32], [5 x i32]* %26, i64 1
%28 = getelementptr inbounds [5 x i32], [5 x i32]* %27, i64 0, i64 3
store i32 %25, i32* %28
%29 = load [5 x i32]*, [5 x i32]** %2
%30 = getelementptr inbounds [5 x i32], [5 x i32]* %29, i64 2
%31 = getelementptr inbounds [5 x i32], [5 x i32]* %30, i64 0, i64 2
%32 = load i32, i32* %31
%33 = xor i32 %32, -1
%34 = load [5 x i32]*, [5 x i32]** %2
%35 = getelementptr inbounds [5 x i32], [5 x i32]* %34, i64 2
%36 = getelementptr inbounds [5 x i32], [5 x i32]* %35, i64 0, i64 2
store i32 %33, i32* %36
%37 = load [5 x i32]*, [5 x i32]** %2
%38 = getelementptr inbounds [5 x i32], [5 x i32]* %37, i64 3
%39 = getelementptr inbounds [5 x i32], [5 x i32]* %38, i64 0, i64 2
%40 = load i32, i32* %39
%41 = xor i32 %40, -1
%42 = load [5 x i32]*, [5 x i32]** %2
%43 = getelementptr inbounds [5 x i32], [5 x i32]* %42, i64 3
%44 = getelementptr inbounds [5 x i32], [5 x i32]* %43, i64 0, i64 2
store i32 %41, i32* %44
%45 = load [5 x i32]*, [5 x i32]** %2
%46 = getelementptr inbounds [5 x i32], [5 x i32]* %45, i64 4
%47 = getelementptr inbounds [5 x i32], [5 x i32]* %46, i64 0, i64 0
%48 = load i32, i32* %47
%49 = xor i32 %48, -1
%50 = load [5 x i32]*, [5 x i32]** %2
%51 = getelementptr inbounds [5 x i32], [5 x i32]* %50, i64 4
%52 = getelementptr inbounds [5 x i32], [5 x i32]* %51, i64 0, i64 0
store i32 %49, i32* %52
store i64 0, i64* %4
br label %53
53: ; preds = %70, %1
%54 = load i64, i64* %4
%55 = icmp ult i64 %54, 24
br i1 %55, label %56, label %73
56: ; preds = %53
%57 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 0
%58 = bitcast [5 x i32]* %57 to i32**
%59 = load [5 x i32]*, [5 x i32]** %2
%60 = bitcast [5 x i32]* %59 to i32**
%61 = load i64, i64* %4
%62 = call i32 @Round(i32** %58, i32** %60, i64 %61)
%63 = load [5 x i32]*, [5 x i32]** %2
%64 = bitcast [5 x i32]* %63 to i32**
%65 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 0
%66 = bitcast [5 x i32]* %65 to i32**
%67 = load i64, i64* %4
%68 = add i64 %67, 1
%69 = call i32 @Round(i32** %64, i32** %66, i64 %68)
br label %70
70: ; preds = %56
%71 = load i64, i64* %4
%72 = add i64 %71, 2
store i64 %72, i64* %4
br label %53
73: ; preds = %53
%74 = load [5 x i32]*, [5 x i32]** %2
%75 = getelementptr inbounds [5 x i32], [5 x i32]* %74, i64 0
%76 = getelementptr inbounds [5 x i32], [5 x i32]* %75, i64 0, i64 1
%77 = load i32, i32* %76
%78 = xor i32 %77, -1
%79 = load [5 x i32]*, [5 x i32]** %2
%80 = getelementptr inbounds [5 x i32], [5 x i32]* %79, i64 0
%81 = getelementptr inbounds [5 x i32], [5 x i32]* %80, i64 0, i64 1
store i32 %78, i32* %81
%82 = load [5 x i32]*, [5 x i32]** %2
%83 = getelementptr inbounds [5 x i32], [5 x i32]* %82, i64 0
%84 = getelementptr inbounds [5 x i32], [5 x i32]* %83, i64 0, i64 2
%85 = load i32, i32* %84
%86 = xor i32 %85, -1
%87 = load [5 x i32]*, [5 x i32]** %2
%88 = getelementptr inbounds [5 x i32], [5 x i32]* %87, i64 0
%89 = getelementptr inbounds [5 x i32], [5 x i32]* %88, i64 0, i64 2
store i32 %86, i32* %89
%90 = load [5 x i32]*, [5 x i32]** %2
%91 = getelementptr inbounds [5 x i32], [5 x i32]* %90, i64 1
%92 = getelementptr inbounds [5 x i32], [5 x i32]* %91, i64 0, i64 3
%93 = load i32, i32* %92
%94 = xor i32 %93, -1
%95 = load [5 x i32]*, [5 x i32]** %2
%96 = getelementptr inbounds [5 x i32], [5 x i32]* %95, i64 1
%97 = getelementptr inbounds [5 x i32], [5 x i32]* %96, i64 0, i64 3
store i32 %94, i32* %97
%98 = load [5 x i32]*, [5 x i32]** %2
%99 = getelementptr inbounds [5 x i32], [5 x i32]* %98, i64 2
%100 = getelementptr inbounds [5 x i32], [5 x i32]* %99, i64 0, i64 2
%101 = load i32, i32* %100
%102 = xor i32 %101, -1
%103 = load [5 x i32]*, [5 x i32]** %2
%104 = getelementptr inbounds [5 x i32], [5 x i32]* %103, i64 2
%105 = getelementptr inbounds [5 x i32], [5 x i32]* %104, i64 0, i64 2
store i32 %102, i32* %105
%106 = load [5 x i32]*, [5 x i32]** %2
%107 = getelementptr inbounds [5 x i32], [5 x i32]* %106, i64 3
%108 = getelementptr inbounds [5 x i32], [5 x i32]* %107, i64 0, i64 2
%109 = load i32, i32* %108
%110 = xor i32 %109, -1
%111 = load [5 x i32]*, [5 x i32]** %2
%112 = getelementptr inbounds [5 x i32], [5 x i32]* %111, i64 3
%113 = getelementptr inbounds [5 x i32], [5 x i32]* %112, i64 0, i64 2
store i32 %110, i32* %113
%114 = load [5 x i32]*, [5 x i32]** %2
%115 = getelementptr inbounds [5 x i32], [5 x i32]* %114, i64 4
%116 = getelementptr inbounds [5 x i32], [5 x i32]* %115, i64 0, i64 0
%117 = load i32, i32* %116
%118 = xor i32 %117, -1
%119 = load [5 x i32]*, [5 x i32]** %2
%120 = getelementptr inbounds [5 x i32], [5 x i32]* %119, i64 4
%121 = getelementptr inbounds [5 x i32], [5 x i32]* %120, i64 0, i64 0
store i32 %118, i32* %121
ret void
}

LLVM IR (-O2):
define void @KeccakF1600([5 x i32]* %0) {
%2 = alloca [5 x [5 x i32]]
%3 = bitcast [5 x [5 x i32]]* %2 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 0, i64 1
%5 = load i32, i32* %4
%6 = xor i32 %5, -1
store i32 %6, i32* %4
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 0, i64 2
%8 = load i32, i32* %7
%9 = xor i32 %8, -1
store i32 %9, i32* %7
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 1, i64 3
%11 = load i32, i32* %10
%12 = xor i32 %11, -1
store i32 %12, i32* %10
%13 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 2, i64 2
%14 = load i32, i32* %13
%15 = xor i32 %14, -1
store i32 %15, i32* %13
%16 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 3, i64 2
%17 = load i32, i32* %16
%18 = xor i32 %17, -1
store i32 %18, i32* %16
%19 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 4, i64 0
%20 = load i32, i32* %19
%21 = xor i32 %20, -1
store i32 %21, i32* %19
%22 = bitcast [5 x [5 x i32]]* %2 to i32**
%23 = bitcast [5 x i32]* %0 to i32**
%24 = call i32 @Round(i32** %22, i32** %23, i64 0)
%25 = call i32 @Round(i32** %23, i32** %22, i64 1)
%26 = call i32 @Round(i32** %22, i32** %23, i64 2)
%27 = call i32 @Round(i32** %23, i32** %22, i64 3)
%28 = call i32 @Round(i32** %22, i32** %23, i64 4)
%29 = call i32 @Round(i32** %23, i32** %22, i64 5)
%30 = call i32 @Round(i32** %22, i32** %23, i64 6)
%31 = call i32 @Round(i32** %23, i32** %22, i64 7)
%32 = call i32 @Round(i32** %22, i32** %23, i64 8)
%33 = call i32 @Round(i32** %23, i32** %22, i64 9)
%34 = call i32 @Round(i32** %22, i32** %23, i64 10)
%35 = call i32 @Round(i32** %23, i32** %22, i64 11)
%36 = call i32 @Round(i32** %22, i32** %23, i64 12)
%37 = call i32 @Round(i32** %23, i32** %22, i64 13)
%38 = call i32 @Round(i32** %22, i32** %23, i64 14)
%39 = call i32 @Round(i32** %23, i32** %22, i64 15)
%40 = call i32 @Round(i32** %22, i32** %23, i64 16)
%41 = call i32 @Round(i32** %23, i32** %22, i64 17)
%42 = call i32 @Round(i32** %22, i32** %23, i64 18)
%43 = call i32 @Round(i32** %23, i32** %22, i64 19)
%44 = call i32 @Round(i32** %22, i32** %23, i64 20)
%45 = call i32 @Round(i32** %23, i32** %22, i64 21)
%46 = call i32 @Round(i32** %22, i32** %23, i64 22)
%47 = call i32 @Round(i32** %23, i32** %22, i64 23)
%48 = load i32, i32* %4
%49 = xor i32 %48, -1
store i32 %49, i32* %4
%50 = load i32, i32* %7
%51 = xor i32 %50, -1
store i32 %51, i32* %7
%52 = load i32, i32* %10
%53 = xor i32 %52, -1
store i32 %53, i32* %10
%54 = load i32, i32* %13
%55 = xor i32 %54, -1
store i32 %55, i32* %13
%56 = load i32, i32* %16
%57 = xor i32 %56, -1
store i32 %57, i32* %16
%58 = load i32, i32* %19
%59 = xor i32 %58, -1
store i32 %59, i32* %19
ret void
}