#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 */
int gmult(int, int);
void compute_next_omega(int d, int A[], int dst[], int src[]) {
  int i;
  for (i = 0; i < (32 * 2); i++) {
    dst[i] = src[i] ^ gmult(d, A[i]);
  }
}


x86 assembly (clang, -O0):
<compute_next_omega>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x40,-0x24(%rbp)
jge    1177 <compute_next_omega+0x67>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <gmult@plt>
mov    -0x28(%rbp),%edx
xor    %eax,%edx
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    112e <compute_next_omega+0x1e>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_next_omega>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %edi,%r13d
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%ebp
mov    (%r12,%rbx,4),%esi
mov    %r13d,%edi
call   1030 <gmult@plt>
xor    %ebp,%eax
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    $0x40,%rbx
jne    1130 <compute_next_omega+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @compute_next_omega(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
store i32 0, i32* %9
br label %10
10: ; preds = %31, %4
%11 = load i32, i32* %9
%12 = icmp slt i32 %11, 64
br i1 %12, label %13, label %34
13: ; preds = %10
%14 = load i32*, i32** %8
%15 = load i32, i32* %9
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %5
%20 = load i32*, i32** %6
%21 = load i32, i32* %9
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
%24 = load i32, i32* %23
%25 = call i32 @gmult(i32 %19, i32 %24)
%26 = xor i32 %18, %25
%27 = load i32*, i32** %7
%28 = load i32, i32* %9
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %27, i64 %29
store i32 %26, i32* %30
br label %31
31: ; preds = %13
%32 = load i32, i32* %9
%33 = add nsw i32 %32, 1
store i32 %33, i32* %9
br label %10
34: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @compute_next_omega(i32 %0, i32* nocapture %1, i32* nocapture writeonly %2, i32* nocapture %3) {
br label %5
5: ; preds = %4, %5
%6 = phi i64 [ 0, %4 ], [ %14, %5 ]
%7 = getelementptr inbounds i32, i32* %3, i64 %6
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %1, i64 %6
%10 = load i32, i32* %9
%11 = tail call i32 @gmult(i32 %0, i32 %10)
%12 = xor i32 %11, %8
%13 = getelementptr inbounds i32, i32* %2, i64 %6
store i32 %12, i32* %13
%14 = add nuw nsw i64 %6, 1
%15 = icmp eq i64 %14, 64
br i1 %15, label %16, label %5
16: ; preds = %5
ret void
}