#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 /*<<< orphan*/ gen_chain(unsigned char *, unsigned char *,
                             unsigned char const *, int);
int /*<<< orphan*/ gen_chain_8x(unsigned char *, unsigned char *,
                                unsigned char const *, int);
void gen_fullchains(unsigned char x[67 * 32],
                    const unsigned char masks[((1 << 4) - 1) * 32]) {
  int i;
  for (i = 0; i < 64; i += 8)
    gen_chain_8x(x + i * 32, x + i * 32, masks, (1 << 4) - 1);
  for (i = 64; i < 67; i++)
    gen_chain(x + i * 32, x + i * 32, masks, (1 << 4) - 1);
}


x86 assembly (clang, -O0):
<gen_fullchains>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x40,-0x14(%rbp)
jge    117b <gen_fullchains+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%eax
shl    $0x5,%eax
cltq
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%eax
shl    $0x5,%eax
cltq
add    %rax,%rsi
mov    -0x10(%rbp),%rdx
mov    $0xf,%ecx
call   1040 <gen_chain_8x@plt>
mov    -0x14(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <gen_fullchains+0x17>
movl   $0x40,-0x14(%rbp)
cmpl   $0x43,-0x14(%rbp)
jge    11c6 <gen_fullchains+0xa6>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%eax
shl    $0x5,%eax
cltq
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%eax
shl    $0x5,%eax
cltq
add    %rax,%rsi
mov    -0x10(%rbp),%rdx
mov    $0xf,%ecx
call   1030 <gen_chain@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1182 <gen_fullchains+0x62>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_fullchains>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdi,%rsi
mov    %r14,%rdx
mov    $0xf,%ecx
call   1040 <gen_chain_8x@plt>
lea    0x100(%rbx),%rdi
mov    %rdi,%rsi
mov    %r14,%rdx
mov    $0xf,%ecx
call   1040 <gen_chain_8x@plt>
lea    0x200(%rbx),%rdi
mov    %rdi,%rsi
mov    %r14,%rdx
mov    $0xf,%ecx
call   1040 <gen_chain_8x@plt>
lea    0x300(%rbx),%rdi
mov    %rdi,%rsi
mov    %r14,%rdx
mov    $0xf,%ecx
call   1040 <gen_chain_8x@plt>
lea    0x400(%rbx),%rdi
mov    %rdi,%rsi
mov    %r14,%rdx
mov    $0xf,%ecx
call   1040 <gen_chain_8x@plt>
lea    0x500(%rbx),%rdi
mov    %rdi,%rsi
mov    %r14,%rdx
mov    $0xf,%ecx
call   1040 <gen_chain_8x@plt>
lea    0x600(%rbx),%rdi
mov    %rdi,%rsi
mov    %r14,%rdx
mov    $0xf,%ecx
call   1040 <gen_chain_8x@plt>
lea    0x700(%rbx),%rdi
mov    %rdi,%rsi
mov    %r14,%rdx
mov    $0xf,%ecx
call   1040 <gen_chain_8x@plt>
lea    0x800(%rbx),%rdi
mov    %rdi,%rsi
mov    %r14,%rdx
mov    $0xf,%ecx
call   1030 <gen_chain@plt>
lea    0x820(%rbx),%rdi
mov    %rdi,%rsi
mov    %r14,%rdx
mov    $0xf,%ecx
call   1030 <gen_chain@plt>
add    $0x840,%rbx
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0xf,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <gen_chain@plt>

LLVM IR (-O0):
define void @gen_fullchains(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %6
6: ; preds = %22, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 64
br i1 %8, label %9, label %25
9: ; preds = %6
%10 = load i8*, i8** %3
%11 = load i32, i32* %5
%12 = mul nsw i32 %11, 32
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %10, i64 %13
%15 = load i8*, i8** %3
%16 = load i32, i32* %5
%17 = mul nsw i32 %16, 32
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %15, i64 %18
%20 = load i8*, i8** %4
%21 = call i32 @gen_chain_8x(i8* %14, i8* %19, i8* %20, i32 15)
br label %22
22: ; preds = %9
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 8
store i32 %24, i32* %5
br label %6
25: ; preds = %6
store i32 64, i32* %5
br label %26
26: ; preds = %42, %25
%27 = load i32, i32* %5
%28 = icmp slt i32 %27, 67
br i1 %28, label %29, label %45
29: ; preds = %26
%30 = load i8*, i8** %3
%31 = load i32, i32* %5
%32 = mul nsw i32 %31, 32
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %30, i64 %33
%35 = load i8*, i8** %3
%36 = load i32, i32* %5
%37 = mul nsw i32 %36, 32
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %35, i64 %38
%40 = load i8*, i8** %4
%41 = call i32 @gen_chain(i8* %34, i8* %39, i8* %40, i32 15)
br label %42
42: ; preds = %29
%43 = load i32, i32* %5
%44 = add nsw i32 %43, 1
store i32 %44, i32* %5
br label %26
45: ; preds = %26
ret void
}

LLVM IR (-O2):
define void @gen_fullchains(i8* %0, i8* %1) {
%3 = tail call i32 @gen_chain_8x(i8* %0, i8* %0, i8* %1, i32 15)
%4 = getelementptr inbounds i8, i8* %0, i64 256
%5 = tail call i32 @gen_chain_8x(i8* %4, i8* %4, i8* %1, i32 15)
%6 = getelementptr inbounds i8, i8* %0, i64 512
%7 = tail call i32 @gen_chain_8x(i8* %6, i8* %6, i8* %1, i32 15)
%8 = getelementptr inbounds i8, i8* %0, i64 768
%9 = tail call i32 @gen_chain_8x(i8* %8, i8* %8, i8* %1, i32 15)
%10 = getelementptr inbounds i8, i8* %0, i64 1024
%11 = tail call i32 @gen_chain_8x(i8* %10, i8* %10, i8* %1, i32 15)
%12 = getelementptr inbounds i8, i8* %0, i64 1280
%13 = tail call i32 @gen_chain_8x(i8* %12, i8* %12, i8* %1, i32 15)
%14 = getelementptr inbounds i8, i8* %0, i64 1536
%15 = tail call i32 @gen_chain_8x(i8* %14, i8* %14, i8* %1, i32 15)
%16 = getelementptr inbounds i8, i8* %0, i64 1792
%17 = tail call i32 @gen_chain_8x(i8* %16, i8* %16, i8* %1, i32 15)
%18 = getelementptr inbounds i8, i8* %0, i64 2048
%19 = tail call i32 @gen_chain(i8* %18, i8* %18, i8* %1, i32 15)
%20 = getelementptr inbounds i8, i8* %0, i64 2080
%21 = tail call i32 @gen_chain(i8* %20, i8* %20, i8* %1, i32 15)
%22 = getelementptr inbounds i8, i8* %0, i64 2112
%23 = tail call i32 @gen_chain(i8* %22, i8* %22, i8* %1, i32 15)
ret void
}