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

/* Variables and functions */
int /*<<< orphan*/ ffts_elaborate_offsets_odd8(int *const, int, int, int, int);
void ffts_elaborate_offsets_even8(ptrdiff_t *const offsets, int log_N) {
  int offset = 1 << (log_N - 4);
  int stride = 1;
  offsets[0] = 0;
  offsets[1] = 0;
  offsets[2] = offset * 2;
  offsets[3] = 8;
  offsets[4] = offset;
  offsets[5] = 16;
  offsets[6] = -offset;
  offsets[7] = 24;
  for (; log_N > 5; --log_N, stride *= 2) {
    ffts_elaborate_offsets_odd8(offsets, log_N - 2, stride, 1 << (log_N - 1),
                                stride * 4);
    ffts_elaborate_offsets_odd8(offsets, log_N - 2, -stride,
                                3 * (1 << (log_N - 2)), stride * 4);
  }
}


x86 assembly (clang, -O0):
<ffts_elaborate_offsets_even8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sub    $0x4,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x10(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0x8,0xc(%rax)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x8(%rbp),%rax
movl   $0x10,0x14(%rax)
xor    %ecx,%ecx
sub    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x18(%rax)
mov    -0x8(%rbp),%rax
movl   $0x18,0x1c(%rax)
cmpl   $0x5,-0xc(%rbp)
jle    1205 <ffts_elaborate_offsets_even8+0xf5>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x2,%esi
mov    -0x14(%rbp),%edx
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x14(%rbp),%r8d
shl    $0x2,%r8d
call   1030 <ffts_elaborate_offsets_odd8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x2,%esi
xor    %edx,%edx
sub    -0x14(%rbp),%edx
mov    -0xc(%rbp),%ecx
sub    $0x2,%ecx
mov    $0x1,%eax
shl    %cl,%eax
imul   $0x3,%eax,%ecx
mov    -0x14(%rbp),%r8d
shl    $0x2,%r8d
call   1030 <ffts_elaborate_offsets_odd8@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    118f <ffts_elaborate_offsets_even8+0x7f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffts_elaborate_offsets_even8>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r15d
lea    -0x4(%r15),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    $0x1,%ebx
movq   $0x0,(%rdi)
lea    (%rax,%rax,1),%ecx
mov    %ecx,0x8(%rdi)
movl   $0x8,0xc(%rdi)
mov    %eax,0x10(%rdi)
movl   $0x10,0x14(%rdi)
neg    %eax
mov    %eax,0x18(%rdi)
movl   $0x18,0x1c(%rdi)
cmp    $0x6,%esi
jl     11c0 <ffts_elaborate_offsets_even8+0xb0>
mov    %rdi,%r14
add    $0x1,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x3(%r15),%ebp
lea    -0x2(%r15),%ecx
mov    $0x1,%eax
shl    %cl,%eax
lea    0x0(,%rbx,4),%r12d
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %eax,%ecx
mov    %r12d,%r8d
call   1030 <ffts_elaborate_offsets_odd8@plt>
mov    %ebx,%edx
neg    %edx
mov    $0x3,%eax
mov    %ebp,%ecx
shl    %cl,%eax
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%ecx
mov    %r12d,%r8d
call   1030 <ffts_elaborate_offsets_odd8@plt>
add    %ebx,%ebx
add    $0xffffffff,%r15d
cmp    $0x6,%r15d
ja     1170 <ffts_elaborate_offsets_even8+0x60>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @ffts_elaborate_offsets_even8(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 4
%9 = shl i32 1, %8
store i32 %9, i32* %5
store i32 1, i32* %6
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 0, i32* %11
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32 0, i32* %13
%14 = load i32, i32* %5
%15 = mul nsw i32 %14, 2
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 2
store i32 %15, i32* %17
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 3
store i32 8, i32* %19
%20 = load i32, i32* %5
%21 = load i32*, i32** %3
%22 = getelementptr inbounds i32, i32* %21, i64 4
store i32 %20, i32* %22
%23 = load i32*, i32** %3
%24 = getelementptr inbounds i32, i32* %23, i64 5
store i32 16, i32* %24
%25 = load i32, i32* %5
%26 = sub nsw i32 0, %25
%27 = load i32*, i32** %3
%28 = getelementptr inbounds i32, i32* %27, i64 6
store i32 %26, i32* %28
%29 = load i32*, i32** %3
%30 = getelementptr inbounds i32, i32* %29, i64 7
store i32 24, i32* %30
br label %31
31: ; preds = %57, %2
%32 = load i32, i32* %4
%33 = icmp sgt i32 %32, 5
br i1 %33, label %34, label %62
34: ; preds = %31
%35 = load i32*, i32** %3
%36 = load i32, i32* %4
%37 = sub nsw i32 %36, 2
%38 = load i32, i32* %6
%39 = load i32, i32* %4
%40 = sub nsw i32 %39, 1
%41 = shl i32 1, %40
%42 = load i32, i32* %6
%43 = mul nsw i32 %42, 4
%44 = call i32 @ffts_elaborate_offsets_odd8(i32* %35, i32 %37, i32 %38, i32 %41, i32 %43)
%45 = load i32*, i32** %3
%46 = load i32, i32* %4
%47 = sub nsw i32 %46, 2
%48 = load i32, i32* %6
%49 = sub nsw i32 0, %48
%50 = load i32, i32* %4
%51 = sub nsw i32 %50, 2
%52 = shl i32 1, %51
%53 = mul nsw i32 3, %52
%54 = load i32, i32* %6
%55 = mul nsw i32 %54, 4
%56 = call i32 @ffts_elaborate_offsets_odd8(i32* %45, i32 %47, i32 %49, i32 %53, i32 %55)
br label %57
57: ; preds = %34
%58 = load i32, i32* %4
%59 = add nsw i32 %58, -1
store i32 %59, i32* %4
%60 = load i32, i32* %6
%61 = mul nsw i32 %60, 2
store i32 %61, i32* %6
br label %31
62: ; preds = %31
ret void
}

LLVM IR (-O2):
define void @ffts_elaborate_offsets_even8(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -4
%4 = shl nuw i32 1, %3
store i32 0, i32* %0
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 0, i32* %5
%6 = shl nsw i32 %4, 1
%7 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %6, i32* %7
%8 = getelementptr inbounds i32, i32* %0, i64 3
store i32 8, i32* %8
%9 = getelementptr inbounds i32, i32* %0, i64 4
store i32 %4, i32* %9
%10 = getelementptr inbounds i32, i32* %0, i64 5
store i32 16, i32* %10
%11 = sub nsw i32 0, %4
%12 = getelementptr inbounds i32, i32* %0, i64 6
store i32 %11, i32* %12
%13 = getelementptr inbounds i32, i32* %0, i64 7
store i32 24, i32* %13
%14 = icmp sgt i32 %1, 5
br i1 %14, label %15, label %28
15: ; preds = %2, %15
%16 = phi i32 [ %26, %15 ], [ 1, %2 ]
%17 = phi i32 [ %19, %15 ], [ %1, %2 ]
%18 = add nsw i32 %17, -2
%19 = add nsw i32 %17, -1
%20 = shl nuw i32 1, %19
%21 = shl nsw i32 %16, 2
%22 = tail call i32 @ffts_elaborate_offsets_odd8(i32* %0, i32 %18, i32 %16, i32 %20, i32 %21)
%23 = sub nsw i32 0, %16
%24 = shl i32 3, %18
%25 = tail call i32 @ffts_elaborate_offsets_odd8(i32* %0, i32 %18, i32 %23, i32 %24, i32 %21)
%26 = shl nsw i32 %16, 1
%27 = icmp ugt i32 %17, 6
br i1 %27, label %15, label %28
28: ; preds = %15, %2
ret void
}